From 7c3ad97df587105dc10b08e42bbd8a9a16179dc6 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Sat, 1 Apr 2017 15:34:56 +0200 Subject: [PATCH] Test for obsolete KT-17134: java.lang.VerifyError: Bad type on operand stack #KT-17134 Obsolete --- compiler/testData/codegen/box/arrays/kt17134.kt | 16 ++++++++++++++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 6 ++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++++++ .../codegen/LightAnalysisModeTestGenerated.java | 6 ++++++ .../semantics/JsCodegenBoxTestGenerated.java | 12 ++++++++++++ .../semantics/JsTypedArraysBoxTestGenerated.java | 12 ++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 compiler/testData/codegen/box/arrays/kt17134.kt diff --git a/compiler/testData/codegen/box/arrays/kt17134.kt b/compiler/testData/codegen/box/arrays/kt17134.kt new file mode 100644 index 00000000000..887b949baaa --- /dev/null +++ b/compiler/testData/codegen/box/arrays/kt17134.kt @@ -0,0 +1,16 @@ +//WITH_RUNTIME +// IGNORE_BACKEND: JS + +object A { + @JvmStatic fun main(args: Array) { + val b = arrayOf(arrayOf("")) + object { + val c = b[0] + } + } +} + +fun box(): String { + A.main(emptyArray()) + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 25a974b525e..d3ca4e10688 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -491,6 +491,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("kt17134.kt") + public void testKt17134() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt17134.kt"); + doTest(fileName); + } + @TestMetadata("kt238.kt") public void testKt238() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt238.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 62ad59aabc1..d93f804ac11 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -491,6 +491,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("kt17134.kt") + public void testKt17134() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt17134.kt"); + doTest(fileName); + } + @TestMetadata("kt238.kt") public void testKt238() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt238.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 8c988d4a4e4..141c9522ebd 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -491,6 +491,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("kt17134.kt") + public void testKt17134() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt17134.kt"); + doTest(fileName); + } + @TestMetadata("kt238.kt") public void testKt238() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt238.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8b07abd18b9..0b54daf9135 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -635,6 +635,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { doTest(fileName); } + @TestMetadata("kt17134.kt") + public void testKt17134() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt17134.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + @TestMetadata("kt238.kt") public void testKt238() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt238.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsTypedArraysBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsTypedArraysBoxTestGenerated.java index 106c6706611..a94def3cac2 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsTypedArraysBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsTypedArraysBoxTestGenerated.java @@ -276,6 +276,18 @@ public class JsTypedArraysBoxTestGenerated extends AbstractJsTypedArraysBoxTest doTest(fileName); } + @TestMetadata("kt17134.kt") + public void testKt17134() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt17134.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + @TestMetadata("kt238.kt") public void testKt238() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt238.kt");