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

29 lines
578 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1282
package foo
fun box(): String {
val c: Int = 3
if (c.toDouble() != 3.0) {
return "fail1"
}
if (c.toFloat() != 3.toFloat()) {
return "fail2"
}
if (c.toByte() != 3.toByte()) {
return "fail3"
}
if (c.toInt() != 3) {
return "fail4"
}
if (c.toShort() != 3.toShort()) {
return "fail5"
}
val c2: Int = -5
if (c2.toShort() != (-5).toShort()) {
return "fail6"
}
if (c2.toFloat() != -5.toFloat()) {
return "fail7"
}
return "OK"
}