File: diagnostic-format-sarif-file-valid-CP850.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (22 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Adapted from gcc.dg/diagnostic-input-charset-1.c  */
/* { dg-do compile } */
/* { dg-require-iconv "CP850" } */
/* { dg-options "-finput-charset=CP850 -fdiagnostics-format=sarif-file" } */
/* { dg-excess-errors "The error is sent to the SARIF file, rather than stderr" } */

/* Test that diagnostics are converted to UTF-8; this file is encoded in
   CP850.

   The non-ASCII byte here is 0xf5, which when decoded as CP850
   is U+00A7 SECTION SIGN  */
const char *section = ""

/* 
   { dg-final { verify-sarif-file } }

   Verify that we captured the expected warning, and converted the snippet to
   UTF-8 on output.

   { dg-final { scan-sarif-file {"text": "expected ',' or ';' at end of input"} } }
   { dg-final { scan-sarif-file {"text": "const char .section = \\"\u00a7\\"} } }
*/