gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
raw| 1 | /* { dg-do link } */ |
| 2 | /* { dg-options "-O" } */ |
| 3 | |
| 4 | /* When optimized we expect the call to foo () in bar to be inlined |
| 5 | and the call to link_error optimized away. */ |
| 6 | |
| 7 | extern void link_error (void); |
| 8 | inline int __attribute__((always_inline)) foo(void) { return 0; } |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | int (*fn)(void) = foo; |
| 13 | if (fn()) |
| 14 | link_error (); |
| 15 | return 0; |
| 16 | } |
| 17 |