Skip to content

Commit

Permalink
[MC,test] Improve .altmacro test
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 12, 2024
1 parent 8698160 commit d22a419
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions llvm/test/MC/AsmParser/altmacro-arg.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# RUN: rm -rf %t && split-file %s %t && cd %t
# RUN: llvm-mc -triple=x86_64 a.s | FileCheck %s
# RUN: llvm-mc -triple=x86_64 b.s | FileCheck %s --check-prefix=CHECK1

#--- a.s
.altmacro
# CHECK: ja .Ltmp0
# CHECK-NEXT: xorq %rax, %rax
# CHECK: .data
# CHECK-NEXT: .ascii "b cc rbx"
# CHECK-NEXT: .ascii "ara rax rax raxx"
.macro gen a, ra, rax
ja 1f
xorq %rax, %rax
1:
.data
.ascii "\a \ra \rax"
.ascii "a\()ra ra\()x rax raxx"
.endm
gen b, cc, rbx

#--- b.s
.altmacro
# CHECK1: 1 1 ._a&a
# CHECK1-NEXT: 1 2 ._a&a $b&b
# CHECK1-NEXT: \$b \$b
.irp ._a,1
.print "\._a \._a& ._a&a"
.irp $b,2
.print "\._a \$b ._a&a $b&b"
.endr
.print "\$b \$b&"
.endr

# CHECK1: 1 1& ._a&a
# CHECK1-NEXT: \$b \$b&
.noaltmacro
.irp ._a,1
.print "\._a \._a& ._a&a"
.print "\$b \$b&"
.endr
.altmacro

0 comments on commit d22a419

Please sign in to comment.