aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp15
-rw-r--r--ld/testsuite/ld-plugin/pr20267a.c12
-rw-r--r--ld/testsuite/ld-plugin/pr20267b.c1
3 files changed, 28 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 7743719..80bc469 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -189,6 +189,15 @@ set lto_link_tests [list \
[list "Build pr20276b.o" \
"$plug_opt" "-flto $lto_no_fat" \
{pr20276b.c}] \
+ [list "Build pr20267a.o" \
+ "" "" \
+ {pr20267a.c}] \
+ [list "Build libpr20267a.a" \
+ "$plug_opt" "-flto $lto_fat" \
+ {pr20267b.c} {} "libpr20267a.a"] \
+ [list "Build libpr20267b.a" \
+ "$plug_opt" "-flto $lto_no_fat" \
+ {pr20267b.c} {} "libpr20267b.a"] \
]
if { [at_least_gcc_version 4 7] } {
@@ -341,6 +350,12 @@ set lto_run_tests [list \
[list "Run pr20276" \
"-O2 -flto tmpdir/pr20276a.o tmpdir/pr20276b.o" "" \
{dummy.c} "pr20276" "pass.out" "-flto -O2" "c"] \
+ [list "Run pr20267a" \
+ "-O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267a.a" "" \
+ {dummy.c} "pr20267a" "pass.out" "-flto -O2" "c"] \
+ [list "Run pr20267b" \
+ "-O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267b.a" "" \
+ {dummy.c} "pr20267b" "pass.out" "-flto -O2" "c"] \
]
if { [at_least_gcc_version 4 7] } {
diff --git a/ld/testsuite/ld-plugin/pr20267a.c b/ld/testsuite/ld-plugin/pr20267a.c
new file mode 100644
index 0000000..0b37bc7
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr20267a.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int global_var;
+extern void abort ();
+
+int main(void)
+{
+ if (global_var != 20)
+ abort ();
+ printf ("PASS\n");
+ return 0;
+}
diff --git a/ld/testsuite/ld-plugin/pr20267b.c b/ld/testsuite/ld-plugin/pr20267b.c
new file mode 100644
index 0000000..2ecbc2c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr20267b.c
@@ -0,0 +1 @@
+int global_var = 20;