summaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestTableGen.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-03-31 22:43:06 -0700
committerVitaly Buka <vitalybuka@google.com>2024-03-31 22:43:06 -0700
commit7aced1ab9772075ef9a77b1ba4a6456968f27906 (patch)
tree995152f5bc707d6c2160f92a879eb52f8fc2a3a9 /clang/unittests/Format/FormatTestTableGen.cpp
parentfd7a6d054b1e027c036a1cff5ddc7ee81461f90a (diff)
parent1e442ac4c33ac36d33e191c2d18ff594d8a5d11a (diff)
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'clang/unittests/Format/FormatTestTableGen.cpp')
-rw-r--r--clang/unittests/Format/FormatTestTableGen.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTableGen.cpp b/clang/unittests/Format/FormatTestTableGen.cpp
index c96866f0840f..8ca6bf97e5a6 100644
--- a/clang/unittests/Format/FormatTestTableGen.cpp
+++ b/clang/unittests/Format/FormatTestTableGen.cpp
@@ -411,6 +411,38 @@ TEST_F(FormatTestTableGen, DAGArgBreakAll) {
Style);
}
+TEST_F(FormatTestTableGen, DAGArgAlignment) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
+ Style.ColumnLimit = 60;
+ Style.TableGenBreakInsideDAGArg = FormatStyle::DAS_BreakAll;
+ Style.TableGenBreakingDAGArgOperators = {"ins", "outs"};
+ verifyFormat("def Def : Parent {\n"
+ " let dagarg = (ins\n"
+ " a:$src1,\n"
+ " aa:$src2,\n"
+ " aaa:$src3\n"
+ " )\n"
+ "}\n",
+ Style);
+ verifyFormat("def Def : Parent {\n"
+ " let dagarg = (not a:$src1, aa:$src2, aaa:$src2)\n"
+ "}\n",
+ Style);
+ Style.AlignConsecutiveTableGenBreakingDAGArgColons.Enabled = true;
+ verifyFormat("def Def : Parent {\n"
+ " let dagarg = (ins\n"
+ " a :$src1,\n"
+ " aa :$src2,\n"
+ " aaa:$src3\n"
+ " )\n"
+ "}\n",
+ Style);
+ verifyFormat("def Def : Parent {\n"
+ " let dagarg = (not a:$src1, aa:$src2, aaa:$src2)\n"
+ "}\n",
+ Style);
+}
+
TEST_F(FormatTestTableGen, CondOperatorAlignment) {
FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
Style.ColumnLimit = 60;