From 76e7af5ffa07e570c7cedb8b8141a822905d78f0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 20 Nov 2014 12:41:11 -0800 Subject: 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. --- ld/testsuite/ld-x86-64/plt-main3.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ld/testsuite/ld-x86-64/plt-main3.c (limited to 'ld/testsuite/ld-x86-64/plt-main3.c') 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 (); +} -- cgit v1.2.1