nasm/travis/expimp/expimp.asm
H. Peter Anvin (Intel) 7f69cf689c travis: reorganize directories, add tests from the test/ directory
This is a mostly automated, partially AI-assisted migration of tests
from the test/ directory into the travis framework.

Running tests manually in the test/ directory is still supported, but
move common include files into travis/test and add a default -I option
to Makefile.in in the test/ directory.

The incbin test fails for pre-existing reasons; for now it contains an
stderr file with the errors. The problem is that INCBIN is both a
macro and a special instruction (not even a directive...), but there
currently is no way to handle prefixes, *especially* TIMES, in
multi-line macros. This is a separate problem and needs to be dealt
with as such.

Reorganize the travis directory so that each test or collection of
tests are in a separate subdirectory of travis/, and travis itself
lives in tools/travis to avoid creating deeper paths.

Add support for recording compression options in the travis .json
files, so that compressed files can be recreated with the same
options: because of the generally repetitive nature of the binary
output test files, the parameters used for xz compression can matter
enormously.

These are combined into a single huge commit to avoid adding large
binary files into the repository that then would immediately be
obsoleted, but still retained in git.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2026-06-30 20:54:46 -07:00

90 lines
2.7 KiB
NASM

;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: