From 8c7c44f9f5117c271328953b3cd954170d026e5a Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Mon, 26 Jun 2023 18:28:49 +0200 Subject: [PATCH] [FIR] Fix evaluation of Java properties for `Char` and `String` types #KT-57802 --- .../kotlin/fir/backend/Fir2IrConverter.kt | 11 +++- ...LightTreeBlackBoxCodegenTestGenerated.java | 58 +++++++++++++------ ...hIrFakeOverrideGeneratorTestGenerated.java | 58 +++++++++++++------ .../FirPsiBlackBoxCodegenTestGenerated.java | 58 +++++++++++++------ .../kotlin/fir/java/FirJavaElementFinder.kt | 2 + .../accessComplexConst.kt | 21 +++++++ .../accessTopLevelConst.kt} | 1 + .../differentTypes.kt | 39 +++++++++++++ .../kt57802_1.kt | 1 + .../kt57802_2.kt | 1 + .../codegen/BlackBoxCodegenTestGenerated.java | 52 +++++++++++------ .../IrBlackBoxCodegenTestGenerated.java | 58 +++++++++++++------ ...kBoxCodegenWithIrInlinerTestGenerated.java | 58 +++++++++++++------ .../LightAnalysisModeTestGenerated.java | 53 ++++++++++++----- .../fir/FirJsCodegenBoxTestGenerated.java | 10 ++++ .../fir/FirJsES6CodegenBoxTestGenerated.java | 10 ++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 10 ++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 10 ++++ .../FirNativeCodegenBoxTestGenerated.java | 13 +++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 15 +++++ .../NativeCodegenBoxTestGenerated.java | 12 ++++ .../NativeCodegenBoxTestNoPLGenerated.java | 13 +++++ .../test/FirWasmCodegenBoxTestGenerated.java | 10 ++++ .../test/K1WasmCodegenBoxTestGenerated.java | 10 ++++ 24 files changed, 459 insertions(+), 125 deletions(-) create mode 100644 compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt rename compiler/testData/codegen/box/involvesIrInterpreter/{accessTopLevelConstFromJava.kt => constEvaluationFromJavaWorld/accessTopLevelConst.kt} (92%) create mode 100644 compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt rename compiler/testData/codegen/box/involvesIrInterpreter/{ => constEvaluationFromJavaWorld}/kt57802_1.kt (95%) rename compiler/testData/codegen/box/involvesIrInterpreter/{ => constEvaluationFromJavaWorld}/kt57802_2.kt (95%) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt index 9e9c1d47479..683182256d5 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -568,7 +568,14 @@ class Fir2IrConverter( val irProperty = components.declarationStorage.getCachedIrProperty(this, fakeOverrideOwnerLookupTag = null) ?: return null fun IrProperty.tryToGetConst(): IrConst<*>? = (backingField?.initializer?.expression as? IrConst<*>) - irProperty.tryToGetConst()?.let { return it.value.toString() } + fun IrConst<*>.asString(): String { + return when (val constVal = value) { + is Char -> constVal.code.toString() + is String -> "\"$constVal\"" + else -> constVal.toString() + } + } + irProperty.tryToGetConst()?.let { return it.asString() } val irFile = irProperty.fileOrNull ?: return null // Note: can't evaluate all expressions in given file, because we can accidentally get recursive processing and @@ -579,7 +586,7 @@ class Fir2IrConverter( inlineConstTracker = components.configuration.inlineConstTracker, ) - return (evaluated as? IrProperty)?.tryToGetConst()?.value?.toString() + return (evaluated as? IrProperty)?.tryToGetConst()?.asString() } // TODO: drop this function in favor of using [IrModuleDescriptor::shouldSeeInternalsOf] in FakeOverrideBuilder KT-61384 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 128330135b2..3f2777dde0d 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 @@ -29066,12 +29066,6 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); @@ -29173,18 +29167,6 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { @@ -29263,6 +29245,46 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessComplexConst.kt") + public void testAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index d6ae7d8c90c..7aa69bdb099 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -29066,12 +29066,6 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); @@ -29173,18 +29167,6 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { @@ -29263,6 +29245,46 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessComplexConst.kt") + public void testAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") 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 b9e3809c69c..eb6fbb00219 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 @@ -29066,12 +29066,6 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); @@ -29173,18 +29167,6 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { @@ -29263,6 +29245,46 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessComplexConst.kt") + public void testAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/FirJavaElementFinder.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/FirJavaElementFinder.kt index 6fc719322ff..e4b9cadabea 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/FirJavaElementFinder.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/FirJavaElementFinder.kt @@ -185,6 +185,8 @@ class FirJavaElementFinder( override fun getType(): TypeInfo { val coneClassLikeType = firProperty.returnTypeRef.coneTypeUnsafe() + if (coneClassLikeType.isString) return TypeInfo.fromString(CommonClassNames.JAVA_LANG_STRING) + val classId = coneClassLikeType.lookupTag.classId val typeInfo = classId.relativeClassName.asString().toLowerCaseAsciiOnly() return TypeInfo.fromString(typeInfo) diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt new file mode 100644 index 00000000000..2ba2a598146 --- /dev/null +++ b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt @@ -0,0 +1,21 @@ +// !LANGUAGE: +IntrinsicConstEvaluation +// TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND_K1: JVM_IR +// WITH_STDLIB +// FILE: Bar.java +package one.two; + +public class Bar { + public static final String BAR = MainKt.FOO + " JavaString"; +} + +// FILE: Main.kt +package one.two + +const val FOO = "123".trimIndent() + +const val BAZ = Bar.BAR + " KotlinString" + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt similarity index 92% rename from compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt rename to compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt index bc2ee80531f..887dc9b2398 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // FILE: Bar.java package one.two; diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt new file mode 100644 index 00000000000..8aba91b8251 --- /dev/null +++ b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt @@ -0,0 +1,39 @@ +// TARGET_BACKEND: JVM +// FILE: Bar.java +public class Bar { + public static final char CHAR = MainKt.CHAR + 1; + public static final boolean BOOL = !MainKt.BOOL; + public static final byte BYTE = MainKt.BYTE + 1; + public static final short SHORT = MainKt.SHORT + 1; + public static final int INT = MainKt.INT + 1; + public static final long LONG = MainKt.LONG + 1L; + public static final float FLOAT = MainKt.FLOAT + 1.0f; + public static final double DOUBLE = MainKt.DOUBLE + 1.0; + public static final String STRING = MainKt.STRING + "3"; +} + +// FILE: Main.kt +const val CHAR: Char = '1' + 1 +const val BOOL: Boolean = true +const val BYTE: Byte = (1.toByte() + 1).toByte() +const val SHORT: Short = (1.toShort() + 1).toShort() +const val INT: Int = 1 + 1 +const val LONG: Long = 1L + 1L +const val FLOAT: Float = 1.5f + .5f +const val DOUBLE: Double = 1.5 + 0.5 +const val STRING: String = "1" + "2" + +// FILE: usages.kt +const val CHAR_JAVA: Char = Bar.CHAR + 1 +const val BOOL_JAVA: Boolean = Bar.BOOL +const val BYTE_JAVA: Byte = (Bar.BYTE + 1).toByte() +const val SHORT_JAVA: Short = (Bar.SHORT + 1).toShort() +const val INT_JAVA: Int = Bar.INT + 1 +const val LONG_JAVA: Long = Bar.LONG + 1L +const val FLOAT_JAVA: Float = Bar.FLOAT + 1.0f +const val DOUBLE_JAVA: Double = Bar.DOUBLE + 1.0 +const val STRING_JAVA: String = Bar.STRING + "4" + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt similarity index 95% rename from compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt rename to compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt index a4873ce2c04..1f4774ae3c2 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // FILE: Bar.java package one.two; diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt similarity index 95% rename from compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt rename to compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt index 32bdfa070e1..5190ac1c70e 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // FILE: Bar.java package one.two; 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 24a6fa5f1c6..af7614d9dab 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 @@ -27794,12 +27794,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); @@ -27829,24 +27823,46 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57028.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt58005.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") 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 025922282f3..fdcaec21dc2 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 @@ -29066,12 +29066,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); @@ -29173,18 +29167,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { @@ -29263,6 +29245,46 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessComplexConst.kt") + public void testAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") 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 1222d42dd42..8abbf2d13ae 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 @@ -29066,12 +29066,6 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter") @TestDataPath("$PROJECT_ROOT") public class InvolvesIrInterpreter { - @Test - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - @Test public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); @@ -29173,18 +29167,6 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @Test - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @Test - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @Test @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { @@ -29263,6 +29245,46 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + @TestMetadata("accessComplexConst.kt") + public void testAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + @Test + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @Test + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @Test + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 6926a594302..91048aa0a62 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -24546,11 +24546,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - @TestMetadata("accessTopLevelConstFromJava.kt") - public void testAccessTopLevelConstFromJava() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/accessTopLevelConstFromJava.kt"); - } - public void testAllFilesPresentInInvolvesIrInterpreter() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } @@ -24630,16 +24625,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57313.kt"); } - @TestMetadata("kt57802_1.kt") - public void testKt57802_1() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_1.kt"); - } - - @TestMetadata("kt57802_2.kt") - public void testKt57802_2() throws Exception { - runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt57802_2.kt"); - } - @TestMetadata("kt58005.kt") public void testKt58005() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt58005.kt"); @@ -24705,6 +24690,44 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ConstEvaluationFromJavaWorld extends AbstractLightAnalysisModeTest { + @TestMetadata("accessComplexConst.kt") + public void ignoreAccessComplexConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessComplexConst.kt"); + } + + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + @TestMetadata("accessTopLevelConst.kt") + public void testAccessTopLevelConst() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/accessTopLevelConst.kt"); + } + + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("differentTypes.kt") + public void testDifferentTypes() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/differentTypes.kt"); + } + + @TestMetadata("kt57802_1.kt") + public void testKt57802_1() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_1.kt"); + } + + @TestMetadata("kt57802_2.kt") + public void testKt57802_2() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld/kt57802_2.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 57890a54d1e..af2c13e7137 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -21631,6 +21631,16 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 729a07f1278..4704ce48b55 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -21631,6 +21631,16 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 6f37d903094..12118149014 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -21631,6 +21631,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 5fa19f4d884..9c3c5edb16d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -21631,6 +21631,16 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index a39c85a79a3..6cd742b8593 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -24459,6 +24459,19 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index a9543397290..f570ffe2b2c 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -24937,6 +24937,21 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index cc6d59f91a0..f6a3cfdb4b5 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -24221,6 +24221,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @DisabledTestsIfProperty(sourceLocations = { "compiler/testData/codegen/box/coroutines/featureIntersection/defaultExpect.kt", "compiler/testData/codegen/box/multiplatform/defaultArguments/*.kt", "compiler/testData/codegen/box/multiplatform/migratedOldTests/*.kt", "compiler/testData/codegen/boxInline/multiplatform/defaultArguments/receiversAndParametersInLambda.kt" }, property = ClassLevelProperty.TEST_MODE, propertyValue = "ONE_STAGE_MULTI_MODULE") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index 7c073d81961..5e22d07b13c 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -24460,6 +24460,19 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java index 5c59171be1f..f91f0f27388 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java @@ -21535,6 +21535,16 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt56215.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index e6a68696841..2232da06178 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -21535,6 +21535,16 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/involvesIrInterpreter/kt56215.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld") + @TestDataPath("$PROJECT_ROOT") + public class ConstEvaluationFromJavaWorld { + @Test + public void testAllFilesPresentInConstEvaluationFromJavaWorld() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/constEvaluationFromJavaWorld"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT")