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 7c88773de47..e009cbff9ce 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 @@ -8100,6 +8100,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @Test + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @Test @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { diff --git a/compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt b/compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt new file mode 100644 index 00000000000..0b5b4a02fc0 --- /dev/null +++ b/compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt @@ -0,0 +1,47 @@ +// IGNORE_BACKEND: WASM + +fun foo() {} + +inline fun test1(v: Int) { + if (v == 0) { + try { + foo() + } catch (e: Exception) { + } + } +} + +inline fun test2(v: Int) { + try { + if (v == 0) { + foo() + } + } catch (e: Exception) { + } +} + +inline fun test3(v: Boolean) { + if (v) { + try { + foo() + } catch (e: Exception) { + } + } +} + +inline fun test4(v: Boolean) { + try { + if (v) { + foo() + } + } catch (e: Exception) { + } +} + +fun box(): String { + test1(1) + test2(1) + test3(false) + test4(false) + return "OK" +} 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 658fd2d3b71..83486084e63 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 @@ -8100,6 +8100,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @Test + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @Test @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { 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 9d28550f36d..ebc58b4f655 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 @@ -8100,6 +8100,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @Test + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @Test @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 39e0d25176f..2cc8d5b6bfc 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6207,6 +6207,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tryCatchExpression.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 598e08071c3..c9b1154d5a4 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 @@ -5456,6 +5456,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tryCatchExpression.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 298f39a74cb..2b2b8e619a4 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 @@ -4862,6 +4862,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tryCatchExpression.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 c23f9c8f386..b5034b462ea 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 @@ -4862,6 +4862,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tryCatchExpression.kt"); 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 8a88682b4f3..77920479aff 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 @@ -3445,6 +3445,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } + @TestMetadata("tcbInEliminatedCondition.kt") + public void testTcbInEliminatedCondition() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); + } + @TestMetadata("tryCatchExpression.kt") public void testTryCatchExpression() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tryCatchExpression.kt");