diff --git a/compiler/testData/codegen/box/privateConstructors/withVarargs.kt b/compiler/testData/codegen/box/privateConstructors/withVarargs.kt index c54b3c21772..f7791f1968c 100644 --- a/compiler/testData/codegen/box/privateConstructors/withVarargs.kt +++ b/compiler/testData/codegen/box/privateConstructors/withVarargs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // See also KT-6299 public open class Outer private constructor(val s: String, vararg i: Int) { class Inner: Outer("xyz") diff --git a/compiler/testData/codegen/box/reified/varargs.kt b/compiler/testData/codegen/box/reified/varargs.kt index 6ad9f19c64f..a3cd0cbb9d4 100644 --- a/compiler/testData/codegen/box/reified/varargs.kt +++ b/compiler/testData/codegen/box/reified/varargs.kt @@ -1,5 +1,4 @@ // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/boxInline/reified/arrayOf.kt b/compiler/testData/codegen/boxInline/reified/arrayOf.kt new file mode 100644 index 00000000000..684e98cadbb --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/arrayOf.kt @@ -0,0 +1,13 @@ +// FILE: 1.kt +package test + +inline fun f(): Array = arrayOf() + +// FILE: 2.kt + +import test.* + +fun box(): String { + f() + return "OK" +} diff --git a/compiler/testData/codegen/boxInline/reified/kt8047_2.kt b/compiler/testData/codegen/boxInline/reified/kt8047_2.kt new file mode 100644 index 00000000000..235ab5a6118 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/kt8047_2.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt + +package test + +inline fun f(x : () -> Unit) { + object { init { "OK" is T } } +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + f() {} + return "OK" +} diff --git a/compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt b/compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt index 451839b7684..ec0b3c68a80 100644 --- a/compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt +++ b/compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR - // There is one ANEWARRAY instruction here, to generate the default parameter value. fun default(vararg s: String = arrayOf("OK")) = s[0] diff --git a/compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt b/compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt index c47d521a728..6ce0d6ec3f4 100644 --- a/compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt +++ b/compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt @@ -9,7 +9,7 @@ inline class UInt(val u: Int) fun takeVarargs(vararg e: T) {} fun test(u1: UInt, u2: UInt, us: Array) { - takeVarargs(*us) // copy + checkcast + takeVarargs(*us) // copy + checkcast (on non-ir backend) takeVarargs(u1, u2, *us) // 2 box + ... } @@ -17,9 +17,13 @@ fun test(u1: UInt, u2: UInt, us: Array) { // 2 INVOKESTATIC UInt\.box // 0 INVOKEVIRTUAL UInt.unbox -// 2 CHECKCAST \[LUInt - // 0 CHECKCAST \[Ljava/lang/Integer // 0 intValue -// 0 valueOf \ No newline at end of file +// 0 valueOf + +// JVM_TEMPLATES +// 2 CHECKCAST \[LUInt + +// JVM_IR_TEMPLATES +// 1 CHECKCAST \[LUInt diff --git a/compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt b/compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt index 448a8e7117e..4a62896cb2a 100644 --- a/compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt +++ b/compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR fun booleanVararg(vararg xs: Boolean) {} fun byteVararg(vararg xs: Byte) {} fun shortVararg(vararg xs: Short) {} @@ -74,5 +73,6 @@ fun test() { genericVararg(xs = *arrayOfNulls(1)) } +// 0 arraycopy // 0 copyOf // 0 clone \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index e0e73db307f..cbd6f92c991 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -2672,6 +2672,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); } + @TestMetadata("arrayOf.kt") + public void testArrayOf() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayOf.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt"); @@ -2737,6 +2742,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/reified/kt8047.kt"); } + @TestMetadata("kt8047_2.kt") + public void testKt8047_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/kt8047_2.kt"); + } + @TestMetadata("kt9637.kt") public void testKt9637() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/kt9637.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index d85dbc0961e..653cee82a67 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2672,6 +2672,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); } + @TestMetadata("arrayOf.kt") + public void testArrayOf() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayOf.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt"); @@ -2737,6 +2742,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/reified/kt8047.kt"); } + @TestMetadata("kt8047_2.kt") + public void testKt8047_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/kt8047_2.kt"); + } + @TestMetadata("kt9637.kt") public void testKt9637() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/kt9637.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 92beb2c0325..13b6cbce34e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -2672,6 +2672,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); } + @TestMetadata("arrayOf.kt") + public void testArrayOf() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayOf.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt"); @@ -2737,6 +2742,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/reified/kt8047.kt"); } + @TestMetadata("kt8047_2.kt") + public void testKt8047_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/kt8047_2.kt"); + } + @TestMetadata("kt9637.kt") public void testKt9637() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/kt9637.kt");