summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/exploded-graph-rewriter
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-06-25 02:16:53 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-06-25 02:16:53 +0000
commitbeb85ad66de5af11e45bae236a3dd5a6a4762150 (patch)
tree49433d897ee48c183699cb06861ab1894a663b5d /clang/test/Analysis/exploded-graph-rewriter
parentb9c94f946f2ca45734af666d6afba0234b21411b (diff)
downloadbcm5719-llvm-beb85ad66de5af11e45bae236a3dd5a6a4762150.tar.gz
bcm5719-llvm-beb85ad66de5af11e45bae236a3dd5a6a4762150.zip
[analyzer] exploded-graph-rewriter: Add support for range constraints.
Diff support included. A cheap solution is implemented that treats range constraints as "some sort of key-value map", so it's going to be trivial to add support for other such maps later, such as dynamic type info. Differential Revision: https://reviews.llvm.org/D63685 llvm-svn: 364268
Diffstat (limited to 'clang/test/Analysis/exploded-graph-rewriter')
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/constraints.dot27
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot65
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/environment.dot1
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot3
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/store.dot1
-rw-r--r--clang/test/Analysis/exploded-graph-rewriter/store_diff.dot2
6 files changed, 99 insertions, 0 deletions
diff --git a/clang/test/Analysis/exploded-graph-rewriter/constraints.dot b/clang/test/Analysis/exploded-graph-rewriter/constraints.dot
new file mode 100644
index 00000000000..f9ffde74316
--- /dev/null
+++ b/clang/test/Analysis/exploded-graph-rewriter/constraints.dot
@@ -0,0 +1,27 @@
+// RUN: %exploded_graph_rewriter %s | FileCheck %s
+
+// FIXME: Substitution doesn't seem to work on Windows.
+// UNSUPPORTED: system-windows
+
+// CHECK: <tr><td align="left"><b>Ranges: </b></td></tr>
+// CHECK-SAME: <tr><td align="left"><table border="0">
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td align="left">reg_$0<x></td>
+// CHECK-SAME: <td align="left">\{ [0, 0] \}</td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: </table></td></tr>
+Node0x1 [shape=record,label=
+ "{
+ { "node_id": 1,
+ "pointer": "0x1",
+ "state_id": 2,
+ "program_points": [],
+ "program_state": {
+ "store": null,
+ "environment": null,
+ "constraints": [
+ { "symbol": "reg_$0<x>", "range": "{ [0, 0] }" }
+ ]
+ }
+ }
+\l}"];
diff --git a/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot
new file mode 100644
index 00000000000..a65a3a2464c
--- /dev/null
+++ b/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot
@@ -0,0 +1,65 @@
+// RUN: %exploded_graph_rewriter -d %s | FileCheck %s
+
+// FIXME: Substitution doesn't seem to work on Windows.
+// UNSUPPORTED: system-windows
+
+Node0x1 [shape=record,label=
+ "{
+ { "node_id": 1,
+ "pointer": "0x1",
+ "state_id": 2,
+ "program_points": [],
+ "program_state": {
+ "store": null,
+ "environment": null,
+ "constraints": [
+ { "symbol": "reg_$0<x>", "range": "{ [0, 10] }" }
+ ]
+ }
+ }
+\l}"];
+
+Node0x1 -> Node0x3;
+
+// CHECK: Node0x3 [
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td><font color="red">-</font></td>
+// CHECK-SAME: <td align="left">reg_$0<x></td>
+// CHECK-SAME: <td align="left">\{ [0, 10] \}</td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td><font color="forestgreen">+</font></td>
+// CHECK-SAME: <td align="left">reg_$0<x></td>
+// CHECK-SAME: <td align="left">\{ [0, 5] \}</td>
+// CHECK-SAME: </tr>
+Node0x3 [shape=record,label=
+ "{
+ { "node_id": 3,
+ "pointer": "0x3",
+ "state_id": 4,
+ "program_points": [],
+ "program_state": {
+ "store": null,
+ "environment": null,
+ "constraints": [
+ { "symbol": "reg_$0<x>", "range": "{ [0, 5] }" }
+ ]
+ }
+ }
+\l}"];
+
+Node0x3 -> Node0x5;
+
+Node0x5 [shape=record,label=
+ "{
+ { "node_id": 5,
+ "pointer": "0x5",
+ "state_id": 6,
+ "program_points": [],
+ "program_state": {
+ "store": null,
+ "environment": null,
+ "constraints": null
+ }
+ }
+\l}"];
diff --git a/clang/test/Analysis/exploded-graph-rewriter/environment.dot b/clang/test/Analysis/exploded-graph-rewriter/environment.dot
index 7271684642a..e18cc7fc192 100644
--- a/clang/test/Analysis/exploded-graph-rewriter/environment.dot
+++ b/clang/test/Analysis/exploded-graph-rewriter/environment.dot
@@ -33,6 +33,7 @@ Node0x1 [shape=record,label=
"program_points": [],
"program_state": {
"store": null,
+ "constraints": null,
"environment": [
{
"location_context": "#0 Call",
diff --git a/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
index 83cf0eb9471..33fe07d8789 100644
--- a/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
+++ b/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
@@ -12,6 +12,7 @@ Node0x1 [shape=record,label=
"program_points": [],
"program_state": {
"store": null,
+ "constraints": null,
"environment": [
{
"location_context": "#0 Call",
@@ -54,6 +55,7 @@ Node0x6 [shape=record,label=
"program_points": [],
"program_state": {
"store": null,
+ "constraints": null,
"environment": [
{
"location_context": "#0 Call",
@@ -90,6 +92,7 @@ Node0x9 [shape=record,label=
"program_points": [],
"program_state": {
"store": null,
+ "constraints": null,
"environment": [
{
"location_context": "#0 Call",
diff --git a/clang/test/Analysis/exploded-graph-rewriter/store.dot b/clang/test/Analysis/exploded-graph-rewriter/store.dot
index 3f1a937b737..22f4eba623c 100644
--- a/clang/test/Analysis/exploded-graph-rewriter/store.dot
+++ b/clang/test/Analysis/exploded-graph-rewriter/store.dot
@@ -28,6 +28,7 @@ Node0x1 [shape=record,label=
"program_points": [],
"program_state": {
"environment": null,
+ "constraints": null,
"store": [
{
"cluster": "x",
diff --git a/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot b/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
index 47ea9af014b..d0a4e19817a 100644
--- a/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
+++ b/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
@@ -11,6 +11,7 @@ Node0x1 [shape=record,label=
"program_points": [],
"program_state": {
"environment": null,
+ "constraints": null,
"store": [
{
"cluster": "x",
@@ -52,6 +53,7 @@ Node0x4 [shape=record,label=
"program_points": [],
"program_state": {
"environment": null,
+ "constraints": null,
"store": [
{
"cluster": "x",
OpenPOWER on IntegriCloud