2019-06-25 00:06:44 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
|
|
// RUN: -analyzer-dump-egraph=%t.dot %s
|
2018-09-29 02:49:21 +08:00
|
|
|
// RUN: cat %t.dot | FileCheck %s
|
2019-06-25 00:06:44 +08:00
|
|
|
|
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
|
|
// RUN: -analyzer-dump-egraph=%t.dot \
|
|
|
|
// RUN: -trim-egraph %s
|
|
|
|
// RUN: cat %t.dot | FileCheck %s
|
|
|
|
|
2018-09-29 02:49:21 +08:00
|
|
|
// REQUIRES: asserts
|
|
|
|
|
|
|
|
int getJ();
|
|
|
|
|
|
|
|
int foo() {
|
2018-10-03 05:19:01 +08:00
|
|
|
int *x = 0, *y = 0;
|
2019-06-25 11:08:32 +08:00
|
|
|
char c = '\x13';
|
|
|
|
|
2018-10-03 05:19:01 +08:00
|
|
|
return *x + *y;
|
2018-09-29 02:49:21 +08:00
|
|
|
}
|
|
|
|
|
2019-10-19 04:15:29 +08:00
|
|
|
// CHECK: \"program_points\": [\l
|
|
|
|
// CHECK-SAME: \{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1,
|
|
|
|
// CHECK-SAME: \"terminator\": null, \"term_kind\": null, \"tag\": null,
|
|
|
|
// CHECK-SAME: \"node_id\": 1, \"is_sink\": 0, \"has_report\": 0
|
|
|
|
// CHECK-SAME: \},
|
|
|
|
// CHECK-SAME: \{ \"kind\": \"BlockEntrance\", \"block_id\": 1, \"tag\": null,
|
|
|
|
// CHECK-SAME: \"node_id\": 2, \"is_sink\": 0, \"has_report\": 0
|
|
|
|
// CHECK-SAME: \},
|
|
|
|
// CHECK-SAME: \{ \"kind\": \"Statement\", \"stmt_kind\": \"IntegerLiteral\",
|
2019-10-19 04:48:21 +08:00
|
|
|
// CHECK-SAME: \"stmt_id\": {{[0-9]*}}, \"pointer\": \"0x{{[0-9a-f]*}}\",
|
2019-10-19 04:15:29 +08:00
|
|
|
// CHECK-SAME: \"pretty\": \"0\", \"location\": \{
|
|
|
|
// CHECK-SAME: \"line\": 15, \"column\": 12, \"file\":
|
|
|
|
// CHECK-SAME: \}, \"stmt_point_kind\": \"PreStmtPurgeDeadSymbols\",
|
|
|
|
// CHECK-SAME: \"tag\": \"ExprEngine : Clean Node\", \"node_id\": 3,
|
|
|
|
// CHECK-SAME: \"is_sink\": 0, \"has_report\": 0
|
|
|
|
// CHECK-SAME: \},
|
|
|
|
// CHECK-SAME: \{ \"kind\": \"Statement\", \"stmt_kind\": \"IntegerLiteral\",
|
2019-10-19 04:48:21 +08:00
|
|
|
// CHECK-SAME: \"stmt_id\": {{[0-9]*}}, \"pointer\": \"0x{{[0-9a-f]*}}\",
|
2019-10-19 04:15:29 +08:00
|
|
|
// CHECK-SAME: \"pretty\": \"0\", \"location\": \{
|
|
|
|
// CHECK-SAME: \"line\": 15, \"column\": 12, \"file\":
|
|
|
|
// CHECK-SAME: \}, \"stmt_point_kind\": \"PostStmt\", \"tag\": null,
|
|
|
|
// CHECK-SAME: \"node_id\": 4, \"is_sink\": 0, \"has_report\": 0
|
|
|
|
// CHECK-SAME: \}
|
|
|
|
// CHECK-SAME: ]
|
[analyzer] print() JSONify: getNodeLabel implementation
Summary: This patch also rewrites the ProgramPoint printing.
Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
Reviewed By: NoQ
Subscribers: cfe-commits, szepet, rnkovacs, a.sidorin, mikhail.ramalho,
donat.nagy, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62346
llvm-svn: 361997
2019-05-30 02:05:53 +08:00
|
|
|
|
2019-06-25 11:08:32 +08:00
|
|
|
// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 18, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \}
|
|
|
|
|
|
|
|
// CHECK: \"pretty\": \"'\\\\x13'\"
|
2019-06-25 00:19:39 +08:00
|
|
|
|
2019-10-18 07:10:09 +08:00
|
|
|
// CHECK: \"has_report\": 1
|
2019-10-19 04:15:35 +08:00
|
|
|
|
|
|
|
// CHECK-NOT: \"program_state\": null
|