1 /* As per inlining-1.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 void foo (void *p)
8 {
9 __builtin_free (p); /* { dg-warning "double-'free' of 'q'" "warning" } */
10 }
11
12 void bar (void *q)
13 {
14 foo (q);
15 foo (q);
16 }
17
18 /* { dg-begin-multiline-output "" }
19 __builtin_free (p);
20 ^~~~~~~~~~~~~~~~~~
21 'bar': events 1-2 (depth 1)
22 |
23 | void bar (void *q)
24 | ^~~
25 | |
26 | (1) entry to 'bar'
27 |
28 | foo (q);
29 | ~
30 | |
31 | (2) inlined call to 'foo' from 'bar'
32 |
33 +--> 'foo': event 3 (depth 2)
34 |
35 | __builtin_free (p);
36 | ^~~~~~~~~~~~~~~~~~
37 | |
38 | (3) first 'free' here
39 |
40 <------+
41 |
42 'bar': event 4 (depth 1)
43 |
44 | foo (q);
45 | ^
46 | |
47 | (4) inlined call to 'foo' from 'bar'
48 |
49 +--> 'foo': event 5 (depth 2)
50 |
51 | __builtin_free (p);
52 | ^~~~~~~~~~~~~~~~~~
53 | |
54 | (5) second 'free' here; first 'free' was at (3)
55 |
56 { dg-end-multiline-output "" } */