Skip to content

Commit 0a0d6d0

Browse files
authored
Merge pull request github#11963 from MathiasVP/testcase-with-loop
C++: Add testcase with looping behavior
2 parents 5be97f3 + a217017 commit 0a0d6d0

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ postWithInFlow
9292
| test.cpp:499:3:499:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
9393
| test.cpp:499:4:499:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
9494
| test.cpp:505:35:505:35 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
95+
| test.cpp:511:5:511:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
96+
| test.cpp:511:6:511:6 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
97+
| test.cpp:516:23:516:23 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
9598
viableImplInCallContextTooLarge
9699
uniqueParameterNodeAtPosition
97100
uniqueParameterNodePosition

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ postWithInFlow
591591
| test.cpp:505:34:505:35 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
592592
| test.cpp:505:34:505:35 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
593593
| test.cpp:505:35:505:35 | x [post update] | PostUpdateNode should not be the target of local flow. |
594+
| test.cpp:511:5:511:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
595+
| test.cpp:511:6:511:6 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
596+
| test.cpp:511:6:511:6 | p [post update] | PostUpdateNode should not be the target of local flow. |
597+
| test.cpp:516:22:516:23 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
598+
| test.cpp:516:22:516:23 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
599+
| test.cpp:516:23:516:23 | x [post update] | PostUpdateNode should not be the target of local flow. |
594600
| true_upon_entry.cpp:9:7:9:7 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
595601
| true_upon_entry.cpp:10:12:10:12 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
596602
| true_upon_entry.cpp:10:27:10:27 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,3 +505,13 @@ void viaOutparamMissingReturn() {
505505
intOutparamSourceMissingReturn(&x);
506506
sink(x); // $ ast,ir
507507
}
508+
509+
void sink_then_source(int* p) {
510+
sink(*p);
511+
*p = source(); // clean
512+
}
513+
514+
void test_sink_then_source() {
515+
int x;
516+
sink_then_source(&x);
517+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
| test.cpp:441:7:441:11 | local | test.cpp:442:18:442:22 | local |
3535
| test.cpp:441:7:441:11 | local | test.cpp:443:8:443:12 | local |
3636
| test.cpp:441:7:441:11 | local | test.cpp:444:9:444:13 | local |
37+
| test.cpp:515:9:515:9 | x | test.cpp:516:23:516:23 | x |

0 commit comments

Comments
 (0)