aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64/plt-main4.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-main4.c
parent731885c1add5b5012654fe1a70572f033c8d21f8 (diff)
downloadgdb-76e7af5ffa07e570c7cedb8b8141a822905d78f0.zip
gdb-76e7af5ffa07e570c7cedb8b8141a822905d78f0.tar.gz
gdb-76e7af5ffa07e570c7cedb8b8141a822905d78f0.tar.bz2
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-main4.c')
-rw-r--r--ld/testsuite/ld-x86-64/plt-main4.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/plt-main4.c b/ld/testsuite/ld-x86-64/plt-main4.c
new file mode 100644
index 0000000..992ba5f
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/plt-main4.c
@@ -0,0 +1,14 @@
+extern int foo(void);
+typedef int (*func_p) (void);
+extern func_p foo_ptr;
+
+void
+check_foo (void)
+{
+ if (foo_ptr != foo)
+ __builtin_abort ();
+ if (foo_ptr() != 1)
+ __builtin_abort ();
+ if (foo() != 1)
+ __builtin_abort ();
+}