aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr23854.d28
-rw-r--r--ld/testsuite/ld-i386/pr23854.s33
3 files changed, 62 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 21f5593..76577c4 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -481,6 +481,7 @@ run_dump_test "pr23486a"
run_dump_test "pr23486b"
run_dump_test "pr23486c"
run_dump_test "pr23486d"
+run_dump_test "pr23854"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr23854.d b/ld/testsuite/ld-i386/pr23854.d
new file mode 100644
index 0000000..3ed9c20
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23854.d
@@ -0,0 +1,28 @@
+#as: --32 -mrelax-relocations=yes
+#ld: -melf_i386
+#objdump: -dw
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+ +[a-f0-9]+: 66 13 81 f8 ff ff ff adc -0x8\(%ecx\),%ax
+ +[a-f0-9]+: 66 03 99 f8 ff ff ff add -0x8\(%ecx\),%bx
+ +[a-f0-9]+: 66 23 89 f8 ff ff ff and -0x8\(%ecx\),%cx
+ +[a-f0-9]+: 66 3b 91 f8 ff ff ff cmp -0x8\(%ecx\),%dx
+ +[a-f0-9]+: 66 0b b9 f8 ff ff ff or -0x8\(%ecx\),%di
+ +[a-f0-9]+: 66 1b b1 f8 ff ff ff sbb -0x8\(%ecx\),%si
+ +[a-f0-9]+: 66 2b a9 f8 ff ff ff sub -0x8\(%ecx\),%bp
+ +[a-f0-9]+: 66 33 a1 f8 ff ff ff xor -0x8\(%ecx\),%sp
+ +[a-f0-9]+: 66 85 89 f8 ff ff ff test %cx,-0x8\(%ecx\)
+ +[a-f0-9]+: 66 13 81 fc ff ff ff adc -0x4\(%ecx\),%ax
+ +[a-f0-9]+: 66 03 99 fc ff ff ff add -0x4\(%ecx\),%bx
+ +[a-f0-9]+: 66 23 89 fc ff ff ff and -0x4\(%ecx\),%cx
+ +[a-f0-9]+: 66 3b 91 fc ff ff ff cmp -0x4\(%ecx\),%dx
+ +[a-f0-9]+: 66 0b b9 fc ff ff ff or -0x4\(%ecx\),%di
+ +[a-f0-9]+: 66 1b b1 fc ff ff ff sbb -0x4\(%ecx\),%si
+ +[a-f0-9]+: 66 2b a9 fc ff ff ff sub -0x4\(%ecx\),%bp
+ +[a-f0-9]+: 66 33 a1 fc ff ff ff xor -0x4\(%ecx\),%sp
+ +[a-f0-9]+: 66 85 89 fc ff ff ff test %cx,-0x4\(%ecx\)
+#pass
diff --git a/ld/testsuite/ld-i386/pr23854.s b/ld/testsuite/ld-i386/pr23854.s
new file mode 100644
index 0000000..565e747
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23854.s
@@ -0,0 +1,33 @@
+ .data
+ .type bar, @object
+bar:
+ .byte 1
+ .size bar, .-bar
+ .globl foo
+ .type foo, @object
+foo:
+ .byte 1
+ .size foo, .-foo
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ adcw bar@GOT(%ecx), %ax
+ addw bar@GOT(%ecx), %bx
+ andw bar@GOT(%ecx), %cx
+ cmpw bar@GOT(%ecx), %dx
+ orw bar@GOT(%ecx), %di
+ sbbw bar@GOT(%ecx), %si
+ subw bar@GOT(%ecx), %bp
+ xorw bar@GOT(%ecx), %sp
+ testw %cx, bar@GOT(%ecx)
+ adcw foo@GOT(%ecx), %ax
+ addw foo@GOT(%ecx), %bx
+ andw foo@GOT(%ecx), %cx
+ cmpw foo@GOT(%ecx), %dx
+ orw foo@GOT(%ecx), %di
+ sbbw foo@GOT(%ecx), %si
+ subw foo@GOT(%ecx), %bp
+ xorw foo@GOT(%ecx), %sp
+ testw %cx, foo@GOT(%ecx)
+ .size _start, .-_start