mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
test: nasm-t -- Add ifelse
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
b93462b8f7
commit
88ef14eed8
46
travis/test/ifelse.asm
Normal file
46
travis/test/ifelse.asm
Normal file
@ -0,0 +1,46 @@
|
||||
;Testname=ifelse; Arguments=-fbin -oifelse.bin; Files=stdout stderr ifelse.bin
|
||||
|
||||
;No problems -> db 3
|
||||
%if 0
|
||||
db 0
|
||||
%elif 0 > 0
|
||||
db 1
|
||||
%elif 1 < 1
|
||||
db 2
|
||||
%else
|
||||
db 3
|
||||
%endif
|
||||
|
||||
;Garbage after else, elif after else -> db 5
|
||||
%if 0
|
||||
db 4
|
||||
%else trailing garbage
|
||||
db 5
|
||||
%elif 1
|
||||
db 6
|
||||
%endif
|
||||
|
||||
;Garbage after endif ->
|
||||
%if 0
|
||||
db 7
|
||||
%endif trailing garbage
|
||||
|
||||
;else after else -> db 9
|
||||
%if 0
|
||||
db 8
|
||||
%else
|
||||
db 9
|
||||
%else
|
||||
db 10
|
||||
%endif
|
||||
|
||||
;Problem preprocessed out, no warning ->
|
||||
%if 0
|
||||
%if 1
|
||||
db 11
|
||||
%else
|
||||
db 12
|
||||
%else
|
||||
db 13
|
||||
%endif
|
||||
%endif
|
1
travis/test/ifelse.bin.t
Normal file
1
travis/test/ifelse.bin.t
Normal file
@ -0,0 +1 @@
|
||||
|
12
travis/test/ifelse.json
Normal file
12
travis/test/ifelse.json
Normal file
@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"description": "Test if,elif,else directives",
|
||||
"id": "ifelse",
|
||||
"format": "bin",
|
||||
"source": "ifelse.asm",
|
||||
"target": [
|
||||
{ "output": "ifelse.bin" },
|
||||
{ "stderr": "ifelse.stderr" }
|
||||
]
|
||||
}
|
||||
]
|
4
travis/test/ifelse.stderr
Normal file
4
travis/test/ifelse.stderr
Normal file
@ -0,0 +1,4 @@
|
||||
./travis/test/ifelse.asm:17: warning: trailing garbage after `%else' ignored
|
||||
./travis/test/ifelse.asm:19: warning: `%elif' after `%else' ignored
|
||||
./travis/test/ifelse.asm:26: warning: trailing garbage after `%endif' ignored
|
||||
./travis/test/ifelse.asm:33: warning: `%else' after `%else' ignored.
|
Loading…
Reference in New Issue
Block a user