| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fdiagnostics-format=sarif-file" } */ |
| 3 |
|
| 4 |
extern void acquire_lock_a(void); |
| 5 |
extern void acquire_lock_b(void); |
| 6 |
|
| 7 |
void foo () |
| 8 |
{ |
| 9 |
acquire_lock_a (); |
| 10 |
acquire_lock_b (); |
| 11 |
} |
| 12 |
|
| 13 |
void bar () |
| 14 |
{ |
| 15 |
acquire_lock_b (); |
| 16 |
acquire_lock_a (); |
| 17 |
} |
| 18 |
|
| 19 |
/* Verify that some JSON was written to a file with the expected name. */ |
| 20 |
/* { dg-final { verify-sarif-file } } */ |
| 21 |
|
| 22 |
/* Use a Python script to verify various properties about the generated |
| 23 |
.sarif file: |
| 24 |
{ dg-final { run-sarif-pytest diagnostic-test-paths-multithreaded-sarif.c "diagnostic-test-paths-multithreaded-sarif.py" } } */ |