Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions clang/unittests/Format/FormatTestTableGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Comment on lines +299 to +300
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

}

TEST_F(FormatTestTableGen, Defm) {
verifyFormat("defm : Multiclass<0>;\n");

Expand Down
Loading