-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JVM IR: do not optimize casts for primitives in TypeOperatorLowering
#KT-48659 Fixed (cherry picked from commit 64b911e)
- Loading branch information
Showing
6 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.../tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
compiler/testData/codegen/box/primitiveTypes/kt48659_identityEqualsWithCastToAny.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// TARGET_BACKEND: JVM | ||
|
||
fun int(a: Int, b: Int): Boolean = (a as Any) === (b as Any) | ||
fun short(a: Short, b: Short): Boolean = (a as Any) === (b as Any) | ||
fun char(a: Char, b: Char): Boolean = (a as Any) === (b as Any) | ||
fun long(a: Long, b: Long): Boolean = (a as Any) === (b as Any) | ||
fun float(a: Float, b: Float): Boolean = (a as Any) === (b as Any) | ||
fun double(a: Double, b: Double): Boolean = (a as Any) === (b as Any) | ||
|
||
fun byte(a: Byte, b: Byte): Boolean = (a as Any) === (b as Any) | ||
fun boolean(a: Boolean, b: Boolean): Boolean = (a as Any) === (b as Any) | ||
|
||
fun box(): String { | ||
if (int(2021, 2021)) return "Fail int" | ||
if (short(32042, 32042)) return "Fail short" | ||
if (char(4242.toChar(), 4242.toChar())) return "Fail char" | ||
if (long(4242424242L, 4242424242L)) return "Fail long" | ||
if (float(3.14f, 3.14f)) return "Fail float" | ||
if (double(2.72, 2.72)) return "Fail double" | ||
|
||
// All byte and boolean values are cached in java.lang.Byte/Boolean.valueOf | ||
if (!byte(127, 127)) return "Fail byte" | ||
if (!boolean(true, true)) return "Fail boolean" | ||
|
||
return "OK" | ||
} |
6 changes: 6 additions & 0 deletions
6
...new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...w/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.