| 1 |
/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-add-output=sarif" } */ |
| 2 |
|
| 3 |
struct s {}; |
| 4 |
struct t {}; |
| 5 |
|
| 6 |
typedef struct s S; |
| 7 |
typedef struct t T; |
| 8 |
|
| 9 |
extern S callee_4a (void); |
| 10 |
extern T callee_4b (void); |
| 11 |
|
| 12 |
int test_4 (void) |
| 13 |
{ |
| 14 |
return callee_4a () + callee_4b (); /* { dg-error "invalid operands to binary \+" } */ |
| 15 |
|
| 16 |
/* { dg-begin-multiline-output "" } |
| 17 |
return callee_4a () + callee_4b (); |
| 18 |
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ |
| 19 |
| | |
| 20 |
| T {aka struct t} |
| 21 |
S {aka struct s} |
| 22 |
{ dg-end-multiline-output "" } */ |
| 23 |
} |
| 24 |
|
| 25 |
/* Verify that some JSON was written to a file with the expected name. */ |
| 26 |
/* { dg-final { verify-sarif-file } } */ |
| 27 |
|
| 28 |
/* Use a Python script to verify various properties about the generated |
| 29 |
.sarif file: |
| 30 |
{ dg-final { run-sarif-pytest bad-binary-op.c "bad-binary-op.py" } } */ |