Skip to content

Commit 3adc10f

Browse files
committed
C++: Accept tests
1 parent a060369 commit 3adc10f

File tree

5 files changed

+42
-40
lines changed

5 files changed

+42
-40
lines changed

cpp/ql/test/library-tests/dataflow/fields/dataflow-ir-consistency.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ unreachableNodeCCtx
2020
localCallNodes
2121
postIsNotPre
2222
postHasUniquePre
23-
| simple.cpp:65:5:65:22 | Store | PostUpdateNode should have one pre-update node but has 0. |
23+
| simple.cpp:65:5:65:22 | i | PostUpdateNode should have one pre-update node but has 0. |
2424
uniquePostUpdate
2525
postIsInSameCallable
2626
reverseRead

cpp/ql/test/library-tests/dataflow/fields/partial-definition-diff.expected

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
| aliasing.cpp:72:5:72:6 | m1 | AST only |
156156
| aliasing.cpp:79:6:79:7 | m1 | AST only |
157157
| aliasing.cpp:86:5:86:6 | m1 | AST only |
158-
| aliasing.cpp:92:3:92:3 | w | AST only |
159158
| aliasing.cpp:92:7:92:8 | m1 | AST only |
160159
| by_reference.cpp:12:8:12:8 | a | AST only |
161160
| by_reference.cpp:16:11:16:11 | a | AST only |
@@ -178,17 +177,13 @@
178177
| by_reference.cpp:84:10:84:10 | a | AST only |
179178
| by_reference.cpp:88:9:88:9 | a | AST only |
180179
| by_reference.cpp:102:21:102:39 | & ... | AST only |
181-
| by_reference.cpp:102:22:102:26 | outer | AST only |
182180
| by_reference.cpp:103:21:103:25 | outer | AST only |
183181
| by_reference.cpp:103:27:103:35 | inner_ptr | AST only |
184182
| by_reference.cpp:104:15:104:22 | & ... | AST only |
185-
| by_reference.cpp:104:16:104:20 | outer | AST only |
186183
| by_reference.cpp:106:21:106:41 | & ... | AST only |
187-
| by_reference.cpp:106:22:106:27 | pouter | AST only |
188184
| by_reference.cpp:107:21:107:26 | pouter | AST only |
189185
| by_reference.cpp:107:29:107:37 | inner_ptr | AST only |
190186
| by_reference.cpp:108:15:108:24 | & ... | AST only |
191-
| by_reference.cpp:108:16:108:21 | pouter | AST only |
192187
| by_reference.cpp:110:8:110:12 | outer | AST only |
193188
| by_reference.cpp:110:14:110:25 | inner_nested | AST only |
194189
| by_reference.cpp:110:27:110:27 | a | AST only |
@@ -205,17 +200,13 @@
205200
| by_reference.cpp:115:27:115:27 | a | AST only |
206201
| by_reference.cpp:116:8:116:13 | pouter | AST only |
207202
| by_reference.cpp:116:16:116:16 | a | AST only |
208-
| by_reference.cpp:122:21:122:25 | outer | AST only |
209203
| by_reference.cpp:122:27:122:38 | inner_nested | AST only |
210204
| by_reference.cpp:123:21:123:36 | * ... | AST only |
211205
| by_reference.cpp:123:22:123:26 | outer | AST only |
212-
| by_reference.cpp:124:15:124:19 | outer | AST only |
213206
| by_reference.cpp:124:21:124:21 | a | AST only |
214-
| by_reference.cpp:126:21:126:26 | pouter | AST only |
215207
| by_reference.cpp:126:29:126:40 | inner_nested | AST only |
216208
| by_reference.cpp:127:21:127:38 | * ... | AST only |
217209
| by_reference.cpp:127:22:127:27 | pouter | AST only |
218-
| by_reference.cpp:128:15:128:20 | pouter | AST only |
219210
| by_reference.cpp:128:23:128:23 | a | AST only |
220211
| by_reference.cpp:130:8:130:12 | outer | AST only |
221212
| by_reference.cpp:130:14:130:25 | inner_nested | AST only |
@@ -235,23 +226,11 @@
235226
| by_reference.cpp:136:16:136:16 | a | AST only |
236227
| complex.cpp:11:22:11:23 | a_ | AST only |
237228
| complex.cpp:12:22:12:23 | b_ | AST only |
238-
| complex.cpp:51:8:51:8 | b | AST only |
239-
| complex.cpp:51:10:51:14 | inner | AST only |
240229
| complex.cpp:51:16:51:16 | f | AST only |
241-
| complex.cpp:52:8:52:8 | b | AST only |
242-
| complex.cpp:52:10:52:14 | inner | AST only |
243230
| complex.cpp:52:16:52:16 | f | AST only |
244-
| complex.cpp:62:3:62:4 | b1 | AST only |
245-
| complex.cpp:62:6:62:10 | inner | AST only |
246231
| complex.cpp:62:12:62:12 | f | AST only |
247-
| complex.cpp:63:3:63:4 | b2 | AST only |
248-
| complex.cpp:63:6:63:10 | inner | AST only |
249232
| complex.cpp:63:12:63:12 | f | AST only |
250-
| complex.cpp:64:3:64:4 | b3 | AST only |
251-
| complex.cpp:64:6:64:10 | inner | AST only |
252233
| complex.cpp:64:12:64:12 | f | AST only |
253-
| complex.cpp:65:3:65:4 | b3 | AST only |
254-
| complex.cpp:65:6:65:10 | inner | AST only |
255234
| complex.cpp:65:12:65:12 | f | AST only |
256235
| complex.cpp:68:7:68:8 | b1 | AST only |
257236
| complex.cpp:71:7:71:8 | b2 | AST only |
@@ -317,20 +296,13 @@
317296
| simple.cpp:51:9:51:9 | h | AST only |
318297
| simple.cpp:54:9:54:9 | i | AST only |
319298
| simple.cpp:65:7:65:7 | i | AST only |
320-
| simple.cpp:83:9:83:10 | this | AST only |
321299
| simple.cpp:83:12:83:13 | f1 | AST only |
322300
| simple.cpp:84:14:84:20 | this | AST only |
323-
| simple.cpp:105:5:105:6 | d2 | AST only |
324301
| simple.cpp:105:14:105:14 | y | AST only |
325-
| simple.cpp:122:5:122:6 | d3 | AST only |
326-
| simple.cpp:122:8:122:11 | d2_1 | AST only |
327302
| simple.cpp:122:18:122:18 | x | AST only |
328303
| simple.cpp:136:21:136:28 | & ... | AST only |
329-
| simple.cpp:136:22:136:23 | d3 | AST only |
330304
| simple.cpp:143:23:143:30 | & ... | AST only |
331-
| simple.cpp:143:24:143:25 | d3 | AST only |
332305
| simple.cpp:144:23:144:30 | & ... | AST only |
333-
| simple.cpp:144:24:144:25 | d3 | AST only |
334306
| struct_init.c:15:8:15:9 | ab | AST only |
335307
| struct_init.c:15:12:15:12 | a | AST only |
336308
| struct_init.c:16:8:16:9 | ab | AST only |
@@ -353,6 +325,5 @@
353325
| struct_init.c:34:14:34:22 | pointerAB | AST only |
354326
| struct_init.c:34:25:34:25 | b | AST only |
355327
| struct_init.c:36:10:36:24 | & ... | AST only |
356-
| struct_init.c:36:11:36:15 | outer | AST only |
357328
| struct_init.c:46:10:46:14 | outer | AST only |
358329
| struct_init.c:46:16:46:24 | pointerAB | AST only |

