blob: 468b5280eeb77a18b8d713560ea720a170edc3da [file]
// TARGET_BACKEND: WASM
// USE_OLD_EXCEPTION_HANDLING_PROPOSAL
// WASM_FAILS_IN: Wasmtime, WasmEdge
var result = ""
fun test() {
try {
for (z in 1..2) {
try {
result += "try "
continue
} catch (fail: Throwable) {
result += " catch"
}
}
result += "after loop"
} finally {
result += " finally"
throw RuntimeException()
}
}
fun box(): String {
try {
test()
return "fail: expected exception"
} catch (e: RuntimeException) {
}
return if (result == "try try after loop finally") "OK" else "fail: $result"
}