summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-08 19:56:28 +0000
committerDaniel Jasper <djasper@google.com>2013-11-08 19:56:28 +0000
commit9e5ede0f8b51c695eb734d388bc21333d310186d (patch)
tree1eef7e1b052e442752cfec47b1cbb10bc65577fb /clang/unittests/Format/FormatTest.cpp
parente73d6b605c2476777b0d3899b9eb2e690d5e69de (diff)
downloadbcm5719-llvm-9e5ede0f8b51c695eb734d388bc21333d310186d.tar.gz
bcm5719-llvm-9e5ede0f8b51c695eb734d388bc21333d310186d.zip
clang-format: Improve formatting of operators forced to new lines.
Before: unsigned ContentSize = sizeof(int16_t) // DWARF ARange version number + sizeof(int32_t) // Offset of CU in the .debug_info section + sizeof(int8_t) // Pointer Size (in bytes) + sizeof(int8_t); // Segment Size (in bytes) After: unsigned ContentSize = sizeof(int16_t) // DWARF ARange version number + sizeof(int32_t) // Offset of CU in the .debug_info section + sizeof(int8_t) // Pointer Size (in bytes) + sizeof(int8_t); // Segment Size (in bytes) This fixes llvm.org/PR17687. llvm-svn: 194276
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index c0c78713db2..794fb1a64b0 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2668,6 +2668,14 @@ TEST_F(FormatTest, ExpressionIndentationBreakingBeforeOperators) {
" > ccccc) {\n"
"}",
Style);
+
+ // Forced by comments.
+ verifyFormat(
+ "unsigned ContentSize =\n"
+ " sizeof(int16_t) // DWARF ARange version number\n"
+ " + sizeof(int32_t) // Offset of CU in the .debug_info section\n"
+ " + sizeof(int8_t) // Pointer Size (in bytes)\n"
+ " + sizeof(int8_t); // Segment Size (in bytes)");
}
TEST_F(FormatTest, ConstructorInitializers) {
OpenPOWER on IntegriCloud