cpp/ql/test/library-tests/dataflow/fields/partial-definition-ir.expected

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,38 @@
2323
| aliasing.cpp:54:3:54:4 | s2 |
2424
| aliasing.cpp:60:3:60:4 | s2 |
2525
| aliasing.cpp:72:3:72:3 | s |
26+
| aliasing.cpp:78:11:78:11 | w |
2627
| aliasing.cpp:79:3:79:3 | s |
28+
| aliasing.cpp:85:10:85:10 | w |
2729
| aliasing.cpp:86:3:86:3 | s |
30+
| aliasing.cpp:92:3:92:3 | w |
2831
| aliasing.cpp:92:5:92:5 | s |
2932
| by_reference.cpp:12:5:12:5 | s |
3033
| by_reference.cpp:16:5:16:8 | this |
3134
| by_reference.cpp:84:3:84:7 | inner |
3235
| by_reference.cpp:88:3:88:7 | inner |
36+
| by_reference.cpp:102:22:102:26 | outer |
37+
| by_reference.cpp:104:16:104:20 | outer |
38+
| by_reference.cpp:106:22:106:27 | pouter |
39+
| by_reference.cpp:108:16:108:21 | pouter |
40+
| by_reference.cpp:122:21:122:25 | outer |
41+
| by_reference.cpp:124:15:124:19 | outer |
42+
| by_reference.cpp:126:21:126:26 | pouter |
43+
| by_reference.cpp:128:15:128:20 | pouter |
3344
| complex.cpp:11:22:11:23 | this |
3445
| complex.cpp:12:22:12:23 | this |
46+
| complex.cpp:51:8:51:8 | b |
47+
| complex.cpp:51:10:51:14 | inner |
48+
| complex.cpp:52:8:52:8 | b |
49+
| complex.cpp:52:10:52:14 | inner |
50+
| complex.cpp:62:3:62:4 | b1 |
51+
| complex.cpp:62:6:62:10 | inner |
52+
| complex.cpp:63:3:63:4 | b2 |
53+
| complex.cpp:63:6:63:10 | inner |
54+
| complex.cpp:64:3:64:4 | b3 |
55+
| complex.cpp:64:6:64:10 | inner |
56+
| complex.cpp:65:3:65:4 | b3 |
57+
| complex.cpp:65:6:65:10 | inner |
3558
| constructors.cpp:20:24:20:25 | this |
3659
| constructors.cpp:21:24:21:25 | this |
3760
| qualifiers.cpp:9:30:9:33 | this |
@@ -41,5 +64,13 @@
4164
| simple.cpp:21:24:21:25 | this |
4265
| simple.cpp:65:5:65:5 | a |
4366
| simple.cpp:83:9:83:10 | f2 |
67+
| simple.cpp:83:9:83:10 | this |
68+
| simple.cpp:105:5:105:6 | d2 |
4469
| simple.cpp:105:9:105:12 | d1_2 |
70+
| simple.cpp:122:5:122:6 | d3 |
71+
| simple.cpp:122:8:122:11 | d2_1 |
4572
| simple.cpp:122:13:122:16 | d1_1 |
73+
| simple.cpp:136:22:136:23 | d3 |
74+
| simple.cpp:143:24:143:25 | d3 |
75+
| simple.cpp:144:24:144:25 | d3 |
76+
| struct_init.c:36:11:36:15 | outer |

