Files
kotlin-fork/compiler/testData/codegen/box/size/add.kt
T
Zalim Bashorov 521a272acb [Wasm] Pass js stack value directly when replacing a wasm exception with JS one
In this case, we don't need to convert a value to and from wasm String.
2023-04-17 16:15:22 +00:00

16 lines
299 B
Kotlin
Vendored

// TARGET_BACKEND: WASM
// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 14_217
// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_579
// FILE: test.kt
@JsExport
fun add(a: Int, b: Int) = a + b
// FILE: entry.mjs
import k from "./index.mjs"
const r = k.add(2, 3);
if (r != 5) throw Error("Wrong result: " + r);