Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53da751

Browse files
committed
C++: Accept tests
1 parent b6b17fe commit 53da751

5 files changed

Lines changed: 31 additions & 36 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@ void taint_a_ptr(int* pa) {
109109
void test_field_conflation_array_content() {
110110
S s;
111111
taint_a_ptr(&s.m1);
112-
sink(s.m2); //$f+:ir
112+
sink(s.m2);
113113
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
| aliasing.cpp:79:11:79:20 | call to user_input | aliasing.cpp:80:12:80:13 | m1 | IR only |
2222
| aliasing.cpp:86:10:86:19 | call to user_input | aliasing.cpp:87:12:87:13 | m1 | IR only |
2323
| aliasing.cpp:98:10:98:19 | call to user_input | aliasing.cpp:102:8:102:10 | * ... | IR only |
24-
| aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:112:10:112:11 | m2 | IR only |
2524
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:8:8:8:13 | access to array | AST only |
2625
| arrays.cpp:15:14:15:23 | call to user_input | arrays.cpp:17:8:17:13 | access to array | AST only |
2726
| arrays.cpp:36:26:36:35 | call to user_input | arrays.cpp:38:24:38:27 | data | AST only |

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

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ edges
6464
| aliasing.cpp:98:3:98:21 | Store | aliasing.cpp:98:3:98:21 | Chi [m1] |
6565
| aliasing.cpp:98:10:98:19 | call to user_input | aliasing.cpp:98:3:98:21 | Store |
6666
| aliasing.cpp:100:14:100:14 | Store [m1] | aliasing.cpp:102:8:102:10 | * ... |
67-
| aliasing.cpp:106:3:106:20 | Chi [array content] | aliasing.cpp:111:15:111:19 | taint_a_ptr output argument [array content] |
68-
| aliasing.cpp:106:3:106:20 | Store | aliasing.cpp:106:3:106:20 | Chi [array content] |
69-
| aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:106:3:106:20 | Store |
70-
| aliasing.cpp:111:15:111:19 | Chi [array content] | aliasing.cpp:112:10:112:11 | m2 |
71-
| aliasing.cpp:111:15:111:19 | taint_a_ptr output argument [array content] | aliasing.cpp:111:15:111:19 | Chi [array content] |
7267
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:7:8:7:13 | access to array |
7368
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:9:8:9:11 | * ... |
7469
| arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:10:8:10:15 | * ... |
@@ -104,20 +99,24 @@ edges
10499
| by_reference.cpp:96:8:96:17 | call to user_input | by_reference.cpp:96:3:96:19 | Store |
105100
| by_reference.cpp:102:21:102:39 | Chi [a] | by_reference.cpp:110:27:110:27 | a |
106101
| by_reference.cpp:102:21:102:39 | taint_inner_a_ptr output argument [a] | by_reference.cpp:102:21:102:39 | Chi [a] |
107-
| by_reference.cpp:104:15:104:22 | Chi [array content] | by_reference.cpp:112:14:112:14 | a |
108-
| by_reference.cpp:104:15:104:22 | taint_a_ptr output argument [array content] | by_reference.cpp:104:15:104:22 | Chi [array content] |
102+
| by_reference.cpp:104:15:104:22 | Chi | by_reference.cpp:104:15:104:22 | Chi [a] |
103+
| by_reference.cpp:104:15:104:22 | Chi [a] | by_reference.cpp:112:14:112:14 | a |
104+
| by_reference.cpp:104:15:104:22 | taint_a_ptr output argument [array content] | by_reference.cpp:104:15:104:22 | Chi |
109105
| by_reference.cpp:106:21:106:41 | Chi [a] | by_reference.cpp:114:29:114:29 | a |
110106
| by_reference.cpp:106:21:106:41 | taint_inner_a_ptr output argument [a] | by_reference.cpp:106:21:106:41 | Chi [a] |
111-
| by_reference.cpp:108:15:108:24 | Chi [array content] | by_reference.cpp:116:16:116:16 | a |
112-
| by_reference.cpp:108:15:108:24 | taint_a_ptr output argument [array content] | by_reference.cpp:108:15:108:24 | Chi [array content] |
107+
| by_reference.cpp:108:15:108:24 | Chi | by_reference.cpp:108:15:108:24 | Chi [a] |
108+
| by_reference.cpp:108:15:108:24 | Chi [a] | by_reference.cpp:116:16:116:16 | a |
109+
| by_reference.cpp:108:15:108:24 | taint_a_ptr output argument [array content] | by_reference.cpp:108:15:108:24 | Chi |
113110
| by_reference.cpp:122:21:122:38 | Chi [a] | by_reference.cpp:130:27:130:27 | a |
114111
| by_reference.cpp:122:21:122:38 | taint_inner_a_ref output argument [a] | by_reference.cpp:122:21:122:38 | Chi [a] |
115-
| by_reference.cpp:124:15:124:21 | Chi [array content] | by_reference.cpp:132:14:132:14 | a |
116-
| by_reference.cpp:124:15:124:21 | taint_a_ref output argument [array content] | by_reference.cpp:124:15:124:21 | Chi [array content] |
112+
| by_reference.cpp:124:15:124:21 | Chi | by_reference.cpp:124:15:124:21 | Chi [a] |
113+
| by_reference.cpp:124:15:124:21 | Chi [a] | by_reference.cpp:132:14:132:14 | a |
114+
| by_reference.cpp:124:15:124:21 | taint_a_ref output argument [array content] | by_reference.cpp:124:15:124:21 | Chi |
117115
| by_reference.cpp:126:21:126:40 | Chi [a] | by_reference.cpp:134:29:134:29 | a |
118116
| by_reference.cpp:126:21:126:40 | taint_inner_a_ref output argument [a] | by_reference.cpp:126:21:126:40 | Chi [a] |
119-
| by_reference.cpp:128:15:128:23 | Chi [array content] | by_reference.cpp:136:16:136:16 | a |
120-
| by_reference.cpp:128:15:128:23 | taint_a_ref output argument [array content] | by_reference.cpp:128:15:128:23 | Chi [array content] |
117+
| by_reference.cpp:128:15:128:23 | Chi | by_reference.cpp:128:15:128:23 | Chi [a] |
118+
| by_reference.cpp:128:15:128:23 | Chi [a] | by_reference.cpp:136:16:136:16 | a |
119+
| by_reference.cpp:128:15:128:23 | taint_a_ref output argument [array content] | by_reference.cpp:128:15:128:23 | Chi |
121120
| complex.cpp:40:17:40:17 | *b [a_] | complex.cpp:51:16:51:16 | Argument -1 indirection [a_] |
122121
| complex.cpp:40:17:40:17 | *b [b_] | complex.cpp:51:16:51:16 | Argument -1 indirection [b_] |
123122
| complex.cpp:40:17:40:17 | *b [b_] | complex.cpp:52:16:52:16 | Argument -1 indirection [b_] |
@@ -285,12 +284,6 @@ nodes
285284
| aliasing.cpp:98:10:98:19 | call to user_input | semmle.label | call to user_input |
286285
| aliasing.cpp:100:14:100:14 | Store [m1] | semmle.label | Store [m1] |
287286
| aliasing.cpp:102:8:102:10 | * ... | semmle.label | * ... |
288-
| aliasing.cpp:106:3:106:20 | Chi [array content] | semmle.label | Chi [array content] |
289-
| aliasing.cpp:106:3:106:20 | Store | semmle.label | Store |
290-
| aliasing.cpp:106:9:106:18 | call to user_input | semmle.label | call to user_input |
291-
| aliasing.cpp:111:15:111:19 | Chi [array content] | semmle.label | Chi [array content] |
292-
| aliasing.cpp:111:15:111:19 | taint_a_ptr output argument [array content] | semmle.label | taint_a_ptr output argument [array content] |
293-
| aliasing.cpp:112:10:112:11 | m2 | semmle.label | m2 |
294287
| arrays.cpp:6:12:6:21 | call to user_input | semmle.label | call to user_input |
295288
| arrays.cpp:7:8:7:13 | access to array | semmle.label | access to array |
296289
| arrays.cpp:9:8:9:11 | * ... | semmle.label | * ... |
@@ -329,23 +322,27 @@ nodes
329322
| by_reference.cpp:96:8:96:17 | call to user_input | semmle.label | call to user_input |
330323
| by_reference.cpp:102:21:102:39 | Chi [a] | semmle.label | Chi [a] |
331324
| by_reference.cpp:102:21:102:39 | taint_inner_a_ptr output argument [a] | semmle.label | taint_inner_a_ptr output argument [a] |
332-
| by_reference.cpp:104:15:104:22 | Chi [array content] | semmle.label | Chi [array content] |
325+
| by_reference.cpp:104:15:104:22 | Chi | semmle.label | Chi |
326+
| by_reference.cpp:104:15:104:22 | Chi [a] | semmle.label | Chi [a] |
333327
| by_reference.cpp:104:15:104:22 | taint_a_ptr output argument [array content] | semmle.label | taint_a_ptr output argument [array content] |
334328
| by_reference.cpp:106:21:106:41 | Chi [a] | semmle.label | Chi [a] |
335329
| by_reference.cpp:106:21:106:41 | taint_inner_a_ptr output argument [a] | semmle.label | taint_inner_a_ptr output argument [a] |
336-
| by_reference.cpp:108:15:108:24 | Chi [array content] | semmle.label | Chi [array content] |
330+
| by_reference.cpp:108:15:108:24 | Chi | semmle.label | Chi |
331+
| by_reference.cpp:108:15:108:24 | Chi [a] | semmle.label | Chi [a] |
337332
| by_reference.cpp:108:15:108:24 | taint_a_ptr output argument [array content] | semmle.label | taint_a_ptr output argument [array content] |
338333
| by_reference.cpp:110:27:110:27 | a | semmle.label | a |
339334
| by_reference.cpp:112:14:112:14 | a | semmle.label | a |
340335
| by_reference.cpp:114:29:114:29 | a | semmle.label | a |
341336
| by_reference.cpp:116:16:116:16 | a | semmle.label | a |
342337
| by_reference.cpp:122:21:122:38 | Chi [a] | semmle.label | Chi [a] |
343338
| by_reference.cpp:122:21:122:38 | taint_inner_a_ref output argument [a] | semmle.label | taint_inner_a_ref output argument [a] |
344-
| by_reference.cpp:124:15:124:21 | Chi [array content] | semmle.label | Chi [array content] |
339+
| by_reference.cpp:124:15:124:21 | Chi | semmle.label | Chi |
340+
| by_reference.cpp:124:15:124:21 | Chi [a] | semmle.label | Chi [a] |
345341
| by_reference.cpp:124:15:124:21 | taint_a_ref output argument [array content] | semmle.label | taint_a_ref output argument [array content] |
346342
| by_reference.cpp:126:21:126:40 | Chi [a] | semmle.label | Chi [a] |
347343
| by_reference.cpp:126:21:126:40 | taint_inner_a_ref output argument [a] | semmle.label | taint_inner_a_ref output argument [a] |
348-
| by_reference.cpp:128:15:128:23 | Chi [array content] | semmle.label | Chi [array content] |
344+
| by_reference.cpp:128:15:128:23 | Chi | semmle.label | Chi |
345+
| by_reference.cpp:128:15:128:23 | Chi [a] | semmle.label | Chi [a] |
349346
| by_reference.cpp:128:15:128:23 | taint_a_ref output argument [array content] | semmle.label | taint_a_ref output argument [array content] |
350347
| by_reference.cpp:130:27:130:27 | a | semmle.label | a |
351348
| by_reference.cpp:132:14:132:14 | a | semmle.label | a |
@@ -460,7 +457,6 @@ nodes
460457
| aliasing.cpp:87:12:87:13 | m1 | aliasing.cpp:86:10:86:19 | call to user_input | aliasing.cpp:87:12:87:13 | m1 | m1 flows from $@ | aliasing.cpp:86:10:86:19 | call to user_input | call to user_input |
461458
| aliasing.cpp:93:12:93:13 | m1 | aliasing.cpp:92:12:92:21 | call to user_input | aliasing.cpp:93:12:93:13 | m1 | m1 flows from $@ | aliasing.cpp:92:12:92:21 | call to user_input | call to user_input |
462459
| aliasing.cpp:102:8:102:10 | * ... | aliasing.cpp:98:10:98:19 | call to user_input | aliasing.cpp:102:8:102:10 | * ... | * ... flows from $@ | aliasing.cpp:98:10:98:19 | call to user_input | call to user_input |
463-
| aliasing.cpp:112:10:112:11 | m2 | aliasing.cpp:106:9:106:18 | call to user_input | aliasing.cpp:112:10:112:11 | m2 | m2 flows from $@ | aliasing.cpp:106:9:106:18 | call to user_input | call to user_input |
464460
| arrays.cpp:7:8:7:13 | access to array | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:7:8:7:13 | access to array | access to array flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |
465461
| arrays.cpp:9:8:9:11 | * ... | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:9:8:9:11 | * ... | * ... flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |
466462
| arrays.cpp:10:8:10:15 | * ... | arrays.cpp:6:12:6:21 | call to user_input | arrays.cpp:10:8:10:15 | * ... | * ... flows from $@ | arrays.cpp:6:12:6:21 | call to user_input | call to user_input |

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
| aliasing.cpp:98:5:98:6 | m1 | AST only |
161161
| aliasing.cpp:106:3:106:5 | * ... | AST only |
162162
| aliasing.cpp:111:15:111:19 | & ... | AST only |
163-
| aliasing.cpp:111:16:111:16 | s | AST only |
164163
| arrays.cpp:6:3:6:8 | access to array | AST only |
165164
| arrays.cpp:6:3:6:23 | arr | IR only |
166165
| arrays.cpp:15:3:15:10 | * ... | AST only |
@@ -222,17 +221,13 @@
222221
| by_reference.cpp:92:3:92:5 | * ... | AST only |
223222
| by_reference.cpp:96:3:96:4 | pa | AST only |
224223
| by_reference.cpp:102:21:102:39 | & ... | AST only |
225-
| by_reference.cpp:102:22:102:26 | outer | AST only |
226224
| by_reference.cpp:103:21:103:25 | outer | AST only |
227225
| by_reference.cpp:103:27:103:35 | inner_ptr | AST only |
228226
| by_reference.cpp:104:15:104:22 | & ... | AST only |
229-
| by_reference.cpp:104:16:104:20 | outer | AST only |
230227
| by_reference.cpp:106:21:106:41 | & ... | AST only |
231-
| by_reference.cpp:106:22:106:27 | pouter | AST only |
232228
| by_reference.cpp:107:21:107:26 | pouter | AST only |
233229
| by_reference.cpp:107:29:107:37 | inner_ptr | AST only |
234230
| by_reference.cpp:108:15:108:24 | & ... | AST only |
235-
| by_reference.cpp:108:16:108:21 | pouter | AST only |
236231
| by_reference.cpp:110:8:110:12 | outer | AST only |
237232
| by_reference.cpp:110:14:110:25 | inner_nested | AST only |
238233
| by_reference.cpp:110:27:110:27 | a | AST only |
@@ -249,17 +244,13 @@
249244
| by_reference.cpp:115:27:115:27 | a | AST only |
250245
| by_reference.cpp:116:8:116:13 | pouter | AST only |
251246
| by_reference.cpp:116:16:116:16 | a | AST only |
252-
| by_reference.cpp:122:21:122:25 | outer | AST only |
253247
| by_reference.cpp:122:27:122:38 | inner_nested | AST only |
254248
| by_reference.cpp:123:21:123:36 | * ... | AST only |
255249
| by_reference.cpp:123:22:123:26 | outer | AST only |
256-
| by_reference.cpp:124:15:124:19 | outer | AST only |
257250
| by_reference.cpp:124:21:124:21 | a | AST only |
258-
| by_reference.cpp:126:21:126:26 | pouter | AST only |
259251
| by_reference.cpp:126:29:126:40 | inner_nested | AST only |
260252
| by_reference.cpp:127:21:127:38 | * ... | AST only |
261253
| by_reference.cpp:127:22:127:27 | pouter | AST only |
262-
| by_reference.cpp:128:15:128:20 | pouter | AST only |
263254
| by_reference.cpp:128:23:128:23 | a | AST only |
264255
| by_reference.cpp:130:8:130:12 | outer | AST only |
265256
| by_reference.cpp:130:14:130:25 | inner_nested | AST only |
@@ -413,6 +404,5 @@
413404
| struct_init.c:34:14:34:22 | pointerAB | AST only |
414405
| struct_init.c:34:25:34:25 | b | AST only |
415406
| struct_init.c:36:10:36:24 | & ... | AST only |
416-
| struct_init.c:36:11:36:15 | outer | AST only |
417407
| struct_init.c:46:10:46:14 | outer | AST only |
418408
| struct_init.c:46:16:46:24 | pointerAB | AST only |

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@
2727
| aliasing.cpp:86:3:86:3 | s |
2828
| aliasing.cpp:92:5:92:5 | s |
2929
| aliasing.cpp:98:3:98:3 | s |
30+
| aliasing.cpp:111:16:111:16 | s |
3031
| arrays.cpp:6:3:6:5 | arr |
3132
| arrays.cpp:36:3:36:17 | access to array |
3233
| by_reference.cpp:12:5:12:5 | s |
3334
| by_reference.cpp:16:5:16:8 | this |
3435
| by_reference.cpp:84:3:84:7 | inner |
3536
| by_reference.cpp:88:3:88:7 | inner |
37+
| by_reference.cpp:102:22:102:26 | outer |
38+
| by_reference.cpp:104:16:104:20 | outer |
39+
| by_reference.cpp:106:22:106:27 | pouter |
40+
| by_reference.cpp:108:16:108:21 | pouter |
41+
| by_reference.cpp:122:21:122:25 | outer |
42+
| by_reference.cpp:124:15:124:19 | outer |
43+
| by_reference.cpp:126:21:126:26 | pouter |
44+
| by_reference.cpp:128:15:128:20 | pouter |
3645
| complex.cpp:11:22:11:23 | this |
3746
| complex.cpp:12:22:12:23 | this |
3847
| constructors.cpp:20:24:20:25 | this |
@@ -46,3 +55,4 @@
4655
| simple.cpp:65:5:65:5 | a |
4756
| simple.cpp:83:9:83:10 | f2 |
4857
| simple.cpp:92:5:92:5 | a |
58+
| struct_init.c:36:11:36:15 | outer |

0 commit comments

Comments
 (0)