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

#KT-5177 In Progress
This commit is contained in:
Dmitry Petrov
2018-01-19 17:29:43 +03:00
parent 9c9e507172
commit 2399a39414
22 changed files with 610 additions and 6 deletions
@@ -5223,6 +5223,57 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ForInCharSequenceWithIndex extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInForInCharSequenceWithIndex() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("forInCharSeqWithIndexStops.kt")
public void testForInCharSeqWithIndexStops() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSeqWithIndexStops.kt");
doTest(fileName);
}
@TestMetadata("forInCharSequenceWithIndex.kt")
public void testForInCharSequenceWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInEmptyStringWithIndex.kt")
public void testForInEmptyStringWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInEmptyStringWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInStringWithIndex.kt")
public void testForInStringWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInStringWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInStringWithIndexNoElementVar.kt")
public void testForInStringWithIndexNoElementVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInStringWithIndexNoElementVar.kt");
doTest(fileName);
}
@TestMetadata("forInStringWithIndexNoIndexVar.kt")
public void testForInStringWithIndexNoIndexVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInStringWithIndexNoIndexVar.kt");
doTest(fileName);
}
@TestMetadata("forInStringWithIndexWithExplicitlyTypedIndexVariable.kt")
public void testForInStringWithIndexWithExplicitlyTypedIndexVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInStringWithIndexWithExplicitlyTypedIndexVariable.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)