aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.c
blob: f0f31d01fef9c67b8c8353cbba1359bd531c2da2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-fdiagnostics-format=sarif-file" } */

extern void acquire_lock_a(void);
extern void acquire_lock_b(void);

void foo ()
{
  acquire_lock_a ();
  acquire_lock_b ();
}

void bar ()
{
  acquire_lock_b ();
  acquire_lock_a ();
}

/* Verify that some JSON was written to a file with the expected name.  */
/* { dg-final { verify-sarif-file } } */

/* Use a Python script to verify various properties about the generated
   .sarif file:
   { dg-final { run-sarif-pytest diagnostic-test-paths-multithreaded-sarif.c "diagnostic-test-paths-multithreaded-sarif.py" } } */