Provide optimized code generation for for-in-withIndex for iterables

#KT-5177 In Progress
This commit is contained in:
Dmitry Petrov
2018-01-19 16:17:06 +03:00
parent 08622b0953
commit 9c9e507172
20 changed files with 523 additions and 0 deletions
@@ -5223,6 +5223,51 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ForInIterableWithIndex extends AbstractLightAnalysisModeTest {
public void testAllFilesPresentInForInIterableWithIndex() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("forInEmptyListWithIndex.kt")
public void testForInEmptyListWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInEmptyListWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInListWithIndex.kt")
public void testForInListWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInListWithIndexNoElementVar.kt")
public void testForInListWithIndexNoElementVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
doTest(fileName);
}
@TestMetadata("forInListWithIndexNoIndexVar.kt")
public void testForInListWithIndexNoIndexVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoIndexVar.kt");
doTest(fileName);
}
@TestMetadata("forInListWithIndexThrowsCME.kt")
public void testForInListWithIndexThrowsCME() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexThrowsCME.kt");
doTest(fileName);
}
@TestMetadata("forInListWithIndexWithExplicitlyTypedIndexVariable.kt")
public void testForInListWithIndexWithExplicitlyTypedIndexVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexWithExplicitlyTypedIndexVariable.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/returnsNothing")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)