Delete asection.symbol_ptr_ptr
[binutils-gdb.git] / ld / testsuite / ld-ifunc / ifunc-main.c
blob61e9934ae5dc836ff770747d2cce7d8453582c17
1 #include <stdio.h>
3 extern int foo(void);
4 extern int bar(void);
6 typedef int (*func_p) (void);
8 func_p foo_ptr = foo;
10 func_p
11 __attribute__((noinline))
12 get_bar (void)
14 return bar;
17 int
18 main (void)
20 func_p bar_ptr = get_bar ();
21 if (bar_ptr != bar)
22 __builtin_abort ();
23 if (bar_ptr() != -1)
24 __builtin_abort ();
25 if (bar() != -1)
26 __builtin_abort ();
28 if (foo_ptr != foo)
29 __builtin_abort ();
30 if (foo_ptr() != 1)
31 __builtin_abort ();
32 if (foo() != 1)
33 __builtin_abort ();
35 printf ("OK\n");
37 return 0;