diff options
author | Jan Beulich <jbeulich@novell.com> | 2005-03-17 12:05:24 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2005-03-17 12:05:24 +0000 |
commit | a724f0f4f542cfa496da75b817f7d63e6727dcc1 (patch) | |
tree | 0dc61b1f1dcdbb1a85eac3e555bd10fee29d9607 /gas/testsuite | |
parent | f7e6ca5e6bb25bf81a5df4bfb0df13cf8b21deb1 (diff) | |
download | gdb-a724f0f4f542cfa496da75b817f7d63e6727dcc1.zip gdb-a724f0f4f542cfa496da75b817f7d63e6727dcc1.tar.gz gdb-a724f0f4f542cfa496da75b817f7d63e6727dcc1.tar.bz2 |
gas/
2005-03-17 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (i386_scale): Beautify error message.
(Intel syntax comments): Update.
(struct intel_parser_s): Add fields in_offset, in_bracket, and
next_operand.
(intel_e04_1, intel_e05_1, intel_e05_1, intel_e09_1, intel_e10_1):
Remove declarations.
(intel_bracket_expr): Declare.
(i386_intel_operand): Initialize new intel_parser fields. Wrap most
of the function body in a loop allowing to split an operand into two.
Replace calls to malloc and checks of it returning non-NULL with
calls to xmalloc/xstrdup.
(intel_expr): SHORT no longer handled here. Add comment indicating
comparison ops need implementation.
(intel_e04, intel_e04_1): Combine, replace recursion with loop.
Check right operand of - does not specify a register when parsing
the address of a memory reference.
(intel_e05, intel_e05_1): Combine, replace recursion with loop.
Check operands do not specify a register when parsing the address of
a memory reference.
(intel_e06, intel_e06_1): Likewise.
(intel_e09, intel_e09_1): Combine, replace recursion with loop. Also
handle SHORT as well as unary + and -. Don't accept : except for
segment overrides or in direct far jump/call insns.
(intel_brack_expr): New.
(intel_e10, intel_e10_1): Combine, replace recursion with loop. Use
intel_brack_expr.
(intel_e11): Replace chain of if/else-if by switch, alloing fall-
through in certain cases. Use intel_brack_expr. Add new diagnostics.
Allow symbolic constants as register scale value.
(intel_get_token): Replace call to malloc and check of return value
with call to xmalloc. Change handling for FLAT to match MASM's.
(intel_putback_token): Don't try to back up/free current token if
that is T_NIL.
gas/testsuite/
2005-03-17 Jan Beulich <jbeulich@novell.com>
* gas/i386/intel.d: Add stderr directive.
* gas/i386/intel.e: New.
* gas/i386/intel16.d: Add stderr directive. Adjust for changed
source.
* gas/i386/intel16.e: New.
* gas/i386/intel16.s: Add instances of addressing forms with base
and index specified in reverse order.
* gas/i386/intelbad.l: Adjust for changed source.
* gas/i386/intelbad.s: Add more operand forms to check.
* gas/i386/intelok.d: Remove -r from objdump options. Add stderr
directive. Adjust for changed source.
* gas/i386/intelok.e: New.
* gas/i386/intelok.s: Define MASM constants byte, word, etc. Add
more operand forms to check.
* gas/i386/x86_64.d: Add stderr directive.
* gas/i386/x86_64.e: New.
* gas/i386/x86_64.s: Adjust for parser changes.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intel.d | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intel.e | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intel16.d | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intel16.e | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intel16.s | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelbad.l | 50 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelbad.s | 51 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.d | 77 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.e | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.s | 71 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86_64.d | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86_64.e | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86_64.s | 10 |
14 files changed, 311 insertions, 23 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 86af7eb..630745a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,23 @@ +2005-03-17 Jan Beulich <jbeulich@novell.com> + + * gas/i386/intel.d: Add stderr directive. + * gas/i386/intel.e: New. + * gas/i386/intel16.d: Add stderr directive. Adjust for changed + source. + * gas/i386/intel16.e: New. + * gas/i386/intel16.s: Add instances of addressing forms with base + and index specified in reverse order. + * gas/i386/intelbad.l: Adjust for changed source. + * gas/i386/intelbad.s: Add more operand forms to check. + * gas/i386/intelok.d: Remove -r from objdump options. Add stderr + directive. Adjust for changed source. + * gas/i386/intelok.e: New. + * gas/i386/intelok.s: Define MASM constants byte, word, etc. Add + more operand forms to check. + * gas/i386/x86_64.d: Add stderr directive. + * gas/i386/x86_64.e: New. + * gas/i386/x86_64.s: Adjust for parser changes. + 2005-03-15 Zack Weinberg <zack@codesourcery.com> * gas/arm/archv6t2.d, gas/arm/archv6t2.s: New dump test. diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d index 24f4536..3fb9270 100644 --- a/gas/testsuite/gas/i386/intel.d +++ b/gas/testsuite/gas/i386/intel.d @@ -1,6 +1,7 @@ #as: -J #objdump: -dw #name: i386 intel +#stderr: intel.e .*: +file format .* diff --git a/gas/testsuite/gas/i386/intel.e b/gas/testsuite/gas/i386/intel.e new file mode 100644 index 0000000..b56da1a --- /dev/null +++ b/gas/testsuite/gas/i386/intel.e @@ -0,0 +1,8 @@ +.*: Assembler messages: +.*:154: Warning: Treating .\[0x90909090\]. as memory reference +.*:155: Warning: Treating .\[0x90909090\]. as memory reference +.*:156: Warning: Treating .\[0x90909090\]. as memory reference +.*:157: Warning: Treating .\[0x90909090\]. as memory reference +.*:492: Warning: Treating .\[0x90909090\]. as memory reference +.*:493: Warning: Treating .\[0x90909090\]. as memory reference +.*:580: Warning: Using register names in OFFSET expressions is deprecated diff --git a/gas/testsuite/gas/i386/intel16.d b/gas/testsuite/gas/i386/intel16.d index 79e57d8..495fe14 100644 --- a/gas/testsuite/gas/i386/intel16.d +++ b/gas/testsuite/gas/i386/intel16.d @@ -1,5 +1,6 @@ #objdump: -dw -mi8086 #name: i386 intel16 +#stderr: intel16.e .*: +file format .* @@ -12,4 +13,12 @@ Disassembly of section .text: 11: 66 0f b7 06 00 00 [ ]*movzwl 0,%eax 17: 66 0f b6 06 00 00 [ ]*movzbl 0,%eax 1d: 0f b6 06 00 00 [ ]*movzbw 0,%ax -#pass + 22: 8d 00 [ ]*lea \(%bx,%si\),%ax + 24: 8d 02 [ ]*lea \(%bp,%si\),%ax + 26: 8d 01 [ ]*lea \(%bx,%di\),%ax + 28: 8d 03 [ ]*lea \(%bp,%di\),%ax + 2a: 8d 00 [ ]*lea \(%bx,%si\),%ax + 2c: 8d 02 [ ]*lea \(%bp,%si\),%ax + 2e: 8d 01 [ ]*lea \(%bx,%di\),%ax + 30: 8d 03 [ ]*lea \(%bp,%di\),%ax + ... diff --git a/gas/testsuite/gas/i386/intel16.e b/gas/testsuite/gas/i386/intel16.e new file mode 100644 index 0000000..62da8a7 --- /dev/null +++ b/gas/testsuite/gas/i386/intel16.e @@ -0,0 +1,7 @@ +.*: Assembler messages: +.*:5: Warning: Treating .word ptr \[0\]. as memory reference +.*:6: Warning: Treating .byte ptr \[0\]. as memory reference +.*:7: Warning: Treating .byte ptr \[0\]. as memory reference +.*:8: Warning: Treating .word ptr \[0\]. as memory reference +.*:9: Warning: Treating .byte ptr \[0\]. as memory reference +.*:10: Warning: Treating .byte ptr \[0\]. as memory reference diff --git a/gas/testsuite/gas/i386/intel16.s b/gas/testsuite/gas/i386/intel16.s index bf78ad8..e27b017 100644 --- a/gas/testsuite/gas/i386/intel16.s +++ b/gas/testsuite/gas/i386/intel16.s @@ -8,4 +8,14 @@ movzx eax,word ptr [0] movzx eax,byte ptr [0] movzx ax,byte ptr [0] + + lea ax, [si+bx] + lea ax, [si+bp] + lea ax, [di+bx] + lea ax, [di+bp] + lea ax, [si][bx] + lea ax, [si][bp] + lea ax, [di][bx] + lea ax, [di][bp] + .p2align 4,0 diff --git a/gas/testsuite/gas/i386/intelbad.l b/gas/testsuite/gas/i386/intelbad.l index 45c21d2..5eaa5d1 100644 --- a/gas/testsuite/gas/i386/intelbad.l +++ b/gas/testsuite/gas/i386/intelbad.l @@ -59,3 +59,53 @@ .*:89: Error: .* .*:90: Error: .* .*:91: Error: .* +.*:94: Error: .* +.*:95: Error: .* +.*:96: Error: .* +.*:97: Error: .* +.*:98: Error: .* +.*:99: Error: .* +.*:100: Error: .* +.*:101: Error: .* +.*:102: Error: .* +.*:103: Error: .* +.*:104: Error: .* +.*:105: Error: .* +.*:106: Error: .* +.*:107: Error: .* +.*:108: Error: .* +.*:109: Error: .* +.*:110: Error: .* +.*:111: Error: .* +.*:112: Error: .* +.*:113: Error: .* +.*:114: Error: .* +.*:115: Error: .* +.*:116: Error: .* +.*:117: Error: .* +.*:118: Error: .* +.*:119: Error: .* +.*:120: Error: .* +.*:121: Error: .* +.*:122: Error: .* +.*:123: Error: .* +.*:124: Error: .* +.*:125: Error: .* +.*:126: Error: .* +.*:127: Error: .* +.*:128: Error: .* +#... +.*:129: Error: .* +#... +.*:130: Error: .* +.*:131: Error: .* +.*:132: Error: .* +.*:133: Error: .* +.*:135: Warning: .* +.*:136: Warning: .* +.*:137: Warning: .* +.*:138: Warning: .* +.*:139: Warning: .* +.*:141: Error: .* +.*:142: Warning: .* +.*:142: Error: .* diff --git a/gas/testsuite/gas/i386/intelbad.s b/gas/testsuite/gas/i386/intelbad.s index c4b03f3..2a9daad 100644 --- a/gas/testsuite/gas/i386/intelbad.s +++ b/gas/testsuite/gas/i386/intelbad.s @@ -89,3 +89,54 @@ start: push 1 1 push 1 + push 1 * * 1 + + # memory references + mov eax, [ecx*3] + mov eax, [3*ecx] + mov eax, [-1*ecx + 1] + mov eax, [esp + esp] + mov eax, [eax - 1*ecx + 1] + mov eax, [(eax-1) * (eax-1)] + mov eax, [eax-1 xor eax-1] + mov eax, [(eax-1) xor (eax-1)] + mov eax, [not eax + 1] + mov eax, [ecx*2 + edx*4] + mov eax, [2*ecx + 4*edx] + mov eax, [eax]1[ecx] # ugly diag + mov eax, [eax][ecx]1 # ugly diag + mov eax, eax[ecx] # ugly diag + mov eax, es[ecx] + mov eax, cr0[ecx] + mov eax, [eax]ecx + mov eax, [eax]+ecx + mov eax, [eax]+ecx*2 + mov eax, [eax]+2*ecx + mov eax, [[eax]ecx] + mov eax, eax:[ecx] + lea eax, [bx+si*1] + lea eax, [bp+si*2] + lea eax, [bx+di*4] + lea eax, [bp+di*8] + lea eax, [bx+1*si] + lea eax, [bp+2*si] + lea eax, [bx+4*di] + lea eax, [bp+8*di] + mov eax, [ah] + mov eax, [ax] + mov eax, [eax+bx] + mov eax, offset [1*eax] + mov eax, offset 1*eax + mov eax, offset x[eax] # ugly diag + mov eax, offset [x][eax] # ugly diag + mov eax, flat x + mov eax, flat [x] + mov eax, es:eax + + mov eax, offset [eax] + mov eax, offset eax + mov eax, offset offset eax + mov eax, es:ss:[eax] + mov eax, es:[eax]+ss:[eax] + + mov eax, 3:5 + call 3:[5] diff --git a/gas/testsuite/gas/i386/intelok.d b/gas/testsuite/gas/i386/intelok.d index f596eb6..e8a80a7 100644 --- a/gas/testsuite/gas/i386/intelok.d +++ b/gas/testsuite/gas/i386/intelok.d @@ -1,6 +1,7 @@ #as: -J -#objdump: -drwMintel +#objdump: -dwMintel #name: i386 intel-ok +#stderr: intelok.e .*: +file format .* @@ -93,20 +94,39 @@ Disassembly of section .text: [ ]*[0-9a-f]+: d7[ ]+xlat(b|[ ]+(BYTE PTR )?(ds:)?\[ebx\]) [ ]*[0-9a-f]+: d7[ ]+xlat(b|[ ]+(BYTE PTR )?(ds:)?\[ebx\]) [ ]*[0-9a-f]+: d7[ ]+xlat(b|[ ]+(BYTE PTR )?(ds:)?\[ebx\]) -[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+byte -[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+byte +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] [ ]*[0-9a-f]+: 8b 40 04[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+4\] [ ]*[0-9a-f]+: 8b 40 04[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+4\] -[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+fword -[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+fword -[ ]*[0-9a-f]+: 8b 80 04 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+qword -[ ]*[0-9a-f]+: 8b 80 04 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+qword -[ ]*[0-9a-f]+: 8b 80 08 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+8\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+tbyte -[ ]*[0-9a-f]+: 8b 80 08 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+8\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+tbyte -#[ ]*[0-9a-f]+: 8b 04 85 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+word -#[ ]*[0-9a-f]+: 8b 04 85 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+word -#[ ]*[0-9a-f]+: 8b 04 85 04 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+xmmword -#[ ]*[0-9a-f]+: 8b 04 85 04 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+4\][ ]+[0-9a-f]+:[ ]+(R_386_|dir)?32[ ]+xmmword +[ ]*[0-9a-f]+: 8b 40 06[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+6\] +[ ]*[0-9a-f]+: 8b 40 06[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+6\] +[ ]*[0-9a-f]+: 8b 40 0c[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+12\] +[ ]*[0-9a-f]+: 8b 40 0c[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+12\] +[ ]*[0-9a-f]+: 8b 40 12[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+18\] +[ ]*[0-9a-f]+: 8b 40 12[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+18\] +[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+2\] +[ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+2\] +[ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\] +[ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\] +[ ]*[0-9a-f]+: 8b 04 8d 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[ecx\*4\] +[ ]*[0-9a-f]+: 8b 04 8d 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[ecx\*4\] +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: 8b 44 08 fb[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\-5\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 44 08 0f[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+15\] +[ ]*[0-9a-f]+: 8b 40 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+16\] +[ ]*[0-9a-f]+: 8b 40 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+16\] +[ ]*[0-9a-f]+: 8b 44 08 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+16\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+1\] +[ ]*[0-9a-f]+: 8b 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] +[ ]*[0-9a-f]+: 8b 04 08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\] +[ ]*[0-9a-f]+: 8b 04 08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\] +[ ]*[0-9a-f]+: 26 8b 00[ ]+mov[ ]+eax,es:(DWORD PTR )?\[eax\] [ ]*[0-9a-f]+: 6a 01[ ]+push[ ]+0x1 [ ]*[0-9a-f]+: 6a ff[ ]+push[ ]+0xffffffff [ ]*[0-9a-f]+: 6a fe[ ]+push[ ]+0xfffffffe @@ -120,4 +140,35 @@ Disassembly of section .text: [ ]*[0-9a-f]+: 6a 02[ ]+push[ ]+0x2 [ ]*[0-9a-f]+: 6a 03[ ]+push[ ]+0x3 [ ]*[0-9a-f]+: 6a 0d[ ]+push[ ]+0xd +[ ]*[0-9a-f]+: 6a 04[ ]+push[ ]+0x4 +[ ]*[0-9a-f]+: 6a fc[ ]+push[ ]+0xfffffffc +[ ]*[0-9a-f]+: 6a fb[ ]+push[ ]+0xfffffffb +[ ]*[0-9a-f]+: 6a fb[ ]+push[ ]+0xfffffffb +[ ]*[0-9a-f]+: 6a 03[ ]+push[ ]+0x3 +[ ]*[0-9a-f]+: 6a 04[ ]+push[ ]+0x4 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: b8 00 00 00 00[ ]+mov[ ]+eax,0x0 +[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1] +[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] +[ ]*[0-9a-f]+: 8b 80 01 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: 8b 80 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] +[ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+1\] +[ ]*[0-9a-f]+: a1 01 00 00 00[ ]+mov[ ]+eax,ds:0x1 +[ ]*[0-9a-f]+: a1 ff ff ff ff[ ]+mov[ ]+eax,ds:0xffffffff +[ ]*[0-9a-f]+: 26 a1 02 00 00 00[ ]+mov[ ]+eax,es:0x2 +#... +[ ]*[0-9a-f]+: b8 03 00 00 00[ ]+mov[ ]+eax,0x3 +[ ]*[0-9a-f]+: a1 04 00 00 00[ ]+mov[ ]+eax,ds:0x4 +[ ]*[0-9a-f]+: a1 05 00 00 00[ ]+mov[ ]+eax,ds:0x5 +[ ]*[0-9a-f]+: 36 a1 06 00 00 00[ ]+mov[ ]+eax,ss:0x6 +[ ]*[0-9a-f]+: 36 a1 07 00 00 00[ ]+mov[ ]+eax,ss:0x7 +[ ]*[0-9a-f]+: a1 08 00 00 00[ ]+mov[ ]+eax,ds:0x8 +[ ]*[0-9a-f]+: 9a 05 00 00 00 03 00[ ]+l?call[ ]+0x3[,:]0x5 +[ ]*[0-9a-f]+: ea 03 00 00 00 05 00[ ]+l?jmp[ ]+0x5[,:]0x3 #pass diff --git a/gas/testsuite/gas/i386/intelok.e b/gas/testsuite/gas/i386/intelok.e new file mode 100644 index 0000000..8403bf2 --- /dev/null +++ b/gas/testsuite/gas/i386/intelok.e @@ -0,0 +1,8 @@ +.*: Assembler messages: +.*:170: Warning: .* taken to mean just .* +.*:177: Warning: Treating .* as memory reference +.*:178: Warning: .* taken to mean just .* +.*:178: Warning: Treating .* as memory reference +.*:181: Warning: Treating .* as memory reference +.*:182: Warning: Treating .* as memory reference +.*:185: Warning: Treating .* as memory reference diff --git a/gas/testsuite/gas/i386/intelok.s b/gas/testsuite/gas/i386/intelok.s index 590d793..a35b38c 100644 --- a/gas/testsuite/gas/i386/intelok.s +++ b/gas/testsuite/gas/i386/intelok.s @@ -1,5 +1,12 @@ .intel_syntax noprefix + .equiv byte, 1 + .equiv word, 2 .equiv dword, 4 + .equiv fword, 6 + .equiv qword, 8 + .equiv tbyte, 10 + .equiv oword, 16 + .equiv xmmword, 16 .text start: @@ -104,10 +111,30 @@ start: mov eax, qword[eax+dword] mov eax, [tbyte+eax+dword*2] mov eax, tbyte[eax+dword*2] -# mov eax, [word+eax*dword] -# mov eax, word[eax*dword] -# mov eax, [xmmword+(eax+1)*dword] -# mov eax, xmmword[(eax+1)*dword] + mov eax, [word+eax*dword] + mov eax, word[eax*dword] + + mov eax, [eax*+2] + mov eax, [+2*eax] + mov eax, [ecx*dword] + mov eax, [dword*ecx] + mov eax, 1[eax] + mov eax, [eax]+1 + mov eax, [eax - 5 + ecx] + mov eax, [eax + 5 and 3 + ecx] + mov eax, [eax + 5*3 + ecx] + mov eax, [oword][eax] + mov eax, [eax][oword] + mov eax, xmmword[eax][ecx] + mov eax, [eax]+1[ecx] + mov eax, [eax][ecx]+1 + mov eax, [1][eax][ecx] + mov eax, [eax][1][ecx] + mov eax, [eax][ecx][1] + mov eax, [[eax]] + mov eax, [eax[ecx]] + mov eax, [[eax][ecx]] + mov eax, es:[eax] # expressions @@ -125,5 +152,41 @@ start: push 7 xor 4 push 8 or 5 + push +dword + push -dword + push not dword + push not +dword + push not -dword + push not not dword + + # offset expressions + + mov eax, offset x + mov eax, offset flat:x + mov eax, flat:x + mov eax, offset [x] + mov eax, offset flat:[x] + mov eax, flat:[x] + mov eax, [offset x] + mov eax, [eax + offset x] + mov eax, [eax + offset 1] + mov eax, [offset x + eax] + mov eax, offset x+1[eax] + mov eax, [eax] + offset x + mov eax, [eax] + offset 1 + mov eax, offset x + [1] + mov eax, [offset x] - [1] + mov eax, offset x + es:[2] + mov eax, offset x + offset es:[3] + mov eax, [4] + offset x + mov eax, [5] + [offset x] + mov eax, ss:[6] + offset x + mov eax, ss:[7] + [offset x] + mov eax, dword ptr [8] + + # other operands + call 3:5 + jmp 5:3 + # Force a good alignment. .p2align 4,0 diff --git a/gas/testsuite/gas/i386/x86_64.d b/gas/testsuite/gas/i386/x86_64.d index 92ae3af..7cea081 100644 --- a/gas/testsuite/gas/i386/x86_64.d +++ b/gas/testsuite/gas/i386/x86_64.d @@ -1,6 +1,7 @@ #as: -J #objdump: -dw #name: i386 x86_64 +#stderr: x86_64.e .*: +file format .* Disassembly of section .text: diff --git a/gas/testsuite/gas/i386/x86_64.e b/gas/testsuite/gas/i386/x86_64.e new file mode 100644 index 0000000..e11e903 --- /dev/null +++ b/gas/testsuite/gas/i386/x86_64.e @@ -0,0 +1,9 @@ +.*.s: Assembler messages: +.*:51: Warning: Treating .\[0x22222222\]. as memory reference +.*:89: Warning: Treating .DWORD PTR \[0x22222222\]. as memory reference +.*:91: Warning: Treating .\[0x8877665544332211\]. as memory reference +.*:92: Warning: Treating .\[0x8877665544332211\]. as memory reference +.*:93: Warning: Treating .\[0x8877665544332211\]. as memory reference +.*:94: Warning: Treating .\[0x8877665544332211\]. as memory reference +.*:95: Warning: Treating .\[0x8877665544332211\]. as memory reference +.*:96: Warning: Treating .\[0x8877665544332211\]. as memory reference diff --git a/gas/testsuite/gas/i386/x86_64.s b/gas/testsuite/gas/i386/x86_64.s index ad2a48d..4e94a50 100644 --- a/gas/testsuite/gas/i386/x86_64.s +++ b/gas/testsuite/gas/i386/x86_64.s @@ -127,12 +127,12 @@ mov symbol(%rip), %eax .intel_syntax noprefix #immediates - various sizes: -mov al, flat symbol -mov ax, flat symbol -mov eax, flat symbol -mov rax, flat symbol +mov al, flat:symbol +mov ax, flat:symbol +mov eax, flat:symbol +mov rax, flat:symbol -#parts aren't supported by the parser +#parts aren't supported by the parser, yet (and not at all for symbol refs) #mov eax, high part symbol #mov eax, low part symbol |