aboutsummaryrefslogtreecommitdiffstats
path: root/travis/test
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2018-11-04 22:51:04 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2018-11-11 21:43:46 +0300
commit9233879e08ac2416ee06f61455eb0ef2e07fb35a (patch)
tree18f3d643e10a20c83cc7e569dceb28c74ebfb73e /travis/test
parent2dccd2c276f5794caf60b9a493536b5f6394d34d (diff)
downloadnasm-9233879e08ac2416ee06f61455eb0ef2e07fb35a.tar.gz
nasm-9233879e08ac2416ee06f61455eb0ef2e07fb35a.tar.xz
nasm-9233879e08ac2416ee06f61455eb0ef2e07fb35a.zip
test: nasm-t -- Add ifmacro
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'travis/test')
-rw-r--r--travis/test/ifmacro.asm411
-rw-r--r--travis/test/ifmacro.bin.t29
-rw-r--r--travis/test/ifmacro.json11
3 files changed, 451 insertions, 0 deletions
diff --git a/travis/test/ifmacro.asm b/travis/test/ifmacro.asm
new file mode 100644
index 00000000..8375614e
--- /dev/null
+++ b/travis/test/ifmacro.asm
@@ -0,0 +1,411 @@
+;
+; ifmacro.asm
+;
+; Test of the new ifmacro directive
+;
+; This file produces a human-readable text file when compiled
+; with -f bin
+;
+
+%define LF 10
+
+%macro dummy 2
+ db 'This is a dummy macro, '
+ db 'arg1 = ', %1, ', '
+ db 'arg2 = ', %2, LF
+%endmacro
+
+ dummy 'this', 'that'
+
+%ifdef CR
+ db '%ifdef CR', LF
+%endif
+
+%ifdef LF
+ db '%ifdef LF', LF
+%endif
+
+%ifmacro dummy 1
+ db '%ifmacro dummy 1', LF
+%endif
+
+%ifmacro dummy 2
+ db '%ifmacro dummy 2', LF
+%endif
+
+%ifmacro dummy 3
+ db '%ifmacro dummy 3', LF
+%endif
+
+%ifmacro dummy 1+
+ db '%ifmacro dummy 1+', LF
+%endif
+
+%ifmacro dummy 2+
+ db '%ifmacro dummy 2+', LF
+%endif
+
+%ifmacro dummy 3+
+ db '%ifmacro dummy 3+', LF
+%endif
+
+%ifmacro dummy
+ db '%ifmacro dummy', LF
+%endif
+
+%ifmacro dummy 0-1
+ db '%ifmacro dummy 0-1', LF
+%endif
+
+%ifmacro dummy 1-2
+ db '%ifmacro dummy 1-2', LF
+%endif
+
+%ifmacro dummy 2-3
+ db '%ifmacro dummy 2-3', LF
+%endif
+
+%ifmacro dummy 3-4
+ db '%ifmacro dummy 3-4', LF
+%endif
+
+%ifmacro LF
+ db '%ifmacro LF', LF
+%endif
+
+%ifndef CR
+ db '%ifndef CR', LF
+%endif
+
+%ifndef LF
+ db '%ifndef LF', LF
+%endif
+
+%ifnmacro dummy 1
+ db '%ifnmacro dummy 1', LF
+%endif
+
+%ifnmacro dummy 2
+ db '%ifnmacro dummy 2', LF
+%endif
+
+%ifnmacro dummy 3
+ db '%ifnmacro dummy 3', LF
+%endif
+
+%ifnmacro dummy 1+
+ db '%ifnmacro dummy 1+', LF
+%endif
+
+%ifnmacro dummy 2+
+ db '%ifnmacro dummy 2+', LF
+%endif
+
+%ifnmacro dummy 3+
+ db '%ifnmacro dummy 3+', LF
+%endif
+
+%ifnmacro dummy
+ db '%ifnmacro dummy', LF
+%endif
+
+%ifnmacro dummy 0-1
+ db '%ifnmacro dummy 0-1', LF
+%endif
+
+%ifnmacro dummy 1-2
+ db '%ifnmacro dummy 1-2', LF
+%endif
+
+%ifnmacro dummy 2-3
+ db '%ifnmacro dummy 2-3', LF
+%endif
+
+%ifnmacro dummy 3-4
+ db '%ifnmacro dummy 3-4', LF
+%endif
+
+%ifnmacro LF
+ db '%ifnmacro LF', LF
+%endif
+
+%if 0
+%elifdef CR
+ db '%elifdef CR', CR
+%endif
+
+%if 0
+%elifdef LF
+ db '%elifdef LF', LF
+%endif
+
+%if 0
+%elifmacro dummy 1
+ db '%elifmacro dummy 1', LF
+%endif
+
+%if 0
+%elifmacro dummy 2
+ db '%elifmacro dummy 2', LF
+%endif
+
+%if 0
+%elifmacro dummy 3
+ db '%elifmacro dummy 3', LF
+%endif
+
+%if 0
+%elifmacro dummy 1+
+ db '%elifmacro dummy 1+', LF
+%endif
+
+%if 0
+%elifmacro dummy 2+
+ db '%elifmacro dummy 2+', LF
+%endif
+
+%if 0
+%elifmacro dummy 3+
+ db '%elifmacro dummy 3+', LF
+%endif
+
+%if 0
+%elifmacro dummy
+ db '%elifmacro dummy', LF
+%endif
+
+%if 0
+%elifmacro dummy 0-1
+ db '%elifmacro dummy 0-1', LF
+%endif
+
+%if 0
+%elifmacro dummy 1-2
+ db '%elifmacro dummy 1-2', LF
+%endif
+
+%if 0
+%elifmacro dummy 2-3
+ db '%elifmacro dummy 2-3', LF
+%endif
+
+%if 0
+%elifmacro dummy 3-4
+ db '%elifmacro dummy 3-4', LF
+%endif
+
+%if 0
+%elifmacro LF
+ db '%elifmacro LF', LF
+%endif
+
+%if 0
+%elifndef CR
+ db '%elifndef CR', LF
+%endif
+
+%if 0
+%elifndef LF
+ db '%elifndef LF', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1
+ db '%elifnmacro dummy 1', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2
+ db '%elifnmacro dummy 2', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3
+ db '%elifnmacro dummy 3', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1+
+ db '%elifnmacro dummy 1+', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2+
+ db '%elifnmacro dummy 2+', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3+
+ db '%elifnmacro dummy 3+', LF
+%endif
+
+%if 0
+%elifnmacro dummy
+ db '%elifnmacro dummy', LF
+%endif
+
+%if 0
+%elifnmacro dummy 0-1
+ db '%elifnmacro dummy 0-1', LF
+%endif
+
+%if 0
+%elifnmacro dummy 1-2
+ db '%elifnmacro dummy 1-2', LF
+%endif
+
+%if 0
+%elifnmacro dummy 2-3
+ db '%elifnmacro dummy 2-3', LF
+%endif
+
+%if 0
+%elifnmacro dummy 3-4
+ db '%elifnmacro dummy 3-4', LF
+%endif
+
+%if 0
+%elifnmacro LF
+ db '%elifnmacro LF', LF
+%endif
+
+%if 1
+%elifdef CR
+ db 'bad %elifdef CR', LF
+%endif
+
+%if 1
+%elifdef LF
+ db 'bad %elifdef LF', LF
+%endif
+
+%if 1
+%elifmacro dummy 1
+ db 'bad %elifmacro dummy 1', LF
+%endif
+
+%if 1
+%elifmacro dummy 2
+ db 'bad %elifmacro dummy 2', LF
+%endif
+
+%if 1
+%elifmacro dummy 3
+ db 'bad %elifmacro dummy 3', LF
+%endif
+
+%if 1
+%elifmacro dummy 1+
+ db 'bad %elifmacro dummy 1+', LF
+%endif
+
+%if 1
+%elifmacro dummy 2+
+ db 'bad %elifmacro dummy 2+', LF
+%endif
+
+%if 1
+%elifmacro dummy 3+
+ db 'bad %elifmacro dummy 3+', LF
+%endif
+
+%if 1
+%elifmacro dummy
+ db 'bad %elifmacro dummy', LF
+%endif
+
+%if 1
+%elifmacro dummy 0-1
+ db 'bad %elifmacro dummy 0-1', LF
+%endif
+
+%if 1
+%elifmacro dummy 1-2
+ db 'bad %elifmacro dummy 1-2', LF
+%endif
+
+%if 1
+%elifmacro dummy 2-3
+ db 'bad %elifmacro dummy 2-3', LF
+%endif
+
+%if 1
+%elifmacro dummy 3-4
+ db 'bad %elifmacro dummy 3-4', LF
+%endif
+
+%if 1
+%elifmacro LF
+ db 'bad %elifmacro LF', LF
+%endif
+
+%if 1
+%elifndef CR
+ db 'bad %elifndef CR', LF
+%endif
+
+%if 1
+%elifndef LF
+ db 'bad %elifndef LF', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1
+ db 'bad %elifnmacro dummy 1', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2
+ db 'bad %elifnmacro dummy 2', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3
+ db 'bad %elifnmacro dummy 3', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1+
+ db 'bad %elifnmacro dummy 1+', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2+
+ db 'bad %elifnmacro dummy 2+', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3+
+ db 'bad %elifnmacro dummy 3+', LF
+%endif
+
+%if 1
+%elifnmacro dummy
+ db 'bad %elifnmacro dummy', LF
+%endif
+
+%if 1
+%elifnmacro dummy 0-1
+ db 'bad %elifnmacro dummy 0-1', LF
+%endif
+
+%if 1
+%elifnmacro dummy 1-2
+ db 'bad %elifnmacro dummy 1-2', LF
+%endif
+
+%if 1
+%elifnmacro dummy 2-3
+ db 'bad %elifnmacro dummy 2-3', LF
+%endif
+
+%if 1
+%elifnmacro dummy 3-4
+ db 'bad %elifnmacro dummy 3-4', LF
+%endif
+
+%if 1
+%elifnmacro LF
+ db 'bad %elifnmacro LF', LF
+%endif
+
diff --git a/travis/test/ifmacro.bin.t b/travis/test/ifmacro.bin.t
new file mode 100644
index 00000000..2e258d1c
--- /dev/null
+++ b/travis/test/ifmacro.bin.t
@@ -0,0 +1,29 @@
+This is a dummy macro, arg1 = this, arg2 = that
+%ifdef LF
+%ifmacro dummy 2
+%ifmacro dummy 1+
+%ifmacro dummy 2+
+%ifmacro dummy
+%ifmacro dummy 1-2
+%ifmacro dummy 2-3
+%ifndef CR
+%ifnmacro dummy 1
+%ifnmacro dummy 3
+%ifnmacro dummy 3+
+%ifnmacro dummy 0-1
+%ifnmacro dummy 3-4
+%ifnmacro LF
+%elifdef LF
+%elifmacro dummy 2
+%elifmacro dummy 1+
+%elifmacro dummy 2+
+%elifmacro dummy
+%elifmacro dummy 1-2
+%elifmacro dummy 2-3
+%elifndef CR
+%elifnmacro dummy 1
+%elifnmacro dummy 3
+%elifnmacro dummy 3+
+%elifnmacro dummy 0-1
+%elifnmacro dummy 3-4
+%elifnmacro LF
diff --git a/travis/test/ifmacro.json b/travis/test/ifmacro.json
new file mode 100644
index 00000000..1f2f4cac
--- /dev/null
+++ b/travis/test/ifmacro.json
@@ -0,0 +1,11 @@
+[
+ {
+ "description": "Generate human readable text with bin",
+ "id": "ifmacro",
+ "format": "bin",
+ "source": "ifmacro.asm",
+ "target": [
+ { "output": "ifmacro.bin" }
+ ]
+ }
+]