diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-11-11 14:41:34 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-11-11 21:43:46 +0300 |
commit | b93462b8f7cdeb9a1ca0abef5f8d4b7cb895af43 (patch) | |
tree | 7b61de68ca6edcdc2b2cae57785a16ae8ca807e8 /travis | |
parent | c777772243da543f9c60097b527cf851310f2f15 (diff) | |
download | nasm-b93462b8f7cdeb9a1ca0abef5f8d4b7cb895af43.tar.gz |
test: nasm-t -- Add expimp
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'travis')
-rw-r--r-- | travis/test/expimp-o0-error.stderr | 8 | ||||
-rw-r--r-- | travis/test/expimp-o0.bin.t | bin | 0 -> 513 bytes | |||
-rw-r--r-- | travis/test/expimp-o0.stderr | 4 | ||||
-rw-r--r-- | travis/test/expimp-o1.bin.t | bin | 0 -> 501 bytes | |||
-rw-r--r-- | travis/test/expimp-o1.stderr | 4 | ||||
-rw-r--r-- | travis/test/expimp-ox-error.stderr | 8 | ||||
-rw-r--r-- | travis/test/expimp-ox.bin.t | bin | 0 -> 495 bytes | |||
-rw-r--r-- | travis/test/expimp.asm | 90 | ||||
-rw-r--r-- | travis/test/expimp.json | 40 |
9 files changed, 154 insertions, 0 deletions
diff --git a/travis/test/expimp-o0-error.stderr b/travis/test/expimp-o0-error.stderr new file mode 100644 index 00000000..6fb20f52 --- /dev/null +++ b/travis/test/expimp-o0-error.stderr @@ -0,0 +1,8 @@ +./travis/test/expimp.asm:17: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:24: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:31: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:38: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:59: error: short jump is out of range +./travis/test/expimp.asm:59: warning: byte data exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:77: error: short jump is out of range +./travis/test/expimp.asm:77: warning: byte data exceeds bounds [-w+number-overflow]
\ No newline at end of file diff --git a/travis/test/expimp-o0.bin.t b/travis/test/expimp-o0.bin.t Binary files differnew file mode 100644 index 00000000..b4034a9d --- /dev/null +++ b/travis/test/expimp-o0.bin.t diff --git a/travis/test/expimp-o0.stderr b/travis/test/expimp-o0.stderr new file mode 100644 index 00000000..9a336950 --- /dev/null +++ b/travis/test/expimp-o0.stderr @@ -0,0 +1,4 @@ +./travis/test/expimp.asm:17: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:24: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:31: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:38: warning: signed byte value exceeds bounds [-w+number-overflow]
\ No newline at end of file diff --git a/travis/test/expimp-o1.bin.t b/travis/test/expimp-o1.bin.t Binary files differnew file mode 100644 index 00000000..161df87f --- /dev/null +++ b/travis/test/expimp-o1.bin.t diff --git a/travis/test/expimp-o1.stderr b/travis/test/expimp-o1.stderr new file mode 100644 index 00000000..9a336950 --- /dev/null +++ b/travis/test/expimp-o1.stderr @@ -0,0 +1,4 @@ +./travis/test/expimp.asm:17: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:24: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:31: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:38: warning: signed byte value exceeds bounds [-w+number-overflow]
\ No newline at end of file diff --git a/travis/test/expimp-ox-error.stderr b/travis/test/expimp-ox-error.stderr new file mode 100644 index 00000000..6fb20f52 --- /dev/null +++ b/travis/test/expimp-ox-error.stderr @@ -0,0 +1,8 @@ +./travis/test/expimp.asm:17: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:24: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:31: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:38: warning: signed byte value exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:59: error: short jump is out of range +./travis/test/expimp.asm:59: warning: byte data exceeds bounds [-w+number-overflow] +./travis/test/expimp.asm:77: error: short jump is out of range +./travis/test/expimp.asm:77: warning: byte data exceeds bounds [-w+number-overflow]
\ No newline at end of file diff --git a/travis/test/expimp-ox.bin.t b/travis/test/expimp-ox.bin.t Binary files differnew file mode 100644 index 00000000..11c0d01d --- /dev/null +++ b/travis/test/expimp-ox.bin.t diff --git a/travis/test/expimp.asm b/travis/test/expimp.asm new file mode 100644 index 00000000..89e32a14 --- /dev/null +++ b/travis/test/expimp.asm @@ -0,0 +1,90 @@ +;Testname=O0; Arguments=-O0 -fbin -oexpimp.bin; Files=stdout stderr expimp.bin +;Testname=O1; Arguments=-O1 -fbin -oexpimp.bin; Files=stdout stderr expimp.bin +;Testname=Ox; Arguments=-Ox -fbin -oexpimp.bin; Files=stdout stderr expimp.bin +;Testname=error-O0; Arguments=-O0 -fbin -oexpimp.bin -DERROR; Files=stdout stderr expimp.bin +;Testname=error-Ox; Arguments=-Ox -fbin -oexpimp.bin -DERROR; Files=stdout stderr expimp.bin + +; +; Test of explicitly and implicitly sized operands +; + BITS 32 + + add esi,2 ; Implicit + add esi,123456h ; Implicit + add esi,byte 2 ; Explicit + add esi,dword 2 ; Explicit + add esi,dword 123456h ; Explicit + add esi,byte 123456h ; Explicit Truncation + + add esi,strict 2 ; Implicit Strict + add esi,strict 123456h ; Implicit Strict + add esi,strict byte 2 ; Explicit Strict + add esi,strict dword 2 ; Explicit Strict + add esi,strict dword 123456h ; Explicit Strict + add esi,strict byte 123456h ; Explicit Strict Truncation + + add eax,2 ; Implicit + add eax,123456h ; Implicit + add eax,byte 2 ; Explicit + add eax,dword 2 ; Explicit + add eax,dword 123456h ; Explicit + add eax,byte 123456h ; Explicit Truncation + + add eax,strict 2 ; Implicit Strict + add eax,strict 123456h ; Implicit Strict + add eax,strict byte 2 ; Explicit Strict + add eax,strict dword 2 ; Explicit Strict + add eax,strict dword 123456h ; Explicit Strict + add eax,strict byte 123456h ; Explicit Strict Truncation + + imul dx,3 ; Implicit + imul dx,byte 3 ; Explicit + imul dx,word 3 ; Explicit + imul dx,strict byte 3 ; Explicit Strict + imul dx,strict word 3 ; Explicit Strict + +; +; Same thing with branches +; +start: + jmp short start ; Explicit + jmp near start ; Explicit + jmp word start ; Explicit + jmp dword start ; Explicit + jmp short forward ; Explicit + jmp near forward ; Explicit + jmp word forward ; Explicit + jmp dword forward ; Explicit +%ifdef ERROR + jmp short faraway ; Explicit (ERROR) +%endif + jmp near faraway ; Explicit + jmp word faraway ; Explicit + jmp dword faraway ; Explicit + jmp start ; Implicit + jmp forward ; Implicit + jmp faraway ; Implicit + + jmp strict short start ; Explicit Strict + jmp strict near start ; Explicit Strict + jmp strict word start ; Explicit Strict + jmp strict dword start ; Explicit Strict + jmp strict short forward ; Explicit Strict + jmp strict near forward ; Explicit Strict + jmp strict word forward ; Explicit Strict + jmp strict dword forward ; Explicit Strict +%ifdef ERROR + jmp strict short faraway ; Explicit (ERROR) +%endif + jmp strict near faraway ; Explicit Strict + jmp strict word faraway ; Explicit Strict + jmp strict dword faraway ; Explicit Strict + jmp strict start ; Implicit Strict + jmp strict forward ; Implicit Strict + jmp strict faraway ; Implicit Strict +forward: + + times 256 nop +faraway: + + diff --git a/travis/test/expimp.json b/travis/test/expimp.json new file mode 100644 index 00000000..fcd77832 --- /dev/null +++ b/travis/test/expimp.json @@ -0,0 +1,40 @@ +[ + { + "description": "Test of explicitly and implicitly sized operands (-O0)", + "id": "expimp", + "format": "bin", + "source": "expimp.asm", + "option": "-O0", + "target": [ + { "output": "expimp-o0.bin" }, + { "stderr": "expimp-o0.stderr" } + ] + }, + { + "description": "Test of explicitly and implicitly sized operands (-O1)", + "ref": "expimp", + "option": "-O1", + "target": [ + { "output": "expimp-o1.bin" }, + { "stderr": "expimp-o1.stderr" } + ] + }, + { + "description": "Test of explicitly and implicitly sized operands (-Ox)", + "ref": "expimp", + "option": "-Ox -DERROR -o expimp-ox-error.bin", + "target": [ + { "stderr": "expimp-ox-error.stderr" } + ], + "error": "expected" + }, + { + "description": "Test of explicitly and implicitly sized operands (-O0 error)", + "ref": "expimp", + "option": "-O0 -DERROR -o expimp-o0-error.bin", + "target": [ + { "stderr": "expimp-o0-error.stderr" } + ], + "error": "expected" + } +] |