Debian Codegraph @

gcc/testsuite/gcc.dg/format/colors.c

raw
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: format '%i' expects argument of type 'int', but argument 2 has type 'const char *' [-Wformat=]
16 { dg-end-multiline-output "" } */
17 /* { dg-begin-multiline-output "" }
18 printf("hello %i", msg);
19 ~^ ~~~
20 | |
21 int const char *
22 %s
23 { dg-end-multiline-output "" } */
24 }
25
26 /* { dg-prune-output "In function" } */
27 /* { dg-prune-output "colors.c" } */