LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / plugin / diagnostic-test-inlining-2.c
blob52e482575a9667a82755f597e4da93d2889154b7
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)
19 foo ();
22 int main()
24 bar ();
25 return 0;
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)
37 ^~~~~~~~~~~~~~~~~~~~
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)
42 ^~~~~~~~~~~~~
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");
47 ^~~~~~~~~~~~~
48 { dg-end-multiline-output "" } */