Files
kotlin-fork/js/js.translator/testData/wasmBox/number/kt2342.kt
T
Svyatoslav Kuzmich 6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00

20 lines
406 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1281
package foo
fun test(a: Int, b: Int, expected: Int): Int {
val result = a / b
if (expected == result) return 100
return 25
}
fun box(): String {
var r = test(10, 3, 3)
if (r != 100) return "Fail1"
r = test(49, 6, 8)
if (r != 100) return "Fail 2"
if (2133 / 3 / 7 / (91 / 5) != 5) return "2133 / 3 / 7 / (91 / 5) != 5"
return "OK"
}