aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/pr29797.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elf/pr29797.c')
-rw-r--r--ld/testsuite/ld-elf/pr29797.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr29797.c b/ld/testsuite/ld-elf/pr29797.c
new file mode 100644
index 0000000..9e3113f
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr29797.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+static int foo (int x) __attribute__ ((ifunc ("resolve_foo")));
+
+static int foo_impl(int x)
+{
+ return x;
+}
+
+static void *resolve_foo (void)
+{
+ return (void *) foo_impl;
+}
+
+int
+main ()
+{
+ foo (0);
+ puts ("PASS");
+ return 0;
+}