aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/plugin/diagnostic-test-nesting-sarif.c
blob: 11d9933da248925c3ebc2894c562501b5d20f578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-fdiagnostics-add-output=sarif" } */

extern void foo (void);

void test_nesting (void)
{
  foo (); /* { dg-error "top-level error" } */
}

/* 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-nesting-sarif.c "diagnostic-test-nesting-sarif.py" } } */