Introduce limited constant conversions for Kotlin/Native

#KT-25320 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-07-16 15:59:21 +03:00
parent 1a51132884
commit acd5b62148
15 changed files with 735 additions and 37 deletions
@@ -83,4 +83,22 @@ public class DiagnosticsWithUnsignedTypesGenerated extends AbstractDiagnosticsWi
public void testWrongLongSuffixForULong() throws Exception {
runTest("compiler/testData/diagnostics/testsWithUnsignedTypes/wrongLongSuffixForULong.kt");
}
@TestMetadata("compiler/testData/diagnostics/testsWithUnsignedTypes/conversions")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Conversions extends AbstractDiagnosticsWithUnsignedTypes {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInConversions() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithUnsignedTypes/conversions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("conversionOfSignedToUnsigned.kt")
public void testConversionOfSignedToUnsigned() throws Exception {
runTest("compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.kt");
}
}
}
@@ -1032,6 +1032,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.kt");
}
@TestMetadata("signedToUnsignedConversions.kt")
public void testSignedToUnsignedConversions() throws Exception {
runTest("compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt");
}
@TestMetadata("simpleOperators.kt")
public void testSimpleOperators() throws Exception {
runTest("compiler/testData/ir/irText/expressions/simpleOperators.kt");