• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple x86_64-apple-darwin10 %s | FileCheck %s
2
3.macro GET   var,re2g
4    movl   \var@GOTOFF(%ebx),\re2g
5.endm
6
7.macro GET_DEFAULT var, re2g=%ebx, re3g=%ecx
8movl 2(\re2g, \re3g, 2), \var
9.endm
10
11GET         is_sse, %eax
12// CHECK: movl  is_sse@GOTOFF(%ebx), %eax
13
14GET_DEFAULT %ebx, , %edx
15// CHECK: movl  2(%ebx,%edx,2), %ebx
16
17GET_DEFAULT %ebx, %edx
18// CHECK: movl  2(%edx,%ecx,2), %ebx
19
20.macro bar
21    .long $n
22.endm
23
24bar 1, 2, 3
25bar
26
27// CHECK: .long 3
28// CHECK: .long 0
29
30
31.macro top
32    middle _$0, $1
33.endm
34.macro middle
35     $0:
36    .if $n > 1
37        bottom $1
38    .endif
39.endm
40.macro bottom
41    .set fred, $0
42.endm
43
44.text
45
46top foo
47top bar, 42
48
49// CHECK: _foo:
50// CHECK-NOT: fred
51// CHECK: _bar
52// CHECK-NEXT: .set fred, 42
53
54
55.macro foo
56foo_$0_$1_$2_$3:
57  nop
58.endm
59
60foo 1, 2, 3, 4
61foo 1, , 3, 4
62
63// CHECK: foo_1_2_3_4:
64// CHECK: foo_1__3_4:
65