Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/inlining-1.c

raw
1 /* Verify that we can reconstruct fndecl and stack depth information
2 after early inlining. */
3
4 /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
5
6 void foo (void *p)
7 {
8 __builtin_free (p); /* { dg-warning "double-'free' of 'q'" "warning" } */
9 /* { dg-message "\\(3\\) first 'free' here \\(fndecl 'foo', depth 2\\)" "1st free message" { target c } .-1 } */
10 /* { dg-message "\\(3\\) first 'free' here \\(fndecl 'void foo\\(void\\*\\)', depth 2\\)" "1st free message" { target c++ } .-2 } */
11 /* { dg-message "\\(5\\) second 'free' here; first 'free' was at \\(3\\) \\(fndecl 'foo', depth 2\\)" "2nd free message" { target c } .-3 } */
12 /* { dg-message "\\(5\\) second 'free' here; first 'free' was at \\(3\\) \\(fndecl 'void foo\\(void\\*\\)', depth 2\\)" "2nd free message" { target c++ } .-4 } */
13 }
14
15 void bar (void *q) /* { dg-message "\\(1\\) entry to 'bar' \\(fndecl 'bar', depth 1\\)" "" { target c } } */
16 /* { dg-message "\\(1\\) entry to 'bar' \\(fndecl 'void bar\\(void\\*\\)', depth 1\\)" "" { target c++ } .-1 } */
17 {
18 foo (q); /* { dg-message "\\(2\\) inlined call to 'foo' from 'bar' \\(fndecl 'bar', depth 1\\)" "" { target c } } */
19 /* { dg-message "\\(2\\) inlined call to 'foo' from 'bar' \\(fndecl 'void bar\\\(void\\*\\)', depth 1\\)" "" { target c++ } .-1 } */
20 foo (q); /* { dg-message "\\(4\\) inlined call to 'foo' from 'bar' \\(fndecl 'bar', depth 1\\)" "" { target c } } */
21 /* { dg-message "\\(4\\) inlined call to 'foo' from 'bar' \\(fndecl 'void bar\\\(void\\*\\)', depth 1\\)" "" { target c++ } .-1 } */
22 }