JVM: Fix unsigned literals in API version < 1.5
This commit is contained in:
committed by
TeamCityServer
parent
af2d0ad36f
commit
a1c1a32515
+6
@@ -41098,6 +41098,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
|
||||
+1
-1
@@ -1065,7 +1065,7 @@ private class ConstantExpressionEvaluatorVisitor(
|
||||
val uInt = constantExpressionEvaluator.module.findClassAcrossModuleDependencies(StandardNames.FqNames.uInt) ?: return false
|
||||
val accessibility = uInt.checkSinceKotlinVersionAccessibility(languageVersionSettings)
|
||||
// Case `NotAccessibleButWasExperimental` will be checked later in `checkExperimentalityOfConstantLiteral`
|
||||
return accessibility is SinceKotlinAccessibility.Accessible
|
||||
return accessibility !is SinceKotlinAccessibility.NotAccessible
|
||||
}
|
||||
|
||||
private fun <T> ConstantValue<T>.wrap(parameters: CompileTimeConstant.Parameters): TypedCompileTimeConstant<T> =
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !API_VERSION: 1.4
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x = 0u
|
||||
val y = 0uL
|
||||
|
||||
fun box(): String {
|
||||
if (x != 0u) return "Fail 1"
|
||||
if (y != 0uL) return "Fail 2"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -41074,6 +41074,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
|
||||
+6
@@ -41098,6 +41098,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
|
||||
+5
@@ -33019,6 +33019,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -27749,6 +27749,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt");
|
||||
|
||||
Generated
+5
@@ -27160,6 +27160,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt");
|
||||
|
||||
Generated
+5
@@ -27120,6 +27120,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -15303,6 +15303,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsInApiVersion14.kt")
|
||||
public void testUnsignedLiteralsInApiVersion14() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsInApiVersion14.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsignedLiteralsWithSignedOverflow.kt")
|
||||
public void testUnsignedLiteralsWithSignedOverflow() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt");
|
||||
|
||||
Reference in New Issue
Block a user