1# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
2
3.macro A
4  add  $1\@, %eax
5.endm
6
7.macro B
8  sub  $1\@, %eax
9.endm
10
11  A
12# CHECK: addl  $10, %eax
13  A
14# CHECK: addl  $11, %eax
15  B
16# CHECK: subl  $12, %eax
17  B
18# CHECK: subl  $13, %eax
19
20# The following uses of \@ are undocumented, but valid:
21.irpc foo,234
22  add  $\foo\@, %eax
23.endr
24# CHECK: addl  $24, %eax
25# CHECK: addl  $34, %eax
26# CHECK: addl  $44, %eax
27
28.irp reg,%eax,%ebx
29  sub  $2\@, \reg
30.endr
31# CHECK: subl  $24, %eax
32# CHECK: subl  $24, %ebx
33
34# Test that .irp(c) and .rep(t) do not increase \@.
35# Only the use of A should increase \@, so we can test that it increases by 1
36# each time.
37
38.irpc foo,123
39  sub  $\foo, %eax
40.endr
41
42  A
43# CHECK: addl  $14, %eax
44
45.irp reg,%eax,%ebx
46  sub  $4, \reg
47.endr
48
49  A
50# CHECK: addl  $15, %eax
51
52.rept 2
53  sub  $5, %eax
54.endr
55
56  A
57# CHECK: addl  $16, %eax
58
59.rep 3
60  sub  $6, %eax
61.endr
62
63  A
64# CHECK: addl  $17, %eax
65