aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-28 15:04:12 +0000
committerDaniel Jasper <djasper@google.com>2013-02-28 15:04:12 +0000
commit25e81b255cea00fe633f2822c1d1d708ef871a59 (patch)
tree68059398682e9b34cf90e9f09e44aa845b3ab6c8 /unittests/Format/FormatTest.cpp
parent8ed4100410ea055a03be5ec4a92a947a0ee664cd (diff)
Reduce penalty for splitting after "{" in static initializers.
This fixes llvm.org/PR15379. Before: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; After: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 392548dc6c..baeb0143bc 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -612,6 +612,11 @@ TEST_F(FormatTest, CommentsInStaticInitializers) {
"\n"
" b\n"
"};"));
+ verifyFormat("const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = {\n"
+ " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment\n"
+ " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment\n"
+ " 0x00, 0x00, 0x00, 0x00 // comment\n"
+ "};");
}
//===----------------------------------------------------------------------===//