1 /* { dg-do compile } */
2 /* { dg-options "-Wno-attributes -fdiagnostics-show-caret" } */
4 extern void __emit_warning (const char *message
);
6 __attribute__((always_inline
))
7 static void depth_0 (void)
9 __emit_warning ("message");
12 __attribute__((always_inline
))
13 static void depth_1 (void)
18 __attribute__((always_inline
))
19 static void depth_2 (void)
24 __attribute__((always_inline
))
25 static void depth_3 (void)
30 __attribute__((always_inline
))
31 static void depth_4 (void)
42 /* Verify that the diagnostic subsytem describes the chain of inlining
43 when reporting the warning, for an example showing many levels of
46 /* { dg-regexp "In function 'depth_0'," "" } */
47 /* { dg-regexp " inlined from 'depth_1' at .+/diagnostic-test-inlining-4.c:15:3," "" } */
48 /* { dg-regexp " inlined from 'depth_2' at .+/diagnostic-test-inlining-4.c:21:3," "" } */
49 /* { dg-regexp " inlined from 'depth_3' at .+/diagnostic-test-inlining-4.c:27:3," "" } */
50 /* { dg-regexp " inlined from 'depth_4' at .+/diagnostic-test-inlining-4.c:33:3," "" } */
51 /* { dg-regexp " inlined from 'main' at .+/diagnostic-test-inlining-4.c:38:3:" "" } */
52 /* { dg-warning "3: message" "" { target *-*-* } 9 } */
53 /* { dg-begin-multiline-output "" }
54 __emit_warning ("message");
55 ^~~~~~~~~~~~~~~~~~~~~~~~~~
56 { dg-end-multiline-output "" } */