Maintain bounds evaluation order in intrinsics for 'reversed'

Makes sense for 'rangeTo', 'downTo', and 'until' with non-const bounds.
This commit is contained in:
Dmitry Petrov
2017-12-13 14:00:14 +03:00
parent 9fa9a8748b
commit 65b5cdbb8d
11 changed files with 206 additions and 10 deletions
@@ -15324,6 +15324,33 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forInReversed/forInReversedUntilWithNonConstBounds.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/codegen/box/ranges/forInReversed/evaluationOrder")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class EvaluationOrder extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInEvaluationOrder() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/forInReversed/evaluationOrder"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("forInReversedDownToEvaluationOrder.kt")
public void testForInReversedDownToEvaluationOrder() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forInReversed/evaluationOrder/forInReversedDownToEvaluationOrder.kt");
doTest(fileName);
}
@TestMetadata("forInReversedRangeLiteralEvaluationOrder.kt")
public void testForInReversedRangeLiteralEvaluationOrder() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forInReversed/evaluationOrder/forInReversedRangeLiteralEvaluationOrder.kt");
doTest(fileName);
}
@TestMetadata("forInReversedUntilEvaluationOrder.kt")
public void testForInReversedUntilEvaluationOrder() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/forInReversed/evaluationOrder/forInReversedUntilEvaluationOrder.kt");
doTest(fileName);
}
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/forInUntil")