aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-i386/i386.exp16
-rw-r--r--ld/testsuite/ld-i386/pr19031.out1
-rw-r--r--ld/testsuite/ld-i386/pr19031a.c4
-rw-r--r--ld/testsuite/ld-i386/pr19031b.S23
-rw-r--r--ld/testsuite/ld-i386/pr19031c.c14
6 files changed, 67 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 7f1b7ac..9c77301 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,14 @@
2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/19031
+ * ld-i386/i386.exp: Run PR ld/19031 test.
+ * ld/testsuite/ld-i386/pr19031.out: New file.
+ * ld/testsuite/ld-i386/pr19031a.c: Likewise.
+ * ld/testsuite/ld-i386/pr19031b.S: Likewise.
+ * ld/testsuite/ld-i386/pr19031c.c: Likewise.
+
+2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/19013
* ld-x86-64/pr19013-nacl.d: New file.
* ld-x86-64/pr19013-x32.d: Likewise.
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 6213dbe..8cddfce 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -490,6 +490,14 @@ if { [isnative]
{{readelf {-Wrd} pr18900b.rd}} \
"pr18900b" \
] \
+ [list \
+ "Build pr19031.so" \
+ "-shared" \
+ "-fPIC" \
+ { pr19031a.c } \
+ "" \
+ "pr19031.so" \
+ ] \
]
run_ld_link_exec_tests [] [list \
@@ -552,6 +560,14 @@ if { [isnative]
"pr18900" \
"pr18900.out" \
] \
+ [list \
+ "Run pr19031" \
+ "tmpdir/pr19031.so" \
+ "" \
+ { pr19031b.S pr19031c.c } \
+ "pr19031" \
+ "pr19031.out" \
+ ] \
]
}
diff --git a/ld/testsuite/ld-i386/pr19031.out b/ld/testsuite/ld-i386/pr19031.out
new file mode 100644
index 0000000..d86bac9
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19031.out
@@ -0,0 +1 @@
+OK
diff --git a/ld/testsuite/ld-i386/pr19031a.c b/ld/testsuite/ld-i386/pr19031a.c
new file mode 100644
index 0000000..fa34d37
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19031a.c
@@ -0,0 +1,4 @@
+void
+f (void)
+{
+}
diff --git a/ld/testsuite/ld-i386/pr19031b.S b/ld/testsuite/ld-i386/pr19031b.S
new file mode 100644
index 0000000..3249652
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19031b.S
@@ -0,0 +1,23 @@
+ .text
+ .globl g
+ .type g, @function
+g:
+ calll .Lfoo
+.Lfoo:
+ popl %eax
+.Lbar:
+ addl $_GLOBAL_OFFSET_TABLE_+(.Lbar-.Lfoo), %eax
+ movl f@GOT(%eax), %eax
+ ret
+
+ .globl h
+ .type h, @function
+h:
+ leal zed, %eax
+ movl zed, %ebx
+ addl %ebx, %eax
+ ret
+
+ .data
+zed:
+ .long f - .
diff --git a/ld/testsuite/ld-i386/pr19031c.c b/ld/testsuite/ld-i386/pr19031c.c
new file mode 100644
index 0000000..60eccaf
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19031c.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+extern void *h (void);
+extern void *g (void);
+
+int
+main (void)
+{
+
+ if (h () == g ())
+ printf ("OK\n");
+
+ return 0;
+}