diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/IntrinsicMethods.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/IntrinsicMethods.java index 802a57a199f..a6542cd57fb 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/IntrinsicMethods.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/IntrinsicMethods.java @@ -41,6 +41,7 @@ public class IntrinsicMethods { private static final FqName KOTLIN_JVM = new FqName("kotlin.jvm"); /* package */ static final FqNameUnsafe RECEIVER_PARAMETER_FQ_NAME = new FqNameUnsafe("T"); + private static final FqNameUnsafe KOTLIN_UINT = new FqNameUnsafe("kotlin.UInt"); private static final FqNameUnsafe KOTLIN_ULONG = new FqNameUnsafe("kotlin.ULong"); private static final IntrinsicMethod UNARY_MINUS = new UnaryMinus(); @@ -162,13 +163,29 @@ public class IntrinsicMethods { declareArrayMethods(); if (jvmTarget.compareTo(JvmTarget.JVM_1_8) >= 0) { - Java8ULongDivide java8ULongDivide = new Java8ULongDivide(); - Java8ULongRemainder java8ULongRemainder = new Java8ULongRemainder(); + Java8UIntDivide java8UIntDivide = new Java8UIntDivide(); + intrinsicsMap.registerIntrinsic(KOTLIN_UINT.toSafe(), null, "div", 1, java8UIntDivide); + intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "uintDivide", 2, java8UIntDivide); + Java8UIntRemainder java8UIntRemainder = new Java8UIntRemainder(); + intrinsicsMap.registerIntrinsic(KOTLIN_UINT.toSafe(), null, "rem", 1, java8UIntRemainder); + intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "uintRemainder", 2, java8UIntRemainder); + + Java8UIntCompare java8UIntCompare = new Java8UIntCompare(); + intrinsicsMap.registerIntrinsic(KOTLIN_UINT.toSafe(), null, "compareTo", 1, java8UIntCompare); + intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "uintCompare", 2, java8UIntCompare); + + Java8ULongDivide java8ULongDivide = new Java8ULongDivide(); intrinsicsMap.registerIntrinsic(KOTLIN_ULONG.toSafe(), null, "div", 1, java8ULongDivide); - intrinsicsMap.registerIntrinsic(KOTLIN_ULONG.toSafe(), null, "rem", 1, java8ULongRemainder); intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "ulongDivide", 2, java8ULongDivide); + + Java8ULongRemainder java8ULongRemainder = new Java8ULongRemainder(); + intrinsicsMap.registerIntrinsic(KOTLIN_ULONG.toSafe(), null, "rem", 1, java8ULongRemainder); intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "ulongRemainder", 2, java8ULongRemainder); + + Java8ULongCompare java8ULongCompare = new Java8ULongCompare(); + intrinsicsMap.registerIntrinsic(KOTLIN_ULONG.toSafe(), null, "compareTo", 1, java8ULongCompare); + intrinsicsMap.registerIntrinsic(BUILT_INS_PACKAGE_FQ_NAME, null, "ulongCompare", 2, java8ULongCompare); } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8ULongDivision.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8Unsigned.kt similarity index 50% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8ULongDivision.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8Unsigned.kt index 42c7c9a68a1..c9db7339eb4 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8ULongDivision.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/intrinsics/Java8Unsigned.kt @@ -10,28 +10,53 @@ import org.jetbrains.kotlin.codegen.CallableMethod import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor -abstract class UnsignedLongDivisionIntrinsic : IntrinsicMethod() { +abstract class UnsignedIntrinsic(private val targetDescriptor: String) : IntrinsicMethod() { override fun isApplicableToOverload(descriptor: CallableMemberDescriptor): Boolean { if (descriptor.containingDeclaration is PackageFragmentDescriptor) return true val singleValueParameterTypeDescriptor = descriptor.valueParameters.single().type.constructor.declarationDescriptor - ?: throw AssertionError("Unexpected descriptor for unsigned long division intrinsic: $descriptor") - return singleValueParameterTypeDescriptor.name.asString() == "ULong" + ?: throw AssertionError("Unexpected descriptor for unsigned intrinsic: $descriptor") + return singleValueParameterTypeDescriptor.name.asString() == targetDescriptor } } +class Java8UIntDivide : UnsignedIntrinsic("UInt") { + override fun toCallable(method: CallableMethod): Callable = + createIntrinsicCallable(method) { + it.invokestatic("java/lang/Integer", "divideUnsigned", "(II)I", false) + } +} -class Java8ULongDivide : UnsignedLongDivisionIntrinsic() { +class Java8UIntRemainder : UnsignedIntrinsic("UInt") { + override fun toCallable(method: CallableMethod): Callable = + createIntrinsicCallable(method) { + it.invokestatic("java/lang/Integer", "remainderUnsigned", "(II)I", false) + } +} + +class Java8UIntCompare : UnsignedIntrinsic("UInt") { + override fun toCallable(method: CallableMethod): Callable = + createIntrinsicCallable(method) { + it.invokestatic("java/lang/Integer", "compareUnsigned", "(II)I", false) + } +} + +class Java8ULongDivide : UnsignedIntrinsic("ULong") { override fun toCallable(method: CallableMethod): Callable = createIntrinsicCallable(method) { it.invokestatic("java/lang/Long", "divideUnsigned", "(JJ)J", false) } } - -class Java8ULongRemainder : UnsignedLongDivisionIntrinsic() { +class Java8ULongRemainder : UnsignedIntrinsic("ULong") { override fun toCallable(method: CallableMethod): Callable = createIntrinsicCallable(method) { it.invokestatic("java/lang/Long", "remainderUnsigned", "(JJ)J", false) } } +class Java8ULongCompare : UnsignedIntrinsic("ULong") { + override fun toCallable(method: CallableMethod): Callable = + createIntrinsicCallable(method) { + it.invokestatic("java/lang/Long", "compareUnsigned", "(JJ)I", false) + } +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt new file mode 100644 index 00000000000..a929c668bc4 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt new file mode 100644 index 00000000000..538345d6f2f --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt new file mode 100644 index 00000000000..2a227accb42 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val u = ua * ub + +fun box(): String { + val div = u / ua + if (div != ub) throw AssertionError("$div") + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt new file mode 100644 index 00000000000..95f55edde46 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val u = ua * ub + +fun box(): String { + val div = u / ua + if (div != ub) throw AssertionError("$div") + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt new file mode 100644 index 00000000000..cea174c1621 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt @@ -0,0 +1,16 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val uc = 3456U +val u = ua * ub + uc + +fun box(): String { + val rem = u % ub + if (rem != uc) throw AssertionError("$rem") + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt new file mode 100644 index 00000000000..f05ae16c4bc --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt @@ -0,0 +1,16 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val uc = 3456U +val u = ua * ub + uc + +fun box(): String { + val rem = u % ub + if (rem != uc) throw AssertionError("$rem") + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt new file mode 100644 index 00000000000..b3fee497f0a --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234UL +val ub = 5678UL + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt new file mode 100644 index 00000000000..e770e2b0263 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt @@ -0,0 +1,15 @@ +// KJS_WITH_FULL_RUNTIME +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234UL +val ub = 5678UL + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm16.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm16.kt new file mode 100644 index 00000000000..b1b74c13ebf --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm16.kt @@ -0,0 +1,16 @@ +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} + +// 1 INVOKESTATIC kotlin/UnsignedKt.uintCompare diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt new file mode 100644 index 00000000000..650c27ba92e --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt @@ -0,0 +1,17 @@ +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} + +// 0 kotlin/UnsignedKt.uintCompare +// 1 INVOKESTATIC java/lang/Integer.compareUnsigned \(II\)I diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm16.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm16.kt new file mode 100644 index 00000000000..5f976391fd3 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm16.kt @@ -0,0 +1,16 @@ +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val u = ua * ub + +fun box(): String { + val div = u / ua + if (div != ub) throw AssertionError("$div") + + return "OK" +} + +// 1 INVOKESTATIC kotlin/UnsignedKt.uintDivide diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt new file mode 100644 index 00000000000..096f6ee9952 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt @@ -0,0 +1,17 @@ +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val u = ua * ub + +fun box(): String { + val div = u / ua + if (div != ub) throw AssertionError("$div") + + return "OK" +} + +// 0 kotlin/UnsignedKt.uintDivide +// 1 INVOKESTATIC java/lang/Integer.divideUnsigned \(II\)I diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm16.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm16.kt new file mode 100644 index 00000000000..11fa209e68b --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm16.kt @@ -0,0 +1,17 @@ +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val uc = 3456U +val u = ua * ub + uc + +fun box(): String { + val rem = u % ub + if (rem != uc) throw AssertionError("$rem") + + return "OK" +} + +// 1 kotlin/UnsignedKt.uintRemainder diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt new file mode 100644 index 00000000000..e42f8d931dd --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt @@ -0,0 +1,18 @@ +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234U +val ub = 5678U +val uc = 3456U +val u = ua * ub + uc + +fun box(): String { + val rem = u % ub + if (rem != uc) throw AssertionError("$rem") + + return "OK" +} + +// 0 kotlin/UnsignedKt.uintRemainder +// 1 INVOKESTATIC java/lang/Integer.remainderUnsigned \(II\)I diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm16.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm16.kt new file mode 100644 index 00000000000..68100a103dd --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm16.kt @@ -0,0 +1,16 @@ +// JVM_TARGET: 1.6 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234UL +val ub = 5678UL + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} + +// 1 INVOKESTATIC kotlin/UnsignedKt.ulongCompare diff --git a/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt new file mode 100644 index 00000000000..dd9d95a9237 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt @@ -0,0 +1,17 @@ +// JVM_TARGET: 1.8 +// WITH_RUNTIME +// IGNORE_BACKEND: JVM_IR + +val ua = 1234UL +val ub = 5678UL + +fun box(): String { + if (ua.compareTo(ub) > 0) { + throw AssertionError() + } + + return "OK" +} + +// 0 kotlin/UnsignedKt.ulongCompare +// 1 INVOKESTATIC java/lang/Long.compareUnsigned \(JJ\)I diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index d3a501c2d7b..5ea91696c18 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -24669,6 +24669,36 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unsignedTypes/signedToUnsignedLiteralConversion.kt"); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + @TestMetadata("unsignedLiteralsForMaxLongValue.kt") public void testUnsignedLiteralsForMaxLongValue() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt"); @@ -24679,6 +24709,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 20b9a998d5a..082b3b3a785 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -3520,6 +3520,46 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 9e47b2e822c..e68c78a69b9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -24669,6 +24669,36 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/unsignedTypes/signedToUnsignedLiteralConversion.kt"); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + @TestMetadata("unsignedLiteralsForMaxLongValue.kt") public void testUnsignedLiteralsForMaxLongValue() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt"); @@ -24679,6 +24709,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ed5a2de1749..561e3121f76 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -24674,6 +24674,36 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unsignedTypes/signedToUnsignedLiteralConversion.kt"); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + @TestMetadata("unsignedLiteralsForMaxLongValue.kt") public void testUnsignedLiteralsForMaxLongValue() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt"); @@ -24684,6 +24714,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 2668bfb603e..1850ccde0fb 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -3530,6 +3530,46 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 1fbbb50ca70..00c8af99961 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -18904,6 +18904,36 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/signedToUnsignedLiteralConversion.kt"); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + @TestMetadata("unsignedLiteralsForMaxLongValue.kt") public void testUnsignedLiteralsForMaxLongValue() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt"); @@ -18914,6 +18944,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongDivide_jvm16.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index e14e64ce489..86833693504 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -20049,6 +20049,36 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/signedToUnsignedLiteralConversion.kt"); } + @TestMetadata("unsignedIntCompare_jvm16.kt") + public void testUnsignedIntCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm16.kt"); + } + + @TestMetadata("unsignedIntCompare_jvm18.kt") + public void testUnsignedIntCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntCompare_jvm18.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm16.kt") + public void testUnsignedIntDivide_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm16.kt"); + } + + @TestMetadata("unsignedIntDivide_jvm18.kt") + public void testUnsignedIntDivide_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntDivide_jvm18.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm16.kt") + public void testUnsignedIntRemainder_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm16.kt"); + } + + @TestMetadata("unsignedIntRemainder_jvm18.kt") + public void testUnsignedIntRemainder_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedIntRemainder_jvm18.kt"); + } + @TestMetadata("unsignedLiteralsForMaxLongValue.kt") public void testUnsignedLiteralsForMaxLongValue() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsForMaxLongValue.kt"); @@ -20059,6 +20089,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLiteralsWithSignedOverflow.kt"); } + @TestMetadata("unsignedLongCompare_jvm16.kt") + public void testUnsignedLongCompare_jvm16() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm16.kt"); + } + + @TestMetadata("unsignedLongCompare_jvm18.kt") + public void testUnsignedLongCompare_jvm18() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongCompare_jvm18.kt"); + } + @TestMetadata("unsignedLongDivide_jvm16.kt") public void testUnsignedLongDivide_jvm16() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/unsignedLongDivide_jvm16.kt");