mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
76e7af5ffa
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.
16 lines
276 B
C
16 lines
276 B
C
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 ();
|
|
}
|