diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-10 08:00:25 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-10 08:00:25 +0000 |
commit | f0fd1c66df9cd7180c3735f283e6cd1c6bc3dcab (patch) | |
tree | 2c479c7328cfbb3d488180e51148b4d2cf8b6d85 /clang/unittests/Format | |
parent | 622c72ded5df46eb6a705cb6fbfc0e680294a590 (diff) | |
download | bcm5719-llvm-f0fd1c66df9cd7180c3735f283e6cd1c6bc3dcab.tar.gz bcm5719-llvm-f0fd1c66df9cd7180c3735f283e6cd1c6bc3dcab.zip |
clang-format: Fix bug in escaped newline calculation.
This prevents clang-format from inadvertently joining stuff into macro
definitions as reported in llvm.org/PR23466.
llvm-svn: 236944
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 9d29a268485..6569badd035 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2987,6 +2987,8 @@ TEST_F(FormatTest, EscapedNewlines) { EXPECT_EQ( "#define A \\\n int i; \\\n int j;", format("#define A \\\nint i;\\\n int j;", getLLVMStyleWithColumns(11))); + EXPECT_EQ( + "#define A\n\nint i;", format("#define A \\\n\n int i;")); EXPECT_EQ("template <class T> f();", format("\\\ntemplate <class T> f();")); EXPECT_EQ("/* \\ \\ \\\n*/", format("\\\n/* \\ \\ \\\n*/")); EXPECT_EQ("<a\n\\\\\n>", format("<a\n\\\\\n>")); |