diff --git a/IDEHelper/Compiler/BfStmtEvaluator.cpp b/IDEHelper/Compiler/BfStmtEvaluator.cpp index ede3f118..046f6fcc 100644 --- a/IDEHelper/Compiler/BfStmtEvaluator.cpp +++ b/IDEHelper/Compiler/BfStmtEvaluator.cpp @@ -5490,7 +5490,7 @@ void BfModule::Visit(BfWhileStatement* whileStmt) // For BeefBackend we continue to do CondBr because it helps our flow analysis and we optimize it anyway if ((isInfiniteLoop) && (!IsTargetingBeefBackend())) mBfIRBuilder->CreateBr(bodyBB); - else if ((isFalseLoop) && (!IsTargetingBeefBackend())) + else if (isFalseLoop) mBfIRBuilder->CreateBr(endBB); else mBfIRBuilder->CreateCondBr(checkVal.mValue, bodyBB, endBB); diff --git a/IDEHelper/Tests/src/Loops.bf b/IDEHelper/Tests/src/Loops.bf new file mode 100644 index 00000000..ac7508c5 --- /dev/null +++ b/IDEHelper/Tests/src/Loops.bf @@ -0,0 +1,16 @@ +using System; + +namespace Tests +{ + class Loops + { + [Test] + public static void TestBasics() + { + while (false) + { + + } + } + } +}