diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index f570781bf3a..4535f923af3 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -49729,6 +49729,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @Test + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @Test @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 71567a721c7..f2bfa4c8159 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -49729,6 +49729,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @Test + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @Test @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { diff --git a/compiler/testData/codegen/box/specialBuiltins/bridges.kt b/compiler/testData/codegen/box/specialBuiltins/bridges.kt index d208e4c63bf..39f6602783c 100644 --- a/compiler/testData/codegen/box/specialBuiltins/bridges.kt +++ b/compiler/testData/codegen/box/specialBuiltins/bridges.kt @@ -1,8 +1,3 @@ -// IGNORE_BACKEND: WASM -// WASM_MUTE_REASON: STDLIB_COLLECTION_INHERITANCE -// KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: NATIVE - interface A0 { val size: Int get() = 56 } @@ -31,16 +26,10 @@ interface I2 { val size: Int } -val list = ArrayList() - -class B2 : ArrayList(list), I2 - interface I3 { val size: T } -class B3 : ArrayList(list), I3 - interface I4 { val size: T get() = 56 as T } @@ -66,8 +55,6 @@ class B5 : I5 { } fun box(): String { - list.add("1") - val b0 = B0() if (b0.size != 56) return "fail 0: ${b0.size}" var x: Collection = B0() @@ -80,20 +67,6 @@ fun box(): String { x = B1() if (x.size != 56) return "fail 2: ${x.size}" - val b2 = B2() - if (b2.size != 1) return "fail 3: ${b2.size}" - x = B2() - if (x.size != 1) return "fail 4: ${x.size}" - val i2: I2 = b2 - if (i2.size != 1) return "fail 5: ${i2.size}" - - val b3 = B3() - if (b3.size != 1) return "fail 6: ${b3.size}" - x = B3() - if (x.size != 1) return "fail 7: ${x.size}" - val i3: I3 = b3 - if (i3.size != 1) return "fail 8: ${i3.size}" - val b4 = B4() if (b4.size != 56) return "fail 9: ${b4.size}" x = B4() diff --git a/compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt b/compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt new file mode 100644 index 00000000000..1f7f7bbf1f1 --- /dev/null +++ b/compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt @@ -0,0 +1,37 @@ +// TARGET_BACKEND: JVM +// TARGET_BACKEND: JVM_IR +// KJS_WITH_FULL_RUNTIME + +val list = ArrayList() + +interface I2 { + val size: Int +} + +class B2 : ArrayList(list), I2 + +interface I3 { + val size: T +} + +class B3 : ArrayList(list), I3 + +fun box(): String { + list.add("1") + + val b2 = B2() + if (b2.size != 1) return "fail 3: ${b2.size}" + var x: Collection = B2() + if (x.size != 1) return "fail 4: ${x.size}" + val i2: I2 = b2 + if (i2.size != 1) return "fail 5: ${i2.size}" + + val b3 = B3() + if (b3.size != 1) return "fail 6: ${b3.size}" + x = B3() + if (x.size != 1) return "fail 7: ${x.size}" + val i3: I3 = b3 + if (i3.size != 1) return "fail 8: ${i3.size}" + + return "OK" +} diff --git a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt index ade2f2b0519..4e283957e83 100644 --- a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt +++ b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTION_INHERITANCE // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: NATIVE +// DONT_TARGET_EXACT_BACKEND: NATIVE open class Base() : HashSet() { override fun remove(element: Target): Boolean { diff --git a/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt b/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt index 025e9e60ad5..294ad219d43 100644 --- a/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt +++ b/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTION_INHERITANCE // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: NATIVE +// DONT_TARGET_EXACT_BACKEND: NATIVE open class Map1 : HashMap() class Map2 : Map1() diff --git a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt index bbbf1f1ce17..f2474461e5f 100644 --- a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt +++ b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTION_INHERITANCE // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: NATIVE +// DONT_TARGET_EXACT_BACKEND: NATIVE class A : ArrayList() { override val size: Int get() = super.size + 56 diff --git a/compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt b/compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt index c42ec0afe88..712f7ce03bd 100644 --- a/compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt +++ b/compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTION_INHERITANCE // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: NATIVE +// DONT_TARGET_EXACT_BACKEND: NATIVE class MySet : HashSet() { override fun remove(element: Int): Boolean { return super.remove(element) diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 49f303e8307..1a63d8be04c 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -46945,6 +46945,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @Test + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @Test @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 060e4caaefd..3ec6e8a4c01 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -49729,6 +49729,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @Test + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @Test @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index e351fe8c3de..fba32f881b0 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -49729,6 +49729,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @Test + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @Test @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index c5a7a4bec9d..934d4fd2649 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -39914,6 +39914,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } + @TestMetadata("bridgesJVM.kt") + public void testBridgesJVM() throws Exception { + runTest("compiler/testData/codegen/box/specialBuiltins/bridgesJVM.kt"); + } + @TestMetadata("charBuffer.kt") public void testCharBuffer() throws Exception { runTest("compiler/testData/codegen/box/specialBuiltins/charBuffer.kt"); diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index 72321fa2f5f..b97a4d3f99b 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -37933,12 +37933,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } - @Test - @TestMetadata("commonBridgesTarget.kt") - public void testCommonBridgesTarget() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt"); - } - @Test @TestMetadata("emptyList.kt") public void testEmptyList() throws Exception { @@ -37957,12 +37951,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt"); } - @Test - @TestMetadata("entrySetSOE.kt") - public void testEntrySetSOE() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt"); - } - @Test @TestMetadata("enumAsOrdinaled.kt") public void testEnumAsOrdinaled() throws Exception { @@ -37975,12 +37963,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/specialBuiltins/exceptionCause.kt"); } - @Test - @TestMetadata("explicitSuperCall.kt") - public void testExplicitSuperCall() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); - } - @Test @TestMetadata("irrelevantRemoveAtOverride.kt") public void testIrrelevantRemoveAtOverride() throws Exception { @@ -38023,12 +38005,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/specialBuiltins/removeAtTwoSpecialBridges.kt"); } - @Test - @TestMetadata("removeSetInt.kt") - public void testRemoveSetInt() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt"); - } - @Test @TestMetadata("throwable.kt") public void testThrowable() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index d1879aec5dc..36a50dcb661 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -38903,12 +38903,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } - @Test - @TestMetadata("commonBridgesTarget.kt") - public void testCommonBridgesTarget() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt"); - } - @Test @TestMetadata("emptyList.kt") public void testEmptyList() throws Exception { @@ -38927,12 +38921,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt"); } - @Test - @TestMetadata("entrySetSOE.kt") - public void testEntrySetSOE() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt"); - } - @Test @TestMetadata("enumAsOrdinaled.kt") public void testEnumAsOrdinaled() throws Exception { @@ -38945,12 +38933,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/specialBuiltins/exceptionCause.kt"); } - @Test - @TestMetadata("explicitSuperCall.kt") - public void testExplicitSuperCall() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); - } - @Test @TestMetadata("irrelevantRemoveAtOverride.kt") public void testIrrelevantRemoveAtOverride() throws Exception { @@ -38993,12 +38975,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/specialBuiltins/removeAtTwoSpecialBridges.kt"); } - @Test - @TestMetadata("removeSetInt.kt") - public void testRemoveSetInt() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt"); - } - @Test @TestMetadata("throwable.kt") public void testThrowable() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index e4cabe6ebf8..40db4669f2f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -37449,12 +37449,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } - @Test - @TestMetadata("commonBridgesTarget.kt") - public void testCommonBridgesTarget() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt"); - } - @Test @TestMetadata("emptyList.kt") public void testEmptyList() throws Exception { @@ -37473,12 +37467,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt"); } - @Test - @TestMetadata("entrySetSOE.kt") - public void testEntrySetSOE() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt"); - } - @Test @TestMetadata("enumAsOrdinaled.kt") public void testEnumAsOrdinaled() throws Exception { @@ -37491,12 +37479,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/specialBuiltins/exceptionCause.kt"); } - @Test - @TestMetadata("explicitSuperCall.kt") - public void testExplicitSuperCall() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); - } - @Test @TestMetadata("irrelevantRemoveAtOverride.kt") public void testIrrelevantRemoveAtOverride() throws Exception { @@ -37539,12 +37521,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/specialBuiltins/removeAtTwoSpecialBridges.kt"); } - @Test - @TestMetadata("removeSetInt.kt") - public void testRemoveSetInt() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt"); - } - @Test @TestMetadata("throwable.kt") public void testThrowable() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index a0d512b4e20..90493ecfb4f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -37934,12 +37934,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/specialBuiltins/bridges.kt"); } - @Test - @TestMetadata("commonBridgesTarget.kt") - public void testCommonBridgesTarget() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt"); - } - @Test @TestMetadata("emptyList.kt") public void testEmptyList() throws Exception { @@ -37958,12 +37952,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt"); } - @Test - @TestMetadata("entrySetSOE.kt") - public void testEntrySetSOE() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt"); - } - @Test @TestMetadata("enumAsOrdinaled.kt") public void testEnumAsOrdinaled() throws Exception { @@ -37976,12 +37964,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/specialBuiltins/exceptionCause.kt"); } - @Test - @TestMetadata("explicitSuperCall.kt") - public void testExplicitSuperCall() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); - } - @Test @TestMetadata("irrelevantRemoveAtOverride.kt") public void testIrrelevantRemoveAtOverride() throws Exception { @@ -38024,12 +38006,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/specialBuiltins/removeAtTwoSpecialBridges.kt"); } - @Test - @TestMetadata("removeSetInt.kt") - public void testRemoveSetInt() throws Exception { - runTest("compiler/testData/codegen/box/specialBuiltins/removeSetInt.kt"); - } - @Test @TestMetadata("throwable.kt") public void testThrowable() throws Exception {