| 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 "" { target c } } */ |
| 57 |
/* { dg-begin-multiline-output "" } |
| 58 |
__builtin_free (p); |
| 59 |
~~~~~~~~~~~~~~~^~~ |
| 60 |
'void bar(void*)': events 1-2 (depth 1) |
| 61 |
| |
| 62 |
| void bar (void *q) |
| 63 |
| ^~~ |
| 64 |
| | |
| 65 |
| (1) entry to 'bar' |
| 66 |
| |
| 67 |
| foo (q); |
| 68 |
| ~ |
| 69 |
| | |
| 70 |
| (2) inlined call to 'foo' from 'bar' |
| 71 |
| |
| 72 |
+--> 'void foo(void*)': event 3 (depth 2) |
| 73 |
| |
| 74 |
| __builtin_free (p); |
| 75 |
| ~~~~~~~~~~~~~~~^~~ |
| 76 |
| | |
| 77 |
| (3) first 'free' here |
| 78 |
| |
| 79 |
<------+ |
| 80 |
| |
| 81 |
'void bar(void*)': event 4 (depth 1) |
| 82 |
| |
| 83 |
| foo (q); |
| 84 |
| ^ |
| 85 |
| | |
| 86 |
| (4) inlined call to 'foo' from 'bar' |
| 87 |
| |
| 88 |
+--> 'void foo(void*)': event 5 (depth 2) |
| 89 |
| |
| 90 |
| __builtin_free (p); |
| 91 |
| ~~~~~~~~~~~~~~~^~~ |
| 92 |
| | |
| 93 |
| (5) second 'free' here; first 'free' was at (3) |
| 94 |
| |
| 95 |
{ dg-end-multiline-output "" { target c++ } } */ |