summaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-10-14 18:45:10 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-10-14 18:45:10 +0000
commit56ffb741123b59c22828fdf4afb1c67f81f2fa24 (patch)
treee68a5f7ee05eacc2d9b2b23824ff0c55fcade5ea /gas/testsuite
parent7062b0a0dfe70957e9cb04749efb627a3032c3f2 (diff)
downloadbinutils-56ffb741123b59c22828fdf4afb1c67f81f2fa24.tar.gz
binutils-56ffb741123b59c22828fdf4afb1c67f81f2fa24.tar.bz2
binutils-56ffb741123b59c22828fdf4afb1c67f81f2fa24.zip
Add CheckRegSize to instructions which require register size check.
gas/ 2010-10-14 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (match_template): Check checkregsize instead of w for register size check. gas/testsuite/ 2010-10-14 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/i386.exp: Run inval-reg. * gas/i386/inval-reg.l: New. * gas/i386/inval-reg.s: Likewise. opcodes/ 2010-10-14 H.J. Lu <hongjiu.lu@intel.com> * i386-gen.c (opcode_modifiers): Add CheckRegSize. * i386-opc.h (CheckRegSize): New. (i386_opcode_modifier): Add checkregsize. * i386-opc.tbl: Add CheckRegSize to instructions which require register size check. * i386-tbl.h: Regenerated.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/inval-reg.l113
-rw-r--r--gas/testsuite/gas/i386/inval-reg.s57
4 files changed, 178 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index acd3d21c157..94840b31b10 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2010-10-14 H.J. Lu <hongjiu.lu@intel.com>
+ * gas/i386/i386.exp: Run inval-reg.
+
+ * gas/i386/inval-reg.l: New.
+ * gas/i386/inval-reg.s: Likewise.
+
+2010-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
* gas/i386/disp32.d: New.
* gas/i386/disp32.s: Likewise.
* gas/i386/x86-64-disp32.d: Likewise.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 90273550c25..b89767ffe6a 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -28,6 +28,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_list_test "inval" "-al"
run_list_test "segment" "-al"
run_list_test "inval-seg" "-al"
+ run_list_test "inval-reg" "-al"
run_list_test "modrm" "-al --listing-lhs-width=2"
run_dump_test "naked"
run_dump_test "opcode"
diff --git a/gas/testsuite/gas/i386/inval-reg.l b/gas/testsuite/gas/i386/inval-reg.l
new file mode 100644
index 00000000000..99c6cfd3d3e
--- /dev/null
+++ b/gas/testsuite/gas/i386/inval-reg.l
@@ -0,0 +1,113 @@
+.*: Assembler messages:
+.*:3: Error: .*
+.*:4: Error: .*
+.*:6: Error: .*
+.*:7: Error: .*
+.*:8: Error: .*
+.*:10: Error: .*
+.*:11: Error: .*
+.*:12: Error: .*
+.*:14: Error: .*
+.*:15: Error: .*
+.*:16: Error: .*
+.*:18: Error: .*
+.*:19: Error: .*
+.*:20: Error: .*
+.*:21: Error: .*
+.*:22: Error: .*
+.*:23: Error: .*
+.*:25: Error: .*
+.*:26: Error: .*
+.*:27: Error: .*
+.*:28: Error: .*
+.*:29: Error: .*
+.*:30: Error: .*
+.*:31: Error: .*
+.*:32: Error: .*
+.*:33: Error: .*
+.*:34: Error: .*
+.*:35: Error: .*
+.*:36: Error: .*
+.*:37: Error: .*
+.*:38: Error: .*
+.*:39: Error: .*
+.*:40: Error: .*
+.*:41: Error: .*
+.*:42: Error: .*
+.*:43: Error: .*
+.*:44: Error: .*
+.*:45: Error: .*
+.*:46: Error: .*
+.*:47: Error: .*
+.*:48: Error: .*
+.*:49: Error: .*
+.*:50: Error: .*
+.*:51: Error: .*
+.*:52: Error: .*
+.*:53: Error: .*
+.*:54: Error: .*
+.*:56: Error: .*
+.*:57: Error: .*
+GAS LISTING .*
+
+
+[ ]*1[ ]+\.text
+[ ]*2[ ]+\# All the following should be illegal
+[ ]*3[ ]+xchg %bx,%eax
+[ ]*4[ ]+xchg %eax,%bx
+[ ]*5[ ]+
+[ ]*6[ ]+imul %bx,%ecx
+[ ]*7[ ]+imul \$10,%bx,%ecx
+[ ]*8[ ]+imul \$0x200,%bx,%ecx
+[ ]*9[ ]+
+[ ]*10[ ]+shld \$0x90, %bx,%ecx
+[ ]*11[ ]+shld %cl, %bx,%ecx
+[ ]*12[ ]+shld %bx,%ecx
+[ ]*13[ ]+
+[ ]*14[ ]+shrd \$0x90, %bx,%ecx
+[ ]*15[ ]+shrd %cl, %bx,%ecx
+[ ]*16[ ]+shrd %bx,%ecx
+[ ]*17[ ]+
+[ ]*18[ ]+bsf %bx,%ecx
+[ ]*19[ ]+bsr %bx,%ecx
+[ ]*20[ ]+bt %bx,%ecx
+[ ]*21[ ]+btc %bx,%ecx
+[ ]*22[ ]+btr %bx,%ecx
+[ ]*23[ ]+bts %bx,%ecx
+[ ]*24[ ]+
+[ ]*25[ ]+cmovo %bx,%ecx
+[ ]*26[ ]+cmovno %bx,%ecx
+[ ]*27[ ]+cmovb %bx,%ecx
+[ ]*28[ ]+cmovc %bx,%ecx
+[ ]*29[ ]+cmovnae %bx,%ecx
+[ ]*30[ ]+cmovae %bx,%ecx
+[ ]*31[ ]+cmovnc %bx,%ecx
+[ ]*32[ ]+cmovnb %bx,%ecx
+[ ]*33[ ]+cmove %bx,%ecx
+[ ]*34[ ]+cmovz %bx,%ecx
+[ ]*35[ ]+cmovne %bx,%ecx
+[ ]*36[ ]+cmovnz %bx,%ecx
+[ ]*37[ ]+cmovbe %bx,%ecx
+[ ]*38[ ]+cmovna %bx,%ecx
+[ ]*39[ ]+cmova %bx,%ecx
+[ ]*40[ ]+cmovnbe %bx,%ecx
+[ ]*41[ ]+cmovs %bx,%ecx
+[ ]*42[ ]+cmovns %bx,%ecx
+[ ]*43[ ]+cmovp %bx,%ecx
+[ ]*44[ ]+cmovnp %bx,%ecx
+[ ]*45[ ]+cmovl %bx,%ecx
+[ ]*46[ ]+cmovnge %bx,%ecx
+[ ]*47[ ]+cmovge %bx,%ecx
+[ ]*48[ ]+cmovnl %bx,%ecx
+[ ]*49[ ]+cmovle %bx,%ecx
+[ ]*50[ ]+cmovng %bx,%ecx
+[ ]*51[ ]+cmovg %bx,%ecx
+[ ]*52[ ]+cmovnle %bx,%ecx
+[ ]*53[ ]+cmovpe %bx,%ecx
+[ ]*54[ ]+cmovpo %bx,%ecx
+[ ]*55[ ]+
+[ ]*56[ ]+popcnt %bx,%ecx
+[ ]*57[ ]+lzcnt %bx,%ecx
+ GAS LISTING .*
+
+
diff --git a/gas/testsuite/gas/i386/inval-reg.s b/gas/testsuite/gas/i386/inval-reg.s
new file mode 100644
index 00000000000..8a0935a5a5c
--- /dev/null
+++ b/gas/testsuite/gas/i386/inval-reg.s
@@ -0,0 +1,57 @@
+ .text
+# All the following should be illegal
+xchg %bx,%eax
+xchg %eax,%bx
+
+imul %bx,%ecx
+imul $10,%bx,%ecx
+imul $0x200,%bx,%ecx
+
+shld $0x90, %bx,%ecx
+shld %cl, %bx,%ecx
+shld %bx,%ecx
+
+shrd $0x90, %bx,%ecx
+shrd %cl, %bx,%ecx
+shrd %bx,%ecx
+
+bsf %bx,%ecx
+bsr %bx,%ecx
+bt %bx,%ecx
+btc %bx,%ecx
+btr %bx,%ecx
+bts %bx,%ecx
+
+cmovo %bx,%ecx
+cmovno %bx,%ecx
+cmovb %bx,%ecx
+cmovc %bx,%ecx
+cmovnae %bx,%ecx
+cmovae %bx,%ecx
+cmovnc %bx,%ecx
+cmovnb %bx,%ecx
+cmove %bx,%ecx
+cmovz %bx,%ecx
+cmovne %bx,%ecx
+cmovnz %bx,%ecx
+cmovbe %bx,%ecx
+cmovna %bx,%ecx
+cmova %bx,%ecx
+cmovnbe %bx,%ecx
+cmovs %bx,%ecx
+cmovns %bx,%ecx
+cmovp %bx,%ecx
+cmovnp %bx,%ecx
+cmovl %bx,%ecx
+cmovnge %bx,%ecx
+cmovge %bx,%ecx
+cmovnl %bx,%ecx
+cmovle %bx,%ecx
+cmovng %bx,%ecx
+cmovg %bx,%ecx
+cmovnle %bx,%ecx
+cmovpe %bx,%ecx
+cmovpo %bx,%ecx
+
+popcnt %bx,%ecx
+lzcnt %bx,%ecx