gcc/testsuite/gcc.c-torture/compile/pr43791.c
raw| 1 | /* { dg-require-effective-target indirect_calls } */ |
| 2 | |
| 3 | int owner(); |
| 4 | int clear(); |
| 5 | |
| 6 | static void fixup() { |
| 7 | clear(); |
| 8 | } |
| 9 | |
| 10 | inline __attribute__ ((always_inline)) |
| 11 | void slowtrylock(void) { |
| 12 | if (owner()) |
| 13 | fixup(); |
| 14 | } |
| 15 | |
| 16 | void fasttrylock(void (*slowfn)()) { |
| 17 | slowfn(); |
| 18 | } |
| 19 | |
| 20 | void trylock(void) { |
| 21 | fasttrylock(slowtrylock); |
| 22 | } |