Files
kotlin-fork/kotlin-native/backend.native/tests/runtime/exceptions/custom_hook_terminate.kt
T
Abduqodiri Qurbonzoda 209c916a7e OptIn ExperimentalNativeApi
2023-06-30 15:27:09 +00:00

19 lines
484 B
Kotlin

/*
* 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.experimental.ExperimentalNativeApi::class, FreezingIsDeprecated::class)
import kotlin.test.*
import kotlin.native.concurrent.*
fun main() {
setUnhandledExceptionHook({ t: Throwable ->
println("Hook called")
terminateWithUnhandledException(t)
}.freeze())
throw Error("some error")
}