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
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 9d29a26..6569bad 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2987,6 +2987,8 @@
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>"));