aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2023-09-24 20:07:23 -0700
committerGitHub <noreply@github.com>2023-09-24 20:07:23 -0700
commitd3f8c88abe2ecc455165f0a32c389fec61730ace (patch)
treea2c4766868f6aa274b690ec033909b79747c19d4 /clang/unittests/Format/FormatTestComments.cpp
parent5f17fcf3010a8393658d38b41a73c9ef8e06bf6d (diff)
downloadllvm-d3f8c88abe2ecc455165f0a32c389fec61730ace.zip
llvm-d3f8c88abe2ecc455165f0a32c389fec61730ace.tar.gz
llvm-d3f8c88abe2ecc455165f0a32c389fec61730ace.tar.bz2
[clang-format] Fix a bug in aligning trailing comments (#67221)
Fixes #67116.
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r--clang/unittests/Format/FormatTestComments.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp
index 001c5bf..1198329 100644
--- a/clang/unittests/Format/FormatTestComments.cpp
+++ b/clang/unittests/Format/FormatTestComments.cpp
@@ -3053,6 +3053,12 @@ TEST_F(FormatTestComments, AlignTrailingCommentsLeave) {
"}",
Style);
+ Style.AlignEscapedNewlines = FormatStyle::ENAS_Left;
+ verifyNoChange("#define FOO \\\n"
+ " /* foo(); */ \\\n"
+ " bar();",
+ Style);
+
// Allow to keep 2 empty lines
Style.MaxEmptyLinesToKeep = 2;
EXPECT_EQ("// do not touch\n"