Cleanup _IO_wfile_seekoff.
[glibc/pb-stable.git] / elf / ifuncmain5.c
blob7f128d006e1de1b2bc839c6fae019def528b895f
1 /* Test STT_GNU_IFUNC symbols with dynamic function pointer only. */
3 #include <stdlib.h>
5 int global = -1;
7 extern int foo (void);
8 extern int foo_protected (void);
10 typedef int (*foo_p) (void);
12 foo_p
13 __attribute__ ((noinline))
14 get_foo (void)
16 return foo;
19 foo_p
20 __attribute__ ((noinline))
21 get_foo_protected (void)
23 return foo_protected;
26 int
27 main (void)
29 foo_p p;
31 p = get_foo ();
32 if ((*p) () != -1)
33 abort ();
35 p = get_foo_protected ();
36 if ((*p) () != 0)
37 abort ();
39 return 0;