PSI2IR: SAM conversion should be performed once for index variables

Given esoteric code as in 'caoWithAdaptationForSam.kt', we should make
sure that we pass same objects to 'get' and 'set'.
This commit is contained in:
Dmitry Petrov
2020-01-28 17:12:50 +03:00
parent e750528551
commit bf9673a0a2
14 changed files with 689 additions and 125 deletions
@@ -8118,83 +8118,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/coroutines/noStdLib")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NoStdLib extends AbstractLightAnalysisModeTest {
@TestMetadata("breakFinally.kt")
public void ignoreBreakFinally_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakFinally.kt")
public void ignoreBreakFinally_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines");
}
@TestMetadata("breakStatement.kt")
public void ignoreBreakStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakStatement.kt")
public void ignoreBreakStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines");
}
@TestMetadata("crossinline.kt")
public void ignoreCrossinline_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("crossinline.kt")
public void ignoreCrossinline_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines");
}
@TestMetadata("ifStatement.kt")
public void ignoreIfStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("ifStatement.kt")
public void ignoreIfStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines");
}
@TestMetadata("stateMachine.kt")
public void ignoreStateMachine_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("stateMachine.kt")
public void ignoreStateMachine_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines");
}
@TestMetadata("switchLikeWhen.kt")
public void ignoreSwitchLikeWhen_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("switchLikeWhen.kt")
public void ignoreSwitchLikeWhen_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception {
KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInNoStdLib() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/noStdLib"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
}
@TestMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)