JVM_IR KT-46840 don't generate special function references with indy
This commit is contained in:
committed by
TeamCityServer
parent
3fc7e0ed03
commit
c0fbdb1535
+46
-6
@@ -21326,12 +21326,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/innerConstructorRef.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intReturnTypeAsNumber.kt")
|
||||
public void testIntReturnTypeAsNumber() throws Exception {
|
||||
@@ -21422,6 +21416,52 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/voidReturnTypeAsObject.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SpecialFunctions {
|
||||
@Test
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anyNToString.kt")
|
||||
public void testAnyNToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/anyNToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayConstructor.kt")
|
||||
public void testArrayConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/arrayConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValueOf.kt")
|
||||
public void testEnumValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValueOf.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValues.kt")
|
||||
public void testEnumValues() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValues.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringNPlus.kt")
|
||||
public void testStringNPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/stringNPlus.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.intrinsics
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
|
||||
|
||||
object IntrinsicShouldHaveBeenLowered : IntrinsicMethod() {
|
||||
override fun toCallable(
|
||||
expression: IrFunctionAccessExpression,
|
||||
signature: JvmMethodSignature,
|
||||
context: JvmBackendContext
|
||||
): IrIntrinsicFunction {
|
||||
error("Intrinsic should have been lowered: '${expression.symbol.owner.render()}'")
|
||||
}
|
||||
}
|
||||
+45
-79
@@ -17,8 +17,8 @@
|
||||
package org.jetbrains.kotlin.backend.jvm.intrinsics
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmSymbols
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrPackageFragment
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
@@ -37,72 +37,36 @@ import org.jetbrains.kotlin.lexer.KtSingleValueToken
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||
import org.jetbrains.kotlin.util.capitalizeDecapitalize.decapitalizeAsciiOnly
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
|
||||
class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) {
|
||||
private val kotlinJvm = FqName("kotlin.jvm")
|
||||
private val kotlinJvmInternalUnsafe = FqName("kotlin.jvm.internal.unsafe")
|
||||
private val kotlinFqn = StandardNames.BUILT_INS_PACKAGE_FQ_NAME
|
||||
private val kotlinJvmFqn = FqName("kotlin.jvm")
|
||||
private val kotlinJvmInternalUnsafeFqn = FqName("kotlin.jvm.internal.unsafe")
|
||||
|
||||
private val anyFqn = StandardNames.FqNames.any.toSafe()
|
||||
private val arrayFqn = StandardNames.FqNames.array.toSafe()
|
||||
private val cloneableFqn = StandardNames.FqNames.cloneable.toSafe()
|
||||
private val intFqn = StandardNames.FqNames._int.toSafe()
|
||||
private val kClassFqn = StandardNames.FqNames.kClass.toSafe()
|
||||
private val stringFqn = StandardNames.FqNames.string.toSafe()
|
||||
|
||||
private val intrinsicsMap = (
|
||||
listOf(
|
||||
Key(kotlinJvm, FqName("T"), "<get-javaClass>", emptyList()) to JavaClassProperty,
|
||||
Key(kotlinJvm, StandardNames.FqNames.kClass.toSafe(), "<get-javaObjectType>", emptyList()) to GetJavaObjectType,
|
||||
Key(kotlinJvm, StandardNames.FqNames.kClass.toSafe(), "<get-javaPrimitiveType>", emptyList()) to GetJavaPrimitiveType,
|
||||
Key(
|
||||
kotlinJvm,
|
||||
StandardNames.FqNames.kClass.toSafe(),
|
||||
"<get-java>",
|
||||
emptyList()
|
||||
) to KClassJavaProperty,
|
||||
Key(
|
||||
kotlinJvmInternalUnsafe,
|
||||
null,
|
||||
"access\$monitorEnter",
|
||||
listOf(StandardNames.FqNames.any.toSafe())
|
||||
) to MonitorInstruction.MONITOR_ENTER,
|
||||
Key(
|
||||
kotlinJvmInternalUnsafe,
|
||||
null,
|
||||
"access\$monitorExit",
|
||||
listOf(StandardNames.FqNames.any.toSafe())
|
||||
) to MonitorInstruction.MONITOR_EXIT,
|
||||
Key(
|
||||
kotlinJvm,
|
||||
StandardNames.FqNames.array.toSafe(),
|
||||
"isArrayOf",
|
||||
emptyList()
|
||||
) to IsArrayOf,
|
||||
Key(
|
||||
StandardNames.BUILT_INS_PACKAGE_FQ_NAME,
|
||||
null,
|
||||
"arrayOfNulls",
|
||||
listOf(StandardNames.FqNames._int.toSafe())
|
||||
) to NewArray,
|
||||
Key(
|
||||
StandardNames.FqNames.cloneable.toSafe(),
|
||||
null,
|
||||
"clone",
|
||||
emptyList()
|
||||
) to Clone,
|
||||
Key(
|
||||
StandardNames.BUILT_INS_PACKAGE_FQ_NAME,
|
||||
null,
|
||||
"enumValues",
|
||||
listOf()
|
||||
) to EnumValues,
|
||||
Key(
|
||||
StandardNames.BUILT_INS_PACKAGE_FQ_NAME,
|
||||
null,
|
||||
"enumValueOf",
|
||||
listOf(StandardNames.FqNames.string.toSafe())
|
||||
) to EnumValueOf,
|
||||
Key(
|
||||
StandardNames.BUILT_INS_PACKAGE_FQ_NAME,
|
||||
StandardNames.FqNames.string.toSafe(),
|
||||
"plus",
|
||||
listOf(StandardNames.FqNames.any.toSafe())
|
||||
) to StringPlus,
|
||||
Key(kotlinJvmFqn, FqName("T"), "<get-javaClass>", emptyList()) to JavaClassProperty,
|
||||
Key(kotlinJvmFqn, kClassFqn, "<get-javaObjectType>", emptyList()) to GetJavaObjectType,
|
||||
Key(kotlinJvmFqn, kClassFqn, "<get-javaPrimitiveType>", emptyList()) to GetJavaPrimitiveType,
|
||||
Key(kotlinJvmFqn, kClassFqn, "<get-java>", emptyList()) to KClassJavaProperty,
|
||||
Key(kotlinJvmInternalUnsafeFqn, null, "access\$monitorEnter", listOf(anyFqn)) to MonitorInstruction.MONITOR_ENTER,
|
||||
Key(kotlinJvmInternalUnsafeFqn, null, "access\$monitorExit", listOf(anyFqn)) to MonitorInstruction.MONITOR_EXIT,
|
||||
Key(kotlinJvmFqn, arrayFqn, "isArrayOf", emptyList()) to IsArrayOf,
|
||||
Key(kotlinFqn, null, "arrayOfNulls", listOf(intFqn)) to NewArray,
|
||||
Key(cloneableFqn, null, "clone", emptyList()) to Clone,
|
||||
Key(kotlinFqn, null, "enumValues", listOf()) to EnumValues,
|
||||
Key(kotlinFqn, null, "enumValueOf", listOf(stringFqn)) to EnumValueOf,
|
||||
Key(kotlinFqn, stringFqn, "plus", listOf(anyFqn)) to StringPlus,
|
||||
irBuiltIns.eqeqSymbol.toKey()!! to Equals(KtTokens.EQEQ),
|
||||
irBuiltIns.eqeqeqSymbol.toKey()!! to Equals(KtTokens.EQEQEQ),
|
||||
irBuiltIns.ieee754equalsFunByOperandType[irBuiltIns.floatClass]!!.toKey()!! to Ieee754Equals(Type.FLOAT_TYPE),
|
||||
@@ -156,9 +120,22 @@ class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) {
|
||||
primitiveComparisonIntrinsics(irBuiltIns.lessFunByOperandType, KtTokens.LT) +
|
||||
primitiveComparisonIntrinsics(irBuiltIns.lessOrEqualFunByOperandType, KtTokens.LTEQ) +
|
||||
primitiveComparisonIntrinsics(irBuiltIns.greaterFunByOperandType, KtTokens.GT) +
|
||||
primitiveComparisonIntrinsics(irBuiltIns.greaterOrEqualFunByOperandType, KtTokens.GTEQ)
|
||||
primitiveComparisonIntrinsics(irBuiltIns.greaterOrEqualFunByOperandType, KtTokens.GTEQ) +
|
||||
|
||||
intrinsicsThatShouldHaveBeenLowered()
|
||||
).toMap()
|
||||
|
||||
private fun intrinsicsThatShouldHaveBeenLowered() =
|
||||
(symbols.primitiveArrays.values.map { primitiveClassSymbol ->
|
||||
val name = primitiveClassSymbol.owner.name.asString()
|
||||
// IntArray -> intArrayOf
|
||||
val arrayOfFunName = name.decapitalizeAsciiOnly() + "Of"
|
||||
Key(kotlinFqn, null, arrayOfFunName, listOf(primitiveClassSymbol.owner.fqNameWhenAvailable))
|
||||
} + listOf(
|
||||
Key(kotlinFqn, anyFqn, "toString", emptyList()),
|
||||
Key(kotlinFqn, null, "arrayOf", listOf(arrayFqn)),
|
||||
)).map { it to IntrinsicShouldHaveBeenLowered }
|
||||
|
||||
private val PrimitiveType.symbol
|
||||
get() = irBuiltIns.primitiveTypeToIrType[this]!!.classOrNull!!
|
||||
|
||||
@@ -181,28 +158,18 @@ class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) {
|
||||
parameter: IrClassifierSymbol
|
||||
): List<Pair<Key, IntrinsicMethod>> =
|
||||
PrimitiveType.values().map { type ->
|
||||
createKeyMapping(
|
||||
intrinsic,
|
||||
type.symbol,
|
||||
name,
|
||||
parameter
|
||||
)
|
||||
createKeyMapping(intrinsic, type.symbol, name, parameter)
|
||||
}
|
||||
|
||||
private fun binaryOp(methodName: String, opcode: Int) = binaryFunForPrimitivesAcrossPrimitives(methodName, BinaryOp(opcode))
|
||||
|
||||
private fun numberConversionMethods(): List<Pair<Key, IntrinsicMethod>> =
|
||||
PrimitiveType.NUMBER_TYPES.flatMap { type ->
|
||||
numberConversionMethods(type.symbol)
|
||||
} + numberConversionMethods(irBuiltIns.numberClass)
|
||||
PrimitiveType.NUMBER_TYPES.flatMap { type -> numberConversionMethods(type.symbol) } +
|
||||
numberConversionMethods(irBuiltIns.numberClass)
|
||||
|
||||
private fun arrayMethods(): List<Pair<Key, IntrinsicMethod>> =
|
||||
symbols.primitiveArrays.flatMap { (key, value) ->
|
||||
arrayMethods(
|
||||
key.symbol,
|
||||
value
|
||||
)
|
||||
} + arrayMethods(symbols.array.owner.typeParameters.single().symbol, symbols.array)
|
||||
symbols.primitiveArrays.flatMap { (key, value) -> arrayMethods(key.symbol, value) } +
|
||||
arrayMethods(symbols.array.owner.typeParameters.single().symbol, symbols.array)
|
||||
|
||||
private fun arrayMethods(elementClass: IrClassifierSymbol, arrayClass: IrClassSymbol) =
|
||||
listOf(
|
||||
@@ -269,9 +236,8 @@ class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) {
|
||||
name: String,
|
||||
vararg args: IrClassifierSymbol
|
||||
): Pair<Key, IntrinsicMethod> =
|
||||
Key(klass.owner.fqNameWhenAvailable!!, null, name, args.map {
|
||||
getParameterFqName(it)
|
||||
}) to intrinsic
|
||||
Key(klass.owner.fqNameWhenAvailable!!, null, name, args.map { getParameterFqName(it) }) to
|
||||
intrinsic
|
||||
|
||||
private fun numberConversionMethods(numberClass: IrClassSymbol) =
|
||||
OperatorConventions.NUMBER_CONVERSIONS.map { method ->
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
|
||||
// FILE: anyNToString.kt
|
||||
fun box() =
|
||||
Sam(Any?::toString).get("OK")
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
String get(String s);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
|
||||
// FILE: arrayConstructor.kt
|
||||
fun box(): String {
|
||||
val sam = Sam(::IntArray)
|
||||
val arr = sam.get(2)
|
||||
if (arr.size != 2 || arr[0] != 0 || arr[1] != 0)
|
||||
return "Failed"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
int[] get(int x);
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
|
||||
// FILE: enumValues.kt
|
||||
enum class ABC(val x: String = "") {
|
||||
A("OK"), B, C
|
||||
}
|
||||
|
||||
fun box() =
|
||||
Sam(::enumValueOf).get("A").x
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
ABC get(String x);
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
|
||||
// FILE: enumValues.kt
|
||||
enum class ABC(val x: String = "") {
|
||||
A("OK"), B, C
|
||||
}
|
||||
|
||||
fun box() =
|
||||
Sam(::enumValues).get()[0].x
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
ABC[] get();
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
|
||||
// FILE: stringNPlus.kt
|
||||
fun test(x: String?, y: Any?) =
|
||||
Sam(String?::plus).get(x, y)
|
||||
|
||||
fun box() =
|
||||
test("O", "K")
|
||||
|
||||
// FILE: Sam.java
|
||||
public interface Sam {
|
||||
String get(String x, Object y);
|
||||
}
|
||||
+46
-6
@@ -21302,12 +21302,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/innerConstructorRef.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intReturnTypeAsNumber.kt")
|
||||
public void testIntReturnTypeAsNumber() throws Exception {
|
||||
@@ -21398,6 +21392,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/voidReturnTypeAsObject.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SpecialFunctions {
|
||||
@Test
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anyNToString.kt")
|
||||
public void testAnyNToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/anyNToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayConstructor.kt")
|
||||
public void testArrayConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/arrayConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValueOf.kt")
|
||||
public void testEnumValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValueOf.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValues.kt")
|
||||
public void testEnumValues() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValues.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringNPlus.kt")
|
||||
public void testStringNPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/stringNPlus.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+46
-6
@@ -21326,12 +21326,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/innerConstructorRef.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intReturnTypeAsNumber.kt")
|
||||
public void testIntReturnTypeAsNumber() throws Exception {
|
||||
@@ -21422,6 +21416,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/voidReturnTypeAsObject.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SpecialFunctions {
|
||||
@Test
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("anyNToString.kt")
|
||||
public void testAnyNToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/anyNToString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayConstructor.kt")
|
||||
public void testArrayConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/arrayConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValueOf.kt")
|
||||
public void testEnumValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValueOf.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumValues.kt")
|
||||
public void testEnumValues() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValues.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/intPlus.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringNPlus.kt")
|
||||
public void testStringNPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/stringNPlus.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+43
-5
@@ -17806,11 +17806,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/innerConstructorRef.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intPlus.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intReturnTypeAsNumber.kt")
|
||||
public void testIntReturnTypeAsNumber() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intReturnTypeAsNumber.kt");
|
||||
@@ -17886,6 +17881,49 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/voidReturnTypeAsObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SpecialFunctions extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anyNToString.kt")
|
||||
public void testAnyNToString() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/anyNToString.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("arrayConstructor.kt")
|
||||
public void testArrayConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/arrayConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumValueOf.kt")
|
||||
public void testEnumValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValueOf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("enumValues.kt")
|
||||
public void testEnumValues() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/enumValues.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intPlus.kt")
|
||||
public void testIntPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/intPlus.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stringNPlus.kt")
|
||||
public void testStringNPlus() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions/stringNPlus.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+13
@@ -15365,6 +15365,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SpecialFunctions extends AbstractIrJsCodegenBoxES6Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+13
@@ -14771,6 +14771,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SpecialFunctions extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+13
@@ -14836,6 +14836,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SpecialFunctions extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+13
@@ -8671,6 +8671,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SpecialFunctions extends AbstractIrCodegenBoxWasmTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSpecialFunctions() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/specialFunctions"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/withAccessor")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user