gcc/testsuite/g++.dg/ext/gnu-inline-global-redecl.C
raw| 1 | /* Test __attribute__((gnu_inline)). |
| 2 | |
| 3 | Check that we don't get out-of-line definitions for extern inline |
| 4 | gnu_inline functions, regardless of redeclaration. |
| 5 | |
| 6 | */ |
| 7 | |
| 8 | /* { dg-do link } */ |
| 9 | /* { dg-options "-O" } */ // such that static functions are optimized out |
| 10 | |
| 11 | #include "gnu-inline-common.h" |
| 12 | |
| 13 | decl(extern, fn) |
| 14 | gnuindef(fn, 0) |
| 15 | decl(extern, fn) |
| 16 | |
| 17 | int main () { |
| 18 | fn (); |
| 19 | } |