Skip to content

Commit 11a7c8e

Browse files
Update testvalueflow.cpp
1 parent c59f47c commit 11a7c8e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/testvalueflow.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5805,6 +5805,30 @@ class TestValueFlow : public TestFixture {
58055805
" bool b = x;\n"
58065806
"}\n";
58075807
ASSERT_EQUALS(false, testValueOfX(code, 3U, 1));
5808+
5809+
code = "int f(int a) {\n"
5810+
" int x = a ^ a;\n"
5811+
" return x;\n"
5812+
"}\n";
5813+
ASSERT_EQUALS(true, testValueOfX(code, 3U, 0));
5814+
5815+
code = "int f(int a) {\n"
5816+
" int x = a /= a;\n"
5817+
" return x;\n"
5818+
"}\n";
5819+
ASSERT_EQUALS(true, testValueOfX(code, 3U, 1));
5820+
5821+
code = "int f(int a) {\n"
5822+
" int x = a -= a;\n"
5823+
" return x;\n"
5824+
"}\n";
5825+
ASSERT_EQUALS(true, testValueOfX(code, 3U, 0));
5826+
5827+
code = "int f(int a) {\n"
5828+
" int x = a %= a;\n"
5829+
" return x;\n"
5830+
"}\n";
5831+
ASSERT_EQUALS(true, testValueOfX(code, 3U, 0));
58085832
}
58095833

58105834
void valueFlowUninit() {

0 commit comments

Comments
 (0)