diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 8a13adfe2e9..05f58ea2e99 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -41679,6 +41679,88 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/testsWithJava9") + @TestDataPath("$PROJECT_ROOT") + public class TestsWithJava9 { + @Test + public void testAllFilesPresentInTestsWithJava9() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava9"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("concatDynamic.kt") + public void testConcatDynamic() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt"); + } + + @Test + @TestMetadata("concatDynamic200.kt") + public void testConcatDynamic200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt"); + } + + @Test + @TestMetadata("concatDynamic200Long.kt") + public void testConcatDynamic200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt"); + } + + @Test + @TestMetadata("concatDynamic201.kt") + public void testConcatDynamic201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200.kt") + public void testConcatDynamicIndy200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200Long.kt") + public void testConcatDynamicIndy200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy201.kt") + public void testConcatDynamicIndy201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt"); + } + + @Test + @TestMetadata("concatDynamicInlineClasses.kt") + public void testConcatDynamicInlineClasses() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt"); + } + + @Test + @TestMetadata("concatDynamicSpecialSymbols.kt") + public void testConcatDynamicSpecialSymbols() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicSpecialSymbols.kt"); + } + + @Test + @TestMetadata("concatDynamicWithInline.kt") + public void testConcatDynamicWithInline() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt"); + } + + @Test + @TestMetadata("kt36984.kt") + public void testKt36984() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/kt36984.kt"); + } + + @Test + @TestMetadata("varHandle.kt") + public void testVarHandle() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/varHandle.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/throws") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/codegen/java9/box/concatDynamic.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt similarity index 80% rename from compiler/testData/codegen/java9/box/concatDynamic.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt index 37753eb20aa..9caace5f1cf 100644 --- a/compiler/testData/codegen/java9/box/concatDynamic.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 fun box(): String { val p = 3147483648u @@ -7,4 +7,4 @@ fun box(): String { val s = a + "1" + "2" + 3 + 4L + b + 5.0 + 6F + '7' + true + false + 3147483647u + p return if (s != "_1234_5.06.07truefalse31474836473147483648") "fail $s" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamic200.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt similarity index 94% rename from compiler/testData/codegen/java9/box/concatDynamic200.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt index 67340759357..a578702d107 100644 --- a/compiler/testData/codegen/java9/box/concatDynamic200.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 fun box(): String { val z = "0" @@ -15,4 +15,4 @@ fun box(): String { return if (result.length != 200) "fail: ${result.length}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamic200Long.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt similarity index 95% rename from compiler/testData/codegen/java9/box/concatDynamic200Long.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt index 8a0f4c2e55a..cf2030d8f21 100644 --- a/compiler/testData/codegen/java9/box/concatDynamic200Long.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 fun test(z: Long): String { val result = "" + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + @@ -24,4 +24,4 @@ fun box(): String { return if (result != "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") "fail 2: ${result}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamic201.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt similarity index 94% rename from compiler/testData/codegen/java9/box/concatDynamic201.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt index 06207a053d7..3af9e28b933 100644 --- a/compiler/testData/codegen/java9/box/concatDynamic201.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 fun box(): String { val z = "0" @@ -16,4 +16,4 @@ fun box(): String { return if (result.length != 201) "fail: ${result.length}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamicIndy200.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt similarity index 95% rename from compiler/testData/codegen/java9/box/concatDynamicIndy200.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt index 0d9284a5604..fbeedac6dd5 100644 --- a/compiler/testData/codegen/java9/box/concatDynamicIndy200.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy +// STRING_CONCAT: indy // JVM_TARGET: 9 fun box(): String { val z = "0" @@ -15,4 +15,4 @@ fun box(): String { return if (result.length != 200) "fail: ${result.length}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamicIndy200Long.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt similarity index 96% rename from compiler/testData/codegen/java9/box/concatDynamicIndy200Long.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt index c81aca25d94..59fa607e454 100644 --- a/compiler/testData/codegen/java9/box/concatDynamicIndy200Long.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy +// STRING_CONCAT: indy // JVM_TARGET: 9 fun test(z: Long): String { val result = "" + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + @@ -24,4 +24,4 @@ fun box(): String { return if (result != "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") "fail 2: ${result}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamicIndy201.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt similarity index 95% rename from compiler/testData/codegen/java9/box/concatDynamicIndy201.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt index 8d28a89f659..8362eea5604 100644 --- a/compiler/testData/codegen/java9/box/concatDynamicIndy201.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy +// STRING_CONCAT: indy // JVM_TARGET: 9 fun box(): String { val z = "0" @@ -16,4 +16,4 @@ fun box(): String { return if (result.length != 201) "fail: ${result.length}" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamicInlineClasses.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt similarity index 90% rename from compiler/testData/codegen/java9/box/concatDynamicInlineClasses.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt index a13b01c4666..7e402ca49d9 100644 --- a/compiler/testData/codegen/java9/box/concatDynamicInlineClasses.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 inline class Str(val s: String) inline class NStr(val s: String?) @@ -24,4 +24,4 @@ fun box(): String { if (test5 != "2nullnull") return "fail 5: $test5" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/concatDynamicSpecialSymbols.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicSpecialSymbols.kt similarity index 100% rename from compiler/testData/codegen/java9/box/concatDynamicSpecialSymbols.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicSpecialSymbols.kt diff --git a/compiler/testData/codegen/java9/box/concatDynamicWithInline.kt b/compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt similarity index 87% rename from compiler/testData/codegen/java9/box/concatDynamicWithInline.kt rename to compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt index 958aa279f7a..40671b2324f 100644 --- a/compiler/testData/codegen/java9/box/concatDynamicWithInline.kt +++ b/compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// STRING_CONCAT: indy-with-constants // JVM_TARGET: 9 inline fun test(crossinline s: (String) -> String): String { var result = "1" + s("2") + "3" + 4 + { @@ -18,4 +18,4 @@ fun box(): String { val result2 = test { it + "_" } return if (result2 != "12_3456_789_10") "fail 2: $result2" else "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/java9/box/kt36984.kt b/compiler/testData/codegen/box/testsWithJava9/kt36984.kt similarity index 100% rename from compiler/testData/codegen/java9/box/kt36984.kt rename to compiler/testData/codegen/box/testsWithJava9/kt36984.kt diff --git a/compiler/testData/codegen/java9/box/varHandle.kt b/compiler/testData/codegen/box/testsWithJava9/varHandle.kt similarity index 98% rename from compiler/testData/codegen/java9/box/varHandle.kt rename to compiler/testData/codegen/box/testsWithJava9/varHandle.kt index c19d54067d7..071e3706fbc 100644 --- a/compiler/testData/codegen/java9/box/varHandle.kt +++ b/compiler/testData/codegen/box/testsWithJava9/varHandle.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +PolymorphicSignature // TARGET_BACKEND: JVM -// FULL_JDK // SKIP_JDK6 // WITH_RUNTIME @@ -30,4 +29,4 @@ fun box(): String { } return if (handle.getVolatile(array, index) == newValue) "OK" else "Fail" -} \ No newline at end of file +} 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 f25770f9bf8..0c27b5b1140 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 @@ -41523,6 +41523,88 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/testsWithJava9") + @TestDataPath("$PROJECT_ROOT") + public class TestsWithJava9 { + @Test + public void testAllFilesPresentInTestsWithJava9() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava9"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("concatDynamic.kt") + public void testConcatDynamic() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt"); + } + + @Test + @TestMetadata("concatDynamic200.kt") + public void testConcatDynamic200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt"); + } + + @Test + @TestMetadata("concatDynamic200Long.kt") + public void testConcatDynamic200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt"); + } + + @Test + @TestMetadata("concatDynamic201.kt") + public void testConcatDynamic201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200.kt") + public void testConcatDynamicIndy200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200Long.kt") + public void testConcatDynamicIndy200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy201.kt") + public void testConcatDynamicIndy201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt"); + } + + @Test + @TestMetadata("concatDynamicInlineClasses.kt") + public void testConcatDynamicInlineClasses() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt"); + } + + @Test + @TestMetadata("concatDynamicSpecialSymbols.kt") + public void testConcatDynamicSpecialSymbols() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicSpecialSymbols.kt"); + } + + @Test + @TestMetadata("concatDynamicWithInline.kt") + public void testConcatDynamicWithInline() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt"); + } + + @Test + @TestMetadata("kt36984.kt") + public void testKt36984() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/kt36984.kt"); + } + + @Test + @TestMetadata("varHandle.kt") + public void testVarHandle() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/varHandle.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/throws") @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 13e147b2447..47bbb482274 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 @@ -41679,6 +41679,88 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/testsWithJava9") + @TestDataPath("$PROJECT_ROOT") + public class TestsWithJava9 { + @Test + public void testAllFilesPresentInTestsWithJava9() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava9"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("concatDynamic.kt") + public void testConcatDynamic() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic.kt"); + } + + @Test + @TestMetadata("concatDynamic200.kt") + public void testConcatDynamic200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200.kt"); + } + + @Test + @TestMetadata("concatDynamic200Long.kt") + public void testConcatDynamic200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic200Long.kt"); + } + + @Test + @TestMetadata("concatDynamic201.kt") + public void testConcatDynamic201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamic201.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200.kt") + public void testConcatDynamicIndy200() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy200Long.kt") + public void testConcatDynamicIndy200Long() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy200Long.kt"); + } + + @Test + @TestMetadata("concatDynamicIndy201.kt") + public void testConcatDynamicIndy201() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicIndy201.kt"); + } + + @Test + @TestMetadata("concatDynamicInlineClasses.kt") + public void testConcatDynamicInlineClasses() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicInlineClasses.kt"); + } + + @Test + @TestMetadata("concatDynamicSpecialSymbols.kt") + public void testConcatDynamicSpecialSymbols() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicSpecialSymbols.kt"); + } + + @Test + @TestMetadata("concatDynamicWithInline.kt") + public void testConcatDynamicWithInline() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/concatDynamicWithInline.kt"); + } + + @Test + @TestMetadata("kt36984.kt") + public void testKt36984() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/kt36984.kt"); + } + + @Test + @TestMetadata("varHandle.kt") + public void testVarHandle() throws Exception { + runTest("compiler/testData/codegen/box/testsWithJava9/varHandle.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/throws") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt index 726767b8dbd..cb2a9028aa6 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.test.runners.codegen import org.jetbrains.kotlin.test.Constructor import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.TestJdkKind import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.backend.handlers.BytecodeListingHandler import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler @@ -14,10 +15,11 @@ import org.jetbrains.kotlin.test.bind import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.DIAGNOSTICS import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.JDK_KIND +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_STDLIB import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler import org.jetbrains.kotlin.test.frontend.fir.handlers.FirDiagnosticsHandler import org.jetbrains.kotlin.test.model.* -import org.jetbrains.kotlin.test.runners.AbstractDiagnosticTest.Companion.DISABLED_BY_DEFAULT_UNUSED_DIAGNOSTICS import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest abstract class AbstractJvmBlackBoxCodegenTestBase>( @@ -50,6 +52,13 @@ abstract class AbstractJvmBlackBoxCodegenTestBase) { "codegen/box", targetBackend = TargetBackend.JVM, skipIgnored = true, - excludeDirs = listOf("ranges/stepped", "compileKotlinAgainstKotlin") + excludeDirs = listOf( + "ranges/stepped", + "compileKotlinAgainstKotlin", + "testsWithJava9", + "testsWithJava15", + "testsWithJava17" + ) ) } @@ -112,14 +118,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("codegen/java15/box", targetBackend = TargetBackend.JVM_IR) } - testClass { - model("codegen/java9/box") - } - - testClass { - model("codegen/java9/box", targetBackend = TargetBackend.JVM_IR) - } - testClass { model("codegen/script", extension = "kts") } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9BlackBoxCodegenTestGenerated.java deleted file mode 100644 index a6d0596031f..00000000000 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9BlackBoxCodegenTestGenerated.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.codegen; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("compiler/testData/codegen/java9/box") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class Jdk9BlackBoxCodegenTestGenerated extends AbstractJdk9BlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java9/box"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("concatDynamic.kt") - public void testConcatDynamic() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic.kt"); - } - - @TestMetadata("concatDynamic200.kt") - public void testConcatDynamic200() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic200.kt"); - } - - @TestMetadata("concatDynamic200Long.kt") - public void testConcatDynamic200Long() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic200Long.kt"); - } - - @TestMetadata("concatDynamic201.kt") - public void testConcatDynamic201() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic201.kt"); - } - - @TestMetadata("concatDynamicIndy200.kt") - public void testConcatDynamicIndy200() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy200.kt"); - } - - @TestMetadata("concatDynamicIndy200Long.kt") - public void testConcatDynamicIndy200Long() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy200Long.kt"); - } - - @TestMetadata("concatDynamicIndy201.kt") - public void testConcatDynamicIndy201() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy201.kt"); - } - - @TestMetadata("concatDynamicInlineClasses.kt") - public void testConcatDynamicInlineClasses() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicInlineClasses.kt"); - } - - @TestMetadata("concatDynamicSpecialSymbols.kt") - public void testConcatDynamicSpecialSymbols() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicSpecialSymbols.kt"); - } - - @TestMetadata("concatDynamicWithInline.kt") - public void testConcatDynamicWithInline() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicWithInline.kt"); - } - - @TestMetadata("kt36984.kt") - public void testKt36984() throws Exception { - runTest("compiler/testData/codegen/java9/box/kt36984.kt"); - } - - @TestMetadata("varHandle.kt") - public void testVarHandle() throws Exception { - runTest("compiler/testData/codegen/java9/box/varHandle.kt"); - } -} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9IrBlackBoxCodegenTestGenerated.java deleted file mode 100644 index 9e273b2acbb..00000000000 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/Jdk9IrBlackBoxCodegenTestGenerated.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.codegen; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TargetBackend; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("compiler/testData/codegen/java9/box") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class Jdk9IrBlackBoxCodegenTestGenerated extends AbstractJdk9IrBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - - public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java9/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @TestMetadata("concatDynamic.kt") - public void testConcatDynamic() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic.kt"); - } - - @TestMetadata("concatDynamic200.kt") - public void testConcatDynamic200() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic200.kt"); - } - - @TestMetadata("concatDynamic200Long.kt") - public void testConcatDynamic200Long() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic200Long.kt"); - } - - @TestMetadata("concatDynamic201.kt") - public void testConcatDynamic201() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamic201.kt"); - } - - @TestMetadata("concatDynamicIndy200.kt") - public void testConcatDynamicIndy200() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy200.kt"); - } - - @TestMetadata("concatDynamicIndy200Long.kt") - public void testConcatDynamicIndy200Long() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy200Long.kt"); - } - - @TestMetadata("concatDynamicIndy201.kt") - public void testConcatDynamicIndy201() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicIndy201.kt"); - } - - @TestMetadata("concatDynamicInlineClasses.kt") - public void testConcatDynamicInlineClasses() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicInlineClasses.kt"); - } - - @TestMetadata("concatDynamicSpecialSymbols.kt") - public void testConcatDynamicSpecialSymbols() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicSpecialSymbols.kt"); - } - - @TestMetadata("concatDynamicWithInline.kt") - public void testConcatDynamicWithInline() throws Exception { - runTest("compiler/testData/codegen/java9/box/concatDynamicWithInline.kt"); - } - - @TestMetadata("kt36984.kt") - public void testKt36984() throws Exception { - runTest("compiler/testData/codegen/java9/box/kt36984.kt"); - } - - @TestMetadata("varHandle.kt") - public void testVarHandle() throws Exception { - runTest("compiler/testData/codegen/java9/box/varHandle.kt"); - } -} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 7ca4f4c1baf..5f51b879436 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -27,7 +27,7 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true, "ranges/stepped", "compileKotlinAgainstKotlin"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true, "ranges/stepped", "compileKotlinAgainstKotlin", "testsWithJava9", "testsWithJava15", "testsWithJava17"); } @TestMetadata("compiler/testData/codegen/box/annotations") diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/constantValues.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/constantValues.kt index 10849a1e95e..af287bfd593 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/constantValues.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/constantValues.kt @@ -128,6 +128,10 @@ class EnumValue(val enumClassId: ClassId, val enumEntryName: Name) : ConstantVal } abstract class ErrorValue : ConstantValue(Unit) { + init { + Unit + } + @Deprecated("Should not be called, for this is not a real value, but a indication of an error") override val value: Unit get() = throw UnsupportedOperationException() diff --git a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt index 84438d9a968..6ec1f8d2988 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt @@ -69,16 +69,22 @@ fun main(args: Array) { } testGroup("js/js.tests/tests-gen", "compiler/testData", testRunnerMethodName = "runTest0") { + val jvmOnlyBoxTests = listOf( + "testsWithJava9", + "testsWithJava15", + "testsWithJava17", + ) + testClass { - model("codegen/box", targetBackend = TargetBackend.JS, excludeDirs = listOf("compileKotlinAgainstKotlin")) + model("codegen/box", targetBackend = TargetBackend.JS, excludeDirs = jvmOnlyBoxTests + "compileKotlinAgainstKotlin") } testClass { - model("codegen/box", targetBackend = TargetBackend.JS_IR, excludeDirs = listOf("compileKotlinAgainstKotlin")) + model("codegen/box", targetBackend = TargetBackend.JS_IR, excludeDirs = jvmOnlyBoxTests + "compileKotlinAgainstKotlin") } testClass { - model("codegen/boxError", targetBackend = TargetBackend.JS_IR, excludeDirs = listOf("compileKotlinAgainstKotlin")) + model("codegen/boxError", targetBackend = TargetBackend.JS_IR, excludeDirs = jvmOnlyBoxTests + "compileKotlinAgainstKotlin") } testClass { @@ -104,12 +110,12 @@ fun main(args: Array) { "delegatedProperty", "compileKotlinAgainstKotlin" - ) + ) + jvmOnlyBoxTests ) } testClass { - model("codegen/box", targetBackend = TargetBackend.JS_IR_ES6) + model("codegen/box", targetBackend = TargetBackend.JS_IR_ES6, excludeDirs = jvmOnlyBoxTests) } testClass { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 00a46b25c84..bc27f17d41c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -27,7 +27,7 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes } public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true, "testsWithJava9", "testsWithJava15", "testsWithJava17"); } @TestMetadata("compiler/testData/codegen/box/annotations") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxErrorTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxErrorTestGenerated.java index cb4abb0c6a9..bef20d298d3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxErrorTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxErrorTestGenerated.java @@ -27,7 +27,7 @@ public class IrJsCodegenBoxErrorTestGenerated extends AbstractIrJsCodegenBoxErro } public void testAllFilesPresentInBoxError() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxError"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "compileKotlinAgainstKotlin"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxError"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "testsWithJava9", "testsWithJava15", "testsWithJava17", "compileKotlinAgainstKotlin"); } @TestMetadata("compiler/testData/codegen/boxError/semantic") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index cd9e9551027..68fdf0308cf 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -27,7 +27,7 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "compileKotlinAgainstKotlin"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true, "testsWithJava9", "testsWithJava15", "testsWithJava17", "compileKotlinAgainstKotlin"); } @TestMetadata("compiler/testData/codegen/box/annotations") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 01e239e6d13..c51d6cb9eb1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -27,7 +27,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true, "compileKotlinAgainstKotlin"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true, "testsWithJava9", "testsWithJava15", "testsWithJava17", "compileKotlinAgainstKotlin"); } @TestMetadata("compiler/testData/codegen/box/annotations") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index ea971240182..58049d59c57 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -27,7 +27,7 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest } public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true, "toArray", "classLiteral", "reflection", "contracts", "platformTypes", "ranges/stepped/unsigned", "coroutines", "parametersMetadata", "finally", "deadCodeElimination", "controlStructures/tryCatchInExpressions", "delegatedProperty", "compileKotlinAgainstKotlin"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true, "toArray", "classLiteral", "reflection", "contracts", "platformTypes", "ranges/stepped/unsigned", "coroutines", "parametersMetadata", "finally", "deadCodeElimination", "controlStructures/tryCatchInExpressions", "delegatedProperty", "compileKotlinAgainstKotlin", "testsWithJava9", "testsWithJava15", "testsWithJava17"); } @TestMetadata("compiler/testData/codegen/box/annotations")