[JS IR BE] Fix boolean and/or generation

This commit is contained in:
Svyatoslav Kuzmich
2019-04-27 22:05:07 +03:00
parent b8bbcb3f93
commit 3153a7dd7e
4 changed files with 52 additions and 6 deletions
@@ -0,0 +1,28 @@
// IGNORE_BACKEND: JS
// EXPECTED_REACHABLE_NODES: 1281
package foo
fun check(x: Any?) {
x as Boolean
}
fun tests(x: Boolean, y: Boolean) {
check(x)
check(!x)
check(x or y)
check(x and y)
check(x xor y)
check(x.not())
check(x || y)
check(x && y)
}
fun box(): String {
tests(false, false)
tests(false, true)
tests(true, false)
tests(true, true)
return "OK"
}