summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64/plt-main3.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-11-20 12:41:11 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-11-20 12:41:11 -0800
commit76e7af5ffa07e570c7cedb8b8141a822905d78f0 (patch)
tree5a8a2c50e37dd125a947bec0454403f01630fa6d /ld/testsuite/ld-x86-64/plt-main3.c
parent731885c1add5b5012654fe1a70572f033c8d21f8 (diff)
downloadbinutils-gdb-76e7af5ffa07e570c7cedb8b8141a822905d78f0.tar.gz
Add function and function pointer tests
This patch adds tests for function and function pointer. * ld-x86-64/plt-lib.c: New file. * ld-x86-64/plt-main.out: Likewise. * ld-x86-64/plt-main1.c: Likewise. * ld-x86-64/plt-main1.rd: Likewise. * ld-x86-64/plt-main2.c: Likewise. * ld-x86-64/plt-main2.rd: Likewise. * ld-x86-64/plt-main3.c: Likewise. * ld-x86-64/plt-main3.rd: Likewise. * ld-x86-64/plt-main4.c: Likewise. * ld-x86-64/plt-main4.rd: Likewise. * ld-x86-64/plt-main5.c: Likewise. * ld-x86-64/x86-64.exp: Run plt-main tests.
Diffstat (limited to 'ld/testsuite/ld-x86-64/plt-main3.c')
-rw-r--r--ld/testsuite/ld-x86-64/plt-main3.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/plt-main3.c b/ld/testsuite/ld-x86-64/plt-main3.c
new file mode 100644
index 00000000000..026e05febb2
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/plt-main3.c
@@ -0,0 +1,15 @@
+extern int bar(void);
+typedef int (*func_p) (void);
+extern func_p get_bar (void);
+
+void
+check_bar (void)
+{
+ func_p bar_ptr = get_bar ();
+ if (bar_ptr != bar)
+ __builtin_abort ();
+ if (bar_ptr() != -1)
+ __builtin_abort ();
+ if (bar() != -1)
+ __builtin_abort ();
+}