1 ; RUN: llvm-ml -m64 -filetype=s %s /Fo - | FileCheck %s
11 SubstitutionMacro
macro a1:req
, a2:=<7>
27 substitution_test_with_default
PROC
28 ; CHECK-LABEL: substitution_test_with_default:
32 ; CHECK-NEXT: mov eax, 1
33 ; CHECK-NEXT: mov eax, 1
34 ; CHECK-NEXT: mov eax, 1
35 ; CHECK: mov eax, dword ptr [rip + xa1]
36 ; CHECK-NEXT: mov eax, dword ptr [rip + x1]
37 ; CHECK-NEXT: mov eax, dword ptr [rip + x1]
39 ; CHECK-NEXT: mov eax, 7
40 ; CHECK-NEXT: mov eax, 7
41 ; CHECK-NEXT: mov eax, 7
44 substitution_test_with_default
ENDP
46 substitution_test_with_value
PROC
47 ; CHECK-LABEL: substitution_test_with_value:
49 SubstitutionMacro
2, 8
51 ; CHECK-NEXT: mov eax, 2
52 ; CHECK-NEXT: mov eax, 2
53 ; CHECK-NEXT: mov eax, 2
54 ; CHECK: mov eax, dword ptr [rip + xa1]
55 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
56 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
58 ; CHECK-NEXT: mov eax, 8
59 ; CHECK-NEXT: mov eax, 8
60 ; CHECK-NEXT: mov eax, 8
63 substitution_test_with_value
ENDP
65 substitution_test_lowercase
PROC
66 ; CHECK-LABEL: substitution_test_lowercase:
68 substitutionmacro
2, 8
70 ; CHECK-NEXT: mov eax, 2
71 ; CHECK-NEXT: mov eax, 2
72 ; CHECK-NEXT: mov eax, 2
73 ; CHECK: mov eax, dword ptr [rip + xa1]
74 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
75 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
77 ; CHECK-NEXT: mov eax, 8
78 ; CHECK-NEXT: mov eax, 8
79 ; CHECK-NEXT: mov eax, 8
82 substitution_test_lowercase
ENDP
84 substitution_test_uppercase
PROC
85 ; CHECK-LABEL: substitution_test_uppercase:
87 SUBSTITUTIONMACRO
2, 8
89 ; CHECK-NEXT: mov eax, 2
90 ; CHECK-NEXT: mov eax, 2
91 ; CHECK-NEXT: mov eax, 2
92 ; CHECK: mov eax, dword ptr [rip + xa1]
93 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
94 ; CHECK-NEXT: mov eax, dword ptr [rip + x2]
96 ; CHECK-NEXT: mov eax, 8
97 ; CHECK-NEXT: mov eax, 8
98 ; CHECK-NEXT: mov eax, 8
101 substitution_test_uppercase
ENDP
103 AmbiguousSubstitutionMacro
MACRO x
, y
107 ambiguous_substitution_test
PROC
108 ; CHECK-LABEL: ambiguous_substitution_test:
110 ; should expand to ab BYTE 0
111 AmbiguousSubstitutionMacro a
, b
117 ambiguous_substitution_test
ENDP
119 AmbiguousSubstitutionInStringMacro
MACRO x
, y
123 ambiguous_substitution_in_string_test
PROC
124 ; CHECK-LABEL: ambiguous_substitution_in_string_test:
126 ; should expand to BYTE "5y"
127 AmbiguousSubstitutionInStringMacro
5, 7
130 ; CHECK-NEXT: .byte 121
132 ambiguous_substitution_in_string_test
ENDP
134 OptionalParameterMacro
MACRO a1:req
, a2
142 optional_parameter_test
PROC
143 ; CHECK-LABEL: optional_parameter_test:
145 OptionalParameterMacro
4
149 OptionalParameterMacro
5, 9
153 optional_parameter_test
ENDP
155 LocalSymbolMacro
MACRO
161 local_symbol_test
PROC
162 ; CHECK-LABEL: local_symbol_test:
167 ; CHECK-NEXT: jmp "??0000"
172 ; CHECK-NEXT: jmp "??0001"
173 local_symbol_test
ENDP
175 PURGE AmbiguousSubstitutionMacro
, LocalSymbolMacro
,
176 OptionalParameterMacro
179 LocalSymbolMacro
MACRO
186 ; CHECK-LABEL: purge_test:
190 ; CHECK-NEXT: xor eax, eax
191 ; CHECK-NEXT: jmp "??0002"