diff options
| author | Owen Pan <owenpiano@gmail.com> | 2019-05-03 23:15:40 +0000 |
|---|---|---|
| committer | Owen Pan <owenpiano@gmail.com> | 2019-05-03 23:15:40 +0000 |
| commit | 3dcb892d2d6fb2809f57cbf80984f7f5603e2ace (patch) | |
| tree | a128bc8b77f4f0986920751a41cf79a800643f4a /clang/unittests/Format | |
| parent | 3f796f974d75e11fbc7267020aa15d5e0f556a74 (diff) | |
| download | bcm5719-llvm-3dcb892d2d6fb2809f57cbf80984f7f5603e2ace.tar.gz bcm5719-llvm-3dcb892d2d6fb2809f57cbf80984f7f5603e2ace.zip | |
[clang-format] Fix bug in block comment reflow that joins * and /
Fixes PR41213
Differential Revision: https://reviews.llvm.org/D61276
llvm-svn: 359943
Diffstat (limited to 'clang/unittests/Format')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index ade52c753c4..31f40b16708 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -11150,6 +11150,24 @@ TEST_F(FormatTest, OptimizeBreakPenaltyVsExcess) { FormatStyle Style = getLLVMStyle(); Style.ColumnLimit = 20; + // See PR41213 + EXPECT_EQ("/*\n" + " *\t9012345\n" + " * /8901\n" + " */", + format("/*\n" + " *\t9012345 /8901\n" + " */", + Style)); + EXPECT_EQ("/*\n" + " *345678\n" + " *\t/8901\n" + " */", + format("/*\n" + " *345678\t/8901\n" + " */", + Style)); + verifyFormat("int a; // the\n" " // comment", Style); EXPECT_EQ("int a; /* first line\n" |

