From cfc21ffa56a0b09e76c4401660f9c88b28e16e02 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 3 Jan 2019 13:22:03 +0100 Subject: [PATCH] Test for obsolete KT-16496 #KT-16496 Obsolete --- .../boxInline/defaultValues/kt16496.kt | 26 +++++++++++++++++++ .../BlackBoxInlineCodegenTestGenerated.java | 5 ++++ ...otlinAgainstInlineKotlinTestGenerated.java | 5 ++++ .../IrBlackBoxInlineCodegenTestGenerated.java | 5 ++++ .../InlineDefaultValuesTestsGenerated.java | 5 ++++ .../IrInlineDefaultValuesTestsGenerated.java | 5 ++++ 6 files changed, 51 insertions(+) create mode 100644 compiler/testData/codegen/boxInline/defaultValues/kt16496.kt diff --git a/compiler/testData/codegen/boxInline/defaultValues/kt16496.kt b/compiler/testData/codegen/boxInline/defaultValues/kt16496.kt new file mode 100644 index 00000000000..604ba528874 --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/kt16496.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JVM_IR +// FILE: 1.kt + +package test + +inline fun f( + wait: Int = 0, + action: (Int) -> Unit +): String { + var millis: Long = 1 + try { + } catch (e: Throwable) { + millis = millis + } + return "OK" +} + +// FILE: 2.kt +import test.* + +fun box(): String { + var x = 0 + return f { + x++ + } +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index e32768d52bd..769b687342e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -1127,6 +1127,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/defaultValues/kt14564_2.kt"); } + @TestMetadata("kt16496.kt") + public void testKt16496() throws Exception { + runTest("compiler/testData/codegen/boxInline/defaultValues/kt16496.kt"); + } + @TestMetadata("kt18689.kt") public void testKt18689() throws Exception { runTest("compiler/testData/codegen/boxInline/defaultValues/kt18689.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 37fbfa719d0..1f842f4bb04 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1127,6 +1127,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/defaultValues/kt14564_2.kt"); } + @TestMetadata("kt16496.kt") + public void testKt16496() throws Exception { + runTest("compiler/testData/codegen/boxInline/defaultValues/kt16496.kt"); + } + @TestMetadata("kt18689.kt") public void testKt18689() throws Exception { runTest("compiler/testData/codegen/boxInline/defaultValues/kt18689.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 0d7bb615f4f..ef242c35cb7 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -1127,6 +1127,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/defaultValues/kt14564_2.kt"); } + @TestMetadata("kt16496.kt") + public void testKt16496() throws Exception { + runTest("compiler/testData/codegen/boxInline/defaultValues/kt16496.kt"); + } + @TestMetadata("kt18689.kt") public void testKt18689() throws Exception { runTest("compiler/testData/codegen/boxInline/defaultValues/kt18689.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java index 1ce0d9f779d..6b7206ae116 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java @@ -89,6 +89,11 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu runTest("compiler/testData/codegen/boxInline/defaultValues/kt14564_2.kt"); } + @TestMetadata("kt16496.kt") + public void testKt16496() throws Exception { + runTest("compiler/testData/codegen/boxInline/defaultValues/kt16496.kt"); + } + @TestMetadata("kt18689.kt") public void testKt18689() throws Exception { runTest("compiler/testData/codegen/boxInline/defaultValues/kt18689.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrInlineDefaultValuesTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrInlineDefaultValuesTestsGenerated.java index 4207ca0619e..aa1f63c7365 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrInlineDefaultValuesTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrInlineDefaultValuesTestsGenerated.java @@ -89,6 +89,11 @@ public class IrInlineDefaultValuesTestsGenerated extends AbstractIrInlineDefault runTest("compiler/testData/codegen/boxInline/defaultValues/kt14564_2.kt"); } + @TestMetadata("kt16496.kt") + public void testKt16496() throws Exception { + runTest("compiler/testData/codegen/boxInline/defaultValues/kt16496.kt"); + } + @TestMetadata("kt18689.kt") public void testKt18689() throws Exception { runTest("compiler/testData/codegen/boxInline/defaultValues/kt18689.kt");