Files
kotlin/compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInIf.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

48 lines
660 B
Kotlin
Vendored

val a = 2
fun main() {
// Generates IF_ICMPNE and GOTO
if (a == 42) {
"then"
} else {
"else"
}
// Generates IF_ICMPLE and GOTO
if (a > 42) {
"then"
} else {
"else"
}
// Generates IF_ICMPLT and GOTO
if (a >= 42) {
"then"
} else {
"else"
}
// Generates IF_ICMPGE and GOTO
if (a < 42) {
"then"
} else {
"else"
}
// Generates IF_ICMPGT and GOTO
if (a <= 42) {
"then"
} else {
"else"
}
}
//0 ICONST_0
//0 ICONST_1
//1 IF_ICMPNE
//1 IF_ICMPLE
//1 IF_ICMPLT
//1 IF_ICMPGE
//1 IF_ICMPGT
//5 IF
//5 GOTO