libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / plugin / diagnostic-test-inlining-4.c
blobdfb939db17d53a7a0dbe7e0c54b6dcd1b03d1e8f
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)
15 depth_0 ();
18 __attribute__((always_inline))
19 static void depth_2 (void)
21 depth_1 ();
24 __attribute__((always_inline))
25 static void depth_3 (void)
27 depth_2 ();
30 __attribute__((always_inline))
31 static void depth_4 (void)
33 depth_3 ();
36 int main()
38 depth_4 ();
39 return 0;
42 /* Verify that the diagnostic subsytem describes the chain of inlining
43 when reporting the warning, for an example showing many levels of
44 inlining. */
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 "" } */