Skip to content

Commit 9ea4c40

Browse files
committed
C++: Add failing test.
1 parent bee073d commit 9ea4c40

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-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
@@ -3,6 +3,9 @@ uniqueEnclosingCallable
33
| test.cpp:864:47:864:54 | call to source | Node should have one enclosing callable but has 0. |
44
| test.cpp:872:46:872:51 | call to source | Node should have one enclosing callable but has 0. |
55
| test.cpp:872:53:872:56 | 1 | Node should have one enclosing callable but has 0. |
6+
| test.cpp:1126:33:1129:1 | {...} | Node should have one enclosing callable but has 0. |
7+
| test.cpp:1127:3:1127:13 | reads_input | Node should have one enclosing callable but has 0. |
8+
| test.cpp:1128:3:1128:21 | not_does_read_input | Node should have one enclosing callable but has 0. |
69
uniqueCallEnclosingCallable
710
| test.cpp:864:47:864:54 | call to source | Call should have one enclosing callable but has 0. |
811
| test.cpp:872:46:872:51 | call to source | Call should have one enclosing callable but has 0. |

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,4 +1115,20 @@ void indirect_sink_const_ref(const T&);
11151115

11161116
void test_temp_with_conversion_from_materialization() {
11171117
indirect_sink_const_ref(source()); // $ ir MISSING: ast
1118+
}
1119+
1120+
void reads_input(int x) {
1121+
sink(x); // $ MISSING: ast,ir
1122+
}
1123+
1124+
void not_does_read_input(int x);
1125+
1126+
void (*dispatch_table[])(int) = {
1127+
reads_input,
1128+
not_does_read_input
1129+
};
1130+
1131+
void test_dispatch_table(int i) {
1132+
int x = source();
1133+
dispatch_table[i](x);
11181134
}

0 commit comments

Comments
 (0)