Skip to content

Commit 41425b1

Browse files
committed
C++: Add test with missing flow.
1 parent 7050100 commit 41425b1

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ postWithInFlow
181181
| test.cpp:1108:4:1108:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
182182
| test.cpp:1109:3:1109:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
183183
| test.cpp:1109:4:1109:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
184+
| test.cpp:1138:3:1138:13 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
185+
| test.cpp:1138:5:1138:8 | data [inner post update] | PostUpdateNode should not be the target of local flow. |
186+
| test.cpp:1139:3:1139:7 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
187+
| test.cpp:1139:4:1139:7 | data [inner post update] | PostUpdateNode should not be the target of local flow. |
184188
viableImplInCallContextTooLarge
185189
uniqueParameterNodeAtPosition
186190
uniqueParameterNodePosition

cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ astFlow
132132
| test.cpp:1069:9:1069:14 | call to source | test.cpp:1074:10:1074:10 | i |
133133
| test.cpp:1069:9:1069:14 | call to source | test.cpp:1082:10:1082:10 | i |
134134
| test.cpp:1086:12:1086:12 | a | test.cpp:1088:8:1088:9 | & ... |
135+
| test.cpp:1137:7:1137:10 | data | test.cpp:1140:8:1140:18 | * ... |
136+
| test.cpp:1138:17:1138:22 | call to source | test.cpp:1140:8:1140:18 | * ... |
135137
| true_upon_entry.cpp:17:11:17:16 | call to source | true_upon_entry.cpp:21:8:21:8 | x |
136138
| true_upon_entry.cpp:27:9:27:14 | call to source | true_upon_entry.cpp:29:8:29:8 | x |
137139
| true_upon_entry.cpp:33:11:33:16 | call to source | true_upon_entry.cpp:39:8:39:8 | x |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,4 +1131,11 @@ void (*dispatch_table[])(int) = {
11311131
void test_dispatch_table(int i) {
11321132
int x = source();
11331133
dispatch_table[i](x);
1134+
}
1135+
1136+
void test_uncertain_array(int n1, int n2) {
1137+
int data[10];
1138+
*(data + 1) = source();
1139+
*data = 0;
1140+
sink(*(data + 1)); // $ ast=1138:17 ast=1137:7 MISSING: ir
11341141
}

cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@
5656
| test.cpp:796:12:796:12 | a | test.cpp:798:17:798:17 | a |
5757
| test.cpp:1086:12:1086:12 | a | test.cpp:1087:3:1087:3 | a |
5858
| test.cpp:1086:12:1086:12 | a | test.cpp:1088:9:1088:9 | a |
59+
| test.cpp:1137:7:1137:10 | data | test.cpp:1138:5:1138:8 | data |
60+
| test.cpp:1137:7:1137:10 | data | test.cpp:1139:4:1139:7 | data |
61+
| test.cpp:1137:7:1137:10 | data | test.cpp:1140:10:1140:13 | data |

0 commit comments

Comments
 (0)