From e9cacc37b66adc840aa28205b9ff38915c3ee5e7 Mon Sep 17 00:00:00 2001 From: Walter Bright Date: Thu, 15 Feb 2024 23:13:11 -0800 Subject: [PATCH] test continue inside do-while (#16192) --- compiler/test/runnable/mars1.d | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/compiler/test/runnable/mars1.d b/compiler/test/runnable/mars1.d index b24eced9f7f4..f493eac181de 100644 --- a/compiler/test/runnable/mars1.d +++ b/compiler/test/runnable/mars1.d @@ -2478,6 +2478,19 @@ void test21835() if (arr[0].r != 0.0) assert(0); } +//////////////////////////////////////////////////////////////////////// +// https://github.com/dlang/dmd/pull/16187#issuecomment-1946534649 + +void testDoWhileContinue() +{ + int i = 10; + do + { + continue; + } + while(--i > 0); +} + //////////////////////////////////////////////////////////////////////// int main() @@ -2578,6 +2591,7 @@ int main() test21256(); test21816(); test21835(); + testDoWhileContinue(); printf("Success\n"); return 0;