From 66935020c4241bb8cb0478cd6bbaf0a9f90d02f7 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Sun, 27 Apr 2014 10:03:19 +0000 Subject: clang-format: Fix bug when aligning trailing /**/-comments in macros. Previously this could lead to a column limit violation with the required escaped newlines. llvm-svn: 207351 --- clang/unittests/Format/FormatTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 398850c38ac..d18968afd5a 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -832,6 +832,17 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { " // first\n" "// at start\n" "otherLine();")); + + verifyFormat( + "#define A \\\n" + " int i; /* iiiiiiiiiiiiiiiiiiiii */ \\\n" + " int jjjjjjjjjjjjjjjjjjjjjjjj; /* */", + getLLVMStyleWithColumns(60)); + verifyFormat( + "#define A \\\n" + " int i; /* iiiiiiiiiiiiiiiiiiiii */ \\\n" + " int jjjjjjjjjjjjjjjjjjjjjjjj; /* */", + getLLVMStyleWithColumns(61)); } TEST_F(FormatTest, KeepsParameterWithTrailingCommentsOnTheirOwnLine) { -- cgit v1.2.3