Support val initialization in non-inline function with EXACTLY_ONCE effect
by generating a box for the value. #KT-26126 Fixed
This commit is contained in:
+18
@@ -4473,6 +4473,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/contracts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Contracts extends AbstractBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContracts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNotInline.kt")
|
||||
public void testExactlyOnceNotInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/controlStructures")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+10
@@ -1024,6 +1024,16 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceCrossinline.kt")
|
||||
public void testExactlyOnceCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNoinline.kt")
|
||||
public void testExactlyOnceNoinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceNoinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturn.kt")
|
||||
public void testNonLocalReturn() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||
|
||||
Generated
+10
@@ -1024,6 +1024,16 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceCrossinline.kt")
|
||||
public void testExactlyOnceCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNoinline.kt")
|
||||
public void testExactlyOnceNoinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceNoinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturn.kt")
|
||||
public void testNonLocalReturn() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||
|
||||
+18
@@ -4473,6 +4473,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/contracts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Contracts extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContracts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNotInline.kt")
|
||||
public void testExactlyOnceNotInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/controlStructures")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+18
@@ -4473,6 +4473,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/contracts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Contracts extends AbstractIrBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContracts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNotInline.kt")
|
||||
public void testExactlyOnceNotInline() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/controlStructures")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+10
@@ -1024,6 +1024,16 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceCrossinline.kt")
|
||||
public void testExactlyOnceCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("exactlyOnceNoinline.kt")
|
||||
public void testExactlyOnceNoinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceNoinline.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturn.kt")
|
||||
public void testNonLocalReturn() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||
|
||||
Reference in New Issue
Block a user