Delete clean reference instructions on dereferencing captured variables

Codegen generates clean instructions for ref values (captured vars)
on block exit so we should delete them on dereferencing captured values.

  #KT-17200 FIXED
This commit is contained in:
Mikhael Bogdanov
2017-04-07 11:47:18 +02:00
parent f3e2abfd5f
commit b51cb9a911
6 changed files with 81 additions and 0 deletions
@@ -3859,6 +3859,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt17200.kt")
public void testKt17200() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt");
doTest(fileName);
}
@TestMetadata("sharedSlotsWithCapturedVars.kt")
public void testSharedSlotsWithCapturedVars() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt");
@@ -3859,6 +3859,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("kt17200.kt")
public void testKt17200() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/kt17200.kt");
doTest(fileName);
}
@TestMetadata("sharedSlotsWithCapturedVars.kt")
public void testSharedSlotsWithCapturedVars() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/closures/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt");