summaryrefslogtreecommitdiff
path: root/test/br2496848.asm
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2010-01-24 21:24:57 +0100
committerVictor van den Elzen <victor.vde@gmail.com>2010-03-12 23:52:04 +0100
commit0d268fb78cc17360d4b20c6bdd4b54c8c996fc63 (patch)
treebf02f87837a7ce079502f3bdbe6f38c5436f5cd5 /test/br2496848.asm
parentdefdaebcbb36dbc1748e8e7a2ec266ec3ba355d4 (diff)
downloadnasm-0d268fb78cc17360d4b20c6bdd4b54c8c996fc63.tar.gz
nasm-0d268fb78cc17360d4b20c6bdd4b54c8c996fc63.tar.bz2
nasm-0d268fb78cc17360d4b20c6bdd4b54c8c996fc63.zip
BR 2496848: Tighten ea checks
Check if the offset and the representation are equivalent. Disallow REL on absolute addresses. I'm not sure what that would mean and the output formats don't support it. Warn about ignored displacement size modifiers.
Diffstat (limited to 'test/br2496848.asm')
-rw-r--r--test/br2496848.asm42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/br2496848.asm b/test/br2496848.asm
new file mode 100644
index 0000000..a60b7c9
--- /dev/null
+++ b/test/br2496848.asm
@@ -0,0 +1,42 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -o br2496848.bin; Files=stdout stderr br2496848.bin
+;Testname=optimized; Arguments=-Ox -fbin -o br2496848.bin; Files=stdout stderr br2496848.bin
+
+bits 64
+
+foo:
+
+default abs
+
+mov al, [qword 0xffffffffffffffff]
+mov al, [qword 0x1ffffffffffffffff]
+
+mov cl, [byte 0x12345678]
+
+default rel
+
+mov cl, [foo]
+mov cl, [foo + 0x10000000]
+mov cl, [foo + 0x100000000]
+
+mov cl, [0x100]
+mov cl, [$$ + 0x100]
+
+mov cl, [rax - 1]
+mov cl, [rax + 0xffffffff]
+mov cl, [rax + 0x1ffffffff]
+
+bits 32
+mov cl, [eax - 1]
+mov cl, [eax + 0xffffffff]
+mov cl, [eax + 0x1ffffffff]
+mov cl, [byte eax + 0xffffffff]
+mov cl, [byte eax + 0x1ffffffff]
+mov cl, [byte eax + 0x1000ffff]
+
+bits 16
+mov cl, [di - 1]
+mov cl, [di + 0xffff]
+mov cl, [di + 0x1ffff]
+mov cl, [byte di + 0xffff]
+mov cl, [byte di + 0x1ffff]
+mov cl, [byte di + 0x10ff]