ident-0b.c: Also skip on 32-bit hppa*-*-hpux*.
[gcc.git] / gcc / testsuite / c-c++-common / diagnostic-format-json-4.c
1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-format=json -Wmisleading-indentation" } */
3
4 int test (void)
5 {
6 if (1)
7 return 3;
8 return 4;
9 return 5;
10 }
11
12 /* Use dg-regexp to consume the JSON output starting with
13 the innermost values, and working outwards.
14 We can't rely on any ordering of the keys. */
15
16 /* Verify nested diagnostics. */
17
18 /* The nested diagnostic. */
19
20 /* { dg-regexp "\"kind\": \"note\"" } */
21 /* { dg-regexp "\"message\": \"...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'\"" } */
22
23 /* { dg-regexp "\"caret\": \{" } */
24 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
25 /* { dg-regexp "\"line\": 8" } */
26 /* { dg-regexp "\"column\": 5" } */
27
28 /* { dg-regexp "\"finish\": \{" } */
29 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
30 /* { dg-regexp "\"line\": 8" } */
31 /* { dg-regexp "\"column\": 10" } */
32
33 /* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
34
35 /* The outer diagnostic. */
36
37 /* { dg-regexp "\"kind\": \"warning\"" } */
38 /* { dg-regexp "\"message\": \"this 'if' clause does not guard...\"" } */
39 /* { dg-regexp "\"option\": \"-Wmisleading-indentation\"" } */
40
41 /* { dg-regexp "\"caret\": \{" } */
42 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
43 /* { dg-regexp "\"line\": 6" } */
44 /* { dg-regexp "\"column\": 3" } */
45
46 /* { dg-regexp "\"finish\": \{" } */
47 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-4.c\"" } */
48 /* { dg-regexp "\"line\": 6" } */
49 /* { dg-regexp "\"column\": 4" } */
50
51 /* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
52
53 /* { dg-regexp "\"children\": \[\[\{\}, \]*\]" } */
54 /* { dg-regexp "\[\[\{\}, \]*\]" } */
55