summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2008-04-23 15:05:31 +0200
committerVictor van den Elzen <victor.vde@gmail.com>2008-05-21 12:42:46 +0200
commit82fa68acecf2f7e1d382501fbcff820883ec2ef4 (patch)
tree46a69ed47dd5f38613f0d78a90bcfd706bcbe292
parent533385ace56de28f3ac0b11c762f510cb19b4e90 (diff)
downloadnasm-82fa68acecf2f7e1d382501fbcff820883ec2ef4.tar.gz
Configure tests to be performed automatically
-rw-r--r--test/a32offs.asm2
-rw-r--r--test/absolute.asm1
-rw-r--r--test/addr64x.asm7
-rw-r--r--test/aoutso.asm3
-rw-r--r--test/aouttest.asm3
-rw-r--r--test/binexe.asm3
-rw-r--r--test/bintest.asm3
-rw-r--r--test/br1879590.asm3
-rw-r--r--test/br560575.asm15
-rw-r--r--test/br560873.asm3
-rw-r--r--test/cofftest.asm3
-rw-r--r--test/elfso.asm3
-rw-r--r--test/elif.asm3
-rw-r--r--test/expimp.asm12
-rw-r--r--test/float.asm3
-rw-r--r--test/float8.asm3
-rw-r--r--test/floatb.asm3
-rw-r--r--test/floatexp.asm3
-rw-r--r--test/floatize.asm3
-rw-r--r--test/floattest.asm2
-rw-r--r--test/fmsub.asm3
-rw-r--r--test/fpu.asm2
-rw-r--r--test/ifmacro.asm2
-rw-r--r--test/iftoken.asm2
-rwxr-xr-xtest/iftoken.pl1
-rw-r--r--test/inctest.asm2
-rw-r--r--test/insnlbl.asm2
-rw-r--r--test/invlpga.asm3
-rw-r--r--test/lar_lsl.asm246
-rw-r--r--test/larlsl.asm2
-rw-r--r--test/lnxhello.asm5
-rw-r--r--test/local.asm1
-rw-r--r--test/loopoffs.asm2
-rw-r--r--test/mmxsize.asm2
-rw-r--r--test/movimm.asm2
-rw-r--r--test/multisection.asm10
-rw-r--r--test/nasmformat.asm3
-rw-r--r--test/nop.asm3
-rw-r--r--test/nullfile.asm1
-rw-r--r--test/objtest.asm3
-rw-r--r--test/org.asm3
-rw-r--r--test/r13.asm2
-rw-r--r--test/radix.asm2
-rw-r--r--test/riprel.asm2
-rwxr-xr-x[-rw-r--r--]test/riprel.pl4
-rw-r--r--test/test67.asm3
-rw-r--r--test/testdos.asm1
-rw-r--r--test/testnos3.asm1
-rw-r--r--test/time.asm1
-rw-r--r--test/uscore.asm1
-rw-r--r--test/xchg.asm3
-rw-r--r--test/zerobyte.asm1
52 files changed, 278 insertions, 124 deletions
diff --git a/test/a32offs.asm b/test/a32offs.asm
index d66aea38..e34aa64f 100644
--- a/test/a32offs.asm
+++ b/test/a32offs.asm
@@ -1,3 +1,5 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -oa32offs.bin; Files=a32offs.bin .stdout .stderr
+;Testname=optimized; Arguments=-Ox -fbin -oa32offs.bin; Files=a32offs.bin .stdout .stderr
bits 16
foo: a32 loop foo
bar: loop bar, ecx
diff --git a/test/absolute.asm b/test/absolute.asm
index 901a83fb..ee5bb638 100644
--- a/test/absolute.asm
+++ b/test/absolute.asm
@@ -1,3 +1,4 @@
+;Testname=bin; Arguments=-fbin -oabsolute.bin; Files=.stdout .stderr absolute.bin
org 7c00h
init_foo:
jmp init_bar
diff --git a/test/addr64x.asm b/test/addr64x.asm
index 1fbec453..bf52d920 100644
--- a/test/addr64x.asm
+++ b/test/addr64x.asm
@@ -1,3 +1,10 @@
+;Testname=O0; Arguments=-O0 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=O1; Arguments=-O1 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=O2; Arguments=-O2 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=O3; Arguments=-O3 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=O4; Arguments=-O4 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=O5; Arguments=-O5 -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
+;Testname=Ox; Arguments=-Ox -fbin -oaddr64.bin; Files=.stdout .stderr addr64.bin
bits 64
mov rdx,[rax]
mov eax,[byte rsp+0x01]
diff --git a/test/aoutso.asm b/test/aoutso.asm
index b95b66ee..eeab2e3f 100644
--- a/test/aoutso.asm
+++ b/test/aoutso.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -faoutb -oaoutso.o; Files=.stdout .stderr aoutso.o
+;Testname=optimized; Arguments=-Ox -faoutb -oaoutso.o; Files=.stdout .stderr aoutso.o
+
; test source file for assembling to NetBSD/FreeBSD a.out shared library
; build with:
; nasm -f aoutb aoutso.asm
diff --git a/test/aouttest.asm b/test/aouttest.asm
index a11824f6..207a5452 100644
--- a/test/aouttest.asm
+++ b/test/aouttest.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -faout -oaouttest.o; Files=.stdout .stderr aouttest.o
+;Testname=optimized; Arguments=-Ox -faout -oaouttest.o; Files=.stdout .stderr aouttest.o
+
; test source file for assembling to a.out
; build with:
; nasm -f aout aouttest.asm
diff --git a/test/binexe.asm b/test/binexe.asm
index ab852fb9..bc85eb41 100644
--- a/test/binexe.asm
+++ b/test/binexe.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obinexe.exe -i../misc/; Files=.stdout .stderr binexe.exe
+;Testname=optimized; Arguments=-Ox -fbin -obinexe.exe -i../misc/; Files=.stdout .stderr binexe.exe
+
; Demonstration of how to write an entire .EXE format program by using
; the `exebin.mac' macro package.
; To build:
diff --git a/test/bintest.asm b/test/bintest.asm
index 94d2bf7f..7246a452 100644
--- a/test/bintest.asm
+++ b/test/bintest.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obintest.bin; Files=.stdout .stderr bintest.bin
+;Testname=optimized; Arguments=-Ox -fbin -obintest.bin; Files=.stdout .stderr bintest.bin
+
; test source file for assembling to binary files
; build with:
; nasm -f bin -o bintest.com bintest.asm
diff --git a/test/br1879590.asm b/test/br1879590.asm
index 6cac12d2..d51a16c1 100644
--- a/test/br1879590.asm
+++ b/test/br1879590.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obr1879590.bin; Files=.stdout .stderr br1879590.bin
+;Testname=optimized; Arguments=-Ox -fbin -obr1879590.bin; Files=.stdout .stderr br1879590.bin
+
bits 32
pavgb mm0,[ebx]
diff --git a/test/br560575.asm b/test/br560575.asm
index 8e02ddd2..bb6feb83 100644
--- a/test/br560575.asm
+++ b/test/br560575.asm
@@ -1,5 +1,16 @@
-;
-; Test for bug report 560575
+;Testname=aout; Arguments=-faout -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=aoutb; Arguments=-faoutb -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=coff; Arguments=-fcoff -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=elf32; Arguments=-felf32 -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=elf64; Arguments=-felf64 -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=as86; Arguments=-fas86 -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=win32; Arguments=-fwin32 -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=win64; Arguments=-fwin64 -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=rdf; Arguments=-frdf -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=ieee; Arguments=-fieee -obr560575.o; Files=.stderr .stdout br560575.o
+;Testname=macho; Arguments=-fmacho -obr560575.o; Files=.stderr .stdout br560575.o
+
+;Test for bug report 560575 - Using SEG with non-relocatable values doesn't work
;
dw seg ~1
dw seg "a"
diff --git a/test/br560873.asm b/test/br560873.asm
index 1aebd0af..724507b4 100644
--- a/test/br560873.asm
+++ b/test/br560873.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -frdf -obr560873.rdf; Files=.stdout .stderr br560873.rdf
+;Testname=optimized; Arguments=-Ox -frdf -obr560873.rdf; Files=.stdout .stderr br560873.rdf
+
label:
bits 16
call far dword label
diff --git a/test/cofftest.asm b/test/cofftest.asm
index 88044c00..6b845e2e 100644
--- a/test/cofftest.asm
+++ b/test/cofftest.asm
@@ -1,3 +1,6 @@
+;Cannot be automatically tested because it differs every time,
+;I guess because of a date/time field.
+
; test source file for assembling to COFF
; build with (under DJGPP, for example):
; nasm -f coff cofftest.asm
diff --git a/test/elfso.asm b/test/elfso.asm
index 5adb6339..78df8bac 100644
--- a/test/elfso.asm
+++ b/test/elfso.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -felf -oelfso.o; Files=.stdout .stderr elfso.o
+;Testname=optimized; Arguments=-Ox -felf -oelfso.o; Files=.stdout .stderr elfso.o
+
; test source file for assembling to ELF shared library
; build with:
; nasm -f elf elfso.asm
diff --git a/test/elif.asm b/test/elif.asm
index 057ce5f3..57c9ac24 100644
--- a/test/elif.asm
+++ b/test/elif.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fobj -oelif.obj; Files=.stdout .stderr elif.obj
+;Testname=optimized; Arguments=-Ox -fobj -oelif.obj; Files=.stdout .stderr elif.obj
+
%macro DosPrintMsg 1+
%ifnid %1
section .data
diff --git a/test/expimp.asm b/test/expimp.asm
index 2db0338c..2a0c1def 100644
--- a/test/expimp.asm
+++ b/test/expimp.asm
@@ -1,6 +1,18 @@
+;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=O2; Arguments=-O2 -fbin -oexpimp.bin; Files=.stdout .stderr expimp.bin
+;Testname=O3; Arguments=-O3 -fbin -oexpimp.bin; Files=.stdout .stderr expimp.bin
+;Testname=O4; Arguments=-O4 -fbin -oexpimp.bin; Files=.stdout .stderr expimp.bin
+;Testname=O5; Arguments=-O5 -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
diff --git a/test/float.asm b/test/float.asm
index df2d96c0..567d2009 100644
--- a/test/float.asm
+++ b/test/float.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloat.bin; Files=.stdout .stderr float.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofloat.bin; Files=.stdout .stderr float.bin
+
;
; Test of floating-point formats
;
diff --git a/test/float8.asm b/test/float8.asm
index ddeb810f..5520060a 100644
--- a/test/float8.asm
+++ b/test/float8.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloat8.bin; Files=.stdout .stderr float8.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofloat8.bin; Files=.stdout .stderr float8.bin
+
; Test of 8-bit floating-point constants
; Zero
diff --git a/test/floatb.asm b/test/floatb.asm
index 0665c603..75ca788c 100644
--- a/test/floatb.asm
+++ b/test/floatb.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatb.bin; Files=.stdout .stderr floatb.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofloatb.bin; Files=.stdout .stderr floatb.bin
+
;; Known problematic floating-point numbers and their proper
;; encoding...
diff --git a/test/floatexp.asm b/test/floatexp.asm
index b3d14f76..5ef185fb 100644
--- a/test/floatexp.asm
+++ b/test/floatexp.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatexp.bin; Files=.stdout .stderr floatexp.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofloatexp.bin; Files=.stdout .stderr floatexp.bin
+
bits 64
;
; Test of floating-point formats
diff --git a/test/floatize.asm b/test/floatize.asm
index 0ff43efd..714b44d9 100644
--- a/test/floatize.asm
+++ b/test/floatize.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofloatize.bin; Files=.stdout .stderr floatize.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofloatize.bin; Files=.stdout .stderr floatize.bin
+
%assign x13 13+26
%assign f16 __float16__(1.6e-7)
%assign f32 __float32__(1.6e-7)
diff --git a/test/floattest.asm b/test/floattest.asm
index dcaac2e1..a8db5acb 100644
--- a/test/floattest.asm
+++ b/test/floattest.asm
@@ -1,3 +1,5 @@
+;Testname=optimized; Arguments=-Ox -felf -ofloattest.o; Files=.stdout .stderr floattest.o
+
; nasm -O99 -f elf32 floattest.asm
; ld -m elf_i386 -o floattest floattest.o -I/lib/ld-linux.so.2 -lc
diff --git a/test/fmsub.asm b/test/fmsub.asm
index 7f087cd7..ca599d54 100644
--- a/test/fmsub.asm
+++ b/test/fmsub.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -ofmsub.bin; Files=.stdout .stderr fmsub.bin
+;Testname=optimized; Arguments=-Ox -fbin -ofmsub.bin; Files=.stdout .stderr fmsub.bin
+
bits 64
fmsubps xmm0,xmm0,xmm1,xmm2
diff --git a/test/fpu.asm b/test/fpu.asm
index 66af8d1e..04680f7e 100644
--- a/test/fpu.asm
+++ b/test/fpu.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -ofpu.bin; Files=.stdout .stderr fpu.bin
+
; relaxed encodings for FPU instructions, which NASM should support
; -----------------------------------------------------------------
diff --git a/test/ifmacro.asm b/test/ifmacro.asm
index 8375614e..abfa6a24 100644
--- a/test/ifmacro.asm
+++ b/test/ifmacro.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -oifmacro.txt; Files=.stdout .stderr ifmacro.txt
+
;
; ifmacro.asm
;
diff --git a/test/iftoken.asm b/test/iftoken.asm
index 7bf000c2..92cf4034 100644
--- a/test/iftoken.asm
+++ b/test/iftoken.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -oiftoken.txt; Files=.stdout .stderr iftoken.txt
+
%define ZMACRO
%define NMACRO 1
%define TMACRO 1 2
diff --git a/test/iftoken.pl b/test/iftoken.pl
index 498b0527..8f063668 100755
--- a/test/iftoken.pl
+++ b/test/iftoken.pl
@@ -4,6 +4,7 @@
'foo', 'foo bar', '%', '+foo', '<<');
@tests = ('token', 'empty');
+print ";Testname=test; Arguments=-fbin -oiftoken.txt; Files=.stdout .stderr iftoken.txt"
print "%define ZMACRO\n";
print "%define NMACRO 1\n";
print "%define TMACRO 1 2\n";
diff --git a/test/inctest.asm b/test/inctest.asm
index d6d35cf3..edc084f1 100644
--- a/test/inctest.asm
+++ b/test/inctest.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -oinctest.com; Files=.stdout .stderr inctest.com
+
; This file, plus inc1.asm and inc2.asm, test NASM's file inclusion
; mechanism.
;
diff --git a/test/insnlbl.asm b/test/insnlbl.asm
index 5c163846..df81f73b 100644
--- a/test/insnlbl.asm
+++ b/test/insnlbl.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -oinsnlbl.bin; Files=.stdout .stderr insnlbl.bin
+
;
; Test "instruction as label" -- make opcodes legal as labels if
; they are followed by a colon.
diff --git a/test/invlpga.asm b/test/invlpga.asm
index ae683102..43759ec1 100644
--- a/test/invlpga.asm
+++ b/test/invlpga.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-fbin -oinvlpga.bin; Files=.stdout .stderr invlpga.bin
+;Testname=optimized; Arguments=-fbin -oinvlpga.bin -Ox; Files=.stdout .stderr invlpga.bin
+
bits 32
invlpga
invlpga ax,ecx
diff --git a/test/lar_lsl.asm b/test/lar_lsl.asm
index 69c56fc9..7c7b82ca 100644
--- a/test/lar_lsl.asm
+++ b/test/lar_lsl.asm
@@ -1,122 +1,124 @@
-; LAR/LSL
-;---------
-
-; 1x ; = invalid due to lack of REX
-; 3x ; = invalid due to Mw
-
-%macro m 1
-
- bits 16
-
- %1 ax, ax
- %1 ax,eax
-; %1 ax,rax
-
- %1 eax, ax
- %1 eax,eax
-; %1 eax,rax
-
-; %1 rax, ax
-; %1 rax,eax
-; %1 rax,rax
-
- %1 ax, [0]
- %1 ax, word [0]
-;;; %1 ax,dword [0]
-; %1 ax,qword [0]
-
- %1 eax, [0]
- %1 eax, word [0]
-;;; %1 eax,dword [0]
-; %1 eax,qword [0]
-
-; %1 rax, [0]
-; %1 rax, word [0]
-; %1 rax,dword [0]
-; %1 rax,qword [0]
-
- bits 32
-
- %1 ax, ax
- %1 ax,eax
-; %1 ax,rax
-
- %1 eax, ax
- %1 eax,eax
-; %1 eax,rax
-
-; %1 rax, ax
-; %1 rax,eax
-; %1 rax,rax
-
- %1 ax, [0]
- %1 ax, word [0]
-;;; %1 ax,dword [0]
-; %1 ax,qword [0]
-
- %1 eax, [0]
- %1 eax, word [0]
-;;; %1 eax,dword [0]
-; %1 eax,qword [0]
-
-; %1 rax, [0]
-; %1 rax, word [0]
-; %1 rax,dword [0]
-; %1 rax,qword [0]
-
- bits 64
-
- %1 ax, ax
- %1 ax,eax
- %1 ax,rax ; $TODO: shouldn't emit REX.W $
-
- %1 eax, ax
- %1 eax,eax
- %1 eax,rax ; $TODO: shouldn't emit REX.W $
-
- %1 rax, ax
- %1 rax,eax
- %1 rax,rax
-
- %1 ax, [0]
- %1 ax, word [0]
-;;; %1 ax,dword [0]
-;;; %1 ax,qword [0]
-
- %1 eax, [0]
- %1 eax, word [0]
-;;; %1 eax,dword [0]
-;;; %1 eax,qword [0]
-
- %1 rax, [0]
- %1 rax, word [0]
-;;; %1 rax,dword [0]
-;;; %1 rax,qword [0]
-
-%endmacro
-
-m lar
-
-m lsl
-
-bits 16
-lar ax,[ si]
-lar ax,[esi]
-bits 32
-lar ax,[ si]
-lar ax,[esi]
-bits 64
-lar ax,[esi]
-lar ax,[rsi]
-
-bits 16
-lsl ax,[ si]
-lsl ax,[esi]
-bits 32
-lsl ax,[ si]
-lsl ax,[esi]
-bits 64
-lar ax,[esi]
-lsl ax,[rsi]
-
-; EOF
+;Testname=test; Arguments=-fbin -olar_lsl.bin; Files=.stdout .stderr lar_lsl.bin
+
+; LAR/LSL
+;---------
+
+; 1x ; = invalid due to lack of REX
+; 3x ; = invalid due to Mw
+
+%macro m 1
+
+ bits 16
+
+ %1 ax, ax
+ %1 ax,eax
+; %1 ax,rax
+
+ %1 eax, ax
+ %1 eax,eax
+; %1 eax,rax
+
+; %1 rax, ax
+; %1 rax,eax
+; %1 rax,rax
+
+ %1 ax, [0]
+ %1 ax, word [0]
+;;; %1 ax,dword [0]
+; %1 ax,qword [0]
+
+ %1 eax, [0]
+ %1 eax, word [0]
+;;; %1 eax,dword [0]
+; %1 eax,qword [0]
+
+; %1 rax, [0]
+; %1 rax, word [0]
+; %1 rax,dword [0]
+; %1 rax,qword [0]
+
+ bits 32
+
+ %1 ax, ax
+ %1 ax,eax
+; %1 ax,rax
+
+ %1 eax, ax
+ %1 eax,eax
+; %1 eax,rax
+
+; %1 rax, ax
+; %1 rax,eax
+; %1 rax,rax
+
+ %1 ax, [0]
+ %1 ax, word [0]
+;;; %1 ax,dword [0]
+; %1 ax,qword [0]
+
+ %1 eax, [0]
+ %1 eax, word [0]
+;;; %1 eax,dword [0]
+; %1 eax,qword [0]
+
+; %1 rax, [0]
+; %1 rax, word [0]
+; %1 rax,dword [0]
+; %1 rax,qword [0]
+
+ bits 64
+
+ %1 ax, ax
+ %1 ax,eax
+ %1 ax,rax ; $TODO: shouldn't emit REX.W $
+
+ %1 eax, ax
+ %1 eax,eax
+ %1 eax,rax ; $TODO: shouldn't emit REX.W $
+
+ %1 rax, ax
+ %1 rax,eax
+ %1 rax,rax
+
+ %1 ax, [0]
+ %1 ax, word [0]
+;;; %1 ax,dword [0]
+;;; %1 ax,qword [0]
+
+ %1 eax, [0]
+ %1 eax, word [0]
+;;; %1 eax,dword [0]
+;;; %1 eax,qword [0]
+
+ %1 rax, [0]
+ %1 rax, word [0]
+;;; %1 rax,dword [0]
+;;; %1 rax,qword [0]
+
+%endmacro
+
+m lar
+
+m lsl
+
+bits 16
+lar ax,[ si]
+lar ax,[esi]
+bits 32
+lar ax,[ si]
+lar ax,[esi]
+bits 64
+lar ax,[esi]
+lar ax,[rsi]
+
+bits 16
+lsl ax,[ si]
+lsl ax,[esi]
+bits 32
+lsl ax,[ si]
+lsl ax,[esi]
+bits 64
+lar ax,[esi]
+lsl ax,[rsi]
+
+; EOF
diff --git a/test/larlsl.asm b/test/larlsl.asm
index c3c12997..fb1c42e4 100644
--- a/test/larlsl.asm
+++ b/test/larlsl.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -olarlsl.bin; Files=.stdout .stderr larlsl.bin
+
bits 64
lar ax,bx
diff --git a/test/lnxhello.asm b/test/lnxhello.asm
index 7bc8ff0a..d48ab5b3 100644
--- a/test/lnxhello.asm
+++ b/test/lnxhello.asm
@@ -1,3 +1,8 @@
+;Testname=aout; Arguments=-faout -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=aoutb; Arguments=-faoutb -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=as86; Arguments=-fas86 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=elf32; Arguments=-felf32 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+
;
; Assembly "Hello, World!" for Linux
;
diff --git a/test/local.asm b/test/local.asm
index 64a0e59a..a5ce7070 100644
--- a/test/local.asm
+++ b/test/local.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -olocal.bin; Files=.stdout .stderr local.bin
bits 32
%push bluttan
diff --git a/test/loopoffs.asm b/test/loopoffs.asm
index 65914a66..f035e4a8 100644
--- a/test/loopoffs.asm
+++ b/test/loopoffs.asm
@@ -1,3 +1,5 @@
+;Testname=unoptimized; Arguments=-fbin -oloopoffs.bin -O0; Files=.stdout .stderr loopoffs.bin
+;Testname=optimized; Arguments=-fbin -oloopoffs.bin -Ox; Files=.stdout .stderr loopoffs.bin
bits 16
delay: loop delay
loop $
diff --git a/test/mmxsize.asm b/test/mmxsize.asm
index 59fc4706..260f9947 100644
--- a/test/mmxsize.asm
+++ b/test/mmxsize.asm
@@ -1,3 +1,5 @@
+;Testname=unoptimized; Arguments=-fbin -ommxsize.bin -O0; Files=.stdout .stderr mmxsize.bin
+;Testname=optimized; Arguments=-fbin -ommxsize.bin -Ox; Files=.stdout .stderr mmxsize.bin
bits 32
movd mm0,eax
movd mm0,[foo]
diff --git a/test/movimm.asm b/test/movimm.asm
index b5a7a274..d6450a61 100644
--- a/test/movimm.asm
+++ b/test/movimm.asm
@@ -1,3 +1,5 @@
+;Testname=unoptimized; Arguments=-fbin -omovimm.bin -O0; Files=.stdout .stderr movimm.bin
+;Testname=optimized; Arguments=-fbin -omovimm.bin -Ox; Files=.stdout .stderr movimm.bin
bits 64
mov rax,1234567890abcdefh
diff --git a/test/multisection.asm b/test/multisection.asm
index 0da2fc74..997ae6db 100644
--- a/test/multisection.asm
+++ b/test/multisection.asm
@@ -1,3 +1,13 @@
+;Testname=aout; Arguments=-faout -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=aoutb; Arguments=-faoutb -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=as86; Arguments=-fas86 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=elf32; Arguments=-felf32 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=elf64; Arguments=-felf64 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=obj; Arguments=-fobj -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=rdf; Arguments=-frdf -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=win32; Arguments=-fwin32 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+;Testname=win64; Arguments=-fwin64 -olnxhello.o -Ox; Files=.stdout .stderr lnxhello.o
+
; To test where code that is placed before any explicit SECTION
; gets placed, and what happens if a .text section has an ORG
;statement, uncomment the following lines.
diff --git a/test/nasmformat.asm b/test/nasmformat.asm
index 5b4dc25e..0c3f0a7b 100644
--- a/test/nasmformat.asm
+++ b/test/nasmformat.asm
@@ -1,3 +1,6 @@
+;Testname=obj; Arguments=-fobj -onasmfomat.o; Files=.stdout .stderr nasmfomat.o
+;Testname=bin; Arguments=-fbin -onasmfomat.o; Files=.stdout .stderr nasmfomat.o
+;Testname=rdf; Arguments=-frdf -onasmfomat.o; Files=.stdout .stderr nasmfomat.o
%if __OUTPUT_FORMAT__ == 'bin'
diff --git a/test/nop.asm b/test/nop.asm
index 3dabaa07..49c1de09 100644
--- a/test/nop.asm
+++ b/test/nop.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-fbin -onop.bin; Files=.stdout .stderr nop.bin
+;Testname=optimized; Arguments=-fbin -onop.bin -Ox; Files=.stdout .stderr nop.bin
+
bits 64
nop
diff --git a/test/nullfile.asm b/test/nullfile.asm
index 338d7101..f837e798 100644
--- a/test/nullfile.asm
+++ b/test/nullfile.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -onull.bin; Files=.stdout .stderr null.bin
;
; A file that produces no output has been known to occationally crash NASM.
;
diff --git a/test/objtest.asm b/test/objtest.asm
index 24e9fbd3..ba94c23d 100644
--- a/test/objtest.asm
+++ b/test/objtest.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-O0 -fobj -oobj.o; Files=.stdout .stderr obj.o
+;Testname=optimized; Arguments=-Ox -fobj -oobj.o; Files=.stdout .stderr obj.o
+
; test source file for assembling to Microsoft 16-bit .OBJ
; build with (16-bit Microsoft C):
; nasm -f obj objtest.asm
diff --git a/test/org.asm b/test/org.asm
index ae73ab62..a958242c 100644
--- a/test/org.asm
+++ b/test/org.asm
@@ -1,3 +1,6 @@
+;Testname=elf64; Arguments=-Ox -felf64 -oorg.o; Files=.stdout .stderr org.o
+;Testname=win64; Arguments=-Ox -fwin64 -oorg.o; Files=.stdout .stderr org.o
+
;
; Simple test of a 64-bit org directive
;
diff --git a/test/r13.asm b/test/r13.asm
index 7748aa6c..5d153dec 100644
--- a/test/r13.asm
+++ b/test/r13.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -or13.bin; Files=.stdout .stderr r13.bin
+
bits 64
mov rax,[rbx]
mov rax,[rbx*4]
diff --git a/test/radix.asm b/test/radix.asm
index d5b6e0e7..a22c2dc8 100644
--- a/test/radix.asm
+++ b/test/radix.asm
@@ -1,3 +1,5 @@
+;Testname=test; Arguments=-fbin -oradix.bin; Files=.stdout .stderr radix.bin
+
;; Integer constants...
dd 1010_0101 ; Decimal
diff --git a/test/riprel.asm b/test/riprel.asm
index f585daba..937694b2 100644
--- a/test/riprel.asm
+++ b/test/riprel.asm
@@ -1,3 +1,5 @@
+;Testname=unoptimized; Arguments=-fbin -oriprel.bin -O0; Files=.stdout .stderr riprel.bin
+;Testname=optimized; Arguments=-fbin -oriprel.bin -Ox; Files=.stdout .stderr riprel.bin
bits 64
default abs
diff --git a/test/riprel.pl b/test/riprel.pl
index 83dabe8e..d4b3ad5a 100644..100755
--- a/test/riprel.pl
+++ b/test/riprel.pl
@@ -1,5 +1,9 @@
#!/usr/bin/perl
+print ";Testname=unoptimized; Arguments=-fbin -oriprel.bin -O0; Files=.stdout .stderr riprel.bin\n";
+print ";Testname=optimized; Arguments=-fbin -oriprel.bin -Ox; Files=.stdout .stderr riprel.bin\n";
+
+
print "\tbits 64\n";
foreach $mode ('abs', 'rel') {
diff --git a/test/test67.asm b/test/test67.asm
index 5917a1bd..16fd5ccb 100644
--- a/test/test67.asm
+++ b/test/test67.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-fbin -otest67.bin -O0; Files=.stdout .stderr test67.bin
+;Testname=optimized; Arguments=-fbin -otest67.bin -Ox; Files=.stdout .stderr test67.bin
+
bits 16
mov ax,[bx]
diff --git a/test/testdos.asm b/test/testdos.asm
index f03e52d0..4fdf87b6 100644
--- a/test/testdos.asm
+++ b/test/testdos.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -otestdos.bin; Files=.stdout .stderr testdos.bin
;
; This file was known to miscompile with the 16-bit NASM built
; under Borland C++ 3.1, so keep it around for testing...
diff --git a/test/testnos3.asm b/test/testnos3.asm
index ed06473d..9737e653 100644
--- a/test/testnos3.asm
+++ b/test/testnos3.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -otestnos3.bin; Files=.stdout .stderr testnos3.bin
;
; Double-precision floating point tests, derived from Fred Tydeman's posting
; of 26 February 1996 to comp.arch.arithmetic, via David M. Gay's gdtoa
diff --git a/test/time.asm b/test/time.asm
index fa1dd296..ee4b9b76 100644
--- a/test/time.asm
+++ b/test/time.asm
@@ -1,3 +1,4 @@
+;Not automatically testable because it is not constant
db __DATE__, 13, 10
db __TIME__, 13, 10
db __UTC_DATE__, 13, 10
diff --git a/test/uscore.asm b/test/uscore.asm
index b82b7ce0..d8670ee3 100644
--- a/test/uscore.asm
+++ b/test/uscore.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -ouscore.bin; Files=.stdout .stderr uscore.bin
dd 0x1234_5678
dd 305_419_896 ; Same number as above it
dd 0x1e16 ; NOT a floating-point number!
diff --git a/test/xchg.asm b/test/xchg.asm
index ad634c16..4bd95e4a 100644
--- a/test/xchg.asm
+++ b/test/xchg.asm
@@ -1,3 +1,6 @@
+;Testname=unoptimized; Arguments=-fbin -oxchg.bin -O0; Files=.stdout .stderr xchg.bin
+;Testname=optimized; Arguments=-fbin -oxchg.bin -Ox; Files=.stdout .stderr xchg.bin
+
%macro x 2
xchg %1,%2
xchg %2,%1
diff --git a/test/zerobyte.asm b/test/zerobyte.asm
index edd88e91..676ea657 100644
--- a/test/zerobyte.asm
+++ b/test/zerobyte.asm
@@ -1,3 +1,4 @@
+;Testname=test; Arguments=-fbin -ozerobyte.bin; Files=.stdout .stderr zerobyte.bin
bits 64
mov eax,bar-foo