Debian Codegraph @

gcc/testsuite/gcc.dg/bad-binary-ops-highlight-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 Also implicitly verify that -fdiagnostics-show-highlight-colors is
5 on by default. */
6
7 /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-color=always" } */
8
9 struct s {};
10 struct t {};
11 typedef struct s S;
12 typedef struct t T;
13
14 extern S callee_4a (void);
15 extern T callee_4b (void);
16
17 int test_4 (void)
18 {
19 return callee_4a () + callee_4b ();
20
21 /* { dg-begin-multiline-output "" }
22  error: invalid operands to binary + (have 'S' {aka 'struct s'} and 'T' {aka 'struct t'})
23 { dg-end-multiline-output "" } */
24
25 /* { dg-begin-multiline-output "" }
26 return callee_4a () + callee_4b ();
27 ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
28 | |
29 | T {aka struct t}
30 S {aka struct s}
31 { dg-end-multiline-output "" } */
32
33 /* { dg-prune-output "In function" } */
34 /* { dg-prune-output "bad-binary-ops-highlight-colors.c" } */
35 }