blob: 64bc2e5ae39362388f1924b00b2ae6bc9ffc6063 [file]
// WITH_STDLIB
// TARGET_BACKEND: WASM
// USE_OLD_EXCEPTION_HANDLING_PROPOSAL
// WASM_FAILS_IN: Wasmtime, WasmEdge
import kotlin.test.*
val sb = StringBuilder()
fun box(): String {
sb.appendLine(foo())
assertEquals("""
Done
Finally
0
""".trimIndent(), sb.toString())
return "OK"
}
fun foo(): Int {
try {
sb.appendLine("Done")
return 0
} finally {
sb.appendLine("Finally")
}
sb.appendLine("After")
return 1
}