| 1 |
/* As per inlining-6.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); |
| 11 |
} |
| 12 |
|
| 13 |
static inline void |
| 14 |
middle (void *q) |
| 15 |
{ |
| 16 |
inner (q); |
| 17 |
__builtin_free (q); /* { dg-warning "double-'free' of 'r'" } */ |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
outer (void *r) |
| 22 |
{ |
| 23 |
middle (r); |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-begin-multiline-output "" } |
| 27 |
__builtin_free (q); |
| 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': event 3 (depth 2) |
| 42 |
| |
| 43 |
| inner (q); |
| 44 |
| ^ |
| 45 |
| | |
| 46 |
| (3) inlined call to 'inner' from 'middle' |
| 47 |
| |
| 48 |
+--> 'inner': event 4 (depth 3) |
| 49 |
| |
| 50 |
| __builtin_free (p); |
| 51 |
| ^~~~~~~~~~~~~~~~~~ |
| 52 |
| | |
| 53 |
| (4) first 'free' here |
| 54 |
| |
| 55 |
<------+ |
| 56 |
| |
| 57 |
'middle': event 5 (depth 2) |
| 58 |
| |
| 59 |
| __builtin_free (q); |
| 60 |
| ^~~~~~~~~~~~~~~~~~ |
| 61 |
| | |
| 62 |
| (5) second 'free' here; first 'free' was at (4) |
| 63 |
| |
| 64 |
{ dg-end-multiline-output "" { target c } } */ |
| 65 |
/* { dg-begin-multiline-output "" } |
| 66 |
__builtin_free (q); |
| 67 |
~~~~~~~~~~~~~~~^~~ |
| 68 |
'void outer(void*)': events 1-2 (depth 1) |
| 69 |
| |
| 70 |
| outer (void *r) |
| 71 |
| ^~~~~ |
| 72 |
| | |
| 73 |
| (1) entry to 'outer' |
| 74 |
| |
| 75 |
| middle (r); |
| 76 |
| ~ |
| 77 |
| | |
| 78 |
| (2) inlined call to 'middle' from 'outer' |
| 79 |
| |
| 80 |
+--> 'void middle(void*)': event 3 (depth 2) |
| 81 |
| |
| 82 |
| inner (q); |
| 83 |
| ^ |
| 84 |
| | |
| 85 |
| (3) inlined call to 'inner' from 'middle' |
| 86 |
| |
| 87 |
+--> 'void inner(void*)': event 4 (depth 3) |
| 88 |
| |
| 89 |
| __builtin_free (p); |
| 90 |
| ~~~~~~~~~~~~~~~^~~ |
| 91 |
| | |
| 92 |
| (4) first 'free' here |
| 93 |
| |
| 94 |
<------+ |
| 95 |
| |
| 96 |
'void middle(void*)': event 5 (depth 2) |
| 97 |
| |
| 98 |
| __builtin_free (q); |
| 99 |
| ~~~~~~~~~~~~~~~^~~ |
| 100 |
| | |
| 101 |
| (5) second 'free' here; first 'free' was at (4) |
| 102 |
| |
| 103 |
{ dg-end-multiline-output "" { target c++ } } */ |