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