| 1 |
/* Verify that colorization affects both text within diagnostic messages |
| 2 |
and underlined ranges of quoted source, and that the types we use |
| 3 |
match up between them. */ |
| 4 |
|
| 5 |
/* { dg-do compile } */ |
| 6 |
/* { dg-options "-Wformat -fdiagnostics-show-caret -fdiagnostics-color=always" } */ |
| 7 |
|
| 8 |
#include "format.h" |
| 9 |
|
| 10 |
void test_mismatching_types (const char *msg) |
| 11 |
{ |
| 12 |
printf("hello %i", msg); |
| 13 |
|
| 14 |
/* { dg-begin-multiline-output "" } |
| 15 |
warning: [m[Kformat '[01m[K[01;32m[K%i[m[K[m[K' expects argument of type '[01m[K[01;32m[Kint[m[K[m[K', but argument 2 has type '[01m[K[01;34m[Kconst char *[m[K[m[K' [[01;35m[K-Wformat=[m[K] |
| 16 |
{ dg-end-multiline-output "" } */ |
| 17 |
/* { dg-begin-multiline-output "" } |
| 18 |
printf("hello [01;32m[K%[m[K[01;32m[Ki[m[K", [01;34m[Km[m[K[01;34m[Ks[m[K[01;34m[Kg[m[K); |
| 19 |
[01;32m[K~[m[K[01;32m[K^[m[K [01;34m[K~[m[K[01;34m[K~[m[K[01;34m[K~[m[K |
| 20 |
[01;32m[K|[m[K [01;34m[K|[m[K |
| 21 |
[01;32m[Kint[m[K [01;34m[Kconst char *[m[K |
| 22 |
[32m[K%s[m[K |
| 23 |
{ dg-end-multiline-output "" } */ |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-prune-output "In function" } */ |
| 27 |
/* { dg-prune-output "colors.c" } */ |