test continue inside do-while (#16192)

This commit is contained in:
Walter Bright 2024-02-15 23:13:11 -08:00 committed by GitHub
parent a952831fdb
commit e9cacc37b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2478,6 +2478,19 @@ void test21835()
if (arr[0].r != 0.0) assert(0); 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() int main()
@ -2578,6 +2591,7 @@ int main()
test21256(); test21256();
test21816(); test21816();
test21835(); test21835();
testDoWhileContinue();
printf("Success\n"); printf("Success\n");
return 0; return 0;