summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-09 09:33:39 +0000
committerDaniel Jasper <djasper@google.com>2013-01-09 09:33:39 +0000
commitd8bb2db2429e1cb0c4ff87ad4f706f36991c85a9 (patch)
tree182d894705ff52a72ede0b1a1feb586929448ca3 /clang/unittests/Format/FormatTest.cpp
parentf927ad34e77a977b745a386d269093c1b6f099a5 (diff)
downloadbcm5719-llvm-d8bb2db2429e1cb0c4ff87ad4f706f36991c85a9.tar.gz
bcm5719-llvm-d8bb2db2429e1cb0c4ff87ad4f706f36991c85a9.zip
Allow comments in the middle of statements to be on their own line.
This fixes llvm.org/PR14860. Before, we messed up the format of: if (DeclaratorInfo.isFunctionDeclarator() && //getDeclSpecContextFromDeclaratorContext(Context) == DSC_top_level && Tok.is(tok::semi) && NextToken().is(tok::l_brace)) { } llvm-svn: 171961
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 2e6424dd00d..fb21ea7c6fb 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -290,6 +290,9 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
verifyFormat(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; // Trailing comment");
+ verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =\n"
+ " // Comment inside a statement.\n"
+ " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;");
EXPECT_EQ("int i; // single line trailing comment",
format("int i;\\\n// single line trailing comment"));
OpenPOWER on IntegriCloud