From 632f5af442eca84741a690aefadbdce381f47417 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 23 Dec 2020 10:55:16 +0300 Subject: [PATCH] Minor: kt21014.kt - add JVM_TARGET 1.8 --- .../ir/FirBlackBoxCodegenTestGenerated.java | 5 +++++ .../codegen/box/callableReference/kt21014.kt | 21 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 +++++ .../LightAnalysisModeTestGenerated.java | 5 +++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 +++++ .../IrJsCodegenBoxES6TestGenerated.java | 5 +++++ .../IrJsCodegenBoxTestGenerated.java | 5 +++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 +++++ 8 files changed, 56 insertions(+) create mode 100644 compiler/testData/codegen/box/callableReference/kt21014.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 770cd432892..e37be48b397 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -2050,6 +2050,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/compiler/testData/codegen/box/callableReference/kt21014.kt b/compiler/testData/codegen/box/callableReference/kt21014.kt new file mode 100644 index 00000000000..f866e9a2c14 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt21014.kt @@ -0,0 +1,21 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS +// DONT_TARGET_EXACT_BACKEND: WASM +// WASM_MUTE_REASON: PROPERTY_REFERENCES + +// JVM_TARGET: 1.8 +// ^ This test causes SIGSEGV on JDK 1.6 with old back-end. +// Running it on JDK 1.6 (even with IGNORE_BACKEND: JVM) would still crash corresponding JVM process. + +fun box(): String { + val ints = intArrayOf(1, 2, 3) + + val test1 = IntArray::size.get(ints) + if (test1 != 3) throw Exception("IntArray::size.get(ints) != 3: $test1") + + val test2 = with(ints, IntArray::size) + if (test2 != 3) throw Exception("with(ints, IntArray::size) != 3: $test2") + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 1457e349882..e81eacdb7fd 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -2050,6 +2050,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 2653d0adc69..b0ca0db8520 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2017,6 +2017,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class CallableReference extends AbstractLightAnalysisModeTest { + @TestMetadata("kt21014.kt") + public void ignoreKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 1594ab8a8ae..18a6802742a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -2050,6 +2050,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); 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 e5334962502..3ae4321123f 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 @@ -1470,6 +1470,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); 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 703a221bed1..a31bcab7729 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 @@ -1470,6 +1470,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); 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 e1d6be2db23..de3410bf1fc 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 @@ -1470,6 +1470,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt21014.kt") + public void testKt21014() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt");