From ccd525962b11bcad680f3288717c2e267ddea031 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 1 Aug 2021 12:32:01 +0200 Subject: [PATCH] #8220: Added a regression test. --- test/testcondition.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 4c93dbe2c..24f2c0720 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -2949,6 +2949,23 @@ private: } void alwaysTrue() { + + check("void f ()\n"// #8220 + "{\n" + " int a;\n" + " int b = 0;\n" + " int ret;\n" + " \n" + " a = rand();\n" + " while (((0 < a) && (a < 2)) && ((8 < a) && (a < 10))) \n" + " {\n" + " b += a;\n" + " a ++;\n" + " }\n" + " ret = b;\n" + "}"); + ASSERT_EQUALS("[test.cpp:8] -> [test.cpp:8]: (style) Condition '8 5) {}\n"