Skip to content

Commit 3394012

Browse files
committed
Fix more tests
1 parent 43b1b42 commit 3394012

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ class SValExplainer : public FullSValVisitor<SValExplainer, std::string> {
118118
OS << "symbol of type '" + S->getType().getAsString() +
119119
"' conjured at statement '";
120120
S->getCFGElementRef()->dumpToStream(OS);
121+
// HACK: dumpToStream will output a new line in the end, this is
122+
// undesireable, thus we remove it.
123+
if (Str.back() == '\n') {
124+
Str.pop_back();
125+
}
121126
OS << "'";
122127
return Str;
123128
}

clang/test/Analysis/ctor-trivial-copy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ struct empty {
2121
void test_copy_return() {
2222
aggr s1 = {1, 2};
2323
aggr const& cr1 = aggr(s1);
24-
clang_analyzer_dump_lref(cr1); // expected-warning-re {{&lifetime_extended_object{aggr, cr1, CFGElemRef{{[0-9]+}}} }}
24+
clang_analyzer_dump_lref(cr1); // expected-warning-re {{&lifetime_extended_object{aggr, cr1, S{{[0-9]+}}} }}
2525

2626
empty s2;
2727
empty const& cr2 = empty{s2};
28-
clang_analyzer_dump_lref(cr2); // expected-warning-re {{&lifetime_extended_object{empty, cr2, CFGElemRef{{[0-9]+}}} }}
28+
clang_analyzer_dump_lref(cr2); // expected-warning-re {{&lifetime_extended_object{empty, cr2, S{{[0-9]+}}} }}
2929
}
3030

3131
void test_assign_return() {

clang/test/Analysis/dump_egraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ void foo() {
2121

2222
// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", \"location\": \{ \"line\": 15, \"column\": 5, \"file\": \"{{.*}}dump_egraph.cpp\" \}, \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", \"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t.s\"
2323

24-
// CHECK: \"cluster\": \"t\", \"pointer\": \"{{0x[0-9a-f]+}}\", \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$3\{int, LC5, CFGElemRef{{[0-9=+]}}, #1\}\"
24+
// CHECK: \"cluster\": \"t\", \"pointer\": \"{{0x[0-9a-f]+}}\", \"items\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$3\{int, LC5, CFGElemRef{{[0-9]+}}, #1\}\"
2525

2626
// CHECK: \"dynamic_types\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"region\": \"HeapSymRegion\{conj_$1\{S *, LC1, CFGElemRef{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"S\", \"sub_classable\": false \}\l

clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void test() {
1010
// CHECK: Dynamic Types:
1111
// CHECK-SAME: <tr><td align="left"><table border="0"><tr>
1212
// CHECK-SAME: <td align="left">HeapSymRegion\{conj_$1\{S *, LC1,
13-
// CHECK-SAME: S{{[0-9]*}}, #1\}\}</td>
13+
// CHECK-SAME: CFGElemRef{{[0-9]*}}, #1\}\}</td>
1414
// CHECK-SAME: <td align="left">S</td>
1515
// CHECK-SAME: </tr></table></td></tr>
1616
new S;

0 commit comments

Comments
 (0)