| 1 |
/* Verify that we can output multiple different versions of SARIF |
| 2 |
with -fdiagnostics-add-output (specifying version and filename), |
| 3 |
as well as usual text output. */ |
| 4 |
|
| 5 |
/* { dg-do compile } */ |
| 6 |
/* { dg-additional-options "-fdiagnostics-add-output=sarif:file=multiple-outputs-c.2.1.sarif,version=2.1" } */ |
| 7 |
/* { dg-additional-options "-fdiagnostics-add-output=sarif:file=multiple-outputs-c.2.2.sarif,version=2.2-prerelease" } */ |
| 8 |
|
| 9 |
/* Verify that SARIF output can capture secondary locations |
| 10 |
relating to a diagnostic. */ |
| 11 |
|
| 12 |
int missing_semicolon (void) |
| 13 |
{ |
| 14 |
return 42 /* { dg-error "expected ';' before '.' token" } */ |
| 15 |
} |
| 16 |
|
| 17 |
/* Verify that JSON was written to the output files with the |
| 18 |
expected version and expected names: |
| 19 |
{ dg-final { verify-sarif-file "2.1" "multiple-outputs-c.2.1.sarif" } } |
| 20 |
{ dg-final { verify-sarif-file "2.2" "multiple-outputs-c.2.2.sarif" } } |
| 21 |
*/ |
| 22 |
|
| 23 |
/* Use a Python script to verify various properties about the generated |
| 24 |
.sarif files: |
| 25 |
{ dg-final { run-sarif-pytest multiple-outputs-c.2.1 "multiple-outputs.py" } } |
| 26 |
{ dg-final { run-sarif-pytest multiple-outputs-c.2.2 "multiple-outputs.py" } } |
| 27 |
*/ |