diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-11 11:59:46 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-11 11:59:46 +0000 |
commit | 790d4f975e0691215701b4f74b90e2b7a96ef65e (patch) | |
tree | 6d41b0f3b821a2604bbea1941d744d95fee18f3f | |
parent | 88504598c332fde335896dbf0cb3431731480685 (diff) | |
download | bcm5719-llvm-790d4f975e0691215701b4f74b90e2b7a96ef65e.tar.gz bcm5719-llvm-790d4f975e0691215701b4f74b90e2b7a96ef65e.zip |
clang-format: Don't merge subsequent lines into _asm blocks.
Before:
_asm {
} int i;
After:
_asm {
}
int i;
llvm-svn: 236985
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 1 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index a2afcc0fd5b..6dee251a918 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -672,6 +672,7 @@ void UnwrappedLineParser::parseStructuralElement() { if (FormatTok->is(tok::r_brace)) { FormatTok->Type = TT_InlineASMBrace; nextToken(); + addUnwrappedLine(); break; } FormatTok->Finalized = true; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index a70cab1096f..43f94f0ce6d 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2328,6 +2328,12 @@ TEST_F(FormatTest, FormatsInlineASM) { " // comment\n" " asm(\"\");\n" "}"); + EXPECT_EQ("__asm {\n" + "}\n" + "int i;", + format("__asm {\n" + "}\n" + "int i;")); } TEST_F(FormatTest, FormatTryCatch) { |