summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r--clang/unittests/Format/FormatTestComments.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp
index 220ce08ff53..ed11fbdb1fc 100644
--- a/clang/unittests/Format/FormatTestComments.cpp
+++ b/clang/unittests/Format/FormatTestComments.cpp
@@ -3080,6 +3080,15 @@ TEST_F(FormatTestComments, PythonStyleComments) {
getTextProtoStyleWithColumns(20)));
}
+TEST_F(FormatTestComments, BreaksBeforeTrailingUnbreakableSequence) {
+ // The end of /* trail */ is exactly at 80 columns, but the unbreakable
+ // trailing sequence ); after it exceeds the column limit. Make sure we
+ // correctly break the line in that case.
+ verifyFormat("int a =\n"
+ " foo(/* trail */);",
+ getLLVMStyleWithColumns(23));
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
OpenPOWER on IntegriCloud