xref: /aosp_15_r20/external/llvm/test/MC/AsmParser/macros-darwin.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: not llvm-mc -triple i386-apple-darwin10 %s 2> %t.err | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker.macro .test0
5*9880d681SAndroid Build Coastguard Worker.macrobody0
6*9880d681SAndroid Build Coastguard Worker.endmacro
7*9880d681SAndroid Build Coastguard Worker.macro .test1
8*9880d681SAndroid Build Coastguard Worker.test0
9*9880d681SAndroid Build Coastguard Worker.endmacro
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker.test1
12*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS: <instantiation>:1:1: error: unknown directive
13*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: macrobody0
14*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: ^
15*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS: <instantiation>:1:1: note: while in macro instantiation
16*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: .test0
17*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: ^
18*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS: 11:1: note: while in macro instantiation
19*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: .test1
20*9880d681SAndroid Build Coastguard Worker// CHECK-ERRORS-NEXT: ^
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker.macro test2
23*9880d681SAndroid Build Coastguard Worker.byte $0
24*9880d681SAndroid Build Coastguard Worker.endmacro
25*9880d681SAndroid Build Coastguard Worker// CHECK: .byte 10
26*9880d681SAndroid Build Coastguard Workertest2 10
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker.macro test3
29*9880d681SAndroid Build Coastguard Worker.globl "$0 $1 $2 $$3 $n"
30*9880d681SAndroid Build Coastguard Worker.endmacro
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker// CHECK: .globl "1 23  $3 2"
33*9880d681SAndroid Build Coastguard Workertest3 1, 2 3
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker// CHECK: .globl	"1 (23)  $3 2"
36*9880d681SAndroid Build Coastguard Workertest3 1, (2 3)
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker// CHECK: .globl "12  $3 1"
39*9880d681SAndroid Build Coastguard Workertest3 1 2
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker.macro test4
42*9880d681SAndroid Build Coastguard Worker.globl "$0 -- $1"
43*9880d681SAndroid Build Coastguard Worker.endmacro
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker// CHECK: .globl  "(ab)(,)) -- (cd)"
46*9880d681SAndroid Build Coastguard Workertest4 (a b)(,)),(cd)
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker// CHECK: .globl  "(ab)(,)) -- (cd)"
49*9880d681SAndroid Build Coastguard Workertest4 (a b)(,)),(cd)
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker.macro test5 _a
52*9880d681SAndroid Build Coastguard Worker.globl "\_a"
53*9880d681SAndroid Build Coastguard Worker.endm
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker// CHECK: .globl zed1
56*9880d681SAndroid Build Coastguard Workertest5 zed1
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker.macro test6 $a
59*9880d681SAndroid Build Coastguard Worker.globl "\$a"
60*9880d681SAndroid Build Coastguard Worker.endm
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard Worker// CHECK: .globl zed2
63*9880d681SAndroid Build Coastguard Workertest6 zed2
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Worker.macro test7 .a
66*9880d681SAndroid Build Coastguard Worker.globl "\.a"
67*9880d681SAndroid Build Coastguard Worker.endm
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Worker// CHECK: .globl zed3
70*9880d681SAndroid Build Coastguard Workertest7 zed3
71*9880d681SAndroid Build Coastguard Worker
72*9880d681SAndroid Build Coastguard Worker.macro test8 _a, _b, _c
73*9880d681SAndroid Build Coastguard Worker.globl "\_a,\_b,\_c"
74*9880d681SAndroid Build Coastguard Worker.endmacro
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker.macro test9 _a _b _c
77*9880d681SAndroid Build Coastguard Worker.globl "\_a \_b \_c"
78*9880d681SAndroid Build Coastguard Worker.endmacro
79*9880d681SAndroid Build Coastguard Worker
80*9880d681SAndroid Build Coastguard Worker// CHECK: .globl  "a,b,c"
81*9880d681SAndroid Build Coastguard Workertest8 a, b, c
82*9880d681SAndroid Build Coastguard Worker// CHECK: .globl  "%1,%2,%3"
83*9880d681SAndroid Build Coastguard Workertest8 %1, %2, %3 #a comment
84*9880d681SAndroid Build Coastguard Worker// CHECK: .globl "x-y,z,1"
85*9880d681SAndroid Build Coastguard Workertest8 x - y, z, 1
86*9880d681SAndroid Build Coastguard Worker// CHECK: .globl  "1 2 3"
87*9880d681SAndroid Build Coastguard Workertest9 1, 2,3
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Worker// CHECK: .globl "1,23,"
90*9880d681SAndroid Build Coastguard Workertest8 1,2 3
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker// CHECK: .globl "12,3,"
93*9880d681SAndroid Build Coastguard Workertest8 1 2, 3
94