| 1 |
/* Verify using -fdiagnostics-add-output=sarif with the defaults. */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-additional-options "-fdiagnostics-add-output=sarif" } */ |
| 5 |
|
| 6 |
/* Verify that SARIF output can capture secondary locations |
| 7 |
relating to a diagnostic. */ |
| 8 |
|
| 9 |
int missing_semicolon (void) |
| 10 |
{ |
| 11 |
return 42 /* { dg-error "expected ';' before '.' token" } */ |
| 12 |
} |
| 13 |
|
| 14 |
/* Verify that JSON was written to the output file with the |
| 15 |
expected version and expected name: |
| 16 |
{ dg-final { verify-sarif-file "2.1" } } */ |