Commit | Line | Data |
---|---|---|
46519784 | 1 | int foo (int) __attribute__ ((ifunc ("resolve_foo"))); |
97dc35c8 L |
2 | extern void abort (void); |
3 | ||
46519784 NC |
4 | static int |
5 | foo_impl (int x) | |
97dc35c8 L |
6 | { |
7 | return x; | |
8 | } | |
9 | ||
46519784 NC |
10 | void |
11 | bar (void) | |
97dc35c8 L |
12 | { |
13 | int (*f)(int) = foo; | |
14 | ||
15 | if (foo (5) != 5) | |
16 | abort (); | |
17 | ||
46519784 | 18 | if (f (42) != 42) |
97dc35c8 L |
19 | abort (); |
20 | } | |
21 | ||
46519784 NC |
22 | void * |
23 | resolve_foo (void) | |
97dc35c8 L |
24 | { |
25 | return (void *) foo_impl; | |
26 | } |