Skip to content

Commit 43b1b42

Browse files
committed
Fix tests
1 parent 6150241 commit 43b1b42

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed

clang/test/Analysis/class-object-state-dump.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ + (void)test {
2828

2929
clang_analyzer_printState();
3030
// CHECK: "class_object_types": [
31-
// CHECK-NEXT: { "symbol": "conj_$[[#]]{Class, LC[[#]], S[[#]], #[[#]]}", "dyn_type": "Child", "sub_classable": true },
32-
// CHECK-NEXT: { "symbol": "conj_$[[#]]{Class, LC[[#]], S[[#]], #[[#]]}", "dyn_type": "Child", "sub_classable": true }
31+
// CHECK-NEXT: { "symbol": "conj_$[[#]]{Class, LC[[#]], CFGElemRef[[#]], #[[#]]}", "dyn_type": "Child", "sub_classable": true },
32+
// CHECK-NEXT: { "symbol": "conj_$[[#]]{Class, LC[[#]], CFGElemRef[[#]], #[[#]]}", "dyn_type": "Child", "sub_classable": true }
3333
// CHECK-NEXT: ]
3434

3535
// Let's make sure that the information is not GC'd away.

clang/test/Analysis/container-modeling.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void pop_front(std::list<int> &L, int n) {
196196
void push_back() {
197197
std::vector<int> V;
198198
V.end();
199-
199+
200200
clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
201201

202202
V.push_back(1); // expected-note{{Container 'V' extended to the back by 1 position}}
@@ -251,15 +251,15 @@ void print_state(std::vector<int> &V) {
251251
// CHECK: "checker_messages": [
252252
// CHECK-NEXT: { "checker": "alpha.cplusplus.ContainerModeling", "messages": [
253253
// CHECK-NEXT: "Container Data :",
254-
// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} .. <Unknown> ]"
254+
// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]} .. <Unknown> ]"
255255
// CHECK-NEXT: ]}
256256

257257
V.cend();
258258
clang_analyzer_printState();
259-
259+
260260
// CHECK: "checker_messages": [
261261
// CHECK-NEXT: { "checker": "alpha.cplusplus.ContainerModeling", "messages": [
262262
// CHECK-NEXT: "Container Data :",
263-
// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} .. conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} ]"
263+
// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]} .. conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]} ]"
264264
// CHECK-NEXT: ]}
265265
}

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

Lines changed: 4 additions & 4 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, S{{[0-9]+}}} }}
24+
clang_analyzer_dump_lref(cr1); // expected-warning-re {{&lifetime_extended_object{aggr, cr1, CFGElemRef{{[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, S{{[0-9]+}}} }}
28+
clang_analyzer_dump_lref(cr2); // expected-warning-re {{&lifetime_extended_object{empty, cr2, CFGElemRef{{[0-9]+}}} }}
2929
}
3030

