summaryrefslogtreecommitdiff
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.exp9
-rw-r--r--ld/testsuite/ld-plugin/pr21382a.c17
-rw-r--r--ld/testsuite/ld-plugin/pr21382b.c7
3 files changed, 33 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 80c084bda11..f0bc345f2c7 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -289,6 +289,12 @@ set lto_link_elf_tests [list \
[list "PR ld/14918" \
"-flto" "-flto" \
{pr14918.c} {{"readelf" {-d --wide} "pr14918.d"}} "pr14918.exe" "c"] \
+ [list "Build pr21382a.o" \
+ "" "-O2 -flto" \
+ {pr21382a.c} {} "" "c"] \
+ [list "Build pr21382.so" \
+ "-shared" "-O2 -fpic" \
+ {pr21382b.c} {} "pr21382.so" "c"] \
]
# Check final symbols in executables.
@@ -387,6 +393,9 @@ set lto_run_elf_shared_tests [list \
[list "LTO 7" \
"-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o -Wl,--no-as-needed tmpdir/liblto-7.so" "" \
{dummy.c} "lto-7.exe" "lto-7.out" "" "c"] \
+ [list "Run pr21382" \
+ "-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr21382a.o tmpdir/pr21382.so" "" \
+ {dummy.c} "pr21382.exe" "pass.out" "" "c"] \
]
# LTO run-time tests for ELF
diff --git a/ld/testsuite/ld-plugin/pr21382a.c b/ld/testsuite/ld-plugin/pr21382a.c
new file mode 100644
index 00000000000..09b9d758d3e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr21382a.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+extern void y (void);
+
+void
+x (void)
+{
+ printf ("PASS\n");
+}
+
+
+int
+main (void)
+{
+ y ();
+ return 0;
+}
diff --git a/ld/testsuite/ld-plugin/pr21382b.c b/ld/testsuite/ld-plugin/pr21382b.c
new file mode 100644
index 00000000000..c5b74a94417
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr21382b.c
@@ -0,0 +1,7 @@
+extern void x (void);
+
+void
+y (void)
+{
+ x ();
+}