Skip to content

Commit 27896b1

Browse files
Update testvalueflow.cpp
1 parent a36539e commit 27896b1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8910,6 +8910,18 @@ class TestValueFlow : public TestFixture {
89108910
" return x;\n"
89118911
"}\n";
89128912
ASSERT_EQUALS(false, testValueOfXKnown(code, 3U, "a", 0));
8913+
8914+
code = "void f(int n) {\n"
8915+
" int x = 0 - n;\n"
8916+
" return x;\n"
8917+
"}\n";
8918+
ASSERT_EQUALS(false, testValueOfX(code, 3U, "n", ValueFlow::Value::ValueType::SYMBOLIC));
8919+
8920+
code = "void f(int n) {\n"
8921+
" int x = n - 0;\n"
8922+
" return x;\n"
8923+
"}\n";
8924+
ASSERT_EQUALS(true, testValueOfX(code, 3U, "n", ValueFlow::Value::ValueType::SYMBOLIC));
89138925
}
89148926

89158927
void valueFlowSymbolicStrlen()

0 commit comments

Comments
 (0)