Skip to content

Commit ae2fa6c

Browse files
authored
Merge pull request #11975 from MathiasVP/another-dataflow-loop
C++: Add another looping dataflow test
2 parents 522c9d6 + 510211a commit ae2fa6c

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ postWithInFlow
9494
| test.cpp:505:35:505:35 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
9595
| test.cpp:511:5:511:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
9696
| 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. |
97+
| test.cpp:516:5:516:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
98+
| test.cpp:516:6:516:6 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
99+
| test.cpp:522:25:522:25 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
100+
| test.cpp:526:25:526:25 | y [inner post update] | PostUpdateNode should not be the target of local flow. |
98101
viableImplInCallContextTooLarge
99102
uniqueParameterNodeAtPosition
100103
uniqueParameterNodePosition

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

+9-3
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,15 @@ postWithInFlow
594594
| test.cpp:511:5:511:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
595595
| test.cpp:511:6:511:6 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
596596
| 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. |
597+
| test.cpp:516:5:516:6 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
598+
| test.cpp:516:6:516:6 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
599+
| test.cpp:516:6:516:6 | p [post update] | PostUpdateNode should not be the target of local flow. |
600+
| test.cpp:522:24:522:25 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
601+
| test.cpp:522:24:522:25 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
602+
| test.cpp:522:25:522:25 | x [post update] | PostUpdateNode should not be the target of local flow. |
603+
| test.cpp:526:24:526:25 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
604+
| test.cpp:526:24:526:25 | & ... [post update] | PostUpdateNode should not be the target of local flow. |
605+
| test.cpp:526:25:526:25 | y [post update] | PostUpdateNode should not be the target of local flow. |
600606
| true_upon_entry.cpp:9:7:9:7 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
601607
| true_upon_entry.cpp:10:12:10:12 | VariableAddress [post update] | PostUpdateNode should not be the target of local flow. |
602608
| 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

+15-4
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,23 @@ void viaOutparamMissingReturn() {
506506
sink(x); // $ ast,ir
507507
}
508508

509-
void sink_then_source(int* p) {
510-
sink(*p);
511-
*p = source(); // clean
509+
void sink_then_source_1(int* p) {
510+
sink(*p); // clean
511+
*p = source();
512+
}
513+
514+
void sink_then_source_2(int* p, int y) {
515+
sink(y); // $ SPURIOUS: ast
516+
*p = source();
512517
}
513518

514519
void test_sink_then_source() {
520+
{
515521
int x;
516-
sink_then_source(&x);
522+
sink_then_source_1(&x);
523+
}
524+
{
525+
int y;
526+
sink_then_source_2(&y, y);
527+
}
517528
}

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@
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 |
37+
| test.cpp:521:9:521:9 | x | test.cpp:522:25:522:25 | x |
38+
| test.cpp:525:9:525:9 | y | test.cpp:526:25:526:25 | y |
39+
| test.cpp:525:9:525:9 | y | test.cpp:526:28:526:28 | y |

0 commit comments

Comments
 (0)