1 /* Test __attribute__((gnu_inline)). 2 3 Check that we reject various forms of duplicate definitions. 4 */ 5 6 /* { dg-do compile } */ 7 /* { dg-options " -ansi -Wno-long-long -ftrack-macro-expansion=0" } */ 8 9 #include "gnu-inline-common.h" 10 11 #undef fn 12 #define fn pfx(func_decl_inline_before) 13 decl(inline, fn) // { dg-message "previous" } 14 gnuindef(fn, 0) // { dg-error "redeclared" } 15 16 #undef fn 17 #define fn pfx(func_decl_inline_after) 18 gnuindef(fn, 0) // { dg-message "previous" } 19 decl(inline, fn) // { dg-error "redeclared" } 20 21 #undef fn 22 #define fn pfx(func_def_gnuin_redef) 23 gnuindef(fn, 0) // { dg-message "previous" } 24 gnuindef(fn, 1) // { dg-error "redefinition" } 25 26 #undef fn 27 #define fn pfx(func_def_inline_redef) 28 def(inline, fn, 0) // { dg-message "previous" } 29 def(inline, fn, 1) // { dg-error "redefinition" } 30 31 #undef fn 32 #define fn pfx(func_def_inline_after) 33 gnuindef(fn, 0) // { dg-message "previous" } 34 def(inline, fn, 1) // { dg-error "redeclare" } 35 36 #undef fn 37 #define fn pfx(func_def_inline_before) 38 def(inline, fn, 0) // { dg-message "previous" } 39 gnuindef(fn, 1) // { dg-error "redefinition" } 40 41 #undef fn 42 #define fn pfx(func_def_before) 43 def(, fn, 0) // { dg-message "previous" } 44 gnuindef(fn, 1) // { dg-error "redefinition" } 45 46 #undef fn 47 #define fn pfx(func_decl_static_inline_before) 48 decl(static inline, fn) // { dg-message "previous" } 49 gnuindef(fn, 0) // { dg-error "redeclared" } 50 51 #undef fn 52 #define fn pfx(func_def_static_inline_after) 53 decl(static, fn) 54 gnuindef(fn, 0) // { dg-message "previous" } 55 decl(static, fn) 56 def(static inline, fn, 1) // { dg-error "redeclare" } 57