[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-08 Thread Hirofumi Nakamura via cfe-commits

hnakamura5 wrote:

Thank you!

https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-08 Thread Hirofumi Nakamura via cfe-commits

https://github.com/hnakamura5 closed 
https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-08 Thread Hirofumi Nakamura via cfe-commits


@@ -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 {\n"
+   "  def : Def#x;\n"
+   "  def : Def#y;\n"
+   "}\n"
+   "multiclass MultiClass2 { def : Def#x; }\n");

hnakamura5 wrote:

I come to notice that they are not required. I will make a patch for whole this 
file later.

https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Owen Pan via cfe-commits


@@ -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 {\n"
+   "  def : Def#x;\n"
+   "  def : Def#y;\n"
+   "}\n"
+   "multiclass MultiClass2 { def : Def#x; }\n");

owenca wrote:

Do you need the trailing newlines? There are dozens of them in this file. 
Please remove them if they are not needed.

https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Björn Schäpers via cfe-commits

https://github.com/HazardyKnusperkeks approved this pull request.


https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-format

Author: Hirofumi Nakamura (hnakamura5)


Changes

The test I mentioned here https://github.com/llvm/llvm-project/pull/87450 .
This is a regression test to detect the case block type is not calculated due 
to the paste `#` operator misunderstood as preprocessor. 

---
Full diff: https://github.com/llvm/llvm-project/pull/87924.diff


1 Files Affected:

- (modified) clang/unittests/Format/FormatTestTableGen.cpp (+10) 


``diff
diff --git a/clang/unittests/Format/FormatTestTableGen.cpp 
b/clang/unittests/Format/FormatTestTableGen.cpp
index 8ca6bf97e5a6b1..d235c85c8eaa0f 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 {\n"
+   "  def : Def#x;\n"
+   "  def : Def#y;\n"
+   "}\n"
+   "multiclass MultiClass2 { def : Def#x; }\n");
+}
+
 TEST_F(FormatTestTableGen, Defm) {
   verifyFormat("defm : Multiclass<0>;\n");
 

``




https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Hirofumi Nakamura via cfe-commits

https://github.com/hnakamura5 created 
https://github.com/llvm/llvm-project/pull/87924

The test I mentioned here https://github.com/llvm/llvm-project/pull/87450 .
This is a regression test to detect the case block type is not calculated due 
to the paste `#` operator misunderstood as preprocessor. 

>From fd10ce8a2d6532052c240d385f263602b859ff7a Mon Sep 17 00:00:00 2001
From: hnakamura5 
Date: Sun, 7 Apr 2024 22:32:31 +0900
Subject: [PATCH] [clang-format] Added unittest of TableGen formatting w.r.t.
 block kind

---
 clang/unittests/Format/FormatTestTableGen.cpp | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/clang/unittests/Format/FormatTestTableGen.cpp 
b/clang/unittests/Format/FormatTestTableGen.cpp
index 8ca6bf97e5a6b1..d235c85c8eaa0f 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 {\n"
+   "  def : Def#x;\n"
+   "  def : Def#y;\n"
+   "}\n"
+   "multiclass MultiClass2 { def : Def#x; }\n");
+}
+
 TEST_F(FormatTestTableGen, Defm) {
   verifyFormat("defm : Multiclass<0>;\n");
 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits