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.exp4
-rw-r--r--ld/testsuite/ld-plugin/pr23309.c10
-rw-r--r--ld/testsuite/ld-plugin/pr23309.d3
3 files changed, 17 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 70274b3..7c50b0f 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -242,6 +242,10 @@ set lto_compile_elf_tests [list \
[list "Compile 8b" \
"" "-flto -O2" \
{lto-8b.c} {} ""] \
+ [list "PR ld/23309" \
+ "-O2 -flto -fuse-linker-plugin -fvisibility=hidden -ffunction-sections -Wl,--gc-sections,-u,KeepMe" \
+ "-O2 -flto -fuse-linker-plugin -fvisibility=hidden -ffunction-sections" \
+ {pr23309.c} {{"nm" {} "pr23309.d"}} "pr23309.exe" "c"] \
]
# Generate input files for complex LTO tests for ELF.
diff --git a/ld/testsuite/ld-plugin/pr23309.c b/ld/testsuite/ld-plugin/pr23309.c
new file mode 100644
index 0000000..da8bb3a
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23309.c
@@ -0,0 +1,10 @@
+int
+main (void)
+{
+ return 0;
+}
+
+void
+KeepMe (void)
+{
+}
diff --git a/ld/testsuite/ld-plugin/pr23309.d b/ld/testsuite/ld-plugin/pr23309.d
new file mode 100644
index 0000000..c353b66
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23309.d
@@ -0,0 +1,3 @@
+#...
+[0-9a-f]+ . _?KeepMe
+#pass