mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-23 17:29:23 +08:00
test/immwarn.asm: new test for immediate warnings
Test for various conditions that should or should not generate immediate warnings. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
1b221bed25
commit
9ac2b843b4
54
test/immwarn.asm
Normal file
54
test/immwarn.asm
Normal file
@ -0,0 +1,54 @@
|
||||
;Testname=onowarn; Arguments=-Ox -DOPT=1 -DWARN=0 -fbin -oimmwarn.bin; Files=.stdout .stderr immwarn.bin
|
||||
;Testname=owarn; Arguments=-Ox -DOPT=1 -DWARN=1 -fbin -oimmwarn.bin; Files=.stdout .stderr immwarn.bin
|
||||
;Testname=nowarn; Arguments=-O0 -DOPT=0 -DWARN=0 -fbin -oimmwarn.bin; Files=.stdout .stderr immwarn.bin
|
||||
;Testname=warn; Arguments=-O0 -DOPT=1 -DWARN=1 -fbin -oimmwarn.bin; Files=.stdout .stderr immwarn.bin
|
||||
|
||||
%ifndef WARN
|
||||
%define WARN 1
|
||||
%endif
|
||||
|
||||
bits 16
|
||||
push 1
|
||||
%if WARN
|
||||
push 0ffffffffh
|
||||
%endif
|
||||
push -1
|
||||
push 0ffffh
|
||||
|
||||
add ax,0FFFFh
|
||||
%if WARN
|
||||
add ax,0FFFFFFFFh
|
||||
%endif
|
||||
add ax,-1
|
||||
|
||||
bits 32
|
||||
push 1
|
||||
push 0ffffffffh
|
||||
push -1
|
||||
push 0ffffh
|
||||
|
||||
push byte 1
|
||||
%if WARN
|
||||
push byte 0ffffffffh
|
||||
%endif
|
||||
push byte -1
|
||||
|
||||
push word 1
|
||||
push word 0ffffh
|
||||
push word -1
|
||||
|
||||
push dword 1
|
||||
push dword 0ffffffffh
|
||||
push dword -1
|
||||
|
||||
add eax,0FFFFh
|
||||
add eax,0FFFFFFFFh
|
||||
add eax,-1
|
||||
|
||||
bits 64
|
||||
mov rax,7fffffffh
|
||||
mov rax,80000000h
|
||||
; mov rax,dword 80000000h
|
||||
add rax,0FFFFh
|
||||
add rax,0FFFFFFFFh
|
||||
add rax,-1
|
Loading…
Reference in New Issue
Block a user