blob: b981cf9268ade788f5bcb9b291af607a17b199b9 (
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
25
26
27
28
29
30
31
32
33
34
35
|
/* { dg-additional-options "-fdiagnostics-add-output=sarif:state-graphs=yes" } */
#include "analyzer-decls.h"
struct foo
{
int m_ints[4];
};
struct bar
{
struct foo m_foos[3];
int m_int;
char m_ch;
};
struct baz
{
struct bar m_bars[2];
struct foo m_foos[5];
};
void test (void)
{
struct baz baz_arr[2];
baz_arr[1].m_bars[1].m_foos[2].m_ints[1] = 42;
__analyzer_dump_path (); /* { dg-message "path" } */
}
/* 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 state-diagram-5-sarif.c "state-diagram-5-sarif.py" } } */
|