comparison gcc/testsuite/gcc.dg/plugin/diagnostic-test-inlining-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
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 "" } */