aboutsummaryrefslogtreecommitdiffstats
path: root/travis/test
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2020-10-10 16:37:00 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2020-10-10 16:37:00 +0300
commite85492c8249950a769d0344c0122c8d9d6d9f05d (patch)
treed53c828e756c46d7fadb8e0025a7473d0bfd2a1f /travis/test
parentb511da48c11e1625136038f5de86500f746d18d6 (diff)
downloadnasm-e85492c8249950a769d0344c0122c8d9d6d9f05d.tar.gz
nasm-e85492c8249950a769d0344c0122c8d9d6d9f05d.tar.xz
nasm-e85492c8249950a769d0344c0122c8d9d6d9f05d.zip
travis: add ppindirect
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'travis/test')
-rw-r--r--travis/test/ppindirect.asm42
-rw-r--r--travis/test/ppindirect.json12
-rw-r--r--travis/test/ppindirect.stdout103
3 files changed, 157 insertions, 0 deletions
diff --git a/travis/test/ppindirect.asm b/travis/test/ppindirect.asm
new file mode 100644
index 00000000..6438fb7c
--- /dev/null
+++ b/travis/test/ppindirect.asm
@@ -0,0 +1,42 @@
+; Fun tests of the preprocessor indirection mode...
+
+ bits 64
+
+%assign foo1 11
+%assign foo11 1111
+%assign foo2 22
+%assign foo22 2222
+%assign foo3 33
+%assign foo33 3333
+%assign n 2
+ dd foo%[foo%[n]]*100
+ dd foo%[n]*100
+%assign foo%[foo%[n]] foo%[foo%[n]]*100
+;%assign foo%[n] foo%[n]*100
+
+ dd foo1
+ dd foo2
+ dd foo3
+ dd foo11
+ dd foo22
+ dd foo33
+
+%define foo33bar 999999
+ dd %[foo%[foo3]bar]
+
+%assign bctr 0
+%macro bluttan 0
+%assign bctr bctr+1
+%assign bluttan%[bctr] bctr
+%defstr bstr bluttan%[bctr]
+ db bluttan%[bctr]
+ db bstr
+%endmacro
+
+%rep 20
+ bluttan
+%endrep
+%rep 20
+ db bluttan%[bctr]
+%assign bctr bctr-1
+%endrep
diff --git a/travis/test/ppindirect.json b/travis/test/ppindirect.json
new file mode 100644
index 00000000..fa245f0e
--- /dev/null
+++ b/travis/test/ppindirect.json
@@ -0,0 +1,12 @@
+[
+ {
+ "description": "Test preprocessor indirection mode",
+ "id": "ppindirect",
+ "format": "bin",
+ "source": "ppindirect.asm",
+ "option": "-E -Ox",
+ "target": [
+ { "stdout": "ppindirect.stdout" }
+ ]
+ }
+]
diff --git a/travis/test/ppindirect.stdout b/travis/test/ppindirect.stdout
new file mode 100644
index 00000000..49dc57be
--- /dev/null
+++ b/travis/test/ppindirect.stdout
@@ -0,0 +1,103 @@
+%line 3+1 ./travis/test/ppindirect.asm
+[bits 64]
+
+%line 12+1 ./travis/test/ppindirect.asm
+ dd 2222*100
+ dd 22*100
+
+
+
+ dd 11
+ dd 22
+ dd 33
+ dd 1111
+ dd 222200
+ dd 3333
+
+
+ dd 999999
+
+%line 35+1 ./travis/test/ppindirect.asm
+
+%line 32+1 ./travis/test/ppindirect.asm
+ db 1
+ db '1'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 2
+ db '2'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 3
+ db '3'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 4
+ db '4'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 5
+ db '5'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 6
+ db '6'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 7
+ db '7'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 8
+ db '8'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 9
+ db '9'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 10
+ db '10'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 11
+ db '11'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 12
+ db '12'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 13
+ db '13'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 14
+ db '14'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 15
+ db '15'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 16
+ db '16'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 17
+ db '17'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 18
+ db '18'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 19
+ db '19'
+%line 32+1 ./travis/test/ppindirect.asm
+ db 20
+ db '20'
+%line 40+1 ./travis/test/ppindirect.asm
+ db 20
+%line 40+0 ./travis/test/ppindirect.asm
+ db 19
+ db 18
+ db 17
+ db 16
+ db 15
+ db 14
+ db 13
+ db 12
+ db 11
+ db 10
+ db 9
+ db 8
+ db 7
+ db 6
+ db 5
+ db 4
+ db 3
+ db 2
+ db 1