2018-10-23 04:11:10 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-dump-egraph=%t.dot %s
|
|
|
|
// RUN: cat %t.dot | FileCheck %s
|
|
|
|
// REQUIRES: asserts
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
~S();
|
|
|
|
};
|
|
|
|
|
2018-12-04 06:23:21 +08:00
|
|
|
struct T {
|
|
|
|
S s;
|
|
|
|
T() : s() {}
|
|
|
|
};
|
|
|
|
|
2018-10-23 04:11:10 +08:00
|
|
|
void foo() {
|
|
|
|
// Test that dumping symbols conjured on null statements doesn't crash.
|
2018-12-04 06:23:21 +08:00
|
|
|
T t;
|
2019-06-20 07:33:45 +08:00
|
|
|
|
|
|
|
new S;
|
2018-10-23 04:11:10 +08:00
|
|
|
}
|
|
|
|
|
2019-07-12 10:10:33 +08:00
|
|
|
// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"foo\", \"location\": null, \"items\": [\l \{ \"stmt_id\": {{[0-9]+}}, \"kind\": \"construct into local variable\", \"argument_index\": null, \"pretty\": \"T t;\", \"value\": \"&t\"
|
2019-05-29 23:58:26 +08:00
|
|
|
|
2019-07-12 10:10:33 +08:00
|
|
|
// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", \"location\": \{ \"line\": 16, \"column\": 5, \"file\": \"{{.*}}dump_egraph.cpp\" \}, \"items\": [\l \{ \"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", \"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t-\>s\"
|
2019-05-29 23:58:26 +08:00
|
|
|
|
2019-06-20 07:33:51 +08:00
|
|
|
// CHECK: \"cluster\": \"t\", \"pointer\": \"{{0x[0-9a-f]+}}\", \"items\": [\l \{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$2\{int, LC5, no stmt, #1\}\"
|
2018-12-04 06:23:21 +08:00
|
|
|
|
2019-08-22 08:20:36 +08:00
|
|
|
// CHECK: \"dynamic_types\": [\l \{ \"region\": \"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"struct S\", \"sub_classable\": false \}\l
|
|
|
|
|