Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/event-links-color.c

raw
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 | __builtin_free (p);
32 | ^~~~~~~~~~~~~~~~~~
33 'test': events 1-6
34 NN | if (flag_a)
35 | ^
36 | |
37 | (1) following 'true' branch (when 'flag_a != 0')... ->-+
38 | |
39 | |
40 |+------------------------------------------------------------+
41 NN || __builtin_free (p);
42 || ~~~~~~~~~~~~~~~~~~
43 || |
44 |+--->(2) ...to here
45 | (3) first 'free' here
46 NN | switch (val)
47 | ~~~~~~
48 | |
49 | (4) following 'case 42:' branch... ->-+
50 | |
51 ......
52 | |
53 |+----------------------------------------+
54 NN || case 42:
55 || ~~~~
56 || |
57 |+--->(5) ...to here
58 NN | __builtin_free (p);
59 | ~~~~~~~~~~~~~~~~~~
60 | |
61 | (6) second 'free' here; first 'free' was at (3)
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 ".*" } */