1 /* { dg-do compile } */
2 /* { dg-options "-Wno-attributes -fdiagnostics-show-caret" } */
4 extern void __emit_warning (const char *message
);
6 #define INNER_WARNING(MSG) __emit_warning (MSG)
8 #define OUTER_WARNING(MSG) INNER_WARNING (MSG)
10 __attribute__((always_inline
))
11 static void foo (void)
13 OUTER_WARNING ("message");
16 __attribute__((always_inline
))
17 static void bar (void)
28 /* Verify that the diagnostic subsytem describes both the chains of
29 inlining and of macro expansion when reporting the warning. */
31 /* { dg-regexp "In function 'foo'," "" } */
32 /* { dg-regexp " inlined from 'bar' at .+/diagnostic-test-inlining-2.c:19:3," "" } */
33 /* { dg-regexp " inlined from 'main' at .+/diagnostic-test-inlining-2.c:24:3:" "" } */
34 /* { dg-warning "28: message" "" { target c } 6 } */
35 /* { dg-begin-multiline-output "" }
36 #define INNER_WARNING(MSG) __emit_warning (MSG)
38 { dg-end-multiline-output "" } */
39 /* { dg-message "28: in expansion of macro 'INNER_WARNING'" "" { target c } 8 } */
40 /* { dg-begin-multiline-output "" }
41 #define OUTER_WARNING(MSG) INNER_WARNING (MSG)
43 { dg-end-multiline-output "" } */
44 /* { dg-message "3: in expansion of macro 'OUTER_WARNING'" "" { target c } 13 } */
45 /* { dg-begin-multiline-output "" }
46 OUTER_WARNING ("message");
48 { dg-end-multiline-output "" } */