summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-11-12 17:30:49 +0000
committerAlexander Kornienko <alexfh@google.com>2013-11-12 17:30:49 +0000
commit3abbb8a4336822c406312ef1cf5b7d8ba433a49d (patch)
treea6b3b00e3dd4116e2f009f556ffb461489e0ab1c /clang/unittests/Format/FormatTest.cpp
parent78fc064b1aa1cbc8561b5dc52ba6df471a18770a (diff)
downloadbcm5719-llvm-3abbb8a4336822c406312ef1cf5b7d8ba433a49d.tar.gz
bcm5719-llvm-3abbb8a4336822c406312ef1cf5b7d8ba433a49d.zip
Do not insert backslashes, when breaking line comments after preprocessor directives.
Summary: This solves http://llvm.org/PR17536 Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2142 llvm-svn: 194491
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index d02fb3405c7..9f05619bb1d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1005,6 +1005,14 @@ TEST_F(FormatTest, SplitsLongCxxComments) {
EXPECT_EQ("//\t aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
format("//\t aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
getLLVMStyleWithColumns(20)));
+ EXPECT_EQ(
+ "#define XXX // a b c d\n"
+ " // e f g h",
+ format("#define XXX // a b c d e f g h", getLLVMStyleWithColumns(22)));
+ EXPECT_EQ(
+ "#define XXX // q w e r\n"
+ " // t y u i",
+ format("#define XXX //q w e r t y u i", getLLVMStyleWithColumns(22)));
}
TEST_F(FormatTest, DontSplitLineCommentsWithEscapedNewlines) {
OpenPOWER on IntegriCloud