Skip to content

Commit 8d4f066

Browse files
committed
Add test for 15042
1 parent 9010116 commit 8d4f066

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎test/testcondition.cpp‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,20 @@ class TestCondition : public TestFixture {
934934
"}\n");
935935
ASSERT_EQUALS("", errout_str());
936936

937+
// the condition 'length > 1' does not make length equal to 2, so 'length > 2' is not dead
938+
check("void f(int length, unsigned int& dst) {\n"
939+
" unsigned int src2 = 0U;\n"
940+
" if (length > 1) {\n"
941+
" if (length > 2) {\n"
942+
" src2 = 15U;\n"
943+
" }\n"
944+
" }\n"
945+
" if (length >= 2) {\n"
946+
" dst = ((0x80) | (src2 >> 2));\n"
947+
" }\n"
948+
"}\n");
949+
ASSERT_EQUALS("", errout_str());
950+
937951
check("const int FEATURE_BITS = x |\n"
938952
"#if FOO_ENABLED\n"
939953
" FEATURE_FOO |\n"

0 commit comments

Comments
 (0)