mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
4a7a792388
This patch adds tests for function and function pointer for i386. * ld-i386/plt-lib.c: New file. * ld-i386/plt-main.out: Likewise. * ld-i386/plt-main1.c: Likewise. * ld-i386/plt-main1.rd: Likewise. * ld-i386/plt-main2.c: Likewise. * ld-i386/plt-main2.rd: Likewise. * ld-i386/plt-main3.c: Likewise. * ld-i386/plt-main3.rd: Likewise. * ld-i386/plt-main4.c: Likewise. * ld-i386/plt-main4.rd: Likewise. * ld-i386/plt-main5.c: Likewise. * ld-i386/i386.exp: Run plt-main tests.
15 lines
236 B
C
15 lines
236 B
C
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 ();
|
|
}
|