Skip to content

Commit e5d27b3

Browse files
committed
C++: Add failing test.
1 parent 69619f1 commit e5d27b3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ postWithInFlow
4343
| example.c:28:23:28:25 | pos [inner post update] | PostUpdateNode should not be the target of local flow. |
4444
| globals.cpp:13:5:13:19 | flowTestGlobal1 [post update] | PostUpdateNode should not be the target of local flow. |
4545
| globals.cpp:23:5:23:19 | flowTestGlobal2 [post update] | PostUpdateNode should not be the target of local flow. |
46+
| globals.cpp:34:18:34:18 | x [post update] | PostUpdateNode should not be the target of local flow. |
4647
| lambdas.cpp:23:3:23:14 | v [post update] | PostUpdateNode should not be the target of local flow. |
4748
| lambdas.cpp:43:3:43:3 | c [post update] | PostUpdateNode should not be the target of local flow. |
4849
| ref.cpp:11:5:11:7 | lhs [post update] | PostUpdateNode should not be the target of local flow. |

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,20 @@ void readGlobal2() {
2222
void writeGlobal2() {
2323
flowTestGlobal2 = source();
2424
}
25+
26+
namespace MyNamespace {
27+
struct A {
28+
int x;
29+
};
30+
31+
A global_a;
32+
33+
void set_without_ssa_def() {
34+
global_a.x = source();
35+
}
36+
37+
void call_set_without_ssa_def() {
38+
set_without_ssa_def();
39+
sink(global_a.x); // $ MISSING: ast,ir
40+
}
41+
}

0 commit comments

Comments
 (0)