Skip to content

Commit 70d6b8a

Browse files
committed
MCAsmParser: Amend \+ expansion
Amend 7c95629 ("MCAsmParser: Support \+") to increase Macro.Count per iteration to match the new gas feature (milestone: 2.43).
1 parent b0f10a1 commit 70d6b8a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/lib/MC/MCParser/AsmParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2580,7 +2580,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &OS, MCAsmMacro &Macro,
25802580
OS << NumOfMacroInstantiations;
25812581
Pos += 2;
25822582
} else if (Argument == "+") {
2583-
OS << Macro.Count++;
2583+
OS << Macro.Count;
25842584
Pos += 2;
25852585
} else {
25862586
for (; Index < NParameters; ++Index)
@@ -2629,6 +2629,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &OS, MCAsmMacro &Macro,
26292629
Body = Body.substr(Pos);
26302630
}
26312631

2632+
++Macro.Count;
26322633
return false;
26332634
}
26342635

llvm/test/MC/AsmParser/macro-at-pseudo-variable.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@
7474

7575
#--- b.s
7676
.rept 2
77-
.print "r\+"
77+
.print "r\+ \+"
7878
.endr
7979
.irpc foo,12
80-
.print "\+i"
80+
.print "\+\+i"
8181
.endr
82-
# CHECK2: r0
83-
# CHECK2-NEXT: r1
84-
# CHECK2-NEXT: 0i
85-
# CHECK2-NEXT: 1i
82+
# CHECK2: r0 0
83+
# CHECK2-NEXT: r1 1
84+
# CHECK2-NEXT: 00i
85+
# CHECK2-NEXT: 11i
8686

8787
.rept 2
8888
.rept 2

0 commit comments

Comments
 (0)