Skip to content

Commit d5442ec

Browse files
committed
C++: Add regression test.
1 parent 354a55c commit d5442ec

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,4 +788,12 @@ void test_sometimes_calls_sink_switch() {
788788
sometimes_calls_sink_switch(source(), 1);
789789
sometimes_calls_sink_switch(0, 0);
790790
sometimes_calls_sink_switch(source(), 0);
791+
}
792+
793+
void intPointerSource(int *ref_source, const int* another_arg);
794+
795+
void test() {
796+
MyStruct a;
797+
intPointerSource(a.content, a.content);
798+
indirect_sink(a.content); // $ ast MISSING: ir
791799
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@
4646
| test.cpp:595:8:595:9 | xs | test.cpp:597:9:597:10 | xs |
4747
| test.cpp:733:7:733:7 | x | test.cpp:734:41:734:41 | x |
4848
| test.cpp:733:7:733:7 | x | test.cpp:735:8:735:8 | x |
49+
| test.cpp:796:12:796:12 | a | test.cpp:797:20:797:20 | a |
50+
| test.cpp:796:12:796:12 | a | test.cpp:797:31:797:31 | a |
51+
| test.cpp:796:12:796:12 | a | test.cpp:798:17:798:17 | a |

0 commit comments

Comments
 (0)