Files
codeql/cpp/ql/test/library-tests/dataflow/dataflow-tests/guard-condition-regression-test.cpp
Mathias Vorreiter Pedersen b0566af938 C++: Accept test changes.
2023-09-14 14:04:12 +01:00

19 lines
363 B
C++

int source();
void gard_condition_sink(int);
void use(int);
/*
This test checks that we hit the node corresponding to the expression node that wraps `source`
in the condition `source >= 0`.
*/
void test_guard_condition(int source, bool b)
{
if (b) {
use(source);
}
if (source >= 0) {
use(source);
}
gard_condition_sink(source); // clean
}