diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/booleanOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/booleanOperations.kt index 947bdad0716..1b42f48a0dd 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/booleanOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/booleanOperations.kt @@ -39,36 +39,37 @@ const val equals4 = falseVal == falseVal const val toString1 = trueVal.toString() const val toString2 = falseVal.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (not1.id() != false) return "Fail 1.1" - if (not2.id() != true) return "Fail 1.2" + if (not1.id() != false) return "Fail 1.1" + if (not2.id() != true) return "Fail 1.2" - if (and1.id() != true) return "Fail 2.1" - if (and2.id() != false) return "Fail 2.2" - if (and3.id() != false) return "Fail 2.3" - if (and4.id() != false) return "Fail 2.4" + if (and1.id() != true) return "Fail 2.1" + if (and2.id() != false) return "Fail 2.2" + if (and3.id() != false) return "Fail 2.3" + if (and4.id() != false) return "Fail 2.4" - if (or1.id() != true) return "Fail 3.1" - if (or2.id() != true) return "Fail 3.2" - if (or3.id() != true) return "Fail 3.3" - if (or4.id() != false) return "Fail 3.4" + if (or1.id() != true) return "Fail 3.1" + if (or2.id() != true) return "Fail 3.2" + if (or3.id() != true) return "Fail 3.3" + if (or4.id() != false) return "Fail 3.4" - if (xor1.id() != false) return "Fail 4.1" - if (xor2.id() != true) return "Fail 4.2" - if (xor3.id() != true) return "Fail 4.3" - if (xor4.id() != false) return "Fail 4.4" + if (xor1.id() != false) return "Fail 4.1" + if (xor2.id() != true) return "Fail 4.2" + if (xor3.id() != true) return "Fail 4.3" + if (xor4.id() != false) return "Fail 4.4" - if (compareTo1.id() != 0) return "Fail 5.1" - if (compareTo2.id() != 1) return "Fail 5.2" - if (compareTo3.id() != -1) return "Fail 5.3" - if (compareTo4.id() != 0) return "Fail 5.4" + if (compareTo1.id() != 0) return "Fail 5.1" + if (compareTo2.id() != 1) return "Fail 5.2" + if (compareTo3.id() != -1) return "Fail 5.3" + if (compareTo4.id() != 0) return "Fail 5.4" - if (equals1.id() != true) return "Fail 6.1" - if (equals2.id() != false) return "Fail 6.2" - if (equals3.id() != false) return "Fail 6.3" - if (equals4.id() != true) return "Fail 6.4" + if (equals1.id() != true) return "Fail 6.1" + if (equals2.id() != false) return "Fail 6.2" + if (equals3.id() != false) return "Fail 6.3" + if (equals4.id() != true) return "Fail 6.4" - if (toString1.id() != "true") return "Fail 7.1" - if (toString2.id() != "false") return "Fail 7.2" + if (toString1.id() != "true") return "Fail 7.1" + if (toString2.id() != "false") return "Fail 7.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt index 8495e9b841a..ce9440eacf0 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt @@ -92,81 +92,82 @@ const val equals4 = fourVal == twoVal const val toString1 = oneVal.toString() const val toString2 = twoVal.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3) return "Fail 2.1" - if (plus2.id() != 4) return "Fail 2.2" - if (plus3.id() != 5) return "Fail 2.3" - if (plus4.id() != 4) return "Fail 2.4" - if (plus5.id() != 4) return "Fail 2.5" - if (plus6.id() != 4L) return "Fail 2.6" - if (plus7.id() != 4.0f) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3) return "Fail 2.1" + if (plus2.id() != 4) return "Fail 2.2" + if (plus3.id() != 5) return "Fail 2.3" + if (plus4.id() != 4) return "Fail 2.4" + if (plus5.id() != 4) return "Fail 2.5" + if (plus6.id() != 4L) return "Fail 2.6" + if (plus7.id() != 4.0f) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1) return "Fail 3.1" - if (minus2.id() != 0) return "Fail 3.2" - if (minus3.id() != 1) return "Fail 3.3" - if (minus4.id() != 0) return "Fail 3.4" - if (minus5.id() != 0) return "Fail 3.5" - if (minus6.id() != 0L) return "Fail 3.6" - if (minus7.id() != 0.0f) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1) return "Fail 3.1" + if (minus2.id() != 0) return "Fail 3.2" + if (minus3.id() != 1) return "Fail 3.3" + if (minus4.id() != 0) return "Fail 3.4" + if (minus5.id() != 0) return "Fail 3.5" + if (minus6.id() != 0L) return "Fail 3.6" + if (minus7.id() != 0.0f) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2) return "Fail 4.1" - if (times2.id() != 4) return "Fail 4.2" - if (times3.id() != 6) return "Fail 4.3" - if (times4.id() != 4) return "Fail 4.4" - if (times5.id() != 4) return "Fail 4.5" - if (times6.id() != 4L) return "Fail 4.6" - if (times7.id() != 4.0f) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2) return "Fail 4.1" + if (times2.id() != 4) return "Fail 4.2" + if (times3.id() != 6) return "Fail 4.3" + if (times4.id() != 4) return "Fail 4.4" + if (times5.id() != 4) return "Fail 4.5" + if (times6.id() != 4L) return "Fail 4.6" + if (times7.id() != 4.0f) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0) return "Fail 5.1" - if (div2.id() != 1) return "Fail 5.2" - if (div3.id() != 1) return "Fail 5.3" - if (div4.id() != 1) return "Fail 5.4" - if (div5.id() != 1) return "Fail 5.5" - if (div6.id() != 1L) return "Fail 5.6" - if (div7.id() != 1.0f) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0) return "Fail 5.1" + if (div2.id() != 1) return "Fail 5.2" + if (div3.id() != 1) return "Fail 5.3" + if (div4.id() != 1) return "Fail 5.4" + if (div5.id() != 1) return "Fail 5.5" + if (div6.id() != 1L) return "Fail 5.6" + if (div7.id() != 1.0f) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1) return "Fail 6.1" - if (rem2.id() != 0) return "Fail 6.2" - if (rem3.id() != 1) return "Fail 6.3" - if (rem4.id() != 0) return "Fail 6.4" - if (rem5.id() != 0) return "Fail 6.5" - if (rem6.id() != 0L) return "Fail 6.6" - if (rem7.id() != 0.0f) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1) return "Fail 6.1" + if (rem2.id() != 0) return "Fail 6.2" + if (rem3.id() != 1) return "Fail 6.3" + if (rem4.id() != 0) return "Fail 6.4" + if (rem5.id() != 0) return "Fail 6.5" + if (rem6.id() != 0L) return "Fail 6.6" + if (rem7.id() != 0.0f) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1) return "Fail 7.1" - if (unaryPlus2.id() != -1) return "Fail 7.2" - if (unaryMinus1.id() != -1) return "Fail 7.3" - if (unaryMinus2.id() != 1) return "Fail 7.4" + if (unaryPlus1.id() != 1) return "Fail 7.1" + if (unaryPlus2.id() != -1) return "Fail 7.2" + if (unaryMinus1.id() != -1) return "Fail 7.3" + if (unaryMinus2.id() != 1) return "Fail 7.4" - if (convert1.id() != 1.toByte()) return "Fail 8.1" - if (convert2.id() != '') return "Fail 8.2" - if (convert3.id() != 1.toShort()) return "Fail 8.3" - if (convert4.id() != 1) return "Fail 8.4" - if (convert5.id() != 1L) return "Fail 8.5" - if (convert6.id() != 1.0f) return "Fail 8.6" - if (convert7.id() != 1.0) return "Fail 8.7" + if (convert1.id() != 1.toByte()) return "Fail 8.1" + if (convert2.id() != '') return "Fail 8.2" + if (convert3.id() != 1.toShort()) return "Fail 8.3" + if (convert4.id() != 1) return "Fail 8.4" + if (convert5.id() != 1L) return "Fail 8.5" + if (convert6.id() != 1.0f) return "Fail 8.6" + if (convert7.id() != 1.0) return "Fail 8.7" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" - if (toString1.id() != "1") return "Fail 10.1" - if (toString2.id() != "2") return "Fail 10.2" + if (toString1.id() != "1") return "Fail 10.1" + if (toString2.id() != "2") return "Fail 10.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt index 47d8803fc1a..eb5e8c6a092 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt @@ -54,46 +54,47 @@ const val code2 = twoVal.code const val code3 = threeVal.code const val code4 = fourVal.code +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 1) return "Fail 1.4" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 1) return "Fail 1.4" - if (plus1.id() != '6') return "Fail 2.1" - if (plus2.id() != '7') return "Fail 2.2" - if (plus3.id() != '8') return "Fail 2.3" - if (plus4.id() != '9') return "Fail 2.4" + if (plus1.id() != '6') return "Fail 2.1" + if (plus2.id() != '7') return "Fail 2.2" + if (plus3.id() != '8') return "Fail 2.3" + if (plus4.id() != '9') return "Fail 2.4" - if (minusChar1.id() != -1) return "Fail 3.1" - if (minusChar2.id() != 0) return "Fail 3.2" - if (minusChar3.id() != 1) return "Fail 3.3" - if (minusChar4.id() != 2) return "Fail 3.4" + if (minusChar1.id() != -1) return "Fail 3.1" + if (minusChar2.id() != 0) return "Fail 3.2" + if (minusChar3.id() != 1) return "Fail 3.3" + if (minusChar4.id() != 2) return "Fail 3.4" - if (minusInt1.id() != ',') return "Fail 4.1" - if (minusInt2.id() != '-') return "Fail 4.2" - if (minusInt3.id() != '.') return "Fail 4.3" - if (minusInt4.id() != '/') return "Fail 4.4" + if (minusInt1.id() != ',') return "Fail 4.1" + if (minusInt2.id() != '-') return "Fail 4.2" + if (minusInt3.id() != '.') return "Fail 4.3" + if (minusInt4.id() != '/') return "Fail 4.4" - if (convert1.id() != 49.toByte()) return "Fail 5.1" - if (convert2.id() != '1') return "Fail 5.2" - if (convert3.id() != 49.toShort()) return "Fail 5.3" - if (convert4.id() != 49) return "Fail 5.4" - if (convert5.id() != 49L) return "Fail 5.5" - if (convert6.id() != 49.0f) return "Fail 5.6" - if (convert7.id() != 49.0) return "Fail 5.7" + if (convert1.id() != 49.toByte()) return "Fail 5.1" + if (convert2.id() != '1') return "Fail 5.2" + if (convert3.id() != 49.toShort()) return "Fail 5.3" + if (convert4.id() != 49) return "Fail 5.4" + if (convert5.id() != 49L) return "Fail 5.5" + if (convert6.id() != 49.0f) return "Fail 5.6" + if (convert7.id() != 49.0) return "Fail 5.7" - if (equals1.id() != false) return "Fail 6.1" - if (equals2.id() != true) return "Fail 6.2" - if (equals3.id() != false) return "Fail 6.3" - if (equals4.id() != false) return "Fail 6.4" + if (equals1.id() != false) return "Fail 6.1" + if (equals2.id() != true) return "Fail 6.2" + if (equals3.id() != false) return "Fail 6.3" + if (equals4.id() != false) return "Fail 6.4" - if (toString1.id() != "1") return "Fail 7.1" - if (toString2.id() != "2") return "Fail 7.2" + if (toString1.id() != "1") return "Fail 7.1" + if (toString2.id() != "2") return "Fail 7.2" - if (code1.id() != 49) return "Fail 8.1" - if (code2.id() != 50) return "Fail 8.2" - if (code3.id() != 51) return "Fail 8.3" - if (code4.id() != 52) return "Fail 8.4" + if (code1.id() != 49) return "Fail 8.1" + if (code2.id() != 50) return "Fail 8.2" + if (code3.id() != 51) return "Fail 8.3" + if (code4.id() != 52) return "Fail 8.4" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt index 41ed10cf0aa..4515e1c10c5 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt @@ -88,76 +88,77 @@ const val equals2 = twoVal == twoVal const val equals3 = threeVal == twoVal const val equals4 = fourVal == twoVal +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3.0) return "Fail 2.1" - if (plus2.id() != 4.0) return "Fail 2.2" - if (plus3.id() != 5.0) return "Fail 2.3" - if (plus4.id() != 4.0) return "Fail 2.4" - if (plus5.id() != 4.0) return "Fail 2.5" - if (plus6.id() != 4.0) return "Fail 2.6" - if (plus7.id() != 4.0) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3.0) return "Fail 2.1" + if (plus2.id() != 4.0) return "Fail 2.2" + if (plus3.id() != 5.0) return "Fail 2.3" + if (plus4.id() != 4.0) return "Fail 2.4" + if (plus5.id() != 4.0) return "Fail 2.5" + if (plus6.id() != 4.0) return "Fail 2.6" + if (plus7.id() != 4.0) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1.0) return "Fail 3.1" - if (minus2.id() != 0.0) return "Fail 3.2" - if (minus3.id() != 1.0) return "Fail 3.3" - if (minus4.id() != 0.0) return "Fail 3.4" - if (minus5.id() != 0.0) return "Fail 3.5" - if (minus6.id() != 0.0) return "Fail 3.6" - if (minus7.id() != 0.0) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1.0) return "Fail 3.1" + if (minus2.id() != 0.0) return "Fail 3.2" + if (minus3.id() != 1.0) return "Fail 3.3" + if (minus4.id() != 0.0) return "Fail 3.4" + if (minus5.id() != 0.0) return "Fail 3.5" + if (minus6.id() != 0.0) return "Fail 3.6" + if (minus7.id() != 0.0) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2.0) return "Fail 4.1" - if (times2.id() != 4.0) return "Fail 4.2" - if (times3.id() != 6.0) return "Fail 4.3" - if (times4.id() != 4.0) return "Fail 4.4" - if (times5.id() != 4.0) return "Fail 4.5" - if (times6.id() != 4.0) return "Fail 4.6" - if (times7.id() != 4.0) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2.0) return "Fail 4.1" + if (times2.id() != 4.0) return "Fail 4.2" + if (times3.id() != 6.0) return "Fail 4.3" + if (times4.id() != 4.0) return "Fail 4.4" + if (times5.id() != 4.0) return "Fail 4.5" + if (times6.id() != 4.0) return "Fail 4.6" + if (times7.id() != 4.0) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0.5) return "Fail 5.1" - if (div2.id() != 1.0) return "Fail 5.2" - if (div3.id() != 1.5) return "Fail 5.3" - if (div4.id() != 1.0) return "Fail 5.4" - if (div5.id() != 1.0) return "Fail 5.5" - if (div6.id() != 1.0) return "Fail 5.6" - if (div7.id() != 1.0) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0.5) return "Fail 5.1" + if (div2.id() != 1.0) return "Fail 5.2" + if (div3.id() != 1.5) return "Fail 5.3" + if (div4.id() != 1.0) return "Fail 5.4" + if (div5.id() != 1.0) return "Fail 5.5" + if (div6.id() != 1.0) return "Fail 5.6" + if (div7.id() != 1.0) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1.0) return "Fail 6.1" - if (rem2.id() != 0.0) return "Fail 6.2" - if (rem3.id() != 1.0) return "Fail 6.3" - if (rem4.id() != 0.0) return "Fail 6.4" - if (rem5.id() != 0.0) return "Fail 6.5" - if (rem6.id() != 0.0) return "Fail 6.6" - if (rem7.id() != 0.0) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1.0) return "Fail 6.1" + if (rem2.id() != 0.0) return "Fail 6.2" + if (rem3.id() != 1.0) return "Fail 6.3" + if (rem4.id() != 0.0) return "Fail 6.4" + if (rem5.id() != 0.0) return "Fail 6.5" + if (rem6.id() != 0.0) return "Fail 6.6" + if (rem7.id() != 0.0) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1.0) return "Fail 7.1" - if (unaryPlus2.id() != -1.0) return "Fail 7.2" - if (unaryMinus1.id() != -1.0) return "Fail 7.3" - if (unaryMinus2.id() != 1.0) return "Fail 7.4" + if (unaryPlus1.id() != 1.0) return "Fail 7.1" + if (unaryPlus2.id() != -1.0) return "Fail 7.2" + if (unaryMinus1.id() != -1.0) return "Fail 7.3" + if (unaryMinus2.id() != 1.0) return "Fail 7.4" - if (convert1.id() != '') return "Fail 8.1" - if (convert2.id() != 1) return "Fail 8.2" - if (convert3.id() != 1L) return "Fail 8.3" - if (convert4.id() != 1.0f) return "Fail 8.4" - if (convert5.id() != 1.0) return "Fail 8.5" + if (convert1.id() != '') return "Fail 8.1" + if (convert2.id() != 1) return "Fail 8.2" + if (convert3.id() != 1L) return "Fail 8.3" + if (convert4.id() != 1.0f) return "Fail 8.4" + if (convert5.id() != 1.0) return "Fail 8.5" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/enumRecursiveName.kt b/compiler/testData/codegen/box/involvesIrInterpreter/enumRecursiveName.kt index ffda9695d01..5183c743c6c 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/enumRecursiveName.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/enumRecursiveName.kt @@ -5,7 +5,8 @@ enum class TestEnum(val testNaming: String) { OK(OK.name), } +// STOP_EVALUATION_CHECKS fun box(): String { - val name = TestEnum.OK.name + val name = TestEnum.OK.name return name } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt index 4f2cdb9d87f..0570be5d7fd 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt @@ -88,76 +88,77 @@ const val equals2 = twoVal == twoVal const val equals3 = threeVal == twoVal const val equals4 = fourVal == twoVal +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3f) return "Fail 2.1" - if (plus2.id() != 4f) return "Fail 2.2" - if (plus3.id() != 5f) return "Fail 2.3" - if (plus4.id() != 4f) return "Fail 2.4" - if (plus5.id() != 4f) return "Fail 2.5" - if (plus6.id() != 4f) return "Fail 2.6" - if (plus7.id() != 4.0f) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3f) return "Fail 2.1" + if (plus2.id() != 4f) return "Fail 2.2" + if (plus3.id() != 5f) return "Fail 2.3" + if (plus4.id() != 4f) return "Fail 2.4" + if (plus5.id() != 4f) return "Fail 2.5" + if (plus6.id() != 4f) return "Fail 2.6" + if (plus7.id() != 4.0f) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1f) return "Fail 3.1" - if (minus2.id() != 0f) return "Fail 3.2" - if (minus3.id() != 1f) return "Fail 3.3" - if (minus4.id() != 0f) return "Fail 3.4" - if (minus5.id() != 0f) return "Fail 3.5" - if (minus6.id() != 0f) return "Fail 3.6" - if (minus7.id() != 0.0f) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1f) return "Fail 3.1" + if (minus2.id() != 0f) return "Fail 3.2" + if (minus3.id() != 1f) return "Fail 3.3" + if (minus4.id() != 0f) return "Fail 3.4" + if (minus5.id() != 0f) return "Fail 3.5" + if (minus6.id() != 0f) return "Fail 3.6" + if (minus7.id() != 0.0f) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2f) return "Fail 4.1" - if (times2.id() != 4f) return "Fail 4.2" - if (times3.id() != 6f) return "Fail 4.3" - if (times4.id() != 4f) return "Fail 4.4" - if (times5.id() != 4f) return "Fail 4.5" - if (times6.id() != 4f) return "Fail 4.6" - if (times7.id() != 4.0f) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2f) return "Fail 4.1" + if (times2.id() != 4f) return "Fail 4.2" + if (times3.id() != 6f) return "Fail 4.3" + if (times4.id() != 4f) return "Fail 4.4" + if (times5.id() != 4f) return "Fail 4.5" + if (times6.id() != 4f) return "Fail 4.6" + if (times7.id() != 4.0f) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0.5f) return "Fail 5.1" - if (div2.id() != 1.0f) return "Fail 5.2" - if (div3.id() != 1.5f) return "Fail 5.3" - if (div4.id() != 1f) return "Fail 5.4" - if (div5.id() != 1f) return "Fail 5.5" - if (div6.id() != 1f) return "Fail 5.6" - if (div7.id() != 1.0f) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0.5f) return "Fail 5.1" + if (div2.id() != 1.0f) return "Fail 5.2" + if (div3.id() != 1.5f) return "Fail 5.3" + if (div4.id() != 1f) return "Fail 5.4" + if (div5.id() != 1f) return "Fail 5.5" + if (div6.id() != 1f) return "Fail 5.6" + if (div7.id() != 1.0f) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1f) return "Fail 6.1" - if (rem2.id() != 0f) return "Fail 6.2" - if (rem3.id() != 1f) return "Fail 6.3" - if (rem4.id() != 0f) return "Fail 6.4" - if (rem5.id() != 0f) return "Fail 6.5" - if (rem6.id() != 0f) return "Fail 6.6" - if (rem7.id() != 0.0f) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1f) return "Fail 6.1" + if (rem2.id() != 0f) return "Fail 6.2" + if (rem3.id() != 1f) return "Fail 6.3" + if (rem4.id() != 0f) return "Fail 6.4" + if (rem5.id() != 0f) return "Fail 6.5" + if (rem6.id() != 0f) return "Fail 6.6" + if (rem7.id() != 0.0f) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1f) return "Fail 7.1" - if (unaryPlus2.id() != -1f) return "Fail 7.2" - if (unaryMinus1.id() != -1f) return "Fail 7.3" - if (unaryMinus2.id() != 1f) return "Fail 7.4" + if (unaryPlus1.id() != 1f) return "Fail 7.1" + if (unaryPlus2.id() != -1f) return "Fail 7.2" + if (unaryMinus1.id() != -1f) return "Fail 7.3" + if (unaryMinus2.id() != 1f) return "Fail 7.4" - if (convert1.id() != '') return "Fail 8.1" - if (convert2.id() != 1) return "Fail 8.2" - if (convert3.id() != 1L) return "Fail 8.3" - if (convert4.id() != 1.0f) return "Fail 8.4" - if (convert5.id() != 1.0) return "Fail 8.5" + if (convert1.id() != '') return "Fail 8.1" + if (convert2.id() != 1) return "Fail 8.2" + if (convert3.id() != 1L) return "Fail 8.3" + if (convert4.id() != 1.0f) return "Fail 8.4" + if (convert5.id() != 1.0) return "Fail 8.5" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt index 609e5fd906b..ee57422deae 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt @@ -92,81 +92,82 @@ const val equals4 = fourVal == twoVal const val toString1 = oneVal.toString() const val toString2 = twoVal.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3) return "Fail 2.1" - if (plus2.id() != 4) return "Fail 2.2" - if (plus3.id() != 5) return "Fail 2.3" - if (plus4.id() != 4) return "Fail 2.4" - if (plus5.id() != 4) return "Fail 2.5" - if (plus6.id() != 4L) return "Fail 2.6" - if (plus7.id() != 4.0f) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3) return "Fail 2.1" + if (plus2.id() != 4) return "Fail 2.2" + if (plus3.id() != 5) return "Fail 2.3" + if (plus4.id() != 4) return "Fail 2.4" + if (plus5.id() != 4) return "Fail 2.5" + if (plus6.id() != 4L) return "Fail 2.6" + if (plus7.id() != 4.0f) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1) return "Fail 3.1" - if (minus2.id() != 0) return "Fail 3.2" - if (minus3.id() != 1) return "Fail 3.3" - if (minus4.id() != 0) return "Fail 3.4" - if (minus5.id() != 0) return "Fail 3.5" - if (minus6.id() != 0L) return "Fail 3.6" - if (minus7.id() != 0.0f) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1) return "Fail 3.1" + if (minus2.id() != 0) return "Fail 3.2" + if (minus3.id() != 1) return "Fail 3.3" + if (minus4.id() != 0) return "Fail 3.4" + if (minus5.id() != 0) return "Fail 3.5" + if (minus6.id() != 0L) return "Fail 3.6" + if (minus7.id() != 0.0f) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2) return "Fail 4.1" - if (times2.id() != 4) return "Fail 4.2" - if (times3.id() != 6) return "Fail 4.3" - if (times4.id() != 4) return "Fail 4.4" - if (times5.id() != 4) return "Fail 4.5" - if (times6.id() != 4L) return "Fail 4.6" - if (times7.id() != 4.0f) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2) return "Fail 4.1" + if (times2.id() != 4) return "Fail 4.2" + if (times3.id() != 6) return "Fail 4.3" + if (times4.id() != 4) return "Fail 4.4" + if (times5.id() != 4) return "Fail 4.5" + if (times6.id() != 4L) return "Fail 4.6" + if (times7.id() != 4.0f) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0) return "Fail 5.1" - if (div2.id() != 1) return "Fail 5.2" - if (div3.id() != 1) return "Fail 5.3" - if (div4.id() != 1) return "Fail 5.4" - if (div5.id() != 1) return "Fail 5.5" - if (div6.id() != 1L) return "Fail 5.6" - if (div7.id() != 1.0f) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0) return "Fail 5.1" + if (div2.id() != 1) return "Fail 5.2" + if (div3.id() != 1) return "Fail 5.3" + if (div4.id() != 1) return "Fail 5.4" + if (div5.id() != 1) return "Fail 5.5" + if (div6.id() != 1L) return "Fail 5.6" + if (div7.id() != 1.0f) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1) return "Fail 6.1" - if (rem2.id() != 0) return "Fail 6.2" - if (rem3.id() != 1) return "Fail 6.3" - if (rem4.id() != 0) return "Fail 6.4" - if (rem5.id() != 0) return "Fail 6.5" - if (rem6.id() != 0L) return "Fail 6.6" - if (rem7.id() != 0.0f) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1) return "Fail 6.1" + if (rem2.id() != 0) return "Fail 6.2" + if (rem3.id() != 1) return "Fail 6.3" + if (rem4.id() != 0) return "Fail 6.4" + if (rem5.id() != 0) return "Fail 6.5" + if (rem6.id() != 0L) return "Fail 6.6" + if (rem7.id() != 0.0f) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1) return "Fail 7.1" - if (unaryPlus2.id() != -1) return "Fail 7.2" - if (unaryMinus1.id() != -1) return "Fail 7.3" - if (unaryMinus2.id() != 1) return "Fail 7.4" + if (unaryPlus1.id() != 1) return "Fail 7.1" + if (unaryPlus2.id() != -1) return "Fail 7.2" + if (unaryMinus1.id() != -1) return "Fail 7.3" + if (unaryMinus2.id() != 1) return "Fail 7.4" - if (convert1.id() != 1.toByte()) return "Fail 8.1" - if (convert2.id() != '') return "Fail 8.2" - if (convert3.id() != 1.toShort()) return "Fail 8.3" - if (convert4.id() != 1) return "Fail 8.4" - if (convert5.id() != 1L) return "Fail 8.5" - if (convert6.id() != 1.0f) return "Fail 8.6" - if (convert7.id() != 1.0) return "Fail 8.7" + if (convert1.id() != 1.toByte()) return "Fail 8.1" + if (convert2.id() != '') return "Fail 8.2" + if (convert3.id() != 1.toShort()) return "Fail 8.3" + if (convert4.id() != 1) return "Fail 8.4" + if (convert5.id() != 1L) return "Fail 8.5" + if (convert6.id() != 1.0f) return "Fail 8.6" + if (convert7.id() != 1.0) return "Fail 8.7" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" - if (toString1.id() != "1") return "Fail 10.1" - if (toString2.id() != "2") return "Fail 10.2" + if (toString1.id() != "1") return "Fail 10.1" + if (toString2.id() != "2") return "Fail 10.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt index b3b9c682d6b..2c3a92c2a6d 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt @@ -12,8 +12,9 @@ const val complexTrimIndent = 456 """.trimIndent() +// STOP_EVALUATION_CHECKS fun box(): String { - if (trimIndent.id() != "123") return "Fail 1" - if (complexTrimIndent.id() != "ABC\n123\n456") return "Fail 2" + if (trimIndent.id() != "123") return "Fail 1" + if (complexTrimIndent.id() != "ABC\n123\n456") return "Fail 2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt index acc39ea7e37..218dddd8b9d 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt @@ -16,9 +16,10 @@ const val withoutMargin = """ #bar """.trimMargin("#") +// STOP_EVALUATION_CHECKS fun box(): String { - if (trimMargin.id() != "123") return "Fail 1" - if (trimMarginDefault.id() != "ABC\n123\n456") return "Fail 2" - if (withoutMargin.id() != "XYZ\nfoo\nbar") return "Fail 3" + if (trimMargin.id() != "123") return "Fail 1" + if (trimMarginDefault.id() != "ABC\n123\n456") return "Fail 2" + if (withoutMargin.id() != "XYZ\nfoo\nbar") return "Fail 3" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt index 484291eb1b6..0e3536fb778 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt @@ -12,10 +12,11 @@ const val name2 = EnumClass.VALUE.name const val name3 = EnumClass.anotherValue.name const val name4 = EnumClass.WITH_UNDERSCORE.name +// STOP_EVALUATION_CHECKS fun box(): String { - if (EnumClass.OK.name.id() != "OK") return "Fail 1" - if (name2.id() != "VALUE") return "Fail 2" - if (name3.id() != "anotherValue") return "Fail 3" - if (name4.id() != "WITH_UNDERSCORE") return "Fail 4" - return name1.id() + if (EnumClass.OK.name.id() != "OK") return "Fail 1" + if (name2.id() != "VALUE") return "Fail 2" + if (name3.id() != "anotherValue") return "Fail 3" + if (name4.id() != "WITH_UNDERSCORE") return "Fail 4" + return name1.id() } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt index 2c9ea588637..fb269d95cad 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt @@ -93,50 +93,51 @@ const val equalsString2 = someStr.equals("123") const val equalsString3 = otherStr == someStr const val equalsString4 = someStr.equals(1) +// STOP_EVALUATION_CHECKS fun box(): String { - if (equalsBoolean1.id() != true) return "Fail 1.1" - if (equalsBoolean2.id() != false) return "Fail 1.2" - if (equalsBoolean3.id() != false) return "Fail 1.3" + if (equalsBoolean1.id() != true) return "Fail 1.1" + if (equalsBoolean2.id() != false) return "Fail 1.2" + if (equalsBoolean3.id() != false) return "Fail 1.3" - if (equalsChar1.id() != false) return "Fail 2.1" - if (equalsChar2.id() != true) return "Fail 2.2" - if (equalsChar3.id() != false) return "Fail 2.3" - if (equalsChar4.id() != false) return "Fail 2.3" + if (equalsChar1.id() != false) return "Fail 2.1" + if (equalsChar2.id() != true) return "Fail 2.2" + if (equalsChar3.id() != false) return "Fail 2.3" + if (equalsChar4.id() != false) return "Fail 2.3" - if (equalsByte1.id() != false) return "Fail 3.1" - if (equalsByte2.id() != true) return "Fail 3.2" - if (equalsByte3.id() != false) return "Fail 3.3" - if (equalsByte4.id() != false) return "Fail 3.3" + if (equalsByte1.id() != false) return "Fail 3.1" + if (equalsByte2.id() != true) return "Fail 3.2" + if (equalsByte3.id() != false) return "Fail 3.3" + if (equalsByte4.id() != false) return "Fail 3.3" - if (equalsShort1.id() != false) return "Fail 4.1" - if (equalsShort2.id() != true) return "Fail 4.2" - if (equalsShort3.id() != false) return "Fail 4.3" - if (equalsShort4.id() != false) return "Fail 4.3" + if (equalsShort1.id() != false) return "Fail 4.1" + if (equalsShort2.id() != true) return "Fail 4.2" + if (equalsShort3.id() != false) return "Fail 4.3" + if (equalsShort4.id() != false) return "Fail 4.3" - if (equalsInt1.id() != false) return "Fail 5.1" - if (equalsInt2.id() != true) return "Fail 5.2" - if (equalsInt3.id() != false) return "Fail 5.3" - if (equalsInt4.id() != false) return "Fail 5.3" + if (equalsInt1.id() != false) return "Fail 5.1" + if (equalsInt2.id() != true) return "Fail 5.2" + if (equalsInt3.id() != false) return "Fail 5.3" + if (equalsInt4.id() != false) return "Fail 5.3" - if (equalsLong1.id() != false) return "Fail 6.1" - if (equalsLong2.id() != true) return "Fail 6.2" - if (equalsLong3.id() != false) return "Fail 6.3" - if (equalsLong4.id() != false) return "Fail 6.3" + if (equalsLong1.id() != false) return "Fail 6.1" + if (equalsLong2.id() != true) return "Fail 6.2" + if (equalsLong3.id() != false) return "Fail 6.3" + if (equalsLong4.id() != false) return "Fail 6.3" - if (equalsFloat1.id() != false) return "Fail 7.1" - if (equalsFloat2.id() != true) return "Fail 7.2" - if (equalsFloat3.id() != false) return "Fail 7.3" - if (equalsFloat4.id() != false) return "Fail 7.3" + if (equalsFloat1.id() != false) return "Fail 7.1" + if (equalsFloat2.id() != true) return "Fail 7.2" + if (equalsFloat3.id() != false) return "Fail 7.3" + if (equalsFloat4.id() != false) return "Fail 7.3" - if (equalsDouble1.id() != false) return "Fail 8.1" - if (equalsDouble2.id() != true) return "Fail 8.2" - if (equalsDouble3.id() != false) return "Fail 8.3" - if (equalsDouble4.id() != false) return "Fail 8.3" + if (equalsDouble1.id() != false) return "Fail 8.1" + if (equalsDouble2.id() != true) return "Fail 8.2" + if (equalsDouble3.id() != false) return "Fail 8.3" + if (equalsDouble4.id() != false) return "Fail 8.3" - if (equalsString1.id() != false) return "Fail 9.1" - if (equalsString2.id() != true) return "Fail 9.2" - if (equalsString3.id() != false) return "Fail 9.3" - if (equalsString4.id() != false) return "Fail 9.3" + if (equalsString1.id() != false) return "Fail 9.1" + if (equalsString2.id() != true) return "Fail 9.2" + if (equalsString3.id() != false) return "Fail 9.3" + if (equalsString4.id() != false) return "Fail 9.3" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt index cdc6c0fcdf5..ec990e225dd 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt @@ -13,11 +13,12 @@ const val withWhen2 = when { flag == true -> "True"; else - const val withWhen3 = when(value) { 10 -> "1"; 100 -> "2"; else -> "3" } const val multibranchIf = if (value == 100) 1 else if (value == 1000) 2 else 3 +// STOP_EVALUATION_CHECKS fun box(): String { - if (condition.id() != "True") return "Fail 1" - if (withWhen.id() != "True") return "Fail 2" - if (withWhen2.id() != "True") return "Fail 3" - if (withWhen3.id() != "1") return "Fail 4" - if (multibranchIf.id() != 3) return "Fail 5" + if (condition.id() != "True") return "Fail 1" + if (withWhen.id() != "True") return "Fail 2" + if (withWhen2.id() != "True") return "Fail 3" + if (withWhen3.id() != "1") return "Fail 4" + if (multibranchIf.id() != 3) return "Fail 5" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt index 5c1b1ca2c97..f02191efd72 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt @@ -16,12 +16,13 @@ const val suspendMethodName = A::bar.name const val className = ::A.")!>name const val topLevelPropName = ::topLevelProp.name +// STOP_EVALUATION_CHECKS fun box(): String { - if (propertyName1.id() != "OK") return "Fail 1" - if (propertyName2.id() != "somePropertyWithLongName") return "Fail 2" - if (methodName.id() != "foo") return "Fail 3" - if (suspendMethodName.id() != "bar") return "Fail 3.2" - if (")!>className.id() != "") return "Fail 4" - if (topLevelPropName.id() != "topLevelProp") return "Fail 5" + if (propertyName1.id() != "OK") return "Fail 1" + if (propertyName2.id() != "somePropertyWithLongName") return "Fail 2" + if (methodName.id() != "foo") return "Fail 3" + if (suspendMethodName.id() != "bar") return "Fail 3.2" + if (className.id() != "") return "Fail 4" + if (topLevelPropName.id() != "topLevelProp") return "Fail 5" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt index 872089100ed..52fae4f83e8 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt @@ -5,7 +5,8 @@ // FILE: 1.kt const val name = E.OK.name -fun box(): String = name +// STOP_EVALUATION_CHECKS +fun box(): String = name // FILE: 2.kt diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt index e6dd1b70b45..cca460ae252 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/jsFloatDoubleToString.kt @@ -11,18 +11,22 @@ const val toStringFloat2 = 2.0f.toString() const val toStringFloat3 = 1.5f.toString() fun box(): String { - if (toStringDouble1.id() != "1") return "Fail 1.1" - if (toStringDouble2.id() != "2") return "Fail 1.2" - if (toStringDouble3.id() != "1.5") return "Fail 1.3" + // STOP_EVALUATION_CHECKS + if (toStringDouble1.id() != "1") return "Fail 1.1" + if (toStringDouble2.id() != "2") return "Fail 1.2" + if (toStringDouble3.id() != "1.5") return "Fail 1.3" - if (toStringFloat1.id() != "1") return "Fail 2.1" - if (toStringFloat2.id() != "2") return "Fail 2.2" - if (toStringFloat3.id() != "1.5") return "Fail 2.3" + if (toStringFloat1.id() != "1") return "Fail 2.1" + if (toStringFloat2.id() != "2") return "Fail 2.2" + if (toStringFloat3.id() != "1.5") return "Fail 2.3" + // START_EVALUATION_CHECKS val localDoubleToString = 1.0.toString() val localFloatToString = 1.0f.toString() - if (localDoubleToString.id() != toStringDouble1) return "Fail 3.1" - if (localFloatToString.id() != toStringFloat1) return "Fail 3.2" + // STOP_EVALUATION_CHECKS + + if (localDoubleToString.id() != toStringDouble1) return "Fail 3.1" + if (localFloatToString.id() != toStringFloat1) return "Fail 3.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/jvmFloatDoubleToString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/jvmFloatDoubleToString.kt index 4bba06f3d7f..e25b53fd8ab 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/jvmFloatDoubleToString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/jvmFloatDoubleToString.kt @@ -11,18 +11,22 @@ const val toStringFloat2 = 2.0f.toString() const val toStringFloat3 = 1.5f.toString() fun box(): String { - if (toStringDouble1.id() != "1.0") return "Fail 1.1" - if (toStringDouble2.id() != "2.0") return "Fail 1.2" - if (toStringDouble3.id() != "1.5") return "Fail 1.3" + // STOP_EVALUATION_CHECKS + if (toStringDouble1.id() != "1.0") return "Fail 1.1" + if (toStringDouble2.id() != "2.0") return "Fail 1.2" + if (toStringDouble3.id() != "1.5") return "Fail 1.3" - if (toStringFloat1.id() != "1.0") return "Fail 2.1" - if (toStringFloat2.id() != "2.0") return "Fail 2.2" - if (toStringFloat3.id() != "1.5") return "Fail 2.3" + if (toStringFloat1.id() != "1.0") return "Fail 2.1" + if (toStringFloat2.id() != "2.0") return "Fail 2.2" + if (toStringFloat3.id() != "1.5") return "Fail 2.3" + // START_EVALUATION_CHECKS val localDoubleToString = 1.0.toString() val localFloatToString = 1.0f.toString() - if (localDoubleToString.id() != toStringDouble1) return "Fail 3.1" - if (localFloatToString.id() != toStringFloat1) return "Fail 3.2" + // STOP_EVALUATION_CHECKS + + if (localDoubleToString.id() != toStringDouble1) return "Fail 3.1" + if (localFloatToString.id() != toStringFloat1) return "Fail 3.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/kt53480.kt b/compiler/testData/codegen/box/involvesIrInterpreter/kt53480.kt index 05f13bf1ec0..f3cdf6b8a4e 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/kt53480.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/kt53480.kt @@ -10,6 +10,7 @@ enum class A { val x = J.f() } +// STOP_EVALUATION_CHECKS fun box(): String { - return A.OK.name + return A.OK.name } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt index 784177639b5..e6ff8067e18 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt @@ -92,81 +92,82 @@ const val equals4 = fourVal == twoVal const val toString1 = oneVal.toString() const val toString2 = twoVal.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3L) return "Fail 2.1" - if (plus2.id() != 4L) return "Fail 2.2" - if (plus3.id() != 5L) return "Fail 2.3" - if (plus4.id() != 4L) return "Fail 2.4" - if (plus5.id() != 4L) return "Fail 2.5" - if (plus6.id() != 4L) return "Fail 2.6" - if (plus7.id() != 4.0f) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3L) return "Fail 2.1" + if (plus2.id() != 4L) return "Fail 2.2" + if (plus3.id() != 5L) return "Fail 2.3" + if (plus4.id() != 4L) return "Fail 2.4" + if (plus5.id() != 4L) return "Fail 2.5" + if (plus6.id() != 4L) return "Fail 2.6" + if (plus7.id() != 4.0f) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1L) return "Fail 3.1" - if (minus2.id() != 0L) return "Fail 3.2" - if (minus3.id() != 1L) return "Fail 3.3" - if (minus4.id() != 0L) return "Fail 3.4" - if (minus5.id() != 0L) return "Fail 3.5" - if (minus6.id() != 0L) return "Fail 3.6" - if (minus7.id() != 0.0f) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1L) return "Fail 3.1" + if (minus2.id() != 0L) return "Fail 3.2" + if (minus3.id() != 1L) return "Fail 3.3" + if (minus4.id() != 0L) return "Fail 3.4" + if (minus5.id() != 0L) return "Fail 3.5" + if (minus6.id() != 0L) return "Fail 3.6" + if (minus7.id() != 0.0f) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2L) return "Fail 4.1" - if (times2.id() != 4L) return "Fail 4.2" - if (times3.id() != 6L) return "Fail 4.3" - if (times4.id() != 4L) return "Fail 4.4" - if (times5.id() != 4L) return "Fail 4.5" - if (times6.id() != 4L) return "Fail 4.6" - if (times7.id() != 4.0f) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2L) return "Fail 4.1" + if (times2.id() != 4L) return "Fail 4.2" + if (times3.id() != 6L) return "Fail 4.3" + if (times4.id() != 4L) return "Fail 4.4" + if (times5.id() != 4L) return "Fail 4.5" + if (times6.id() != 4L) return "Fail 4.6" + if (times7.id() != 4.0f) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0L) return "Fail 5.1" - if (div2.id() != 1L) return "Fail 5.2" - if (div3.id() != 1L) return "Fail 5.3" - if (div4.id() != 1L) return "Fail 5.4" - if (div5.id() != 1L) return "Fail 5.5" - if (div6.id() != 1L) return "Fail 5.6" - if (div7.id() != 1.0f) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0L) return "Fail 5.1" + if (div2.id() != 1L) return "Fail 5.2" + if (div3.id() != 1L) return "Fail 5.3" + if (div4.id() != 1L) return "Fail 5.4" + if (div5.id() != 1L) return "Fail 5.5" + if (div6.id() != 1L) return "Fail 5.6" + if (div7.id() != 1.0f) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1L) return "Fail 6.1" - if (rem2.id() != 0L) return "Fail 6.2" - if (rem3.id() != 1L) return "Fail 6.3" - if (rem4.id() != 0L) return "Fail 6.4" - if (rem5.id() != 0L) return "Fail 6.5" - if (rem6.id() != 0L) return "Fail 6.6" - if (rem7.id() != 0.0f) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1L) return "Fail 6.1" + if (rem2.id() != 0L) return "Fail 6.2" + if (rem3.id() != 1L) return "Fail 6.3" + if (rem4.id() != 0L) return "Fail 6.4" + if (rem5.id() != 0L) return "Fail 6.5" + if (rem6.id() != 0L) return "Fail 6.6" + if (rem7.id() != 0.0f) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1L) return "Fail 7.1" - if (unaryPlus2.id() != -1L) return "Fail 7.2" - if (unaryMinus1.id() != -1L) return "Fail 7.3" - if (unaryMinus2.id() != 1L) return "Fail 7.4" + if (unaryPlus1.id() != 1L) return "Fail 7.1" + if (unaryPlus2.id() != -1L) return "Fail 7.2" + if (unaryMinus1.id() != -1L) return "Fail 7.3" + if (unaryMinus2.id() != 1L) return "Fail 7.4" - if (convert1.id() != 1.toByte()) return "Fail 8.1" - if (convert2.id() != '') return "Fail 8.2" - if (convert3.id() != 1.toShort()) return "Fail 8.3" - if (convert4.id() != 1) return "Fail 8.4" - if (convert5.id() != 1L) return "Fail 8.5" - if (convert6.id() != 1.0f) return "Fail 8.6" - if (convert7.id() != 1.0) return "Fail 8.7" + if (convert1.id() != 1.toByte()) return "Fail 8.1" + if (convert2.id() != '') return "Fail 8.2" + if (convert3.id() != 1.toShort()) return "Fail 8.3" + if (convert4.id() != 1) return "Fail 8.4" + if (convert5.id() != 1L) return "Fail 8.5" + if (convert6.id() != 1.0f) return "Fail 8.6" + if (convert7.id() != 1.0) return "Fail 8.7" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" - if (toString1.id() != "1") return "Fail 10.1" - if (toString2.id() != "2") return "Fail 10.2" + if (toString1.id() != "1") return "Fail 10.1" + if (toString2.id() != "2") return "Fail 10.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt index b3fbb5f6471..b2ea370b9c3 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt @@ -92,81 +92,82 @@ const val equals4 = fourVal == twoVal const val toString1 = oneVal.toString() const val toString2 = twoVal.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (compareTo1.id() != -1) return "Fail 1.1" - if (compareTo2.id() != 0) return "Fail 1.2" - if (compareTo3.id() != 1) return "Fail 1.3" - if (compareTo4.id() != 0) return "Fail 1.4" - if (compareTo5.id() != 0) return "Fail 1.5" - if (compareTo6.id() != 0) return "Fail 1.6" - if (compareTo7.id() != 0) return "Fail 1.7" - if (compareTo8.id() != 0) return "Fail 1.8" + if (compareTo1.id() != -1) return "Fail 1.1" + if (compareTo2.id() != 0) return "Fail 1.2" + if (compareTo3.id() != 1) return "Fail 1.3" + if (compareTo4.id() != 0) return "Fail 1.4" + if (compareTo5.id() != 0) return "Fail 1.5" + if (compareTo6.id() != 0) return "Fail 1.6" + if (compareTo7.id() != 0) return "Fail 1.7" + if (compareTo8.id() != 0) return "Fail 1.8" - if (plus1.id() != 3) return "Fail 2.1" - if (plus2.id() != 4) return "Fail 2.2" - if (plus3.id() != 5) return "Fail 2.3" - if (plus4.id() != 4) return "Fail 2.4" - if (plus5.id() != 4) return "Fail 2.5" - if (plus6.id() != 4L) return "Fail 2.6" - if (plus7.id() != 4.0f) return "Fail 2.7" - if (plus8.id() != 4.0) return "Fail 2.8" + if (plus1.id() != 3) return "Fail 2.1" + if (plus2.id() != 4) return "Fail 2.2" + if (plus3.id() != 5) return "Fail 2.3" + if (plus4.id() != 4) return "Fail 2.4" + if (plus5.id() != 4) return "Fail 2.5" + if (plus6.id() != 4L) return "Fail 2.6" + if (plus7.id() != 4.0f) return "Fail 2.7" + if (plus8.id() != 4.0) return "Fail 2.8" - if (minus1.id() != -1) return "Fail 3.1" - if (minus2.id() != 0) return "Fail 3.2" - if (minus3.id() != 1) return "Fail 3.3" - if (minus4.id() != 0) return "Fail 3.4" - if (minus5.id() != 0) return "Fail 3.5" - if (minus6.id() != 0L) return "Fail 3.6" - if (minus7.id() != 0.0f) return "Fail 3.7" - if (minus8.id() != 0.0) return "Fail 3.8" + if (minus1.id() != -1) return "Fail 3.1" + if (minus2.id() != 0) return "Fail 3.2" + if (minus3.id() != 1) return "Fail 3.3" + if (minus4.id() != 0) return "Fail 3.4" + if (minus5.id() != 0) return "Fail 3.5" + if (minus6.id() != 0L) return "Fail 3.6" + if (minus7.id() != 0.0f) return "Fail 3.7" + if (minus8.id() != 0.0) return "Fail 3.8" - if (times1.id() != 2) return "Fail 4.1" - if (times2.id() != 4) return "Fail 4.2" - if (times3.id() != 6) return "Fail 4.3" - if (times4.id() != 4) return "Fail 4.4" - if (times5.id() != 4) return "Fail 4.5" - if (times6.id() != 4L) return "Fail 4.6" - if (times7.id() != 4.0f) return "Fail 4.7" - if (times8.id() != 4.0) return "Fail 4.8" + if (times1.id() != 2) return "Fail 4.1" + if (times2.id() != 4) return "Fail 4.2" + if (times3.id() != 6) return "Fail 4.3" + if (times4.id() != 4) return "Fail 4.4" + if (times5.id() != 4) return "Fail 4.5" + if (times6.id() != 4L) return "Fail 4.6" + if (times7.id() != 4.0f) return "Fail 4.7" + if (times8.id() != 4.0) return "Fail 4.8" - if (div1.id() != 0) return "Fail 5.1" - if (div2.id() != 1) return "Fail 5.2" - if (div3.id() != 1) return "Fail 5.3" - if (div4.id() != 1) return "Fail 5.4" - if (div5.id() != 1) return "Fail 5.5" - if (div6.id() != 1L) return "Fail 5.6" - if (div7.id() != 1.0f) return "Fail 5.7" - if (div8.id() != 1.0) return "Fail 5.8" + if (div1.id() != 0) return "Fail 5.1" + if (div2.id() != 1) return "Fail 5.2" + if (div3.id() != 1) return "Fail 5.3" + if (div4.id() != 1) return "Fail 5.4" + if (div5.id() != 1) return "Fail 5.5" + if (div6.id() != 1L) return "Fail 5.6" + if (div7.id() != 1.0f) return "Fail 5.7" + if (div8.id() != 1.0) return "Fail 5.8" - if (rem1.id() != 1) return "Fail 6.1" - if (rem2.id() != 0) return "Fail 6.2" - if (rem3.id() != 1) return "Fail 6.3" - if (rem4.id() != 0) return "Fail 6.4" - if (rem5.id() != 0) return "Fail 6.5" - if (rem6.id() != 0L) return "Fail 6.6" - if (rem7.id() != 0.0f) return "Fail 6.7" - if (rem8.id() != 0.0) return "Fail 6.8" + if (rem1.id() != 1) return "Fail 6.1" + if (rem2.id() != 0) return "Fail 6.2" + if (rem3.id() != 1) return "Fail 6.3" + if (rem4.id() != 0) return "Fail 6.4" + if (rem5.id() != 0) return "Fail 6.5" + if (rem6.id() != 0L) return "Fail 6.6" + if (rem7.id() != 0.0f) return "Fail 6.7" + if (rem8.id() != 0.0) return "Fail 6.8" - if (unaryPlus1.id() != 1) return "Fail 7.1" - if (unaryPlus2.id() != -1) return "Fail 7.2" - if (unaryMinus1.id() != -1) return "Fail 7.3" - if (unaryMinus2.id() != 1) return "Fail 7.4" + if (unaryPlus1.id() != 1) return "Fail 7.1" + if (unaryPlus2.id() != -1) return "Fail 7.2" + if (unaryMinus1.id() != -1) return "Fail 7.3" + if (unaryMinus2.id() != 1) return "Fail 7.4" - if (convert1.id() != 1.toByte()) return "Fail 8.1" - if (convert2.id() != '') return "Fail 8.2" - if (convert3.id() != 1.toShort()) return "Fail 8.3" - if (convert4.id() != 1) return "Fail 8.4" - if (convert5.id() != 1L) return "Fail 8.5" - if (convert6.id() != 1.0f) return "Fail 8.6" - if (convert7.id() != 1.0) return "Fail 8.7" + if (convert1.id() != 1.toByte()) return "Fail 8.1" + if (convert2.id() != '') return "Fail 8.2" + if (convert3.id() != 1.toShort()) return "Fail 8.3" + if (convert4.id() != 1) return "Fail 8.4" + if (convert5.id() != 1L) return "Fail 8.5" + if (convert6.id() != 1.0f) return "Fail 8.6" + if (convert7.id() != 1.0) return "Fail 8.7" - if (equals1.id() != false) return "Fail 9.1" - if (equals2.id() != true) return "Fail 9.2" - if (equals3.id() != false) return "Fail 9.3" - if (equals4.id() != false) return "Fail 9.4" + if (equals1.id() != false) return "Fail 9.1" + if (equals2.id() != true) return "Fail 9.2" + if (equals3.id() != false) return "Fail 9.3" + if (equals4.id() != false) return "Fail 9.4" - if (toString1.id() != "1") return "Fail 10.1" - if (toString2.id() != "2") return "Fail 10.2" + if (toString1.id() != "1") return "Fail 10.1" + if (toString2.id() != "2") return "Fail 10.2" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt index 029dc8d4338..c6bd18e15d0 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt @@ -8,10 +8,11 @@ const val code = '1'.code const val floorDiv = 10.floorDiv(2) const val mod = 5.mod(3) +// STOP_EVALUATION_CHECKS fun box(): String { - if (code.id() != 49) return "Fail 1" - if (floorDiv.id() != 5) return "Fail 2" - if (mod.id() != 2) return "Fail 3" + if (code.id() != 49) return "Fail 1" + if (floorDiv.id() != 5) return "Fail 2" + if (mod.id() != 2) return "Fail 3" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt index 1124b1df24f..536712c8e3a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt @@ -8,10 +8,11 @@ const val simple = "O${'K'} ${1.toLong() + 2.5}" const val withInnerConcatenation = "1 ${"2 ${3} ${4} 5"} 6" const val withNull = "1 ${null}" // but `"1" + null` is invalid +// STOP_EVALUATION_CHECKS fun box(): String { - if (simple.id() != "OK 3.5") return "Fail 1" - if (withInnerConcatenation.id() != "1 2 3 4 5 6") return "Fail 2" - if (withNull.id() != "1 null") return "Fail 3" + if (simple.id() != "OK 3.5") return "Fail 1" + if (withInnerConcatenation.id() != "1 2 3 4 5 6") return "Fail 2" + if (withNull.id() != "1 null") return "Fail 3" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt index 55093864567..f8a5322c950 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt @@ -27,24 +27,25 @@ const val equals3 = otherStr == someStr const val toString1 = someStr.toString() +// STOP_EVALUATION_CHECKS fun box(): String { - if (plus1.id() != "123other") return "Fail 1.1" - if (plus2.id() != "1231") return "Fail 1.2" + if (plus1.id() != "123other") return "Fail 1.1" + if (plus2.id() != "1231") return "Fail 1.2" - if (length1.id() != 3) return "Fail 2.1" - if (length2.id() != 5) return "Fail 2.2" + if (length1.id() != 3) return "Fail 2.1" + if (length2.id() != 5) return "Fail 2.2" - if (get1.id() != '1') return "Fail 3.1" - if (get2.id() != 't') return "Fail 3.2" + if (get1.id() != '1') return "Fail 3.1" + if (get2.id() != 't') return "Fail 3.2" - if (compareTo1.id() != 0) return "Fail 4.1" - if (compareTo2 >= 0) return "Fail 4.2" - if (compareTo3 <= 0) return "Fail 4.3" + if (compareTo1.id() != 0) return "Fail 4.1" + if (compareTo2 >= 0) return "Fail 4.2" + if (compareTo3 <= 0) return "Fail 4.3" - if (equals1.id() != true) return "Fail 5.1" - if (equals2.id() != false) return "Fail 5.2" - if (equals3.id() != false) return "Fail 5.3" + if (equals1.id() != true) return "Fail 5.1" + if (equals2.id() != false) return "Fail 5.2" + if (equals3.id() != false) return "Fail 5.3" - if (toString1.id() != "123") return "Fail 6.1" + if (toString1.id() != "123") return "Fail 6.1" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt index 0080e5674d9..5dc869cc20f 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt @@ -11,9 +11,10 @@ object Test { fun baz(): String = "baz " + this.toString() } +// STOP_EVALUATION_CHECKS fun box(): String { - if (!Test.foo().startsWith("foo ")) return "Fail ${Test.foo()}" - if (!Test.bar().startsWith("bar ")) return "Fail ${Test.bar()}" - if (!Test.baz().startsWith("baz ")) return "Fail ${Test.baz()}" + if (!Test.foo().startsWith("foo ")) return "Fail ${Test.foo()}" + if (!Test.bar().startsWith("bar ")) return "Fail ${Test.bar()}" + if (!Test.baz().startsWith("baz ")) return "Fail ${Test.baz()}" return "OK" } diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt b/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt index 5abfdc3936d..1b6035d3359 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt @@ -9,10 +9,11 @@ const val shortVal: UShort = 2u const val intVal: UInt = 3u const val longVal: ULong = 4uL +// STOP_EVALUATION_CHECKS fun box(): String { - if (byteVal.id() != 1u.toUByte()) return "Fail 1" - if (shortVal.id() != 2u.toUShort()) return "Fail 2" - if (intVal.id() != 3u.toUInt()) return "Fail 3" - if (longVal.id() != 4u.toULong()) return "Fail 4" + if (byteVal.id() != 1u.toUByte()) return "Fail 1" + if (shortVal.id() != 2u.toUShort()) return "Fail 2" + if (intVal.id() != 3u.toUInt()) return "Fail 3" + if (longVal.id() != 4u.toULong()) return "Fail 4" return "OK" } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrInterpreterDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrInterpreterDumpHandler.kt index 06a24197787..0571ca3863b 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrInterpreterDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrInterpreterDumpHandler.kt @@ -18,6 +18,9 @@ import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.services.* import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator +private const val stopEvaluation = "// STOP_EVALUATION_CHECKS" +private const val startEvaluation = "// START_EVALUATION_CHECKS" + interface IrInterpreterDumpHandler { val testServices: TestServices private val globalMetadataInfoHandler @@ -47,8 +50,11 @@ interface IrInterpreterDumpHandler { } private fun EvaluatedConstTracker.processFile(testFile: TestFile, irFile: IrFile) { + val rangesThatAreNotSupposedToBeRendered = testFile.extractRangesWithoutRender() this.load(irFile.name)?.forEach { (pair, constantValue) -> val (start, end) = pair + if (rangesThatAreNotSupposedToBeRendered.any { start >= it.first && start <= it.second }) return@forEach + val message = constantValue.stringTemplateValue() val metaInfo = ParsedCodeMetaInfo( start, end, @@ -59,6 +65,20 @@ interface IrInterpreterDumpHandler { globalMetadataInfoHandler.addMetadataInfosForFile(testFile, listOf(metaInfo)) } } + + private fun TestFile.extractRangesWithoutRender(): List> { + val content = testServices.sourceFileProvider.getContentOfSourceFile(this) + return buildList { + var indexOfStop = -1 + do { + indexOfStop = content.indexOf(stopEvaluation, indexOfStop + 1) + if (indexOfStop < 0) break + + val indexOfStart = content.indexOf(startEvaluation, indexOfStop).takeIf { it != -1 } ?: content.length + add(indexOfStop to indexOfStart) + } while (true) + } + } } class JvmIrInterpreterDumpHandler(testServices: TestServices) : IrInterpreterDumpHandler, JvmBinaryArtifactHandler(testServices) {