cpp/ql/test/library-tests/dataflow/fields/simple.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ void write_to_d1_2_y(DeepStruct2* d2, int val) {
107107

108108
void read_from_y(DeepStruct2 d2) {
109109
sink(d2.d1_1.y);
110-
// Hopefully we will catch this flow when we merge #3123
111-
sink(d2.d1_2.y); //$ast $f-:ir
110+
111+
sink(d2.d1_2.y); //$ast,ir
112112
}
113113

114114
void read_from_y_deref(DeepStruct2* d2) {
@@ -121,22 +121,22 @@ void test_deep_structs() {
121121
DeepStruct3 d3;
122122
d3.d2_1.d1_1.x = user_input();
123123
DeepStruct2 d2_1 = d3.d2_1;
124-
sink(d2_1.d1_1.x); //$ast $f-:ir
124+
sink(d2_1.d1_1.x); //$ast,ir
125125
sink(d2_1.d1_1.y);
126126

127127
sink(d2_1.d1_2.x);
128128

129129
DeepStruct1* pd1 = &d2_1.d1_1;
130-
sink(pd1->x); //$ast $f-:ir
130+
sink(pd1->x); //$ast,ir
131131
}
132132

133133
void test_deep_structs_setter() {
134134
DeepStruct3 d3;
135135

136136
write_to_d1_2_y(&d3.d2_1, user_input());
137137

138-
sink(d3.d2_1.d1_1.y); //$f+:ir
139-
sink(d3.d2_1.d1_2.y); //$ast $ir
138+
sink(d3.d2_1.d1_1.y);
139+
sink(d3.d2_1.d1_2.y); //$ast,ir
140140

141141
read_from_y(d3.d2_1);
142142
read_from_y(d3.d2_2);

cpp/ql/test/library-tests/syntax-zoo/dataflow-ir-consistency.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,10 @@ unreachableNodeCCtx
659659
localCallNodes
660660
postIsNotPre
661661
postHasUniquePre
662-
| assignexpr.cpp:9:2:9:12 | Store | PostUpdateNode should have one pre-update node but has 0. |
663-
| bad_asts.cpp:15:10:15:12 | Store | PostUpdateNode should have one pre-update node but has 0. |
664-
| cpp11.cpp:65:19:65:45 | Store | PostUpdateNode should have one pre-update node but has 0. |
665-
| ir.cpp:531:14:531:14 | Store | PostUpdateNode should have one pre-update node but has 0. |
662+
| assignexpr.cpp:9:2:9:12 | i | PostUpdateNode should have one pre-update node but has 0. |
663+
| bad_asts.cpp:15:10:15:12 | x | PostUpdateNode should have one pre-update node but has 0. |
664+
| cpp11.cpp:65:19:65:45 | x | PostUpdateNode should have one pre-update node but has 0. |
665+
| ir.cpp:531:14:531:14 | d | PostUpdateNode should have one pre-update node but has 0. |
666666
uniquePostUpdate
667667
postIsInSameCallable
668668
reverseRead

0 commit comments

Comments
 (0)