From 7c52e0e8658a0ea03067c301a15e793cf9f1c208 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 27 Sep 2007 18:31:51 +0000 Subject: gas/testsuite/gas/ 2007-09-27 H.J. Lu PR binutils/5072 * gas/i386/i386.exp: Run x86-64-opcode-inval and x86-64-opcode-inval-intel. * gas/i386/x86-64-opcode-inval-intel.d: New. * gas/i386/x86-64-opcode-inval.d: Likewise. * gas/i386/x86-64-opcode-inval.s: Likewise. opcodes/ 2007-09-27 H.J. Lu PR binutils/5072 * i386-dis.c: Update comments on '{', '}' and '|' to support only AT&T and Intel modes. (X86_64_4...X86_64_27): New. (dis386): Updated. Use X86_64_4...X86_64_21. (dis386_twobyte): Updated. (float_mem): Likewise. (x86_64_table): Add X86_64_4...X86_64_27. (opc_ext_table): Updated. Use X86_64_22 and X86_64_27. (putop): Updated handling of '{', '}' and '|' to support only AT&T and Intel modes. --- gas/testsuite/ChangeLog | 10 ++++ gas/testsuite/gas/i386/i386.exp | 2 + gas/testsuite/gas/i386/x86-64-opcode-inval-intel.d | 58 ++++++++++++++++++++++ gas/testsuite/gas/i386/x86-64-opcode-inval.d | 57 +++++++++++++++++++++ gas/testsuite/gas/i386/x86-64-opcode-inval.s | 30 +++++++++++ 5 files changed, 157 insertions(+) create mode 100644 gas/testsuite/gas/i386/x86-64-opcode-inval-intel.d create mode 100644 gas/testsuite/gas/i386/x86-64-opcode-inval.d create mode 100644 gas/testsuite/gas/i386/x86-64-opcode-inval.s (limited to 'gas') diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 32d5263..6f8d27d 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2007-09-27 H.J. Lu + + PR binutils/5072 + * gas/i386/i386.exp: Run x86-64-opcode-inval and + x86-64-opcode-inval-intel. + + * gas/i386/x86-64-opcode-inval-intel.d: New. + * gas/i386/x86-64-opcode-inval.d: Likewise. + * gas/i386/x86-64-opcode-inval.s: Likewise. + 2007-09-27 Kazu Hirata * gas/m68k/fido.s: Add tests for %mbo. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 9807432..584d315 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -199,6 +199,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-reg-intel" run_dump_test "x86-64-sib" run_dump_test "x86-64-sib-intel" + run_dump_test "x86-64-opcode-inval" + run_dump_test "x86-64-opcode-inval-intel" if { ![istarget "*-*-aix*"] && ![istarget "*-*-beos*"] diff --git a/gas/testsuite/gas/i386/x86-64-opcode-inval-intel.d b/gas/testsuite/gas/i386/x86-64-opcode-inval-intel.d new file mode 100644 index 0000000..cb0fdbf --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-opcode-inval-intel.d @@ -0,0 +1,58 @@ +#as: --32 +#source: x86-64-opcode-inval.s +#objdump: -dw -Mx86-64 -Mintel +#name: 64bit illegal opcodes (Intel mode) + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 37 \(bad\) + +0+1 : +[ ]*[a-f0-9]+: d5 \(bad\) +[ ]*[a-f0-9]+: 0a d5 or dl,ch + +0+3 : +[ ]*[a-f0-9]+: d5 \(bad\) +[ ]*[a-f0-9]+: 02 d4 add dl,ah + +0+5 : +[ ]*[a-f0-9]+: d4 \(bad\) +[ ]*[a-f0-9]+: 0a d4 or dl,ah + +0+7 : +[ ]*[a-f0-9]+: d4 \(bad\) +[ ]*[a-f0-9]+: 02 3f add bh,BYTE PTR \[rdi\] + +0+9 : +[ ]*[a-f0-9]+: 3f \(bad\) + +0+a : +[ ]*[a-f0-9]+: 62 \(bad\) +[ ]*[a-f0-9]+: 10 27 adc BYTE PTR \[rdi\],ah + +0+c : +[ ]*[a-f0-9]+: 27 \(bad\) + +0+d : +[ ]*[a-f0-9]+: 2f \(bad\) + +0+e : +[ ]*[a-f0-9]+: ce \(bad\) + +0+f : +[ ]*[a-f0-9]+: c5 \(bad\) +[ ]*[a-f0-9]+: 10 c4 adc ah,al + +0+11 : +[ ]*[a-f0-9]+: c4 \(bad\) +[ ]*[a-f0-9]+: 10 60 61 adc BYTE PTR \[rax\+0x61\],ah + +0+13 : +[ ]*[a-f0-9]+: 60 \(bad\) + +0+14 : +[ ]*[a-f0-9]+: 61 \(bad\) +#pass diff --git a/gas/testsuite/gas/i386/x86-64-opcode-inval.d b/gas/testsuite/gas/i386/x86-64-opcode-inval.d new file mode 100644 index 0000000..fab3192 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-opcode-inval.d @@ -0,0 +1,57 @@ +#as: --32 +#objdump: -dw -Mx86-64 +#name: 64bit illegal opcodes + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 37 \(bad\) + +0+1 : +[ ]*[a-f0-9]+: d5 \(bad\) +[ ]*[a-f0-9]+: 0a d5 or %ch,%dl + +0+3 : +[ ]*[a-f0-9]+: d5 \(bad\) +[ ]*[a-f0-9]+: 02 d4 add %ah,%dl + +0+5 : +[ ]*[a-f0-9]+: d4 \(bad\) +[ ]*[a-f0-9]+: 0a d4 or %ah,%dl + +0+7 : +[ ]*[a-f0-9]+: d4 \(bad\) +[ ]*[a-f0-9]+: 02 3f add \(%rdi\),%bh + +0+9 : +[ ]*[a-f0-9]+: 3f \(bad\) + +0+a : +[ ]*[a-f0-9]+: 62 \(bad\) +[ ]*[a-f0-9]+: 10 27 adc %ah,\(%rdi\) + +0+c : +[ ]*[a-f0-9]+: 27 \(bad\) + +0+d : +[ ]*[a-f0-9]+: 2f \(bad\) + +0+e : +[ ]*[a-f0-9]+: ce \(bad\) + +0+f : +[ ]*[a-f0-9]+: c5 \(bad\) +[ ]*[a-f0-9]+: 10 c4 adc %al,%ah + +0+11 : +[ ]*[a-f0-9]+: c4 \(bad\) +[ ]*[a-f0-9]+: 10 60 61 adc %ah,0x61\(%rax\) + +0+13 : +[ ]*[a-f0-9]+: 60 \(bad\) + +0+14 : +[ ]*[a-f0-9]+: 61 \(bad\) +#pass diff --git a/gas/testsuite/gas/i386/x86-64-opcode-inval.s b/gas/testsuite/gas/i386/x86-64-opcode-inval.s new file mode 100644 index 0000000..6eb4879 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-opcode-inval.s @@ -0,0 +1,30 @@ + .text +# All the followings are illegal opcodes for x86-64. +aaa: + aaa +aad0: + aad +aad1: + aad $2 +aam0: + aam +aam1: + aam $2 +aas: + aas +bound: + bound %edx,(%eax) +daa: + daa +das: + das +into: + into +lds: + lds (%eax),%edx +les: + les (%eax),%edx +pusha: + pusha +popa: + popa -- cgit v1.1