(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
diagnostic-format-sarif-file-valid-CP850.c
       1  /* Adapted from gcc.dg/diagnostic-input-charset-1.c  */
       2  /* { dg-do compile } */
       3  /* { dg-require-iconv "CP850" } */
       4  /* { dg-options "-finput-charset=CP850 -fdiagnostics-format=sarif-file" } */
       5  /* { dg-excess-errors "The error is sent to the SARIF file, rather than stderr" } */
       6  
       7  /* Test that diagnostics are converted to UTF-8; this file is encoded in
       8     CP850.
       9  
      10     The non-ASCII byte here is 0xf5, which when decoded as CP850
      11     is U+00A7 SECTION SIGN  */
      12  const char *section = ""
      13  
      14  /* 
      15     { dg-final { verify-sarif-file } }
      16  
      17     Verify that we captured the expected warning, and converted the snippet to
      18     UTF-8 on output.
      19  
      20     { dg-final { scan-sarif-file {"text": "expected ',' or ';' at end of input"} } }
      21     { dg-final { scan-sarif-file {"text": "const char .section = \\"\u00a7\\"} } }
      22  */