KT-1436 Allow break/continue in inlined lambdas

This commit is contained in:
Pavel Mikhailovskii
2022-08-11 00:12:43 +02:00
committed by teamcity
parent ba7df005a1
commit 8ba80b4b7b
52 changed files with 1851 additions and 88 deletions
@@ -6077,6 +6077,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testWhileTrueBreak() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/whileTrueBreak.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue")
@TestDataPath("$PROJECT_ROOT")
public class InlinedBreakContinue {
@Test
public void testAllFilesPresentInInlinedBreakContinue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
}
}
@Nested
@@ -6125,6 +6125,52 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testWhileTrueBreak() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/whileTrueBreak.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue")
@TestDataPath("$PROJECT_ROOT")
public class InlinedBreakContinue {
@Test
public void testAllFilesPresentInInlinedBreakContinue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("inlineFunctionWithMultipleParameters.kt")
public void testInlineFunctionWithMultipleParameters() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/inlineFunctionWithMultipleParameters.kt");
}
@Test
@TestMetadata("lambdaPassedToInlineFunction.kt")
public void testLambdaPassedToInlineFunction() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/lambdaPassedToInlineFunction.kt");
}
@Test
@TestMetadata("loopWithinInlineFunction.kt")
public void testLoopWithinInlineFunction() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/loopWithinInlineFunction.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/simple.kt");
}
@Test
@TestMetadata("stdlibFunctions.kt")
public void testStdlibFunctions() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/stdlibFunctions.kt");
}
@Test
@TestMetadata("withReturnValue.kt")
public void testWithReturnValue() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/withReturnValue.kt");
}
}
}
@Nested
@@ -5392,6 +5392,49 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testWhileTrueBreak() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/whileTrueBreak.kt");
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlinedBreakContinue extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInInlinedBreakContinue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("inlineFunctionWithMultipleParameters.kt")
public void testInlineFunctionWithMultipleParameters() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/inlineFunctionWithMultipleParameters.kt");
}
@TestMetadata("lambdaPassedToInlineFunction.kt")
public void testLambdaPassedToInlineFunction() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/lambdaPassedToInlineFunction.kt");
}
@TestMetadata("loopWithinInlineFunction.kt")
public void testLoopWithinInlineFunction() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/loopWithinInlineFunction.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/simple.kt");
}
@TestMetadata("stdlibFunctions.kt")
public void testStdlibFunctions() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/stdlibFunctions.kt");
}
@TestMetadata("withReturnValue.kt")
public void testWithReturnValue() throws Exception {
runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/inlinedBreakContinue/withReturnValue.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInArray")