OptIn ExperimentalNativeApi

This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-17 11:50:29 +03:00
committed by Space Team
parent aae8a687a4
commit 209c916a7e
94 changed files with 123 additions and 67 deletions
+2
View File
@@ -5,6 +5,8 @@
// ASSERTIONS_MODE: always-enable
// WITH_STDLIB
@file:Suppress("OPT_IN_USAGE_ERROR") // ExperimentalNativeApi is defined only in Native
fun checkTrue(): Boolean {
var hit = false
val l = { hit = true; true }
+1
View File
@@ -6,6 +6,7 @@
// WITH_STDLIB
@Suppress("OPT_IN_USAGE_ERROR") // ExperimentalNativeApi is defined only in Native
fun box(): String {
kotlin.assert(true)
return "OK"
@@ -10,6 +10,7 @@ import kotlin.concurrent.*
var y = -1
fun box() : String {
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
if (Platform.memoryModel != MemoryModel.EXPERIMENTAL) {
// The test doesn't make sense for legacy mm, you can't have anything non-atomic to protect with @Volatile var
return "OK"
@@ -2,7 +2,7 @@
* 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(FreezingIsDeprecated::class)
@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class)
package codegen.enum.isFrozen
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(kotlin.ExperimentalStdlibApi::class)
@file:OptIn(kotlin.ExperimentalStdlibApi::class, kotlin.experimental.ExperimentalNativeApi::class)
package codegen.initializers.static
@@ -2,6 +2,7 @@
* Copyright 2010-2021 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(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
import kotlin.native.Platform
@@ -34,6 +34,7 @@ fun <T: Any> dsl(block: DslMain.() -> T): T = DslMain().block()
class TestClass
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
class App(testQualified: Boolean) {
var type = dsl {
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class)
@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class)
package codegen.objectDeclaration.isFrozen
import kotlin.test.*
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
package datagen.rtti.vtable_any
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.Platform
// The following 2 singletons are unused. However, since we are generating ObjC bindings for them,
@@ -2,6 +2,7 @@
* Copyright 2010-2021 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(kotlin.experimental.ExperimentalNativeApi::class)
fun inner1() : Nothing {
throw Exception()
@@ -5,8 +5,8 @@ func testStackTrace() throws {
let trace = StacktraceKt.getStackTrace()
try assertTrue(trace[0].contains("Throwable.kt"))
try assertTrue(trace[1].contains("Exceptions.kt"))
try assertTrue(trace[2].contains("stacktrace.kt:7"))
try assertTrue(trace[3].contains("stacktrace.kt:12"))
try assertTrue(trace[2].contains("stacktrace.kt:8"))
try assertTrue(trace[3].contains("stacktrace.kt:13"))
try assertTrue(trace[4].contains("<compiler-generated>"))
try assertTrue(trace[5].contains("stacktrace.swift:5"))
try assertTrue(trace[6].contains("main.swift"))
@@ -2,6 +2,7 @@
* Copyright 2010-2021 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(kotlin.experimental.ExperimentalNativeApi::class)
fun thrower() : Nothing {
throw Exception()
@@ -2,6 +2,7 @@
* Copyright 2010-2021 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(kotlin.experimental.ExperimentalNativeApi::class)
inline fun inner2() : Nothing {
throw Exception()
@@ -3,10 +3,10 @@ import StacktraceByLibbacktrace
func testStackTrace() throws {
let trace = StacktraceByLibbacktraceKt.getStackTrace()
try assertTrue(trace[0].contains("stacktraceByLibbacktrace.kt:7"))
try assertTrue(trace[0].contains("stacktraceByLibbacktrace.kt:8"))
try assertTrue(trace[0].contains("[inlined]"))
try assertTrue(trace[1].contains("stacktraceByLibbacktrace.kt:11"))
try assertTrue(trace[2].contains("stacktraceByLibbacktrace.kt:16"))
try assertTrue(trace[1].contains("stacktraceByLibbacktrace.kt:12"))
try assertTrue(trace[2].contains("stacktraceByLibbacktrace.kt:17"))
try assertTrue(trace[3].contains("<compiler-generated>"))
try assertTrue(trace[4].contains("stacktraceByLibbacktrace.swift:5"))
try assertTrue(trace[5].contains("main.swift:126"))
@@ -2,7 +2,7 @@
* 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)
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.*
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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)
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class)
import kotlinx.cinterop.*
import cglobals.*
@@ -2,7 +2,7 @@
* 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)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlin.test.*
import cmacros.*
@@ -1,4 +1,4 @@
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
import cunion.*
import kotlinx.cinterop.*
@@ -1,4 +1,4 @@
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class)
import kotlinx.cinterop.*
import kotlin.native.*
@@ -1,3 +1,4 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package knlibrary
import kotlin.native.Platform
@@ -1,5 +1,6 @@
// This test is similar to kt42397, just everything is doubled: in "package knlibrary" and the root package
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package knlibrary
import kotlin.native.Platform
@@ -1,5 +1,7 @@
// This test is similar to kt42397, just everything is in root package instead of "package knlibrary"
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.Platform
// The following 2 singletons are unused. However, since we are generating C bindings for them,
@@ -1,6 +1,7 @@
// This test is similar to kt42397, just everything is doubled: in "package knlibrary.subpackage" and the root package
// FILE: FirstLevelPackage.kt
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package knlibrary
import kotlin.native.Platform
@@ -19,6 +20,8 @@ fun enableMemoryChecker() {
}
// FILE: rootPackage.kt
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
object A {}
class B {
@@ -1,6 +1,7 @@
// This test is similar to kt42397, just everything is doubled: in "package knlibrary.subpackage" and the root package
// FILE: SecondLevelPackage.kt
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package knlibrary.subpackage
import kotlin.native.Platform
@@ -19,6 +20,8 @@ fun enableMemoryChecker() {
}
// FILE: rootPackage.kt
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
object A {}
class B {
@@ -1,4 +1,5 @@
// This test is similar to kt42397, just everything is in "package knlibrary.subpackage" instead of "package knlibrary"
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package knlibrary.subpackage
import kotlin.native.Platform
@@ -1,4 +1,4 @@
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import leakMemory.*
import kotlin.native.concurrent.*
@@ -1,4 +1,4 @@
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import leakMemory.*
import kotlin.native.concurrent.*
@@ -1,4 +1,4 @@
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
import objclib.*
import kotlin.native.concurrent.*
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
import objclib.*
@@ -2,7 +2,7 @@
* 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(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlinx.cinterop.*
import objcSmoke.*
@@ -2,7 +2,7 @@
* 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(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlinx.cinterop.*
import objcSmoke.*
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.test.*
import kotlin.native.ref.WeakReference
@@ -1,4 +1,4 @@
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.ref.WeakReference
import kotlinx.cinterop.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.system.exitProcess
import kotlinx.cinterop.autoreleasepool
import kotlin.native.internal.test.testLauncherEntryPoint
@@ -1,4 +1,4 @@
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
import kotlinx.cinterop.*
import kotlin.native.concurrent.*
@@ -1,4 +1,4 @@
@file:OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.ref.*
import kotlinx.cinterop.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import objc_misc.*
import kotlin.native.Platform
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(FreezingIsDeprecated::class, ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.concurrent.*
import kotlin.native.runtime.Debugging
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(FreezingIsDeprecated::class, ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(FreezingIsDeprecated::class, kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.concurrent.*
import kotlin.native.runtime.Debugging
@@ -244,4 +244,5 @@ fun createCoroutineUninterceptedAndResume(fn: suspend () -> Any?, resultHolder:
fun createCoroutineUninterceptedAndResume(fn: suspend Any?.() -> Any?, receiver: Any?, resultHolder: ResultHolder<Any?>) =
fn.createCoroutine(receiver, ResultHolderCompletion(resultHolder)).resume(Unit)
@OptIn(kotlin.native.runtime.NativeRuntimeApi::class)
fun gc() = kotlin.native.runtime.GC.collect()
@@ -3,6 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package deallocretain
open class DeallocRetainBase
@@ -6,6 +6,7 @@ import kotlin.native.internal.NativePtr
import kotlin.native.ref.WeakReference
import kotlin.test.*
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
class KotlinLivenessTracker {
val weakRefs = mutableListOf<WeakReference<Any>>()
@@ -5,7 +5,7 @@
// All classes and methods should be used in tests
@file:Suppress("UNUSED")
@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class)
package conversions
@@ -251,6 +251,7 @@ fun IC3.getValue3() = value
fun IC3?.getValueOrNull3() = this?.value
fun isFrozen(obj: Any): Boolean = obj.isFrozen
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
fun isFreezingEnabled() = Platform.isFreezingEnabled
fun kotlinLambda(block: (Any) -> Any): Any = block
@@ -3,7 +3,7 @@
* 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(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.atomics.atomic0
import kotlin.test.*
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
fun main(args: Array<String>) {
assert(false)
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
fun main(args: Array<String>) {
assert(true)
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class, FreezingIsDeprecated::class,
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class,
kotlin.native.runtime.NativeRuntimeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
package runtime.basic.cleaner_basic
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.ref.Cleaner
import kotlin.native.ref.createCleaner
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.ref.createCleaner
import kotlin.native.Platform
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
package runtime.collections.array5
@@ -5,8 +5,6 @@
package runtime.collections.hash_map1
import kotlin.native.MemoryModel
import kotlin.native.Platform
import kotlin.test.*
fun assertTrue(cond: Boolean) {
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
package runtime.collections.typed_array0
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
package runtime.collections.typed_array1
import kotlin.test.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)
package runtime.concurrent.worker_bound_reference0
@@ -2,6 +2,8 @@
// "\tat 1 main.kexe\t\t 0x000000010d7cdb4c kfun:package.function(kotlin.Int) + 108 (/path/to/file/name.kt:10:27)\n"
// If test is broken, org.jetbrains.kotlin.idea.filters.KotlinExceptionFilter (in main Kotlin repo) should be updated.
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
import kotlin.text.Regex
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class, FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class, FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class, FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class, FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class, FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.text.Regex
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.text.Regex
import kotlin.test.*
@@ -44,14 +46,14 @@ internal val regex = Regex("^(\\d+)\\ +.*/(.*):(\\d+):.*$")
internal fun checkFrame(value:String) {
val goldValues = arrayOf<Pair<String, Int>?>(
*arrayOfNulls(expectedExceptionContrFrames),
"kt-37572.kt" to 40,
"kt-37572.kt" to 31,
"kt-37572.kt" to 42,
"kt-37572.kt" to 33,
*(if (expectedInlinesCount != 0) arrayOf(
"kt-37572.kt" to 36,
"kt-37572.kt" to 29,
"kt-37572.kt" to 38,
"kt-37572.kt" to 31,
) else emptyArray()),
"kt-37572.kt" to 19,
"kt-37572.kt" to 7)
"kt-37572.kt" to 21,
"kt-37572.kt" to 9)
val (pos, file, line) = regex.find(value)!!.destructured
goldValues[pos.toInt()]?.let {
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.text.Regex
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.text.Regex
import kotlin.test.*
@@ -34,8 +36,8 @@ internal fun checkFrame(value:String) {
val goldValues = arrayOf<Pair<String, Int>?>(
*arrayOfNulls(expectedExceptionContrFrames),
*arrayOfNulls(expectedInlinesCount),
"stack_trace_inline.kt" to 8,
"stack_trace_inline.kt" to 23)
"stack_trace_inline.kt" to 10,
"stack_trace_inline.kt" to 25)
val (pos, file, line) = regex.find(value)!!.destructured
goldValues[pos.toInt()]?.let {
assertEquals(it.first, file)
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.text.Regex
import kotlin.test.*
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(ExperimentalStdlibApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlinx.cinterop.*
import kotlin.native.Platform
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
import kotlinx.cinterop.*
@@ -2,7 +2,7 @@
* 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.
*/
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class, kotlinx.cinterop.ExperimentalForeignApi::class)
package runtime.memory.stable_ref_cross_thread_check
@@ -2,7 +2,7 @@
* Copyright 2010-2021 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(kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.test.*
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
package runtime.text.chars0
@@ -2,6 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
package runtime.text.parse0
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
package runtime.workers.lazy1
import kotlin.test.*
@@ -1,4 +1,4 @@
@file:OptIn(FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, kotlin.native.runtime.NativeRuntimeApi::class)
import kotlin.native.concurrent.*
import kotlin.native.ref.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.workers.lazy4
import kotlin.test.*
@@ -1,4 +1,4 @@
@file:OptIn(ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class)
import kotlin.native.concurrent.*
import kotlin.native.Platform
import kotlinx.cinterop.*
@@ -1,4 +1,4 @@
@file:OptIn(ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class)
import kotlin.native.concurrent.*
import kotlin.native.Platform
import kotlinx.cinterop.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.workers.worker11
import kotlin.test.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class)
package runtime.workers.worker3
import kotlin.test.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.workers.worker6
import kotlin.test.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.workers.worker9_experimentalMM
import kotlin.test.*
@@ -1,4 +1,4 @@
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
package runtime.workers.worker_exception_messages
import kotlin.test.*
@@ -3,7 +3,7 @@
* that can be found in the LICENSE file.
*/
@file:OptIn(ObsoleteWorkersApi::class)
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class, ObsoleteWorkersApi::class)
import kotlin.native.concurrent.*
import kotlin.native.Platform
@@ -1,3 +1,4 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
package sanity.assertions_enabled
import kotlin.test.Test
@@ -2,7 +2,7 @@
* 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(kotlin.experimental.ExperimentalNativeApi::class)
package kotlin.test.tests
import kotlin.test.*
@@ -1,3 +1,5 @@
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.native.internal.test.*
import kotlin.test.*
import library.*
@@ -25,6 +25,7 @@ class AllCodePointsTest {
fun assertTrue(msg: String, value: Boolean) = assertTrue(value, msg)
fun assertFalse(msg: String, value: Boolean) = assertFalse(value, msg)
@OptIn(kotlin.experimental.ExperimentalNativeApi::class)
fun codePointToString(codePoint: Int): String {
val charArray = Char.toChars(codePoint)
return charArray.concatToString(0, charArray.size)