Files
kotlin-fork/js/js.translator/testData/wasmBox/number/assignmentIntOverflow.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

26 lines
442 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1282
package foo
fun bigValue() = 0x7FFFFFFC
fun mediumValue() = 0x12345
fun box(): String {
var v = bigValue()
v += 1
if (v != 0x7FFFFFFD) return "fail1"
v = bigValue()
v += 8
if (v != -0x7FFFFFFC) return "fail2"
v = mediumValue()
v *= 0x23456
if (v != -2112496338) return "fail3"
v = bigValue()
v *= bigValue()
if (v != 16) return "fail4"
return "OK"
}