(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
diagnostic-format-sarif-file-bad-utf8-pr109098-2.c
       1  /* Try to process this explicitly as UTF-8.  */
       2  
       3  /* { dg-do compile } */
       4  /* { dg-options "-finput-charset=utf-8 -fdiagnostics-format=sarif-file" } */
       5  /* { dg-excess-errors "The error is sent to the SARIF file, rather than stderr" } */
       6  
       7  const char *section = ""
       8  
       9  /* The above in quotes is byte 0xFE which is not valid in UTF-8.
      10     Verify that we can generate a valid UTF-8 .sarif file complaining
      11     about the missing semicolon above.  */
      12  
      13  /* { dg-final { verify-sarif-file } }
      14  
      15       { dg-final { scan-sarif-file {"text": "expected ',' or ';' at end of input"} } }
      16  */