File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments