Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/sarif-path-role.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options " -fno-diagnostics-json-formatting -fdiagnostics-format=sarif-file" } */
3 /* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */
4
5 #include <stdlib.h>
6
7 void test_1 (void)
8 {
9 void *ptr = malloc (1024);
10 #include "sarif-path-role.h"
11 free (ptr);
12 }
13
14 /* Verify SARIF output.
15
16 { dg-final { verify-sarif-file } }
17
18 Verify that the artifact for the header has this role, given
19 that it's only referenced by an execution path event.
20
21 { dg-final { scan-sarif-file "\"roles\": \\\[\"tracedFile\"\\\]" } }
22 */