aboutsummaryrefslogtreecommitdiffstats
path: root/travis/test
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-11-11 15:33:56 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-11-11 21:43:46 +0300
commit88ef14eed8994ab60ff9dd893d88dbd4837a80f0 (patch)
tree40480f6aa68fed87e4eed35039b87ee7e448e5ed /travis/test
parentb93462b8f7cdeb9a1ca0abef5f8d4b7cb895af43 (diff)
downloadnasm-88ef14eed8994ab60ff9dd893d88dbd4837a80f0.tar.gz
nasm-88ef14eed8994ab60ff9dd893d88dbd4837a80f0.tar.xz
nasm-88ef14eed8994ab60ff9dd893d88dbd4837a80f0.zip
test: nasm-t -- Add ifelse
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'travis/test')
-rw-r--r--travis/test/ifelse.asm46
-rw-r--r--travis/test/ifelse.bin.t1
-rw-r--r--travis/test/ifelse.json12
-rw-r--r--travis/test/ifelse.stderr4
4 files changed, 63 insertions, 0 deletions
diff --git a/travis/test/ifelse.asm b/travis/test/ifelse.asm
new file mode 100644
index 00000000..bbb0d796
--- /dev/null
+++ b/travis/test/ifelse.asm
@@ -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
diff --git a/travis/test/ifelse.bin.t b/travis/test/ifelse.bin.t
new file mode 100644
index 00000000..8d99a0d6
--- /dev/null
+++ b/travis/test/ifelse.bin.t
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/travis/test/ifelse.json b/travis/test/ifelse.json
new file mode 100644
index 00000000..56a9c3af
--- /dev/null
+++ b/travis/test/ifelse.json
@@ -0,0 +1,12 @@
+[
+ {
+ "description": "Test if,elif,else directives",
+ "id": "ifelse",
+ "format": "bin",
+ "source": "ifelse.asm",
+ "target": [
+ { "output": "ifelse.bin" },
+ { "stderr": "ifelse.stderr" }
+ ]
+ }
+]
diff --git a/travis/test/ifelse.stderr b/travis/test/ifelse.stderr
new file mode 100644
index 00000000..dd9dfb55
--- /dev/null
+++ b/travis/test/ifelse.stderr
@@ -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. \ No newline at end of file