JVM_IR: support non-local break/continue in the inliner

Not in the frontend or psi2ir, though, so this not a complete
implementation of KT-1436, but rather a part of it that is currently
useful to make other code compile. In particular, lambdas passed to
array constructors and JVM-style `assert` are inlined as IR returnable
blocks, which are then converted into `do { ... } while (false)` loops,
so non-local returns from them become non-local `break`s.
This commit is contained in:
pyos
2020-02-18 12:48:59 +01:00
committed by max-kammerer
parent 4a17228621
commit 0f2ca5d84c
28 changed files with 660 additions and 155 deletions
@@ -2420,6 +2420,46 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.kt");
}
@TestMetadata("fromArrayGenerator.kt")
public void testFromArrayGenerator() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGenerator.kt");
}
@TestMetadata("fromArrayGeneratorCatch.kt")
public void testFromArrayGeneratorCatch() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorCatch.kt");
}
@TestMetadata("fromArrayGeneratorNested.kt")
public void testFromArrayGeneratorNested() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorNested.kt");
}
@TestMetadata("fromArrayGeneratorWithCapture.kt")
public void testFromArrayGeneratorWithCapture() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorWithCapture.kt");
}
@TestMetadata("fromArrayGeneratorWithCatch.kt")
public void testFromArrayGeneratorWithCatch() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorWithCatch.kt");
}
@TestMetadata("fromArrayGeneratorWithFinally.kt")
public void testFromArrayGeneratorWithFinally() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorWithFinally.kt");
}
@TestMetadata("fromArrayGeneratorWithFinallyX2.kt")
public void testFromArrayGeneratorWithFinallyX2() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorWithFinallyX2.kt");
}
@TestMetadata("fromArrayGeneratorWithFinallyX2_2.kt")
public void testFromArrayGeneratorWithFinallyX2_2() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromArrayGeneratorWithFinallyX2_2.kt");
}
@TestMetadata("fromInterfaceDefaultGetter.kt")
public void testFromInterfaceDefaultGetter() throws Exception {
runTest("compiler/testData/codegen/boxInline/nonLocalReturns/fromInterfaceDefaultGetter.kt");