Skip to content

Commit bd0b6fa

Browse files
committed
[clang-format] Add a unittest for GH119258
1 parent 6a390e3 commit bd0b6fa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

clang/unittests/Format/MacroCallReconstructorTest.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ TEST_F(MacroCallReconstructorTest, Identifier) {
219219
EXPECT_THAT(std::move(Unexp).takeResult(), matchesLine(line(U.consume("X"))));
220220
}
221221

222+
TEST_F(MacroCallReconstructorTest, IdentifierObject) {
223+
auto Macros = createExpander({"X"});
224+
Expansion Exp(Lex, *Macros);
225+
TokenList Call = Exp.expand("X");
226+
227+
MacroCallReconstructor Unexp(0, Exp.getUnexpanded());
228+
Unexp.addLine(line(Exp.getTokens()));
229+
EXPECT_TRUE(Unexp.finished());
230+
Matcher U(Call, Lex);
231+
EXPECT_THAT(std::move(Unexp).takeResult(), matchesLine(line(U.consume("X"))));
232+
}
233+
222234
TEST_F(MacroCallReconstructorTest, EmptyExpansion) {
223235
auto Macros = createExpander({"A(x)=x"});
224236
Expansion Exp(Lex, *Macros);

0 commit comments

Comments
 (0)