diff options
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/gpoff.d | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/gpoff.s | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/inval-gpoff.l | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/inval-gpoff.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-gpoff.d | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-gpoff.s | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-inval-gpoff.l | 30 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-inval-gpoff.s | 7 |
9 files changed, 96 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/gpoff.d b/gas/testsuite/gas/i386/gpoff.d new file mode 100644 index 00000000000..6a16ba49a7f --- /dev/null +++ b/gas/testsuite/gas/i386/gpoff.d @@ -0,0 +1,11 @@ +#objdump: -drw +#name: i386 gpoff + +.*: +file format .* + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 8d 05 00 00 00 00 lea 0x0,%eax 2: R_386_GPOFF foo + +[a-f0-9]+: 64 a1 00 00 00 00 mov %fs:0x0,%eax 8: R_386_GPOFF foo +#pass diff --git a/gas/testsuite/gas/i386/gpoff.s b/gas/testsuite/gas/i386/gpoff.s new file mode 100644 index 00000000000..4b786a24721 --- /dev/null +++ b/gas/testsuite/gas/i386/gpoff.s @@ -0,0 +1,4 @@ + .text +_start: + leal foo@GPOFF, %eax + movl %fs:foo@GPOFF, %eax diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 67a7a13b259..542749d57b9 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -455,6 +455,9 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] run_dump_test "addend" + run_dump_test "gpoff" + run_list_test "inval-gpoff" "-al" + if {![istarget "*-*-nacl*"]} then { run_dump_test "iamcu-1" run_dump_test "iamcu-2" @@ -868,6 +871,9 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-gotpcrel-no-relax" run_dump_test "x86-64-addend" + + run_dump_test "x86-64-gpoff" + run_list_test "x86-64-inval-gpoff" "-al" } set ASFLAGS "$old_ASFLAGS" diff --git a/gas/testsuite/gas/i386/inval-gpoff.l b/gas/testsuite/gas/i386/inval-gpoff.l new file mode 100644 index 00000000000..3fad845e697 --- /dev/null +++ b/gas/testsuite/gas/i386/inval-gpoff.l @@ -0,0 +1,18 @@ +.*: Assembler messages: +.*:3: Error: invalid GPOFF relocation +.*:4: Error: invalid GPOFF relocation +.*:5: Error: invalid GPOFF relocation +GAS LISTING .* + + +[ ]*1[ ]+\.text +[ ]*2[ ]+_start: +[ ]*3[ ]+\?\?\?\? 648B8000 movl %fs:foo@GPOFF\(%eax\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*3[ ]+000000 +[ ]*4[ ]+\?\?\?\? 8B844800 movl %ds:foo@GPOFF\(%eax, %ecx, 2\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*4[ ]+000000 +[ ]*5[ ]+\?\?\?\? 8B800000 movl foo@GPOFF\(%eax\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*5[ ]+0000 diff --git a/gas/testsuite/gas/i386/inval-gpoff.s b/gas/testsuite/gas/i386/inval-gpoff.s new file mode 100644 index 00000000000..7556de3518e --- /dev/null +++ b/gas/testsuite/gas/i386/inval-gpoff.s @@ -0,0 +1,5 @@ + .text +_start: + movl %fs:foo@GPOFF(%eax), %eax + movl %ds:foo@GPOFF(%eax, %ecx, 2), %eax + movl foo@GPOFF(%eax), %eax diff --git a/gas/testsuite/gas/i386/x86-64-gpoff.d b/gas/testsuite/gas/i386/x86-64-gpoff.d new file mode 100644 index 00000000000..2d5e8bd870c --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-gpoff.d @@ -0,0 +1,11 @@ +#objdump: -drw +#name: x86-64 gpoff + +.*: +file format .* + +Disassembly of section .text: + +0+ <_start>: + +[a-f0-9]+: 8d 04 25 00 00 00 00 lea 0x0,%eax 3: R_X86_64_GPOFF foo + +[a-f0-9]+: 65 8b 04 25 00 00 00 00 mov %gs:0x0,%eax b: R_X86_64_GPOFF foo +#pass diff --git a/gas/testsuite/gas/i386/x86-64-gpoff.s b/gas/testsuite/gas/i386/x86-64-gpoff.s new file mode 100644 index 00000000000..ccd743506b0 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-gpoff.s @@ -0,0 +1,4 @@ + .text +_start: + leal foo@GPOFF, %eax + movl %gs:foo@GPOFF, %eax diff --git a/gas/testsuite/gas/i386/x86-64-inval-gpoff.l b/gas/testsuite/gas/i386/x86-64-inval-gpoff.l new file mode 100644 index 00000000000..e64a8bde1ee --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-inval-gpoff.l @@ -0,0 +1,30 @@ +.*: Assembler messages: +.*:3: Error: invalid GPOFF relocation +.*:3: Error: non-pc-relative relocation for pc-relative field +.*:4: Error: invalid GPOFF relocation +.*:5: Error: invalid GPOFF relocation +.*:6: Error: invalid GPOFF relocation +.*:6: Error: non-pc-relative relocation for pc-relative field +.*:7: Error: invalid GPOFF relocation +GAS LISTING .* + + +[ ]*1[ ]+\.text +[ ]*2[ ]+_start: +[ ]*3[ ]+\?\?\?\? 648B0500 movl %fs:foo@GPOFF\(%rip\), %eax +\*\*\*\* Error: invalid GPOFF relocation +\*\*\*\* Error: non-pc-relative relocation for pc-relative field +[ ]*3[ ]+000000 +[ ]*4[ ]+\?\?\?\? 648B8000 movl %fs:foo@GPOFF\(%rax\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*4[ ]+000000 +[ ]*5[ ]+\?\?\?\? 8B844800 movl %ds:foo@GPOFF\(%rax, %rcx, 2\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*5[ ]+000000 +[ ]*6[ ]+\?\?\?\? 8B050000 movl foo@GPOFF\(%rip\), %eax +\*\*\*\* Error: invalid GPOFF relocation +\*\*\*\* Error: non-pc-relative relocation for pc-relative field +[ ]*6[ ]+0000 +[ ]*7[ ]+\?\?\?\? 8B800000 movl foo@GPOFF\(%rax\), %eax +\*\*\*\* Error: invalid GPOFF relocation +[ ]*7[ ]+0000 diff --git a/gas/testsuite/gas/i386/x86-64-inval-gpoff.s b/gas/testsuite/gas/i386/x86-64-inval-gpoff.s new file mode 100644 index 00000000000..8aacbf84807 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-inval-gpoff.s @@ -0,0 +1,7 @@ + .text +_start: + movl %fs:foo@GPOFF(%rip), %eax + movl %fs:foo@GPOFF(%rax), %eax + movl %ds:foo@GPOFF(%rax, %rcx, 2), %eax + movl foo@GPOFF(%rip), %eax + movl foo@GPOFF(%rax), %eax |