brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · a5bf86c Raw
214 lines · plain
1; RUN: llvm-ml64 -filetype=s %s /Fo - | FileCheck %s2 3.data4 5x1 DWORD ?6x2 DWORD ?7xa1 DWORD ?8 9.code10 11SubstitutionMacro macro a1:req, a2:=<7>12  mov eax, a113  mov eax, a1&14  mov eax, &a115  mov eax, &a1&16 17  mov eax, xa118  mov eax, x&a119  mov eax, x&a1&20 21  mov eax, a222  mov eax, a2&23  mov eax, &a224  mov eax, &a2&25endm26 27substitution_test_with_default PROC28; CHECK-LABEL: substitution_test_with_default:29 30  SubstitutionMacro 131; CHECK: mov eax, 132; CHECK-NEXT: mov eax, 133; CHECK-NEXT: mov eax, 134; CHECK-NEXT: mov eax, 135; 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]38; CHECK: mov eax, 739; CHECK-NEXT: mov eax, 740; CHECK-NEXT: mov eax, 741; CHECK-NEXT: mov eax, 742 43  ret44substitution_test_with_default ENDP45 46substitution_test_with_value PROC47; CHECK-LABEL: substitution_test_with_value:48 49  SubstitutionMacro 2, 850; CHECK: mov eax, 251; CHECK-NEXT: mov eax, 252; CHECK-NEXT: mov eax, 253; CHECK-NEXT: mov eax, 254; 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]57; CHECK: mov eax, 858; CHECK-NEXT: mov eax, 859; CHECK-NEXT: mov eax, 860; CHECK-NEXT: mov eax, 861 62  ret63substitution_test_with_value ENDP64 65substitution_test_lowercase PROC66; CHECK-LABEL: substitution_test_lowercase:67 68  substitutionmacro 2, 869; CHECK: mov eax, 270; CHECK-NEXT: mov eax, 271; CHECK-NEXT: mov eax, 272; CHECK-NEXT: mov eax, 273; 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]76; CHECK: mov eax, 877; CHECK-NEXT: mov eax, 878; CHECK-NEXT: mov eax, 879; CHECK-NEXT: mov eax, 880 81  ret82substitution_test_lowercase ENDP83 84substitution_test_uppercase PROC85; CHECK-LABEL: substitution_test_uppercase:86 87  SUBSTITUTIONMACRO 2, 888; CHECK: mov eax, 289; CHECK-NEXT: mov eax, 290; CHECK-NEXT: mov eax, 291; CHECK-NEXT: mov eax, 292; 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]95; CHECK: mov eax, 896; CHECK-NEXT: mov eax, 897; CHECK-NEXT: mov eax, 898; CHECK-NEXT: mov eax, 899 100  ret101substitution_test_uppercase ENDP102 103substitution_test_with_parentheses PROC104; CHECK-LABEL: substitution_test_with_parentheses:105 106  SubstitutionMacro(2, 8)107; CHECK: mov eax, 2108; CHECK-NEXT: mov eax, 2109; CHECK-NEXT: mov eax, 2110; CHECK-NEXT: mov eax, 2111; CHECK: mov eax, dword ptr [rip + xa1]112; CHECK-NEXT: mov eax, dword ptr [rip + x2]113; CHECK-NEXT: mov eax, dword ptr [rip + x2]114; CHECK: mov eax, 8115; CHECK-NEXT: mov eax, 8116; CHECK-NEXT: mov eax, 8117; CHECK-NEXT: mov eax, 8118 119  ret120substitution_test_with_parentheses ENDP121 122AmbiguousSubstitutionMacro MACRO x, y123  x&y BYTE 0124ENDM125 126ambiguous_substitution_test PROC127; CHECK-LABEL: ambiguous_substitution_test:128 129; should expand to ab BYTE 0130  AmbiguousSubstitutionMacro a, b131 132; CHECK: ab:133; CHECK-NOT: ay:134; CHECK-NOT: xb:135; CHECK-NOT: xy:136ambiguous_substitution_test ENDP137 138AmbiguousSubstitutionInStringMacro MACRO x, y139  BYTE "x&y"140ENDM141 142ambiguous_substitution_in_string_test PROC143; CHECK-LABEL: ambiguous_substitution_in_string_test:144 145; should expand to BYTE "5y"146  AmbiguousSubstitutionInStringMacro 5, 7147 148; CHECK: .byte 53149; CHECK-NEXT: .byte 121150; CHECK-NOT: .byte151ambiguous_substitution_in_string_test ENDP152 153OptionalParameterMacro MACRO a1:req, a2154  mov eax, a1155IFNB <a2>156  mov eax, a2157ENDIF158  ret159ENDM160 161optional_parameter_test PROC162; CHECK-LABEL: optional_parameter_test:163 164  OptionalParameterMacro 4165; CHECK: mov eax, 4166; CHECK: ret167 168  OptionalParameterMacro 5, 9169; CHECK: mov eax, 5170; CHECK: mov eax, 9171; CHECK: ret172optional_parameter_test ENDP173 174LocalSymbolMacro MACRO175  LOCAL a176a: ret177   jmp a178ENDM179 180local_symbol_test PROC181; CHECK-LABEL: local_symbol_test:182 183  LocalSymbolMacro184; CHECK: "??0000":185; CHECK-NEXT: ret186; CHECK-NEXT: jmp "??0000"187 188  LocalSymbolMacro189; CHECK: "??0001":190; CHECK-NEXT: ret191; CHECK-NEXT: jmp "??0001"192local_symbol_test ENDP193 194PURGE AmbiguousSubstitutionMacro, LocalSymbolMacro,195      OptionalParameterMacro196 197; Redefinition198LocalSymbolMacro MACRO199  LOCAL b200b: xor eax, eax201   jmp b202ENDM203 204purge_test PROC205; CHECK-LABEL: purge_test:206 207  LocalSymbolMacro208; CHECK: "??0002":209; CHECK-NEXT: xor eax, eax210; CHECK-NEXT: jmp "??0002"211purge_test ENDP212 213END214