3131
void test_assign_return() {
@@ -64,7 +64,7 @@ void _01_empty_structs() {
6464
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "conj_$
6565
// CHECK-NEXT: ]},
6666
// CHECK-NEXT: { "cluster": "Empty", "pointer": "0x{{[0-9a-f]+}}", "items": [
67-
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[EMPTY_CONJ:conj_\$[0-9]+{int, LC[0-9]+, S[0-9]+, #[0-9]+}]]" }
67+
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[EMPTY_CONJ:conj_\$[0-9]+{int, LC[0-9]+, CFGElemRef[0-9]+, #[0-9]+}]]" }
6868
// CHECK-NEXT: ]},
6969
// CHECK-NEXT: { "cluster": "Empty2", "pointer": "0x{{[0-9a-f]+}}", "items": [
7070
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[EMPTY_CONJ]]" }
@@ -101,7 +101,7 @@ void _02_structs_with_members() {
101101
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "conj_$
102102
// CHECK-NEXT: ]},
103103
// CHECK-NEXT: { "cluster": "Aggr", "pointer": "0x{{[0-9a-f]+}}", "items": [
104-
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[AGGR_CONJ:conj_\$[0-9]+{int, LC[0-9]+, S[0-9]+, #[0-9]+}]]" }
104+
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[AGGR_CONJ:conj_\$[0-9]+{int, LC[0-9]+, CFGElemRef[0-9]+, #[0-9]+}]]" }
105105
// CHECK-NEXT: ]},
106106
// CHECK-NEXT: { "cluster": "Aggr2", "pointer": "0x{{[0-9a-f]+}}", "items": [
107107
// CHECK-NEXT: { "kind": "Default", "offset": 0, "value": "[[AGGR_CONJ]]" }

clang/test/Analysis/dump_egraph.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +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, no stmt, #1\}\"
25-
26-
// CHECK: \"dynamic_types\": [\l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\{ \"region\": \"HeapSymRegion\{conj_$1\{S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"S\", \"sub_classable\": false \}\l
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\}\"
2725

26+
// 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/iterator-modeling.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,8 +2035,8 @@ void print_state(std::vector<int> &V) {
20352035
// CHECK: "checker_messages": [
20362036
// CHECK: { "checker": "alpha.cplusplus.IteratorModeling", "messages": [
20372037
// CHECK-NEXT: "Iterator Positions :",
2038-
// CHECK-NEXT: "conj_$[[#]]{int, LC[[#]], S[[#]], #[[#]]} : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}",
2039-
// CHECK-NEXT: "i0 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}"
2038+
// CHECK-NEXT: "conj_$[[#]]{int, LC[[#]], CFGElemRef[[#]], #[[#]]} : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]}",
2039+
// CHECK-NEXT: "i0 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]}"
20402040
// CHECK-NEXT: ]}
20412041

20422042
*i0;
@@ -2046,8 +2046,8 @@ void print_state(std::vector<int> &V) {
20462046
// CHECK: "checker_messages": [
20472047
// CHECK: { "checker": "alpha.cplusplus.IteratorModeling", "messages": [
20482048
// CHECK-NEXT: "Iterator Positions :",
2049-
// CHECK-NEXT: "conj_$[[#]]{int, LC[[#]], S[[#]], #[[#]]} : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}",
2050-
// CHECK-NEXT: "i1 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}"
2049+
// CHECK-NEXT: "conj_$[[#]]{int, LC[[#]], CFGElemRef[[#]], #[[#]]} : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]}",
2050+
// CHECK-NEXT: "i1 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], CFGElemRef[[#]], #[[#]]}"
20512051
// CHECK-NEXT: ]}
20522052

20532053
*i1;

clang/test/Analysis/malloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,9 +1954,9 @@ int conjure(void);
19541954
void testExtent(void) {
19551955
int x = conjure();
19561956
clang_analyzer_dump(x);
1957-
// expected-warning-re@-1 {{{{^conj_\$[[:digit:]]+{int, LC1, S[[:digit:]]+, #1}}}}}}
1957+
// expected-warning-re@-1 {{{{^conj_\$[[:digit:]]+{int, LC1, CFGElemRef[[:digit:]]+, #1}}}}}}
19581958
int *p = (int *)malloc(x);
19591959
clang_analyzer_dumpExtent(p);
1960-
// expected-warning-re@-1 {{{{^conj_\$[[:digit:]]+{int, LC1, S[[:digit:]]+, #1}}}}}}
1960+
// expected-warning-re@-1 {{{{^conj_\$[[:digit:]]+{int, LC1, CFGElemRef[[:digit:]]+, #1}}}}}}
19611961
free(p);
19621962
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void copy_on_heap(Node* n1) {
2525
Node* n2 = new Node(*n1);
2626

2727
clang_analyzer_dump(n1); // expected-warning-re {{&SymRegion{reg_${{[0-9]+}}<Node * n1>}}}
28-
clang_analyzer_dump(n2); // expected-warning-re {{&HeapSymRegion{conj_${{[0-9]+}}{Node *, LC{{[0-9]+}}, S{{[0-9]+}}, #{{[0-9]+}}}}}}
28+
clang_analyzer_dump(n2); // expected-warning-re {{&HeapSymRegion{conj_${{[0-9]+}}{Node *, LC{{[0-9]+}}, CFGElemRef{{[0-9]+}}, #{{[0-9]+}}}}}}
2929

3030
clang_analyzer_dump(n1->ptr); // expected-warning-re {{&SymRegion{reg_${{[0-9]+}}<int * Element{SymRegion{reg_${{[0-9]+}}<Node * n1>},0 S64b,struct Node}.ptr>}}}
3131
clang_analyzer_dump(n2->ptr); // expected-warning-re {{&SymRegion{reg_${{[0-9]+}}<int * Element{SymRegion{reg_${{[0-9]+}}<Node * n1>},0 S64b,struct Node}.ptr>}}}

0 commit comments

Comments
 (0)