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