diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 8391668b92a..69d397c3765 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -577,16 +577,8 @@ standaloneTest("runtime_basic_exit") { expectedExitStatus = 42 } -tasks.register("runtime_random", KonanLocalTest) { - source = "runtime/basic/random.kt" -} - -tasks.register("runtime_basic_simd", KonanLocalTest) { - source = "runtime/basic/simd.kt" -} - -tasks.register("runtime_worker_random", KonanLocalTest) { - source = "runtime/basic/worker_random.kt" +tasks.register("codegen_vector_default_argument", KonanLocalTest) { + source = "codegen/vector/default_argument.kt" } tasks.register("hello0", KonanLocalTest) { @@ -723,35 +715,6 @@ standaloneTest("readline1") { source = "runtime/basic/readline1.kt" } -tasks.register("tostring0", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/tostring0.kt" -} - -tasks.register("tostring1", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/tostring1.kt" -} - -tasks.register("tostring2", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/tostring2.kt" -} - -tasks.register("tostring3", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/tostring3.kt" -} - -tasks.register("tostring4", KonanLocalTest) { - source = "runtime/basic/tostring4.kt" -} - -tasks.register("empty_substring", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/empty_substring.kt" -} - standaloneTest("cleaner_basic") { enabled = !isNoopGC source = "runtime/basic/cleaner_basic.kt" @@ -2244,20 +2207,6 @@ tasks.register("interface0", KonanLocalTest) { source = "runtime/basic/interface0.kt" } -tasks.register("hash0", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/hash0.kt" -} - -tasks.register("ieee754", KonanLocalTest) { - useGoldenData = true - source = "runtime/basic/ieee754.kt" -} - -standaloneTest("hypotenuse") { - source = "runtime/basic/hypot.kt" -} - tasks.register("listof1", KonanLocalTest) { enabled = false useGoldenData = true @@ -2626,10 +2575,6 @@ tasks.register("main_exception", KonanLocalTest) { source = "runtime/basic/main_exception.kt" } -tasks.register("runtime_basic_standard", KonanLocalTest) { - source = "runtime/basic/standard.kt" -} - standaloneTest("runtime_basic_assert_failed") { expectedExitStatusChecker = { it != 0 } source = "runtime/basic/assert_failed.kt" diff --git a/kotlin-native/backend.native/tests/codegen/vector/default_argument.kt b/kotlin-native/backend.native/tests/codegen/vector/default_argument.kt new file mode 100644 index 00000000000..0ca44eb7036 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/vector/default_argument.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) + +package codegen.vector.default_argument + +import kotlin.test.* +import kotlinx.cinterop.Vector128 +import kotlinx.cinterop.vectorOf + +private fun funDefaultValue(v: Vector128 = vectorOf(1.0f, 2.0f, 3.0f, 4.0f)) = v + +@Test fun runTest() { + assertEquals(vectorOf(1.0f, 2.0f, 3.0f, 4.0f), funDefaultValue()) +} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/empty_substring.kt b/kotlin-native/backend.native/tests/runtime/basic/empty_substring.kt deleted file mode 100644 index 02741c2ab96..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/empty_substring.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.empty_substring - -import kotlin.test.* - -@Test fun runTest() { - val hello = "Hello world" - println(hello.subSequence(1, 1).toString()) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out b/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out deleted file mode 100644 index 8b137891791..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/empty_substring.out +++ /dev/null @@ -1 +0,0 @@ - diff --git a/kotlin-native/backend.native/tests/runtime/basic/hash0.kt b/kotlin-native/backend.native/tests/runtime/basic/hash0.kt deleted file mode 100644 index 4bc72321ed0..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/hash0.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.hash0 - -import kotlin.test.* - -@Test fun runTest() { - println(239.hashCode()) - println((-1L).hashCode()) - println('a'.hashCode()) - println(1.0f.hashCode()) - println(1.0.hashCode()) - println(true.hashCode()) - println(false.hashCode()) - println(Any().hashCode() != Any().hashCode()) - val a = CharArray(5) - a[0] = 'H' - a[1] = 'e' - a[2] = 'l' - a[3] = 'l' - a[4] = 'o' - println("Hello".hashCode() == a.concatToString(0, 5).hashCode()) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/hash0.out b/kotlin-native/backend.native/tests/runtime/basic/hash0.out deleted file mode 100644 index a6c45a1095d..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/hash0.out +++ /dev/null @@ -1,9 +0,0 @@ -239 -0 -97 -1065353216 -1072693248 -1231 -1237 -true -true diff --git a/kotlin-native/backend.native/tests/runtime/basic/hypot.kt b/kotlin-native/backend.native/tests/runtime/basic/hypot.kt deleted file mode 100644 index f125ecd1046..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/hypot.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -import kotlin.test.* -import kotlin.math.* - -fun main() { - val hf = hypot(Float.NEGATIVE_INFINITY, Float.NaN) - println("float hypot: $hf ${hf.toRawBits().toString(16)}") - println("Float.NaN: ${Float.NaN.toRawBits().toString(16)}") - println("Float.+Inf: ${Float.POSITIVE_INFINITY} ${Float.POSITIVE_INFINITY.toRawBits().toString(16)}") - println("Float.-Inf: ${Float.NEGATIVE_INFINITY} ${Float.NEGATIVE_INFINITY.toRawBits().toUInt().toString(16)}") - println(Float.POSITIVE_INFINITY == Float.NEGATIVE_INFINITY) - assertEquals(Float.POSITIVE_INFINITY, hypot(Float.NEGATIVE_INFINITY, Float.NaN)) - - val hd = hypot(Double.NEGATIVE_INFINITY, Double.NaN) - println("Double hypot: $hd ${hd.toRawBits().toString(16)}") - println("Double.NaN: ${Double.NaN.toRawBits().toString(16)}") - println("Double.+Inf: ${Double.POSITIVE_INFINITY} ${Double.POSITIVE_INFINITY.toRawBits().toString(16)}") - println("Double.-Inf: ${Double.NEGATIVE_INFINITY} ${Double.NEGATIVE_INFINITY.toRawBits().toUInt().toString(16)}") - println(Double.POSITIVE_INFINITY == Double.NEGATIVE_INFINITY) - assertEquals(Double.POSITIVE_INFINITY, hypot(Double.NEGATIVE_INFINITY, Double.NaN)) - - println("hypot NaN, 0: ${hypot(Double.NaN, 0.0).toRawBits().toString(16)}") - assertTrue(hypot(Double.NaN, 0.0).isNaN()) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt b/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt deleted file mode 100644 index c25d02b5121..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.ieee754 - -import kotlin.test.* - -@Test fun runTest() { - val v = Float.POSITIVE_INFINITY - val i = v.toInt() - println("$v $i ${i.toShort()}") - - val a = 42 - val b = Float.MAX_VALUE - println("${a + b}") - - val s = Float.NaN.toInt().toShort() - println("NAN2SHORT:: $s") - - val d: Float = Float.MAX_VALUE - val d2i = d.toInt() - println("$d2i ${d2i.toShort()}") - - for (f in arrayOf(Float.POSITIVE_INFINITY, Float.MAX_VALUE / 2, Float.MAX_VALUE, - 3.14f, Float.NaN, -33333.12312f, Float.MIN_VALUE, Float.NEGATIVE_INFINITY, - -1.2f, -12.6f, 2.3f)) { - println("FLOAT:: $f INT:: ${f.toInt()}") - } - - println("OK") -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/ieee754.out b/kotlin-native/backend.native/tests/runtime/basic/ieee754.out deleted file mode 100644 index 90793410eca..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/ieee754.out +++ /dev/null @@ -1,16 +0,0 @@ -Infinity 2147483647 -1 -3.4028235E38 -NAN2SHORT:: 0 -2147483647 -1 -FLOAT:: Infinity INT:: 2147483647 -FLOAT:: 1.7014117E38 INT:: 2147483647 -FLOAT:: 3.4028235E38 INT:: 2147483647 -FLOAT:: 3.14 INT:: 3 -FLOAT:: NaN INT:: 0 -FLOAT:: -33333.125 INT:: -33333 -FLOAT:: 1.4E-45 INT:: 0 -FLOAT:: -Infinity INT:: -2147483648 -FLOAT:: -1.2 INT:: -1 -FLOAT:: -12.6 INT:: -12 -FLOAT:: 2.3 INT:: 2 -OK diff --git a/kotlin-native/backend.native/tests/runtime/basic/random.kt b/kotlin-native/backend.native/tests/runtime/basic/random.kt deleted file mode 100644 index 8afeac16175..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/random.kt +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.random - -import kotlin.collections.* -import kotlin.random.* -import kotlin.system.* -import kotlin.test.* - -/** - * Tests that setting the same seed make random generate the same sequence - */ -private inline fun testReproducibility(seed: Long, generator: Random.() -> T) { - // Reset seed. This will make Random to start a new sequence - val r1 = Random(seed) - val first = Array(50, { i -> r1.generator() }).toList() - - // Reset seed and try again - val r2 = Random(seed) - val second = Array(50, { i -> r2.generator() }).toList() - assertTrue(first == second, "FAIL: got different sequences of generated values " + - "first: $first, second: $second") -} - -/** - * Tests that setting seed makes random generate different sequence. - */ -private inline fun testDifference(generator: Random.() -> T) { - val r1 = Random(12345678L) - val first = Array(100, { i -> r1.generator() }).toList() - - val r2 = Random(87654321L) - val second = Array(100, { i -> r2.generator() }).toList() - assertTrue(first != second, "FAIL: got the same sequence of generated values " + - "first: $first, second: $second") -} - -@Test -fun testInts() { - testReproducibility(getTimeMillis(), { nextInt() }) - testReproducibility(Long.MAX_VALUE, { nextInt() }) -} - -@Test -fun testLong() { - testReproducibility(getTimeMillis(), { nextLong() }) - testReproducibility(Long.MAX_VALUE, { nextLong() }) -} - -@Test -fun testDiffInt() = testDifference { nextInt() } - -@Test -fun testDiffLong() = testDifference { nextLong() } - -@Test -fun testNextInt() { - testReproducibility(getTimeMillis(), { nextInt(1000) }) - testReproducibility(1000L, { nextInt(1024) }) -} diff --git a/kotlin-native/backend.native/tests/runtime/basic/simd.kt b/kotlin-native/backend.native/tests/runtime/basic/simd.kt deleted file mode 100644 index fa1bc5f79eb..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/simd.kt +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2010-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ -@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) - -package runtime.basic.simd - -import kotlin.test.* -import kotlinx.cinterop.Vector128 -import kotlinx.cinterop.vectorOf - - -@Test fun runTest() { - testBoxingSimple() - testBoxing() - testSetGet() - testString() - testOOB() - testEquals() - testHash() - testDefaultValue() -} - - -class Box(t: T) { - var value = t -} - -class UnalignedC(t: Vector128) { - var smth = 1 - var value = t -} - -fun testBoxingSimple() { - val v = vectorOf(1f, 3.162f, 10f, 31f) - val box: Box = Box(v) - assertEquals(v, box.value, "testBoxingSimple FAILED") -} - -fun testBoxing() { - var u = UnalignedC(vectorOf(0, 1, 2, 3)) - assertEquals(3, u.value.getIntAt(3)) - u.value = vectorOf(0f, 1f, 2f, 3f) - assertEquals(vectorOf(0f, 1f, 2f, 3f), u.value, "testBoxing FAILED") -} - -fun testSetGet() { - var v4any = vectorOf(0, 1, 2, 3) - (0 until 4).forEach { assertEquals(it, v4any.getIntAt(it), "testSetGet FAILED for <4 x i32>") } - - // type punning: set the variable to another runtime type - val a = arrayOf(1f, 3.162f, 10f, 31f) - v4any = vectorOf(a[0], a[1], a[2], a[3]) - (0 until 4).forEach { assertEquals(a[it], v4any.getFloatAt(it), "testSetGet FAILED for <4 x float>") } -} - -fun testString() { - val v4i = vectorOf(100, 1024, Int.MAX_VALUE, Int.MIN_VALUE) - assertEquals("(0x64, 0x400, 0x7fffffff, 0x80000000)", v4i.toString(), "testString FAILED") -} - -fun testOOB() { - val f = vectorOf(1f, 3.162f, 10f, 31f) - - println("f.getByteAt(15) is OK ${f.getByteAt(15)}") - - assertFailsWith("f.getByteAt(16) should fail") { - f.getByteAt(16) - } - - assertFailsWith("f.getIntAt(-1) should fail") { - f.getIntAt(-1) - } - - assertFailsWith("f.getFloatAt(4) should fail") { - f.getFloatAt(4) - } -} - -fun testEquals() { - var v1 = vectorOf(-1f, 0f, 0f, -7f) - var v2 = vectorOf(1f, 4f, 3f, 7f) - assertEquals(false, v1 == v2) - assertEquals(false, v1.equals(v2)) - assertEquals(false, v1.equals(Any())) - assertEquals(true, v2 == v2) - - v1 = v2 - assertEquals(true, v1 == v2) -} - -fun testHash() { - val h1 = vectorOf(1f, 4f, 3f, 7f).hashCode() - val h2 = vectorOf(3f, 7f, 1f, 4f).hashCode() - assertEquals(false, h1 == h2) - - val i = 654687 - assertEquals(true, vectorOf(0, 0, i, 0).hashCode() == i.hashCode()) // exploit little endianness - assertEquals(true, vectorOf(1, 0, 0, 0).hashCode() == vectorOf(0, 0, 31, 0).hashCode()) -} - -private fun funDefaultValue(v: Vector128 = vectorOf(1.0f, 2.0f, 3.0f, 4.0f)) = v - -fun testDefaultValue() { - assertEquals(vectorOf(1.0f, 2.0f, 3.0f, 4.0f), funDefaultValue()) -} diff --git a/kotlin-native/backend.native/tests/runtime/basic/standard.kt b/kotlin-native/backend.native/tests/runtime/basic/standard.kt deleted file mode 100644 index 0a8b96f83e1..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/standard.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.standard - -import kotlin.test.* - -class Foo(val bar: Int) - -fun assertEquals(actual: T, expected: T) { - if (actual != expected) throw AssertionError("Assertion failed. Expected value: $expected, actual value: $actual") -} - -@Test fun runTest() { - try { - TODO() - throw AssertionError("TODO() doesn't throw an exception") - } catch(e: NotImplementedError) {} - - val foo = Foo(42) - assertEquals(run { 42 }, 42) - assertEquals(foo.run { bar }, 42) - assertEquals(with(foo) { bar }, 42) - assertEquals(foo.apply { bar }, foo) - assertEquals(foo.also { it.bar }, foo) - assertEquals(foo.let { it.bar }, 42) - var i = 0 - repeat(10) { i++ } - assertEquals(i, 10) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring0.kt b/kotlin-native/backend.native/tests/runtime/basic/tostring0.kt deleted file mode 100644 index aebff72d9c1..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring0.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.tostring0 - -import kotlin.test.* - -@Test fun runTest() { - println(127.toByte().toString()) - println(255.toByte().toString()) - println(239.toShort().toString()) - println('A'.toString()) - println('Ё'.toString()) - println('ト'.toString()) - println(1122334455.toString()) - println(112233445566778899.toString()) - // Here we differ from Java, as have no dtoa() yet. - println(3.14159265358.toString()) - // Here we differ from Java, as have no dtoa() yet. - println(1e27.toFloat().toString()) - println(1e7.toString()) - println(1e-300.toDouble().toString()) - println(true.toString()) - println(false.toString()) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring0.out b/kotlin-native/backend.native/tests/runtime/basic/tostring0.out deleted file mode 100644 index 68b0937df27..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring0.out +++ /dev/null @@ -1,14 +0,0 @@ -127 --1 -239 -A -Ё -ト -1122334455 -112233445566778899 -3.14159265358 -1.0E27 -1.0E7 -1.0E-300 -true -false diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring1.kt b/kotlin-native/backend.native/tests/runtime/basic/tostring1.kt deleted file mode 100644 index ccf26ceb4b8..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring1.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.tostring1 - -import kotlin.test.* - -@Test fun runTest() { - val hello = "Hello world" - println(hello.subSequence(1, 5).toString()) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring1.out b/kotlin-native/backend.native/tests/runtime/basic/tostring1.out deleted file mode 100644 index 994dae62780..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring1.out +++ /dev/null @@ -1 +0,0 @@ -ello diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring2.kt b/kotlin-native/backend.native/tests/runtime/basic/tostring2.kt deleted file mode 100644 index 360b2b73a7d..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring2.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.tostring2 - -import kotlin.test.* - -@Test fun runTest() { - val hello = "Hello" - val array = hello.toCharArray() - for (ch in array) { - print(ch) - print(" ") - } - println() - println(array.concatToString(0, array.size)) -} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring2.out b/kotlin-native/backend.native/tests/runtime/basic/tostring2.out deleted file mode 100644 index 2d952063a9e..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring2.out +++ /dev/null @@ -1,2 +0,0 @@ -H e l l o -Hello diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring3.kt b/kotlin-native/backend.native/tests/runtime/basic/tostring3.kt deleted file mode 100644 index 5381283ea3e..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring3.kt +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.tostring3 - -import kotlin.test.* - -fun testByte() { - val values = ByteArray(2) - values[0] = Byte.MIN_VALUE - values[1] = Byte.MAX_VALUE - for (v in values) { - println(v) - } -} - -fun testShort() { - val values = ShortArray(2) - values[0] = Short.MIN_VALUE - values[1] = Short.MAX_VALUE - for (v in values) { - println(v) - } -} - -fun testInt() { - val values = IntArray(2) - values[0] = Int.MIN_VALUE - values[1] = Int.MAX_VALUE - for (v in values) { - println(v) - } -} - -fun testLong() { - val values = LongArray(2) - values[0] = Long.MIN_VALUE - values[1] = Long.MAX_VALUE - for (v in values) { - println(v) - } -} - -fun testFloat() { - val values = FloatArray(5) - values[0] = Float.MIN_VALUE - values[1] = Float.MAX_VALUE - values[2] = Float.NEGATIVE_INFINITY - values[3] = Float.POSITIVE_INFINITY - values[4] = Float.NaN - for (v in values) { - println(v) - } -} - -fun testDouble() { - val values = DoubleArray(5) - values[0] = Double.MIN_VALUE - values[1] = Double.MAX_VALUE - values[2] = Double.NEGATIVE_INFINITY - values[3] = Double.POSITIVE_INFINITY - values[4] = Double.NaN - for (v in values) { - println(v) - } -} - -@Test fun runTest() { - testByte() - testShort() - testInt() - testLong() - testFloat() - testDouble() - -} diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring3.out b/kotlin-native/backend.native/tests/runtime/basic/tostring3.out deleted file mode 100644 index a41c92b37a3..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring3.out +++ /dev/null @@ -1,18 +0,0 @@ --128 -127 --32768 -32767 --2147483648 -2147483647 --9223372036854775808 -9223372036854775807 -1.4E-45 -3.4028235E38 --Infinity -Infinity -NaN -4.9E-324 -1.7976931348623157E308 --Infinity -Infinity -NaN diff --git a/kotlin-native/backend.native/tests/runtime/basic/tostring4.kt b/kotlin-native/backend.native/tests/runtime/basic/tostring4.kt deleted file mode 100644 index 7e1978a16c7..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/tostring4.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.tostring4 - -import kotlin.test.* - -class TopLevel - -@Test fun runTest() { - assertEquals("runtime.basic.tostring4.TopLevel", TopLevel().toStringWithoutHashCode()) - - class Local1 - assertEquals("runtime.basic.tostring4.runTest\$Local1", Local1().toStringWithoutHashCode()) - - assertEquals("runtime.basic.tostring4.runTest\$1", object {}.toStringWithoutHashCode()) - - fun localFun() { - class Local2 - assertEquals("runtime.basic.tostring4.runTest\$localFun\$Local2", Local2().toStringWithoutHashCode()) - - assertEquals("runtime.basic.tostring4.runTest\$localFun\$1", object {}.toStringWithoutHashCode()) - } - localFun() -} - -private fun Any.toStringWithoutHashCode(): String { - val string = toString() - assertEquals(1, string.count { it == '@' }, "Invalid toString() value: $string") - return string.substringBefore('@') -} diff --git a/kotlin-native/backend.native/tests/runtime/basic/worker_random.kt b/kotlin-native/backend.native/tests/runtime/basic/worker_random.kt deleted file mode 100644 index 97a2fe106c9..00000000000 --- a/kotlin-native/backend.native/tests/runtime/basic/worker_random.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -@file:OptIn(ObsoleteWorkersApi::class) -package runtime.basic.worker_random - -import kotlin.native.concurrent.* -import kotlin.collections.* -import kotlin.random.* -import kotlin.system.* -import kotlin.test.* - -@Test -fun testRandomWorkers() { - val seed = getTimeMillis() - val workers = Array(5, { _ -> Worker.start() }) - - val attempts = 3 - val results = Array(attempts, { ArrayList() } ) - for (attempt in 0 until attempts) { - // Produce a list of random numbers in each worker - val futures = Array(workers.size, { workerIndex -> - workers[workerIndex].execute(TransferMode.SAFE, { workerIndex }) { - input -> - Array(10, { Random.nextInt() }).toList() - } - }) - // Now collect all results into current attempt's list - val futureSet = futures.toSet() - var finished = 0 - while (finished < futureSet.size) { - val ready = waitForMultipleFutures(futureSet, 10000) - ready.forEach { results[attempt].addAll(it.result) } - finished += ready.size - } - } - - workers.forEach { - it.requestTermination().result - } -} diff --git a/kotlin-native/runtime/test/kotlinx.cinterop/VectorTest.kt b/kotlin-native/runtime/test/kotlinx.cinterop/VectorTest.kt new file mode 100644 index 00000000000..7209549d6a7 --- /dev/null +++ b/kotlin-native/runtime/test/kotlinx.cinterop/VectorTest.kt @@ -0,0 +1,94 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.kotlinx.cinterop + +import kotlin.test.* +import kotlinx.cinterop.Vector128 +import kotlinx.cinterop.vectorOf + +class VectorTest { + @Test + fun box() { + class Box(val value: Vector128) + + val v = vectorOf(1f, 3.162f, 10f, 31f) + val box = Box(v) + assertEquals(v, box.value) + } + + @Test + fun boxWithExtraFields() { + class Box(v: Vector128) { + val extraField: Int = 1 + var value: Vector128 = v + } + + val box = Box(vectorOf(0, 1, 2, 3)) + assertEquals(vectorOf(0, 1, 2, 3), box.value) + box.value = vectorOf(0.1f, 1.1f, 2.1f, 3.1f) + assertEquals(vectorOf(0.1f, 1.1f, 2.1f, 3.1f), box.value) + } + + @Test + fun getIntAt() { + val a = arrayOf(0, 1, 2, 3) + val v = vectorOf(a[0], a[1], a[2], a[3]) + (0 until 4).forEach { assertEquals(a[it], v.getIntAt(it)) } + assertFailsWith { v.getIntAt(-1) } + assertFailsWith { v.getIntAt(4) } + } + + @Test + fun getFloatAt() { + val a = arrayOf(1f, 3.162f, 10f, 31f) + val v = vectorOf(a[0], a[1], a[2], a[3]) + (0 until 4).forEach { assertEquals(a[it], v.getFloatAt(it)) } + assertFailsWith { v.getFloatAt(-1) } + assertFailsWith { v.getFloatAt(4) } + } + + @Test + fun getByteAt() { + val a = arrayOf(0, 1, 2, 3) + val v = vectorOf(a[0], a[1], a[2], a[3]) + (0 until 4).forEach { + assertEquals(if (Platform.isLittleEndian) a[it].toByte() else 0, v.getByteAt(it * 4)) + assertEquals(0, v.getByteAt(it * 4 + 1)) + assertEquals(0, v.getByteAt(it * 4 + 2)) + assertEquals(if (!Platform.isLittleEndian) a[it].toByte() else 0, v.getByteAt(it * 4 + 3)) + } + assertFailsWith { v.getByteAt(-1) } + assertFailsWith { v.getByteAt(16) } + } + + @Test + fun updateVector() { + var v = vectorOf(0, 1, 2, 3) + val a = arrayOf(1f, 3.162f, 10f, 31f) + // Used to be vector of ints, now a vector of floats. + v = vectorOf(a[0], a[1], a[2], a[3]) + (0 until 4).forEach { assertEquals(a[it], v.getFloatAt(it)) } + } + + @Test + fun testToString() { + val v = vectorOf(100, 1024, Int.MAX_VALUE, Int.MIN_VALUE) + assertEquals("(0x64, 0x400, 0x7fffffff, 0x80000000)", v.toString()) + } + + @Test + fun testEquals() { + assertNotEquals(vectorOf(-1f, 0f, 0f, -7f), vectorOf(1f, 4f, 3f, 7f)) + assertNotEquals(vectorOf(-1f, 0f, 0f, -7f), Any()) + assertEquals(vectorOf(-1f, 0f, 0f, -7f), vectorOf(-1f, 0f, 0f, -7f)) + } + + @Test + fun testHashCode() { + assertNotEquals(vectorOf(1f, 4f, 3f, 7f).hashCode(), vectorOf(3f, 7f, 1f, 4f).hashCode()) + assertEquals(vectorOf(1f, 4f, 3f, 7f).hashCode(), vectorOf(1f, 4f, 3f, 7f).hashCode()) + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/numbers/ConversionNativeTest.kt b/kotlin-native/runtime/test/numbers/ConversionNativeTest.kt new file mode 100644 index 00000000000..ca23a39bd81 --- /dev/null +++ b/kotlin-native/runtime/test/numbers/ConversionNativeTest.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.numbers + +import kotlin.test.* + +// Native-specific part of stdlib/test/numbers/ConversionTest.kt +class ConversionNativeTest { + @Test + fun floatToInt() { + fun testEquals(expected: Int, v: Float) = assertEquals(expected, v.toInt()) + + testEquals(3, 3.14f) + testEquals(-33333, -33333.12312f) + testEquals(-1, -1.2f) + testEquals(-12, -12.6f) + testEquals(2, 2.3f) + } + + @Test + fun intToShort() { + fun testEquals(expected: Short, v: Int) = assertEquals(expected, v.toShort()) + + testEquals(-1, Int.MAX_VALUE) + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/numbers/MathTest.kt b/kotlin-native/runtime/test/numbers/MathTest.kt index 2e9987d7aa9..b8bf9c30edc 100644 --- a/kotlin-native/runtime/test/numbers/MathTest.kt +++ b/kotlin-native/runtime/test/numbers/MathTest.kt @@ -138,4 +138,8 @@ class FloatMathNativeTest { assertTrue(2.0f.IEEErem(0.0f).isNaN()) assertEquals(PI.toFloat(), PI.toFloat().IEEErem(Float.NEGATIVE_INFINITY)) } + + @Test fun maxValue() { + assertEquals(Float.MAX_VALUE, Float.MAX_VALUE + 42) + } } \ No newline at end of file diff --git a/kotlin-native/runtime/test/random/RandomNativeTest.kt b/kotlin-native/runtime/test/random/RandomNativeTest.kt new file mode 100644 index 00000000000..0556ee78933 --- /dev/null +++ b/kotlin-native/runtime/test/random/RandomNativeTest.kt @@ -0,0 +1,75 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.random + +import kotlin.concurrent.AtomicInt +import kotlin.native.concurrent.* +import kotlin.random.* +import kotlin.test.* + +// Native-specific part of stdlib/test/random/RandomTest.kt +class SeededRandomSmokeNativeTest { + val subject: Random get() = seededRandomSmokeTestSubject + + @Test + fun sameIntSeedNextLong() { + val v = subject.nextInt(1..Int.MAX_VALUE) + for (seed in listOf(v, -v)) { + testSameSeededRandoms(Random(seed), Random(seed), seed) { nextLong() } + } + } + + @Test + fun sameIntSeedNextIntWithLimit() { + val v = subject.nextInt(1..Int.MAX_VALUE) + for (seed in listOf(v, -v)) { + testSameSeededRandoms(Random(seed), Random(seed), seed) { nextInt(1000) } + } + } + + private inline fun testSameSeededRandoms(r1: Random, r2: Random, seed: Any, generator: Random.() -> T) { + val seq1 = List(10) { r1.generator() } + val seq2 = List(10) { r2.generator() } + + assertEquals(seq1, seq2, "Generators seeded with $seed should produce the same output") + } +} + +class MultiThreadedRandomSmokeTest { + val subject: Random get() = Random + + @Test + fun nextInt() { + val workers = Array(10) { Worker.start() } + val canStart = AtomicInt(0) + val futures = workers.map { + it.execute(TransferMode.SAFE, { subject to canStart }) { (subject, canStart) -> + var result1 = 0 + var result2 = -1 + while (canStart.value == 0) {} + repeat(100) { + val r = subject.nextInt() + result1 = result1 or r + result2 = result2 and r + } + result1 to result2 + } + } + canStart.value = 1 + var result1 = 0 + var result2 = -1 + futures.forEach { + val (r1, r2) = it.result + result1 = result1 or r1 + result2 = result2 and r2 + } + assertEquals(-1, result1, "All one bits should present") + assertEquals(0, result2, "All zero bits should present") + workers.forEach { + it.requestTermination().result + } + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/text/CharNativeTest.kt b/kotlin-native/runtime/test/text/CharNativeTest.kt index e698c2caaa4..df33abfb259 100644 --- a/kotlin-native/runtime/test/text/CharNativeTest.kt +++ b/kotlin-native/runtime/test/text/CharNativeTest.kt @@ -118,4 +118,11 @@ class CharNativeTest { assertTrue('_' in CharCategory.CONNECTOR_PUNCTUATION) assertTrue('$' in CharCategory.CURRENCY_SYMBOL) } + + @Test + fun testToString() { + assertEquals("A", 'A'.toString()) + assertEquals("Ё", 'Ё'.toString()) + assertEquals("ト", 'ト'.toString()) + } } diff --git a/kotlin-native/runtime/test/text/StringNativeTest.kt b/kotlin-native/runtime/test/text/StringNativeTest.kt index 9abcb9ba947..9cd4acb68cd 100644 --- a/kotlin-native/runtime/test/text/StringNativeTest.kt +++ b/kotlin-native/runtime/test/text/StringNativeTest.kt @@ -151,4 +151,10 @@ class StringNativeTest { assertEquals(expected = "\u1FFFString", actual = "\u00A0 \u1FFFString".trim(), message = "Trim special whitespace but should left a unicode symbol") } + + @Test + fun subSequence() { + assertEquals("ello", "Hello world".subSequence(1, 5).toString()) + assertEquals("", "Hello world".subSequence(1, 1).toString()) + } } diff --git a/kotlin-native/runtime/test/text/StringNumberConversionNativeTest.kt b/kotlin-native/runtime/test/text/StringNumberConversionNativeTest.kt index 8c06855f6c9..f52cf1586e7 100644 --- a/kotlin-native/runtime/test/text/StringNumberConversionNativeTest.kt +++ b/kotlin-native/runtime/test/text/StringNumberConversionNativeTest.kt @@ -127,4 +127,61 @@ class StringNumberConversionNativeTest { assertFailsWith { "\uDC0012".toFloat() } assertFailsWith { "12\uD800".toFloat() } } + + @Test + fun byteToString() { + assertEquals("13", 13.toByte().toString()) + assertEquals("-1", (-1).toByte().toString()) + assertEquals("-128", Byte.MIN_VALUE.toString()) + assertEquals("127", Byte.MAX_VALUE.toString()) + } + + @Test + fun shortToString() { + assertEquals("239", 239.toShort().toString()) + assertEquals("-32768", Short.MIN_VALUE.toString()) + assertEquals("32767", Short.MAX_VALUE.toString()) + } + + @Test + fun intToString() { + assertEquals("1122334455", 1122334455.toString()) + assertEquals("-2147483648", Int.MIN_VALUE.toString()) + assertEquals("2147483647", Int.MAX_VALUE.toString()) + } + + @Test + fun longToString() { + assertEquals("112233445566778899", 112233445566778899L.toString()) + assertEquals("-9223372036854775808", Long.MIN_VALUE.toString()) + assertEquals("9223372036854775807", Long.MAX_VALUE.toString()) + } + + @Test + fun floatToString() { + assertEquals("1.0E27", 1e27.toFloat().toString()) + assertEquals("1.4E-45", Float.MIN_VALUE.toString()) + assertEquals("3.4028235E38", Float.MAX_VALUE.toString()) + assertEquals("-Infinity", Float.NEGATIVE_INFINITY.toString()) + assertEquals("Infinity", Float.POSITIVE_INFINITY.toString()) + assertEquals("NaN", Float.NaN.toString()) + } + + @Test + fun doubleToString() { + assertEquals("3.14159265358", 3.14159265358.toString()) + assertEquals("1.0E7", 1e7.toString()) + assertEquals("1.0E-300", 1e-300.toDouble().toString()) + assertEquals("4.9E-324", Double.MIN_VALUE.toString()) + assertEquals("1.7976931348623157E308", Double.MAX_VALUE.toString()) + assertEquals("-Infinity", Double.NEGATIVE_INFINITY.toString()) + assertEquals("Infinity", Double.POSITIVE_INFINITY.toString()) + assertEquals("NaN", Double.NaN.toString()) + } + + @Test + fun booleanToString() { + assertEquals("true", true.toString()) + assertEquals("false", false.toString()) + } } \ No newline at end of file diff --git a/kotlin-native/runtime/test/utils/AnyTest.kt b/kotlin-native/runtime/test/utils/AnyTest.kt new file mode 100644 index 00000000000..c99b8b5b144 --- /dev/null +++ b/kotlin-native/runtime/test/utils/AnyTest.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.utils + +import kotlin.test.* + +private class TopLevel + +private fun Any.toStringWithoutHashCode(): String { + val string = toString() + assertEquals(1, string.count { it == '@' }, "Invalid toString() value: $string") + return string.substringBefore('@') +} + +class AnyTest { + @Test + fun testToString() { + assertEquals("test.utils.TopLevel", TopLevel().toStringWithoutHashCode()) + + class Local1 + assertEquals("test.utils.AnyTest\$testToString\$Local1", Local1().toStringWithoutHashCode()) + + assertEquals("test.utils.AnyTest\$testToString\$1", object {}.toStringWithoutHashCode()) + + fun localFun() { + class Local2 + assertEquals("test.utils.AnyTest\$testToString\$localFun\$Local2", Local2().toStringWithoutHashCode()) + + assertEquals("test.utils.AnyTest\$testToString\$localFun\$1", object {}.toStringWithoutHashCode()) + } + localFun() + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/utils/HashCodeNativeTest.kt b/kotlin-native/runtime/test/utils/HashCodeNativeTest.kt new file mode 100644 index 00000000000..e9af7a7961c --- /dev/null +++ b/kotlin-native/runtime/test/utils/HashCodeNativeTest.kt @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.utils + +import kotlin.test.* + +// Native-specific part of stdlib/test/utils/HashCodeTest.kt +class HashCodeNativeTest { + @Test + fun hashCodeOfInt() { + assertEquals(239, 239.hashCode()) + } + + @Test + fun hashCodeOfLong() { + assertEquals(0, (-1L).hashCode()) + } + + @Test + fun hashCodeOfChar() { + assertEquals(97, 'a'.hashCode()) + } + + @Test + fun hashCodeOfFloat() { + assertEquals(1065353216, 1.0f.hashCode()) + } + + @Test + fun hashCodeOfDouble() { + assertEquals(1072693248, 1.0.hashCode()) + } + + @Test + fun hashCodeOfBool() { + assertEquals(1231, true.hashCode()) + assertEquals(1237, false.hashCode()) + } + + @Test + fun hashCodeOfAny() { + assertNotEquals(Any().hashCode(), Any().hashCode()) + } + + @Test + fun hashCodeOfString() { + val str = "Hello" + val charArray = charArrayOf('H', 'e', 'l', 'l', 'o') + assertEquals(str.hashCode(), charArray.concatToString(0, 5).hashCode()) + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/utils/RepeatTest.kt b/kotlin-native/runtime/test/utils/RepeatTest.kt new file mode 100644 index 00000000000..4af6ef93b79 --- /dev/null +++ b/kotlin-native/runtime/test/utils/RepeatTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.utils + +import kotlin.test.* + +class RepeatTest { + @Test + fun testRepeat() { + var i = 0 + repeat(10) { i++ } + assertEquals(10, i) + } +} \ No newline at end of file diff --git a/kotlin-native/runtime/test/utils/ScopeFunctionsTest.kt b/kotlin-native/runtime/test/utils/ScopeFunctionsTest.kt new file mode 100644 index 00000000000..efec4f980e6 --- /dev/null +++ b/kotlin-native/runtime/test/utils/ScopeFunctionsTest.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package test.utils + +import kotlin.test.* + +private class Box(val value: Int) + +class ScopeFunctionsTest { + @Test + fun testLet() { + val box = Box(42) + assertEquals(42, box.let { it.value }) + } + + @Test + fun testWith() { + val box = Box(42) + assertEquals(42, with(box) { value }) + } + + @Test + fun testRun() { + assertEquals(42, run { 42 }) + val box = Box(42) + assertEquals(42, box.run { value }) + } + + @Test + fun testApply() { + val box = Box(42) + assertEquals(box, box.apply { value }) + } + + @Test + fun testAlso() { + val box = Box(42) + assertEquals(box, box.also { it.value }) + } +} \ No newline at end of file diff --git a/libraries/stdlib/test/random/RandomTest.kt b/libraries/stdlib/test/random/RandomTest.kt index 1b40e17c616..2fd47aeb5dc 100644 --- a/libraries/stdlib/test/random/RandomTest.kt +++ b/libraries/stdlib/test/random/RandomTest.kt @@ -570,7 +570,7 @@ class DefaultRandomSmokeTest : RandomSmokeTest() { } @ThreadLocal -private val seededRandomSmokeTestSubject = Random(Random.nextInt().also { println("Seed: $it") }) +internal val seededRandomSmokeTestSubject = Random(Random.nextInt().also { println("Seed: $it") }) class SeededRandomSmokeTest : RandomSmokeTest() { override val subject: Random get() = seededRandomSmokeTestSubject diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/StdlibTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/StdlibTest.kt index de35f69b2d1..15885c469d1 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/StdlibTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/blackbox/StdlibTest.kt @@ -26,7 +26,8 @@ import org.jetbrains.kotlin.konan.test.blackbox.support.group.PredefinedTestCase runnerType = TestRunnerType.DEFAULT, freeCompilerArgs = [ ENABLE_MPP, STDLIB_IS_A_FRIEND, ENABLE_X_STDLIB_API, ENABLE_X_ENCODING_API, ENABLE_RANGE_UNTIL, - ENABLE_X_FOREIGN_API, ENABLE_X_NATIVE_API, ENABLE_OBSOLETE_NATIVE_API], + ENABLE_X_FOREIGN_API, ENABLE_X_NATIVE_API, ENABLE_OBSOLETE_NATIVE_API, ENABLE_NATIVE_RUNTIME_API, + ENABLE_INTERNAL_FOR_KOTLIN_NATIVE], sourceLocations = [ "libraries/stdlib/test/**.kt", "libraries/stdlib/common/test/**.kt", @@ -51,7 +52,8 @@ class StdlibTest : AbstractNativeBlackBoxTest() { runnerType = TestRunnerType.DEFAULT, freeCompilerArgs = [ ENABLE_MPP, STDLIB_IS_A_FRIEND, ENABLE_X_STDLIB_API, ENABLE_X_ENCODING_API, ENABLE_RANGE_UNTIL, - ENABLE_X_FOREIGN_API, ENABLE_X_NATIVE_API, ENABLE_OBSOLETE_NATIVE_API, + ENABLE_X_FOREIGN_API, ENABLE_X_NATIVE_API, ENABLE_OBSOLETE_NATIVE_API, ENABLE_NATIVE_RUNTIME_API, + ENABLE_INTERNAL_FOR_KOTLIN_NATIVE, "-Xcommon-sources=libraries/stdlib/common/test/jsCollectionFactories.kt", "-Xcommon-sources=libraries/stdlib/common/test/testUtils.kt", "-Xcommon-sources=libraries/stdlib/test/testUtils.kt", @@ -81,5 +83,7 @@ private const val ENABLE_X_ENCODING_API = "-opt-in=kotlin.io.encoding.Experiment private const val ENABLE_X_FOREIGN_API = "-opt-in=kotlinx.cinterop.ExperimentalForeignApi" private const val ENABLE_X_NATIVE_API = "-opt-in=kotlin.experimental.ExperimentalNativeApi" private const val ENABLE_OBSOLETE_NATIVE_API = "-opt-in=kotlin.native.ObsoleteNativeApi" +private const val ENABLE_NATIVE_RUNTIME_API = "-opt-in=kotlin.native.runtime.NativeRuntimeApi" +private const val ENABLE_INTERNAL_FOR_KOTLIN_NATIVE = "-opt-in=kotlin.native.internal.InternalForKotlinNative" private const val ENABLE_RANGE_UNTIL = "-XXLanguage:+RangeUntilOperator" // keep until 1.8 private const val DISABLED_STDLIB_TEST = "test.collections.CollectionTest.abstractCollectionToArray" \ No newline at end of file