test: nasm-t -- Add ifelse

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2018-11-11 15:33:56 +03:00
parent b93462b8f7
commit 88ef14eed8
4 changed files with 63 additions and 0 deletions

46
travis/test/ifelse.asm Normal file
View 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
View File

@ -0,0 +1 @@


12
travis/test/ifelse.json Normal file
View 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" }
]
}
]

View 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.