Files
kotlin-fork/native/native.tests/testData/standalone/termination/unhandledExceptionHookThrow.kt
T

14 lines
343 B
Kotlin
Vendored

// EXIT_CODE: !0
// OUTPUT_REGEX: Hook\RUncaught Kotlin exception: kotlin\.Error: another error\R(?!.*an error.*).*
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
fun main() {
setUnhandledExceptionHook {
println("Hook")
throw Error("another error")
}
throw Error("an error")
}