| 1 |
/* Verify colorization of event links (using ASCII). |
| 2 |
C only: we don't care about any C/C++ differences between source |
| 3 |
locations here. */ |
| 4 |
|
| 5 |
/* { dg-additional-options "-fdiagnostics-path-format=inline-events" } */ |
| 6 |
/* { dg-additional-options "-fdiagnostics-show-line-numbers" } */ |
| 7 |
/* { dg-additional-options "-fdiagnostics-show-caret" } */ |
| 8 |
/* { dg-additional-options "-fdiagnostics-show-event-links" } */ |
| 9 |
/* { dg-additional-options "-fdiagnostics-color=always" } */ |
| 10 |
/* { dg-enable-nn-line-numbers "" } */ |
| 11 |
|
| 12 |
void test (int flag_a, int val, void *p) |
| 13 |
{ |
| 14 |
if (flag_a) |
| 15 |
__builtin_free (p); |
| 16 |
switch (val) |
| 17 |
{ |
| 18 |
default: |
| 19 |
break; |
| 20 |
case 41: |
| 21 |
break; |
| 22 |
case 42: |
| 23 |
__builtin_free (p); |
| 24 |
break; |
| 25 |
case 43: |
| 26 |
break; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-begin-multiline-output "" } |
| 31 |
NN | [01;35m[K__builtin_free (p)[m[K; |
| 32 |
| [01;35m[K^~~~~~~~~~~~~~~~~~[m[K |
| 33 |
'[01m[Ktest[m[K': events 1-6 |
| 34 |
NN | if [01;36m[K([m[Kflag_a) |
| 35 |
| [01;36m[K^[m[K |
| 36 |
| [01;36m[K|[m[K |
| 37 |
| [01;36m[K(1)[m[K following '[01m[Ktrue[m[K' branch (when '[01m[Kflag_a != 0[m[K')...[01;36m[K ->-+[m[K |
| 38 |
| [01;36m[K|[m[K |
| 39 |
| [01;36m[K|[m[K |
| 40 |
|[01;36m[K+[m[K[01;36m[K------------------------------------------------------------+[m[K |
| 41 |
NN |[01;36m[K|[m[K [01;36m[K__builtin_free (p)[m[K; |
| 42 |
|[01;36m[K|[m[K [01;36m[K~~~~~~~~~~~~~~~~~~[m[K |
| 43 |
|[01;36m[K|[m[K [01;36m[K|[m[K |
| 44 |
|[01;36m[K+[m[K[01;36m[K--->[m[K[01;36m[K(2)[m[K ...to here |
| 45 |
| [01;36m[K(3)[m[K first '[01m[Kfree[m[K' here |
| 46 |
NN | [01;36m[Kswitch[m[K (val) |
| 47 |
| [01;36m[K~~~~~~[m[K |
| 48 |
| [01;36m[K|[m[K |
| 49 |
| [01;36m[K(4)[m[K following '[01m[Kcase 42:[m[K' branch...[01;36m[K ->-+[m[K |
| 50 |
| [01;36m[K|[m[K |
| 51 |
...... |
| 52 |
| [01;36m[K|[m[K |
| 53 |
|[01;36m[K+[m[K[01;36m[K----------------------------------------+[m[K |
| 54 |
NN |[01;36m[K|[m[K [01;36m[Kcase[m[K 42: |
| 55 |
|[01;36m[K|[m[K [01;36m[K~~~~[m[K |
| 56 |
|[01;36m[K|[m[K [01;36m[K|[m[K |
| 57 |
|[01;36m[K+[m[K[01;36m[K--->[m[K[01;36m[K(5)[m[K ...to here |
| 58 |
NN | [01;36m[K__builtin_free (p)[m[K; |
| 59 |
| [01;36m[K~~~~~~~~~~~~~~~~~~[m[K |
| 60 |
| [01;36m[K|[m[K |
| 61 |
| [01;36m[K(6)[m[K second '[01m[Kfree[m[K' here; first '[01m[Kfree[m[K' was at [01;36m[K(3)[m[K |
| 62 |
{ dg-end-multiline-output "" } */ |
| 63 |
|
| 64 |
/* DejaGnu won't recognize the warning due to the colorization codes, |
| 65 |
so skip it. */ |
| 66 |
/* { dg-prune-output ".*" } */ |