131
|
1 /* { dg-do compile } */
|
|
2 /* { dg-options "-Wno-attributes -fdiagnostics-show-caret" } */
|
|
3
|
|
4 extern void __emit_warning (const char *message);
|
|
5
|
|
6 __attribute__((always_inline))
|
|
7 static void foo (void)
|
|
8 {
|
|
9 __emit_warning ("message");
|
|
10 }
|
|
11
|
|
12 __attribute__((always_inline))
|
|
13 static void bar (void)
|
|
14 {
|
|
15 foo ();
|
|
16 }
|
|
17
|
|
18 int main()
|
|
19 {
|
|
20 bar ();
|
|
21 return 0;
|
|
22 }
|
|
23
|
|
24 /* Verify that the diagnostic subsytem describes the chain of inlining
|
|
25 when reporting the warning. */
|
|
26
|
|
27 /* { dg-regexp "In function 'foo'," "" } */
|
|
28 /* { dg-regexp " inlined from 'bar' at .+/diagnostic-test-inlining-1.c:15:3," "" } */
|
|
29 /* { dg-regexp " inlined from 'main' at .+/diagnostic-test-inlining-1.c:20:3:" "" } */
|
|
30 /* { dg-warning "3: message" "" { target *-*-* } 9 } */
|
|
31 /* { dg-begin-multiline-output "" }
|
|
32 __emit_warning ("message");
|
|
33 ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
34 { dg-end-multiline-output "" } */
|