1 /* As per inlining-2.c, but testing how the ASCII art version of
2 the path looks. */
3
4 /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
5 /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
6
7 static void __analyzer_foo (void *p)
8 {
9 __builtin_free (p);
10
11 __builtin_free (p); /* { dg-warning "double-'free' of 'q'" "warning" } */
12 }
13
14 void bar (void *q)
15 {
16 __analyzer_foo (q);
17 }
18
19 /* { dg-begin-multiline-output "" }
20 __builtin_free (p);
21 ^~~~~~~~~~~~~~~~~~
22 'bar': events 1-2 (depth 1)
23 |
24 | void bar (void *q)
25 | ^~~
26 | |
27 | (1) entry to 'bar'
28 |
29 | __analyzer_foo (q);
30 | ~
31 | |
32 | (2) inlined call to '__analyzer_foo' from 'bar'
33 |
34 +--> '__analyzer_foo': events 3-4 (depth 2)
35 |
36 | __builtin_free (p);
37 | ^~~~~~~~~~~~~~~~~~
38 | |
39 | (3) first 'free' here
40 |
41 | __builtin_free (p);
42 | ~~~~~~~~~~~~~~~~~~
43 | |
44 | (4) second 'free' here; first 'free' was at (3)
45 |
46 { dg-end-multiline-output "" } */