]> granicus.if.org Git - yasm/commitdiff
Test circular reference detection. Very basic examples from NASM's docs on
authorPeter Johnson <peter@tortall.net>
Wed, 20 Feb 2002 08:16:13 +0000 (08:16 -0000)
committerPeter Johnson <peter@tortall.net>
Wed, 20 Feb 2002 08:16:13 +0000 (08:16 -0000)
critical expressions.
NASM behavior: 1-3 fail, 4 generates a 4-byte offset in the memory expression.
YASM behavior: 1&2 fail (and rightfully so :), 3 works as expected, and 4
 generates a 1-byte offset.

svn path=/trunk/yasm/; revision=473

tests/nasm/circular1.asm [new file with mode: 0644]
tests/nasm/circular2.asm [new file with mode: 0644]
tests/nasm/circular3.asm [new file with mode: 0644]
tests/nasm/circular4.asm [new file with mode: 0644]

diff --git a/tests/nasm/circular1.asm b/tests/nasm/circular1.asm
new file mode 100644 (file)
index 0000000..dc96746
--- /dev/null
@@ -0,0 +1,2 @@
+       times (label-$) db 0\r
+label: db 'Where am I?'\r
diff --git a/tests/nasm/circular2.asm b/tests/nasm/circular2.asm
new file mode 100644 (file)
index 0000000..ea558ae
--- /dev/null
@@ -0,0 +1,2 @@
+       times (label-$+1) db 0\r
+label: db 'NOW where am I?'\r
diff --git a/tests/nasm/circular3.asm b/tests/nasm/circular3.asm
new file mode 100644 (file)
index 0000000..9edc472
--- /dev/null
@@ -0,0 +1,3 @@
+       mov ax, symbol1\r
+symbol1 equ symbol2\r
+symbol2:\r
diff --git a/tests/nasm/circular4.asm b/tests/nasm/circular4.asm
new file mode 100644 (file)
index 0000000..87a7b21
--- /dev/null
@@ -0,0 +1,2 @@
+       mov eax, [ebx+offset]\r
+offset equ 10\r