Split up generation of test data for codegen/box/ranges into signed and

unsigned ranges/progressions.

The tests pass in JVM_IR for signed, but fail for unsigned due to
inlining being broken. We can disable the JVM_IR tests for unsigned,
while keeping them enabled for signed, to get better test coverage in
the interim until inlining is fixed.
This commit is contained in:
Mark Punzalan
2019-05-01 10:59:24 -07:00
committed by Alexander Udalov
parent 331891b0d7
commit 7efc29df7e
126 changed files with 4575 additions and 2304 deletions
@@ -19469,6 +19469,345 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/ranges/nullableLoopParameter/rangeLiteral.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Unsigned extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInUnsigned() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/expression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Expression extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInExpression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/literal")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Literal extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInLiteral() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt");
}
}
}
}
@TestMetadata("compiler/testData/codegen/box/reflection")
@@ -19469,6 +19469,345 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/ranges/nullableLoopParameter/rangeLiteral.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Unsigned extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInUnsigned() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/expression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Expression extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInExpression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/literal")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Literal extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInLiteral() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt");
}
}
}
}
@TestMetadata("compiler/testData/codegen/box/reflection")
@@ -19474,6 +19474,345 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/ranges/nullableLoopParameter/rangeLiteral.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Unsigned extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInUnsigned() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/expression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Expression extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInExpression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/expression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/ranges/unsigned/literal")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Literal extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInLiteral() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/ranges/unsigned/literal"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("emptyDownto.kt")
public void testEmptyDownto() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyDownto.kt");
}
@TestMetadata("emptyRange.kt")
public void testEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/emptyRange.kt");
}
@TestMetadata("inexactDownToMinValue.kt")
public void testInexactDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactDownToMinValue.kt");
}
@TestMetadata("inexactSteppedDownTo.kt")
public void testInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt");
}
@TestMetadata("inexactSteppedRange.kt")
public void testInexactSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt");
}
@TestMetadata("inexactToMaxValue.kt")
public void testInexactToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/inexactToMaxValue.kt");
}
@TestMetadata("maxValueMinusTwoToMaxValue.kt")
public void testMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("maxValueToMaxValue.kt")
public void testMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMaxValue.kt");
}
@TestMetadata("maxValueToMinValue.kt")
public void testMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/maxValueToMinValue.kt");
}
@TestMetadata("oneElementDownTo.kt")
public void testOneElementDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementDownTo.kt");
}
@TestMetadata("oneElementRange.kt")
public void testOneElementRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/oneElementRange.kt");
}
@TestMetadata("openRange.kt")
public void testOpenRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt");
}
@TestMetadata("overflowZeroDownToMaxValue.kt")
public void testOverflowZeroDownToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroDownToMaxValue.kt");
}
@TestMetadata("overflowZeroToMinValue.kt")
public void testOverflowZeroToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/overflowZeroToMinValue.kt");
}
@TestMetadata("progressionDownToMinValue.kt")
public void testProgressionDownToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionDownToMinValue.kt");
}
@TestMetadata("progressionMaxValueMinusTwoToMaxValue.kt")
public void testProgressionMaxValueMinusTwoToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueMinusTwoToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMaxValue.kt")
public void testProgressionMaxValueToMaxValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMaxValue.kt");
}
@TestMetadata("progressionMaxValueToMinValue.kt")
public void testProgressionMaxValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMaxValueToMinValue.kt");
}
@TestMetadata("progressionMinValueToMinValue.kt")
public void testProgressionMinValueToMinValue() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/progressionMinValueToMinValue.kt");
}
@TestMetadata("reversedBackSequence.kt")
public void testReversedBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt");
}
@TestMetadata("reversedEmptyBackSequence.kt")
public void testReversedEmptyBackSequence() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyBackSequence.kt");
}
@TestMetadata("reversedEmptyRange.kt")
public void testReversedEmptyRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedEmptyRange.kt");
}
@TestMetadata("reversedInexactSteppedDownTo.kt")
public void testReversedInexactSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt");
}
@TestMetadata("reversedRange.kt")
public void testReversedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt");
}
@TestMetadata("reversedSimpleSteppedRange.kt")
public void testReversedSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt");
}
@TestMetadata("simpleDownTo.kt")
public void testSimpleDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt");
}
@TestMetadata("simpleRange.kt")
public void testSimpleRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt");
}
@TestMetadata("simpleRangeWithNonConstantEnds.kt")
public void testSimpleRangeWithNonConstantEnds() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt");
}
@TestMetadata("simpleSteppedDownTo.kt")
public void testSimpleSteppedDownTo() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt");
}
@TestMetadata("simpleSteppedRange.kt")
public void testSimpleSteppedRange() throws Exception {
runTest("compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt");
}
}
}
}
@TestMetadata("compiler/testData/codegen/box/reflection")
@@ -32,12 +32,16 @@ public class GenerateRangesCodegenTestData {
private static final File TEST_DATA_DIR = new File("compiler/testData/codegen/box/ranges");
private static final File AS_LITERAL_DIR = new File(TEST_DATA_DIR, "literal");
private static final File AS_EXPRESSION_DIR = new File(TEST_DATA_DIR, "expression");
private static final File UNSIGNED_TEST_DATA_DIR = new File(TEST_DATA_DIR, "unsigned");
private static final File UNSIGNED_AS_LITERAL_DIR = new File(UNSIGNED_TEST_DATA_DIR, "literal");
private static final File UNSIGNED_AS_EXPRESSION_DIR = new File(UNSIGNED_TEST_DATA_DIR, "expression");
private static final File[] SOURCE_TEST_FILES = {
new File("libraries/stdlib/test/ranges/RangeIterationTest.kt"),
};
private static final Pattern TEST_FUN_PATTERN = Pattern.compile("@Test fun (\\w+)\\(\\) \\{.+?}", Pattern.DOTALL);
private static final Pattern SUBTEST_INVOCATION_PATTERN = Pattern.compile("doTest\\(([^,]+), [^,]+, [^,]+, [^,]+,\\s+listOf[\\w<>]*\\(([^\\n]*)\\)\\)", Pattern.DOTALL);
private static final Pattern SUBTEST_INVOCATION_PATTERN =
Pattern.compile("doTest\\(([^,]+), [^,]+, [^,]+, [^,]+,\\s+listOf[\\w<>]*\\(([^\\n]*)\\)\\)", Pattern.DOTALL);
// $LIST.size() check is needed in order for tests not to run forever
private static final String LITERAL_TEMPLATE = " val $LIST = ArrayList<$TYPE>()\n" +
@@ -61,7 +65,8 @@ public class GenerateRangesCodegenTestData {
" }\n" +
"\n";
private static final List<String> INTEGER_PRIMITIVES = Arrays.asList("Int", "Byte", "Short", "Long", "Char", "UInt", "UByte", "UShort", "ULong");
private static final List<String> INTEGER_PRIMITIVES =
Arrays.asList("Int", "Byte", "Short", "Long", "Char", "UInt", "UByte", "UShort", "ULong");
private static final Map<String, String> ELEMENT_TYPE_KNOWN_SUBSTRINGS = new HashMap<>();
private static final Map<String, String> MIN_MAX_CONSTANTS = new LinkedHashMap<>();
@@ -108,7 +113,13 @@ public class GenerateRangesCodegenTestData {
operandType;
}
private static String renderTemplate(String template, int number, String elementType, String rangeExpression, String expectedListElements) {
private static String renderTemplate(
String template,
int number,
String elementType,
String rangeExpression,
String expectedListElements
) {
return template
.replace("$RANGE_EXPR_ESCAPED", StringUtil.escapeStringCharacters(rangeExpression))
.replace("$RANGE_EXPR", rangeExpression)
@@ -126,7 +137,7 @@ public class GenerateRangesCodegenTestData {
out.printf("// IGNORE_BACKEND: %s%n%n", backendName);
}
private static void writeToFile(File file, String generatedBody) {
private static void writeToFile(File file, String generatedBody, boolean isForUnsigned) {
PrintWriter out;
try {
//noinspection IOResourceOpenedButNotSafelyClosed
@@ -138,8 +149,8 @@ public class GenerateRangesCodegenTestData {
out.println("// KJS_WITH_FULL_RUNTIME");
// Ranges are not supported in JVM_IR yet
if (!WHITELISTED_FOR_JVM_IR_BACKEND.contains(file.getName())) {
// Most test cases for unsigned ranges/progressions are broken for JVM_IR, due to inlining.
if (isForUnsigned && !WHITELISTED_FOR_JVM_IR_BACKEND.contains(file.getName())) {
writeIgnoreBackendDirective(out, "JVM_IR");
}
@@ -166,10 +177,16 @@ public class GenerateRangesCodegenTestData {
try {
FileUtil.delete(AS_LITERAL_DIR);
FileUtil.delete(AS_EXPRESSION_DIR);
FileUtil.delete(UNSIGNED_AS_LITERAL_DIR);
FileUtil.delete(UNSIGNED_AS_EXPRESSION_DIR);
//noinspection ResultOfMethodCallIgnored
AS_LITERAL_DIR.mkdirs();
//noinspection ResultOfMethodCallIgnored
AS_EXPRESSION_DIR.mkdirs();
//noinspection ResultOfMethodCallIgnored
UNSIGNED_AS_LITERAL_DIR.mkdirs();
//noinspection ResultOfMethodCallIgnored
UNSIGNED_AS_EXPRESSION_DIR.mkdirs();
for (File file : SOURCE_TEST_FILES) {
String sourceContent = FileUtil.loadFile(file);
@@ -184,24 +201,43 @@ public class GenerateRangesCodegenTestData {
StringBuilder asLiteralBody = new StringBuilder();
StringBuilder asExpressionBody = new StringBuilder();
int index = 0;
StringBuilder unsignedAsLiteralBody = new StringBuilder();
StringBuilder unsignedAsExpressionBody = new StringBuilder();
int signedIndex = 0;
int unsignedIndex = 0;
Matcher matcher = SUBTEST_INVOCATION_PATTERN.matcher(testFunText);
while (matcher.find()) {
index++;
String rangeExpression = matcher.group(1);
String expectedListElements = matcher.group(2);
String elementType = detectElementType(rangeExpression);
asLiteralBody.append(renderTemplate(LITERAL_TEMPLATE, index, elementType, rangeExpression, expectedListElements));
asExpressionBody.append(renderTemplate(EXPRESSION_TEMPLATE, index, elementType, rangeExpression, expectedListElements));
if (elementType.startsWith("U")) {
unsignedIndex++;
unsignedAsLiteralBody
.append(renderTemplate(LITERAL_TEMPLATE, unsignedIndex, elementType, rangeExpression,
expectedListElements));
unsignedAsExpressionBody
.append(renderTemplate(EXPRESSION_TEMPLATE, unsignedIndex, elementType, rangeExpression,
expectedListElements));
}
else {
signedIndex++;
asLiteralBody
.append(renderTemplate(LITERAL_TEMPLATE, signedIndex, elementType, rangeExpression,
expectedListElements));
asExpressionBody
.append(renderTemplate(EXPRESSION_TEMPLATE, signedIndex, elementType, rangeExpression,
expectedListElements));
}
}
String fileName = testFunName + ".kt";
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString());
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString());
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false);
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false);
writeToFile(new File(UNSIGNED_AS_LITERAL_DIR, fileName), unsignedAsLiteralBody.toString(), true);
writeToFile(new File(UNSIGNED_AS_EXPRESSION_DIR, fileName), unsignedAsExpressionBody.toString(), true);
}
}
}
catch (IOException e) {
throw new RuntimeException(e);