1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/tools/llvm-ml/repeat_directives.asm
Eric Astor 4082cce59d [ms] [llvm-ml] Introduce command-line compatibility for ml.exe and ml64.exe
Switch to OptParser for command-line handling

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D90058
2020-12-01 17:43:44 -05:00

106 lines
1.8 KiB
NASM

; RUN: llvm-ml -m64 -filetype=s %s /Fo - | FileCheck %s
.data
a BYTE ?
.code
repeat_test PROC
; CHECK-LABEL: repeat_test:
REPEAT 1+2
xor eax, 0
ENDM
; CHECK: xor eax, 0
; CHECK: xor eax, 0
; CHECK: xor eax, 0
; CHECK-NOT: xor eax, 0
repeat_test ENDP
while_test PROC
; CHECK-LABEL: while_test:
C = 1
WHILE C <= 3
xor eax, C
C = C + 1
ENDM
; CHECK: xor eax, 1
; CHECK: xor eax, 2
; CHECK: xor eax, 3
; CHECK-NOT: xor eax,
while_test ENDP
for_test PROC
; CHECK-LABEL: for_test:
FOR arg, <'O', 'K', 13, 10>
mov al, arg
ENDM
; CHECK: mov al, 79
; CHECK: mov al, 75
; CHECK: mov al, 13
; CHECK: mov al, 10
; CHECK-NOT: mov al,
for_test ENDP
for_without_substitution_test PROC
; CHECK-LABEL: for_without_substitution_test:
FOR a, <'O', 'K', 13, 10>
mov al, 'a'
ENDM
; CHECK: mov al, 97
; CHECK: mov al, 97
; CHECK: mov al, 97
; CHECK: mov al, 97
; CHECK-NOT: mov al,
for_without_substitution_test ENDP
for_with_default_test PROC
; CHECK-LABEL: for_with_default_test:
FOR arg:=<'K'>, <'O', ,, 13,>
mov al, arg
ENDM
; CHECK: mov al, 79
; CHECK: mov al, 75
; CHECK: mov al, 75
; CHECK: mov al, 13
; CHECK: mov al, 75
; CHECK-NOT: mov al,
for_with_default_test ENDP
forc_test PROC
; CHECK-LABEL: forc_test:
FORC arg, <OK>
mov al, "&arg"
ENDM
; CHECK: mov al, 79
; CHECK: mov al, 75
; CHECK-NOT: mov al,
forc_test ENDP
forc_improper_test PROC
; CHECK-LABEL: forc_improper_test:
FORC arg, A-; OK
mov al, "&arg"
ENDM
; CHECK: mov al, 65
; CHECK: mov al, 45
; CHECK: mov al, 59
; CHECK-NOT: mov al,
forc_improper_test ENDP
nested_substitution_test PROC
; CHECK-LABEL: nested_substitution_test:
FOR s, <A-, OK>
FORC c, <s>
mov al, '&c'
ENDM
ENDM
; CHECK: mov al, 65
; CHECK: mov al, 45
; CHECK: mov al, 79
; CHECK: mov al, 75
; CHECK-NOT: mov al,
nested_substitution_test ENDP
end