PR libstdc++/87308 adjust regex used in std::any pretty printer
[official-gcc.git] / gcc / testsuite / c-c++-common / diagnostic-format-json-5.c
blobf36e896d228bbfa4b0186779ba75651c67ec4132
1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-format=json" } */
4 struct s { int color; };
6 int test (struct s *ptr)
8 return ptr->colour;
11 /* Use dg-regexp to consume the JSON output starting with
12 the innermost values, and working outwards.
13 We can't rely on any ordering of the keys. */
15 /* { dg-regexp "\"kind\": \"error\"" } */
16 /* { dg-regexp "\"message\": \".*\"" } */
18 /* Verify fix-it hints. */
20 /* { dg-regexp "\"string\": \"color\"" } */
22 /* { dg-regexp "\"start\": \{" } */
23 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
24 /* { dg-regexp "\"line\": 8" } */
25 /* { dg-regexp "\"column\": 15" } */
27 /* { dg-regexp "\"next\": \{" } */
28 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
29 /* { dg-regexp "\"line\": 8" } */
30 /* { dg-regexp "\"column\": 21" } */
32 /* { dg-regexp "\"fixits\": \[\[\{\}, \]*\]" } */
34 /* { dg-regexp "\"caret\": \{" } */
35 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
36 /* { dg-regexp "\"line\": 8" } */
37 /* { dg-regexp "\"column\": 15" } */
39 /* { dg-regexp "\"finish\": \{" } */
40 /* { dg-regexp "\"file\": \"\[^\n\r\"\]*diagnostic-format-json-5.c\"" } */
41 /* { dg-regexp "\"line\": 8" } */
42 /* { dg-regexp "\"column\": 20" } */
44 /* { dg-regexp "\"locations\": \[\[\{\}, \]*\]" } */
45 /* { dg-regexp "\"children\": \[\[\]\[\]\]" } */
46 /* { dg-regexp "\[\[\{\}, \]*\]" } */