gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / testsuite / ifuncmain5.c
CommitLineData
7223e9ca
ILT
1/* Test STT_GNU_IFUNC symbols with dynamic function pointer only. */
2
3#include <stdlib.h>
4
5extern int foo (void);
6extern int foo_protected (void);
7
8typedef int (*foo_p) (void);
9
10extern foo_p __attribute__ ((noinline)) get_foo (void);
11extern foo_p __attribute__ ((noinline)) get_foo_protected (void);
12
13foo_p
14__attribute__ ((noinline))
15get_foo (void)
16{
17 return foo;
18}
19
20foo_p
21__attribute__ ((noinline))
22get_foo_protected (void)
23{
24 return foo_protected;
25}
26
27int
28main (void)
29{
30 foo_p p;
31
32 p = get_foo ();
33 if ((*p) () != -1)
34 abort ();
35
36 p = get_foo_protected ();
37 if ((*p) () != 0)
38 abort ();
39
40 return 0;
41}
This page took 0.466294 seconds and 4 git commands to generate.