summaryrefslogtreecommitdiffstats
path: root/clang/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
commita400cab43adcc7361433e28a48a38f655e34a632 (patch)
treec1a1ea0e655e8b94ab62cc0e1e85b10e1ae5e097 /clang/unittests/Format/FormatTest.cpp
parentce17020c973e7b25aac23405b2a7812f40c1bb5b (diff)
downloadbcm5719-llvm-a400cab43adcc7361433e28a48a38f655e34a632.tar.gz
bcm5719-llvm-a400cab43adcc7361433e28a48a38f655e34a632.zip
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 }; llvm-svn: 176262
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 392548dc6cc..baeb0143bc3 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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"
+ "};");
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud