summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirofumi Nakamura <k.nakamura.hirofumi@gmail.com>2024-04-08 21:12:12 +0900
committerGitHub <noreply@github.com>2024-04-08 21:12:12 +0900
commit5a855d51272608e2122c45d86676aa2247a11d19 (patch)
tree3c8e42e9c1ce3fb3603f7618c9b628223e912871
parent8b3b4a92adee40483c27f26c478a384cd69c6f05 (diff)
[clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (#87924)
-rw-r--r--clang/unittests/Format/FormatTestTableGen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTableGen.cpp b/clang/unittests/Format/FormatTestTableGen.cpp
index 8ca6bf97e5a6..d235c85c8eaa 100644
--- a/clang/unittests/Format/FormatTestTableGen.cpp
+++ b/clang/unittests/Format/FormatTestTableGen.cpp
@@ -290,6 +290,16 @@ TEST_F(FormatTestTableGen, MultiClass) {
"}\n");
}
+TEST_F(FormatTestTableGen, MultiClassesWithPasteOperator) {
+ // This is a sensitive example for the handling of the paste operators in
+ // brace type calculation.
+ verifyFormat("multiclass MultiClass1<int i> {\n"
+ " def : Def#x<i>;\n"
+ " def : Def#y<i>;\n"
+ "}\n"
+ "multiclass MultiClass2<int i> { def : Def#x<i>; }\n");
+}
+
TEST_F(FormatTestTableGen, Defm) {
verifyFormat("defm : Multiclass<0>;\n");