xref: /llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot (revision b5147937b2a9ffdc12110a5df5ba4d482f83d2a8)
1// RUN: %exploded_graph_rewriter -d %s | FileCheck %s
2
3// No diffs on the first node, nothing to check.
4Node0x1 [shape=record,label=
5 "{
6    {
7      "state_id": 2,
8      "program_points": [
9        {
10          "kind": "BlockEntrance", "block_id": 1,
11          "terminator": null, "term_kind": null,
12          "tag": null, "node_id": 1,
13          "has_report": 0, "is_sink": 0
14        }
15      ],
16      "program_state": {
17        "store": null,
18        "constraints": null,
19        "dynamic_types": null,
20        "checker_messages": null,
21        "environment": {
22          "pointer": "0x2",
23          "items": [
24            {
25              "location_context": "#0 Call",
26              "lctx_id": 3,
27              "calling": "foo",
28              "location": null,
29              "items": [
30                {
31                  "stmt_id": 5,
32                  "pretty": "bar()",
33                  "value": "Unknown"
34                }
35              ]
36            }
37          ]
38        }
39      }
40    }
41\l}"];
42
43Node0x1 -> Node0x6;
44
45// CHECK: Node0x6 [
46// CHECK-SAME: <tr>
47// CHECK-SAME:   <td><font color="red">-</font></td>
48// CHECK-SAME:   <td align="left"><i>S5</i></td>
49// CHECK-SAME:   <td align="left">bar()</td>
50// CHECK-SAME:   <td align="left">Unknown</td>
51// CHECK-SAME: </tr>
52// CHECK-SAME: <tr>
53// CHECK-SAME:   <td><font color="forestgreen">+</font></td>
54// CHECK-SAME:   <td align="left"><i>S9</i></td>
55// CHECK-SAME:   <td align="left">baz()</td>
56// CHECK-SAME:   <td align="left">Undefined</td>
57// CHECK-SAME: </tr>
58Node0x6 [shape=record,label=
59 "{
60    {
61      "state_id": 7,
62      "program_points": [
63        {
64          "kind": "BlockEntrance", "block_id": 1,
65          "terminator": null, "term_kind": null,
66          "tag": null, "node_id": 1,
67          "has_report": 0, "is_sink": 0
68        }
69      ],
70      "program_state": {
71        "store": null,
72        "constraints": null,
73        "dynamic_types": null,
74        "checker_messages": null,
75        "environment": {
76          "pointer": "0x2",
77          "items": [
78            {
79              "location_context": "#0 Call",
80              "lctx_id": 3,
81              "calling": "foo",
82              "location": null,
83              "items": [
84                {
85                  "stmt_id": 9,
86                  "pretty": "baz()",
87                  "value": "Undefined"
88                }
89              ]
90            }
91          ]
92        }
93      }
94    }
95\l}"];
96
97Node0x6 -> Node0x9;
98// Make sure that the last node in the path is not diffed.
99// CHECK: Node0x9 [
100// CHECK-SAME: <tr>
101// CHECK-SAME:   <td></td>
102// CHECK-SAME:   <td align="left"><i>S9</i></td>
103// CHECK-SAME:   <td align="left">baz()</td>
104// CHECK-SAME:   <td align="left">Undefined</td>
105// CHECK-SAME: </tr>
106Node0x9 [shape=record,label=
107 "{
108    {
109      "state_id": 7,
110      "program_points": [
111        {
112          "kind": "BlockEntrance", "block_id": 1,
113          "terminator": null, "term_kind": null,
114          "tag": null, "node_id": 1,
115          "has_report": 0, "is_sink": 0
116        }
117      ],
118      "program_state": {
119        "store": null,
120        "constraints": null,
121        "dynamic_types": null,
122        "checker_messages": null,
123        "environment": {
124          "pointer": "0x2",
125          "items": [
126            {
127              "location_context": "#0 Call",
128              "lctx_id": 3,
129              "calling": "foo",
130              "location": null,
131              "items": [
132                {
133                  "stmt_id": 9,
134                  "pretty": "baz()",
135                  "value": "Undefined"
136                }
137              ]
138            }
139          ]
140        }
141      }
142    }
143\l}"];
144