Skip to content

Commit e9d3d8d

Browse files
authored
Added regression test for Ticket 11822 - FP knownConditionTrueFalse (#6562)
This issue has been fixed with 84782cc
1 parent 84782cc commit e9d3d8d

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

test/testcondition.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4633,7 +4633,7 @@ class TestCondition : public TestFixture {
46334633
"}\n");
46344634
ASSERT_EQUALS("", errout_str());
46354635

4636-
check("int h();\n"
4636+
check("int h();\n" // #12858
46374637
"bool g() {\n"
46384638
" bool b{};\n"
46394639
" try {\n"
@@ -4652,6 +4652,24 @@ class TestCondition : public TestFixture {
46524652
" if (g()) {}\n"
46534653
"}\n");
46544654
ASSERT_EQUALS("", errout_str());
4655+
4656+
check("int f(int x, int y) {\n" // #11822
4657+
" if (x) {\n"
4658+
" switch (y) {\n"
4659+
" case 1:\n"
4660+
" return 7;\n"
4661+
" }\n"
4662+
" }\n"
4663+
" \n"
4664+
" if (y)\n"
4665+
" return 8;\n"
4666+
" \n"
4667+
" if (x)\n"
4668+
" return 9;\n"
4669+
" \n"
4670+
" return 0;\n"
4671+
"}");
4672+
ASSERT_EQUALS("", errout_str());
46554673
}
46564674

46574675
void alwaysTrueSymbolic()

0 commit comments

Comments
 (0)