aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-04-22 10:22:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2014-04-22 10:22:39 -0700
commit43c001c7d638bde9f310fdc3a199e02036f7b205 (patch)
treed4f730e5c60013d3ae52d245e241f837e2db73b2 /ld/testsuite/ld-plugin
parentd5f59c10fc37e325d3fbad4ae7970c7cf0857b46 (diff)
downloadgdb-43c001c7d638bde9f310fdc3a199e02036f7b205.zip
gdb-43c001c7d638bde9f310fdc3a199e02036f7b205.tar.gz
gdb-43c001c7d638bde9f310fdc3a199e02036f7b205.tar.bz2
Add tests for PR ld/16846
PR ld/16846 * ld-plugin/lto.exp (lto_link_tests): Add tests for PR ld/16846. * ld-plugin/pr16846a.c: New file. * ld-plugin/pr16846b.c: Likewise. * ld-plugin/pr16846c.c: Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp12
-rw-r--r--ld/testsuite/ld-plugin/pr16846a.c7
-rw-r--r--ld/testsuite/ld-plugin/pr16846b.c7
-rw-r--r--ld/testsuite/ld-plugin/pr16846c.c1
4 files changed, 27 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 1a525fc..6ff474e 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -139,6 +139,18 @@ set lto_link_tests {
{"PR ld/15323"
"" "-O2"
{pr15323a.c} {} "libdummy.a" "c"}
+ {"Build libdummy.a(1) PR ld/pr16846"
+ "" "-flto"
+ {pr16846a.c pr16846b.c} {} "libdummy.a"}
+ {"Build libdummy.a(2) PR ld/pr16846"
+ "" ""
+ {pr16846c.c} {} "libdummy.a"}
+ {"PR ld/pr16846(1)"
+ "-flto -fuse-linker-plugin tmpdir/pr16846a.o tmpdir/pr16846b.o tmpdir/pr16846c.o" ""
+ {dummy.c} {} "pr16846a.exe"}
+ {"PR ld/pr16846(2)"
+ "-flto -fuse-linker-plugin tmpdir/pr16846a.o tmpdir/pr16846c.o tmpdir/pr16846b.o" ""
+ {dummy.c} {} "pr16846b.exe"}
}
if { [at_least_gcc_version 4 7] } {
diff --git a/ld/testsuite/ld-plugin/pr16846a.c b/ld/testsuite/ld-plugin/pr16846a.c
new file mode 100644
index 0000000..2f119a4
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr16846a.c
@@ -0,0 +1,7 @@
+extern int bar (void);
+
+int
+main ()
+{
+ return bar ();
+}
diff --git a/ld/testsuite/ld-plugin/pr16846b.c b/ld/testsuite/ld-plugin/pr16846b.c
new file mode 100644
index 0000000..bd8ddf3
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr16846b.c
@@ -0,0 +1,7 @@
+extern __thread int foo;
+
+int
+bar (void)
+{
+ return foo;
+}
diff --git a/ld/testsuite/ld-plugin/pr16846c.c b/ld/testsuite/ld-plugin/pr16846c.c
new file mode 100644
index 0000000..3f39c5b
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr16846c.c
@@ -0,0 +1 @@
+__thread int foo;