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