Files
kotlin/compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInIf.kt
pyos fc6b03b08f JVM_IR: move const initialization handling to lowering
Had to edit some bytecodeText tests to account for the fact that JVM_IR
no longer generates explicit initializations for ConstantValue fields,
but NoConstantValueAttributeForNonConstVals is not the default yet.
2019-11-29 16:49:52 +01:00

55 lines
719 B
Kotlin
Vendored

val a = 2
fun main() {
// Generates IFEQ and GOTO
if (!(a == 0)) {
"then"
} else {
"else"
}
// Generates IFEQ and GOTO
if (a != 0) {
"then"
} else {
"else"
}
// Generates IFGT and GOTO
if (!(a > 0)) {
"then"
} else {
"else"
}
// Generates IFGE and GOTO
if (!(a >= 0)) {
"then"
} else {
"else"
}
// Generates IFLT and GOTO
if (!(a < 0)) {
"then"
} else {
"else"
}
// Generates IFLE and GOTO
if (!(a <= 0)) {
"then"
} else {
"else"
}
}
//0 ICONST_0
//0 ICONST_1
//2 IFEQ
//1 IFLE
//1 IFLT
//1 IFGE
//1 IFGT
//6 IF
//6 GOTO