Skip to content

Commit b48168f

Browse files
committed
C++: Accept tests
1 parent 431cc5c commit b48168f

File tree

5 files changed

+58
-0
lines changed

5 files changed

+58
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ edges
102102
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:139:23:139:23 | d2_1.d1_2.y [d1_2, y] |
103103
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:141:20:141:23 | d2_1 [d1_2, y] |
104104
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:143:23:143:30 | d2_1 [d1_2, y] |
105+
| simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] | simple.cpp:143:23:143:30 | d2_1 [d1_2, y] |
105106
| simple.cpp:136:21:136:28 | d2_1 [d2_1, d1_2, ... (3)] | simple.cpp:136:21:136:28 | Chi [d2_1, d1_2, ... (3)] |
106107
| simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] | simple.cpp:136:21:136:28 | d2_1 [d2_1, d1_2, ... (3)] |
107108
| simple.cpp:136:21:136:28 | write_to_d1_2_y output argument [d1_2, y] | simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] |
@@ -114,9 +115,19 @@ edges
114115
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | simple.cpp:141:20:141:23 | d2_1 [d1_2, y] |
115116
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | simple.cpp:114:37:114:38 | *d2 [d1_2, y] |
116117
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] |
118+
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] |
117119
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] |
118120
| simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] | simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] |
119121
| simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] | simple.cpp:114:37:114:38 | *d2 [d1_2, y] |
122+
| simple.cpp:159:20:159:24 | *inner [f] | simple.cpp:161:17:161:17 | f |
123+
| simple.cpp:161:17:161:17 | f | simple.cpp:161:17:161:17 | f |
124+
| simple.cpp:167:5:167:32 | Chi [inner, f] | simple.cpp:168:12:168:23 | inner [f] |
125+
| simple.cpp:167:5:167:32 | Store | simple.cpp:167:5:167:32 | f [f] |
126+
| simple.cpp:167:5:167:32 | f [f] | simple.cpp:167:5:167:32 | inner.f [inner, f] |
127+
| simple.cpp:167:5:167:32 | inner.f [inner, f] | simple.cpp:167:5:167:32 | Chi [inner, f] |
128+
| simple.cpp:167:21:167:30 | call to user_input | simple.cpp:167:5:167:32 | Store |
129+
| simple.cpp:168:12:168:23 | Argument 0 indirection [f] | simple.cpp:159:20:159:24 | *inner [f] |
130+
| simple.cpp:168:12:168:23 | inner [f] | simple.cpp:168:12:168:23 | Argument 0 indirection [f] |
120131
| struct_init.c:14:24:14:25 | *ab [a] | struct_init.c:15:12:15:12 | a |
121132
| struct_init.c:15:12:15:12 | a | struct_init.c:15:12:15:12 | a |
122133
| struct_init.c:20:20:20:29 | Store | struct_init.c:20:20:20:29 | a [a] |
@@ -130,8 +141,11 @@ edges
130141
| struct_init.c:27:7:27:16 | call to user_input | struct_init.c:27:7:27:16 | Store |
131142
| struct_init.c:27:7:27:16 | call to user_input | struct_init.c:31:23:31:23 | a |
132143
| struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] | struct_init.c:27:7:27:16 | Chi [nestedAB, a] |
144+
| struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] | struct_init.c:28:5:28:7 | Chi [nestedAB, a] |
133145
| struct_init.c:27:21:27:21 | nestedAB.b [a] | struct_init.c:36:10:36:24 | Argument 0 indirection [a] |
146+
| struct_init.c:28:5:28:7 | Chi [nestedAB, a] | struct_init.c:36:10:36:24 | nestedAB [a] |
134147
| struct_init.c:36:10:36:24 | Argument 0 indirection [a] | struct_init.c:14:24:14:25 | *ab [a] |
148+
| struct_init.c:36:10:36:24 | nestedAB [a] | struct_init.c:36:10:36:24 | Argument 0 indirection [a] |
135149
nodes
136150
| A.cpp:98:12:98:18 | new | semmle.label | new |
137151
| A.cpp:100:5:100:13 | Store | semmle.label | Store |
@@ -263,8 +277,19 @@ nodes
263277
| simple.cpp:141:20:141:23 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
264278
| simple.cpp:143:23:143:30 | Argument 0 indirection [d1_2, y] | semmle.label | Argument 0 indirection [d1_2, y] |
265279
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
280+
| simple.cpp:143:23:143:30 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
266281
| simple.cpp:143:23:143:30 | read_from_y_deref output argument [d1_2, y] | semmle.label | read_from_y_deref output argument [d1_2, y] |
267282
| simple.cpp:144:23:144:30 | Argument 0 indirection [d1_2, y] | semmle.label | Argument 0 indirection [d1_2, y] |
283+
| simple.cpp:159:20:159:24 | *inner [f] | semmle.label | *inner [f] |
284+
| simple.cpp:161:17:161:17 | f | semmle.label | f |
285+
| simple.cpp:161:17:161:17 | f | semmle.label | f |
286+
| simple.cpp:167:5:167:32 | Chi [inner, f] | semmle.label | Chi [inner, f] |
287+
| simple.cpp:167:5:167:32 | Store | semmle.label | Store |
288+
| simple.cpp:167:5:167:32 | f [f] | semmle.label | f [f] |
289+
| simple.cpp:167:5:167:32 | inner.f [inner, f] | semmle.label | inner.f [inner, f] |
290+
| simple.cpp:167:21:167:30 | call to user_input | semmle.label | call to user_input |
291+
| simple.cpp:168:12:168:23 | Argument 0 indirection [f] | semmle.label | Argument 0 indirection [f] |
292+
| simple.cpp:168:12:168:23 | inner [f] | semmle.label | inner [f] |
268293
| struct_init.c:14:24:14:25 | *ab [a] | semmle.label | *ab [a] |
269294
| struct_init.c:15:12:15:12 | a | semmle.label | a |
270295
| struct_init.c:15:12:15:12 | a | semmle.label | a |
@@ -279,8 +304,10 @@ nodes
279304
| struct_init.c:27:7:27:16 | call to user_input | semmle.label | call to user_input |
280305
| struct_init.c:27:7:27:16 | nestedAB.a [nestedAB, a] | semmle.label | nestedAB.a [nestedAB, a] |
281306
| struct_init.c:27:21:27:21 | nestedAB.b [a] | semmle.label | nestedAB.b [a] |
307+
| struct_init.c:28:5:28:7 | Chi [nestedAB, a] | semmle.label | Chi [nestedAB, a] |
282308
| struct_init.c:31:23:31:23 | a | semmle.label | a |
283309
| struct_init.c:36:10:36:24 | Argument 0 indirection [a] | semmle.label | Argument 0 indirection [a] |
310+
| struct_init.c:36:10:36:24 | nestedAB [a] | semmle.label | nestedAB [a] |
284311
#select
285312
| A.cpp:107:12:107:16 | (void *)... | A.cpp:98:12:98:18 | new | A.cpp:107:12:107:16 | (void *)... | (void *)... flows from $@ | A.cpp:98:12:98:18 | new | new |
286313
| A.cpp:107:16:107:16 | a | A.cpp:98:12:98:18 | new | A.cpp:107:16:107:16 | a | a flows from $@ | A.cpp:98:12:98:18 | new | new |
@@ -306,6 +333,7 @@ nodes
306333
| simple.cpp:124:20:124:20 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:124:20:124:20 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
307334
| simple.cpp:130:15:130:15 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:130:15:130:15 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
308335
| simple.cpp:139:23:139:23 | y | simple.cpp:136:31:136:40 | call to user_input | simple.cpp:139:23:139:23 | y | y flows from $@ | simple.cpp:136:31:136:40 | call to user_input | call to user_input |
336+
| simple.cpp:161:17:161:17 | f | simple.cpp:167:21:167:30 | call to user_input | simple.cpp:161:17:161:17 | f | f flows from $@ | simple.cpp:167:21:167:30 | call to user_input | call to user_input |
309337
| struct_init.c:15:12:15:12 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |
310338
| struct_init.c:15:12:15:12 | a | struct_init.c:27:7:27:16 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:27:7:27:16 | call to user_input | call to user_input |
311339
| struct_init.c:22:11:22:11 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:22:11:22:11 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@
303303
| simple.cpp:136:21:136:28 | & ... | AST only |
304304
| simple.cpp:143:23:143:30 | & ... | AST only |
305305
| simple.cpp:144:23:144:30 | & ... | AST only |
306+
| simple.cpp:167:17:167:17 | f | AST only |
307+
| simple.cpp:168:12:168:23 | & ... | AST only |
306308
| struct_init.c:15:8:15:9 | ab | AST only |
307309
| struct_init.c:15:12:15:12 | a | AST only |
308310
| struct_init.c:16:8:16:9 | ab | AST only |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,7 @@
7373
| simple.cpp:136:22:136:23 | d3 |
7474
| simple.cpp:143:24:143:25 | d3 |
7575
| simple.cpp:144:24:144:25 | d3 |
76+
| simple.cpp:167:5:167:9 | outer |
77+
| simple.cpp:167:11:167:15 | inner |
78+
| simple.cpp:168:13:168:17 | outer |
7679
| struct_init.c:36:11:36:15 | outer |

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@
376376
| simple.cpp:143:24:143:25 | d3 |
377377
| simple.cpp:144:23:144:30 | & ... |
378378
| simple.cpp:144:24:144:25 | d3 |
379+
| simple.cpp:167:5:167:9 | outer |
380+
| simple.cpp:167:11:167:15 | inner |
381+
| simple.cpp:167:17:167:17 | f |
382+
| simple.cpp:168:12:168:23 | & ... |
383+
| simple.cpp:168:13:168:17 | outer |
379384
| struct_init.c:15:8:15:9 | ab |
380385
| struct_init.c:15:12:15:12 | a |
381386
| struct_init.c:16:8:16:9 | ab |

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,15 @@ edges
365365
| simple.cpp:143:23:143:30 | & ... [d1_2, y] | simple.cpp:114:37:114:38 | d2 [d1_2, y] |
366366
| simple.cpp:143:24:143:25 | d3 [d2_1, d1_2, ... (3)] | simple.cpp:143:27:143:30 | d2_1 [d1_2, y] |
367367
| simple.cpp:143:27:143:30 | d2_1 [d1_2, y] | simple.cpp:143:23:143:30 | & ... [d1_2, y] |
368+
| simple.cpp:159:20:159:24 | inner [f] | simple.cpp:161:10:161:14 | inner [f] |
369+
| simple.cpp:161:10:161:14 | inner [f] | simple.cpp:161:17:161:17 | f |
370+
| simple.cpp:167:5:167:9 | outer [post update] [inner, f] | simple.cpp:168:13:168:17 | outer [inner, f] |
371+
| simple.cpp:167:5:167:32 | ... = ... | simple.cpp:167:11:167:15 | inner [post update] [f] |
372+
| simple.cpp:167:11:167:15 | inner [post update] [f] | simple.cpp:167:5:167:9 | outer [post update] [inner, f] |
373+
| simple.cpp:167:21:167:30 | call to user_input | simple.cpp:167:5:167:32 | ... = ... |
374+
| simple.cpp:168:12:168:23 | & ... [f] | simple.cpp:159:20:159:24 | inner [f] |
375+
| simple.cpp:168:13:168:17 | outer [inner, f] | simple.cpp:168:19:168:23 | inner [f] |
376+
| simple.cpp:168:19:168:23 | inner [f] | simple.cpp:168:12:168:23 | & ... [f] |
368377
| struct_init.c:14:24:14:25 | ab [a] | struct_init.c:15:8:15:9 | ab [a] |
369378
| struct_init.c:15:8:15:9 | ab [a] | struct_init.c:15:12:15:12 | a |
370379
| struct_init.c:20:17:20:36 | {...} [a] | struct_init.c:22:8:22:9 | ab [a] |
@@ -800,6 +809,16 @@ nodes
800809
| simple.cpp:143:23:143:30 | & ... [d1_2, y] | semmle.label | & ... [d1_2, y] |
801810
| simple.cpp:143:24:143:25 | d3 [d2_1, d1_2, ... (3)] | semmle.label | d3 [d2_1, d1_2, ... (3)] |
802811
| simple.cpp:143:27:143:30 | d2_1 [d1_2, y] | semmle.label | d2_1 [d1_2, y] |
812+
| simple.cpp:159:20:159:24 | inner [f] | semmle.label | inner [f] |
813+
| simple.cpp:161:10:161:14 | inner [f] | semmle.label | inner [f] |
814+
| simple.cpp:161:17:161:17 | f | semmle.label | f |
815+
| simple.cpp:167:5:167:9 | outer [post update] [inner, f] | semmle.label | outer [post update] [inner, f] |
816+
| simple.cpp:167:5:167:32 | ... = ... | semmle.label | ... = ... |
817+
| simple.cpp:167:11:167:15 | inner [post update] [f] | semmle.label | inner [post update] [f] |
818+
| simple.cpp:167:21:167:30 | call to user_input | semmle.label | call to user_input |
819+
| simple.cpp:168:12:168:23 | & ... [f] | semmle.label | & ... [f] |
820+
| simple.cpp:168:13:168:17 | outer [inner, f] | semmle.label | outer [inner, f] |
821+
| simple.cpp:168:19:168:23 | inner [f] | semmle.label | inner [f] |
803822
| struct_init.c:14:24:14:25 | ab [a] | semmle.label | ab [a] |
804823
| struct_init.c:15:8:15:9 | ab [a] | semmle.label | ab [a] |
805824
| struct_init.c:15:12:15:12 | a | semmle.label | a |
@@ -903,6 +922,7 @@ nodes
903922
| simple.cpp:124:20:124:20 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:124:20:124:20 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
904923
| simple.cpp:130:15:130:15 | x | simple.cpp:122:22:122:31 | call to user_input | simple.cpp:130:15:130:15 | x | x flows from $@ | simple.cpp:122:22:122:31 | call to user_input | call to user_input |
905924
| simple.cpp:139:23:139:23 | y | simple.cpp:136:31:136:40 | call to user_input | simple.cpp:139:23:139:23 | y | y flows from $@ | simple.cpp:136:31:136:40 | call to user_input | call to user_input |
925+
| simple.cpp:161:17:161:17 | f | simple.cpp:167:21:167:30 | call to user_input | simple.cpp:161:17:161:17 | f | f flows from $@ | simple.cpp:167:21:167:30 | call to user_input | call to user_input |
906926
| struct_init.c:15:12:15:12 | a | struct_init.c:20:20:20:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:20:20:20:29 | call to user_input | call to user_input |
907927
| struct_init.c:15:12:15:12 | a | struct_init.c:27:7:27:16 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:27:7:27:16 | call to user_input | call to user_input |
908928
| struct_init.c:15:12:15:12 | a | struct_init.c:40:20:40:29 | call to user_input | struct_init.c:15:12:15:12 | a | a flows from $@ | struct_init.c:40:20:40:29 | call to user_input | call to user_input |

0 commit comments

Comments
 (0)