Remove bytecode text test kt15806.kt
It's not correct to expect that the backend generates the `when` in this test as tableswitch because there are only two branches. JVM IR has a cutoff in the when optimization and generates `when`s with fewer than 3 branches as if-else chains, which is probably better. Note that there's also a corresponding box test in when/enumOptimization/, so the backend behavior is still tested.
This commit is contained in:
Generated
-5
@@ -4974,11 +4974,6 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt15806.kt")
|
||||
public void testKt15806() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt15806.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyWhensWithinClass.kt")
|
||||
public void testManyWhensWithinClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt");
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TODO KT-36845 Generate enum-based TABLESWITCH/LOOKUPSWITCH on a value with smart cast to enum in JVM_IR
|
||||
|
||||
private fun Any?.doTheThing(): String {
|
||||
when (this) {
|
||||
is String -> return this
|
||||
is Level -> {
|
||||
when (this) {
|
||||
Level.O -> return Level.O.name
|
||||
Level.K -> return Level.K.name
|
||||
}
|
||||
}
|
||||
|
||||
else -> return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum class Level {
|
||||
O,
|
||||
K
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return "O".doTheThing() + Level.K.doTheThing()
|
||||
}
|
||||
|
||||
// 1 TABLESWITCH
|
||||
-5
@@ -4991,11 +4991,6 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt15806.kt")
|
||||
public void testKt15806() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt15806.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyWhensWithinClass.kt")
|
||||
public void testManyWhensWithinClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt");
|
||||
|
||||
-5
@@ -4974,11 +4974,6 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt15806.kt")
|
||||
public void testKt15806() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt15806.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyWhensWithinClass.kt")
|
||||
public void testManyWhensWithinClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user