summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2010-11-07 19:56:14 +0100
committerCyrill Gorcunov <gorcunov@gmail.com>2010-11-21 19:40:49 +0300
commit41f1f2badc86bfb3bdb7ef11697ed01d0c476207 (patch)
tree4cee1ff7ff6cae4c45e44905be328b47fa98db6c /test
parente635491941a2cac2e2239c2230ea3a82af4860ff (diff)
downloadnasm-41f1f2badc86bfb3bdb7ef11697ed01d0c476207.tar.gz
nasm-41f1f2badc86bfb3bdb7ef11697ed01d0c476207.tar.bz2
nasm-41f1f2badc86bfb3bdb7ef11697ed01d0c476207.zip
BR3058845: mostly fix bogus warning with implicit operand size override
The implicit operand size override code didn't set the operand size prefix, which confused the size calculation code for the range check. The BITS 64 operand size calculation is still off, but "fixing" it by making it 32-bit unless REX.W is set breaks PUSH and maybe others.
Diffstat (limited to 'test')
-rw-r--r--test/br3058845.asm14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/br3058845.asm b/test/br3058845.asm
new file mode 100644
index 0000000..b0de560
--- /dev/null
+++ b/test/br3058845.asm
@@ -0,0 +1,14 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obr3058845.bin; Files=stdout stderr br3058845.bin
+;Testname=optimized; Arguments=-Ox -fbin -obr3058845.bin; Files=stdout stderr br3058845.bin
+
+BITS 16
+cmp ax, 0xFFFF
+cmp eax, 0xFFFF_FFFF
+
+BITS 32
+cmp ax, 0xFFFF
+cmp eax, 0xFFFF_FFFF
+
+BITS 64
+cmp ax, 0xFFFF
+cmp eax, 0xFFFF_FFFF ; shouldn't warn, but does currently