1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-format=json" } */
3
4 #error message
5
6 /* Use dg-regexp to consume the JSON output starting with
7 the innermost values, and working outwards. */
8
9 /* { dg-regexp "\"kind\": \"error\"" } */
10 /* { dg-regexp "\"column-origin\": 1" } */
11 /* { dg-regexp "\"escape-source\": false" } */
12 /* { dg-regexp "\"message\": \"#error message\"" } */
13
14 /* { dg-regexp "\"caret\": \{" } */
15 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.c\"" } */
16 /* { dg-regexp "\"line\": 4" } */
17 /* { dg-regexp "\"column\": 2" } */
18 /* { dg-regexp "\"display-column\": 2" } */
19 /* { dg-regexp "\"byte-column\": 2" } */
20
21 /* { dg-regexp "\"finish\": \{" } */
22 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-1.c\"" } */
23 /* { dg-regexp "\"line\": 4" } */
24 /* { dg-regexp "\"column\": 6" } */
25 /* { dg-regexp "\"display-column\": 6" } */
26 /* { dg-regexp "\"byte-column\": 6" } */
27
28 /* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
29 /* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
30 /* { dg-regexp "\[\[\{\}, \]*\]" } */