Add intrinsic for ULong/UInt.toString on Java 8+
Unfortunately this cannot currently be done for the extension overload which accepts a radix due to behavior difference with regard to invalid radix values.
This commit is contained in:
committed by
max-kammerer
parent
b7917978b8
commit
4386518c4d
+19
@@ -0,0 +1,19 @@
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
fun box(): String {
|
||||
val min = 0U.toString()
|
||||
if ("0" != min) throw AssertionError(min)
|
||||
|
||||
val middle = 2_147_483_647U.toString()
|
||||
if ("2147483647" != middle) throw AssertionError(middle)
|
||||
|
||||
val max = 4_294_967_295U.toString()
|
||||
if ("4294967295" != max) throw AssertionError(max)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// 0 kotlin/UInt.toString
|
||||
// 3 INVOKESTATIC java/lang/Integer.toUnsignedString \(I\)Ljava/lang/String;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
fun box(): String {
|
||||
val min = 0UL.toString()
|
||||
if ("0" != min) throw AssertionError(min)
|
||||
|
||||
val middle = 9_223_372_036_854_775_807UL.toString()
|
||||
if ("9223372036854775807" != middle) throw AssertionError(middle)
|
||||
|
||||
val max = 18_446_744_073_709_551_615UL.toString()
|
||||
if ("18446744073709551615" != max) throw AssertionError(max)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// 0 kotlin/ULong.toString
|
||||
// 3 INVOKESTATIC java/lang/Long.toUnsignedString \(J\)Ljava/lang/String;
|
||||
Reference in New Issue
Block a user