diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs index b7c798027..f98c1f791 100644 --- a/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs +++ b/ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs @@ -38,6 +38,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness Test("test", ref result); Console.WriteLine(result); ForeachWithAssignment(new int[] { 1, 5, 25 }); + BreakUnlessContinue(true); + BreakUnlessContinue(false); return 0; } @@ -117,5 +119,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness Console.WriteLine(i); } } + + static void BreakUnlessContinue(bool b) + { + Console.WriteLine("BreakUnlessContinue({0})", b); + for (int i = 0; i < 5; i++) { + if ((i % 3) == 0) + continue; + Console.WriteLine(i); + if (b) { + Console.WriteLine("continuing"); + continue; + } + Console.WriteLine("breaking out of loop"); + break; + } + Console.WriteLine("BreakUnlessContinue (end)"); + } } } \ No newline at end of file