mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
AsmParser: Fix nested .irp/.irpc
Count .irp/.irpc in parseMacroLikeBody similar to .rept Update tests. Review: http://reviews.llvm.org/D17707 llvm-svn: 262313
This commit is contained in:
parent
ec7d7b8389
commit
dd568e520a
@ -4707,7 +4707,9 @@ MCAsmMacro *AsmParser::parseMacroLikeBody(SMLoc DirectiveLoc) {
|
||||
}
|
||||
|
||||
if (Lexer.is(AsmToken::Identifier) &&
|
||||
(getTok().getIdentifier() == ".rept")) {
|
||||
(getTok().getIdentifier() == ".rept" ||
|
||||
getTok().getIdentifier() == ".irp" ||
|
||||
getTok().getIdentifier() == ".irpc")) {
|
||||
++NestLevel;
|
||||
}
|
||||
|
||||
|
@ -6,3 +6,16 @@
|
||||
|
||||
// CHECK: pushl %eax
|
||||
// CHECK: pushl %ebx
|
||||
|
||||
.irp reg,%eax,%ebx
|
||||
.irp imm,4,3,5
|
||||
addl \reg, \imm
|
||||
.endr
|
||||
.endr
|
||||
|
||||
// CHECK: addl %eax, 4
|
||||
// CHECK: addl %eax, 3
|
||||
// CHECK: addl %eax, 5
|
||||
// CHECK: addl %ebx, 4
|
||||
// CHECK: addl %ebx, 3
|
||||
// CHECK: addl %ebx, 5
|
||||
|
@ -7,3 +7,16 @@
|
||||
// CHECK: long 1
|
||||
// CHECK: long 2
|
||||
// CHECK: long 3
|
||||
|
||||
.irpc foo,123
|
||||
.irpc bar,45
|
||||
addl %eax, \foo\bar
|
||||
.endr
|
||||
.endr
|
||||
|
||||
// CHECK: addl %eax, 14
|
||||
// CHECK: addl %eax, 15
|
||||
// CHECK: addl %eax, 24
|
||||
// CHECK: addl %eax, 25
|
||||
// CHECK: addl %eax, 34
|
||||
// CHECK: addl %eax, 35
|
||||
|
Loading…
Reference in New Issue
Block a user