Skip to content

Commit

Permalink
Added regression test for Ticket 11822 - FP knownConditionTrueFalse
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Jul 1, 2024
1 parent 84782cc commit 7814411
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/testcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4633,7 +4633,7 @@ class TestCondition : public TestFixture {
"}\n");
ASSERT_EQUALS("", errout_str());

check("int h();\n"
check("int h();\n" // #12858
"bool g() {\n"
" bool b{};\n"
" try {\n"
Expand All @@ -4652,6 +4652,24 @@ class TestCondition : public TestFixture {
" if (g()) {}\n"
"}\n");
ASSERT_EQUALS("", errout_str());

check("int f(int x, int y) {\n" // #11822
" if (x) {\n"
" switch (y) {\n"
" case 1:\n"
" return 7;\n"
" }\n"
" }\n"
" \n"
" if (y)\n"
" return 8;\n"
" \n"
" if (x)\n"
" return 9;\n"
" \n"
" return 0;\n"
"}");
ASSERT_EQUALS("", errout_str());
}

void alwaysTrueSymbolic()
Expand Down

0 comments on commit 7814411

Please sign in to comment.