blob: 3a8b122a1c0800513a8b71e3654d8d8138d9ea02 [file]
// EXIT_CODE: !0
// OUTPUT_REGEX: Hook\RUncaught Kotlin exception: kotlin\.Error: an error\R(?!.*FAIL.*).*
@file:OptIn(kotlin.experimental.ExperimentalNativeApi::class)
import kotlin.test.*
fun main() {
setUnhandledExceptionHook {
println("Hook")
terminateWithUnhandledException(it)
}
processUnhandledException(Error("an error"))
println("FAIL")
}