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 1e133bb6cca..b2b922e9533 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 @@ -4793,6 +4793,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/casts/kt53677.kt"); } + @Test + @TestMetadata("kt54318.kt") + public void testKt54318() throws Exception { + runTest("compiler/testData/codegen/box/casts/kt54318.kt"); + } + @Test @TestMetadata("lambdaToUnitCast.kt") public void testLambdaToUnitCast() throws Exception { diff --git a/compiler/testData/codegen/box/casts/kt54318.kt b/compiler/testData/codegen/box/casts/kt54318.kt new file mode 100644 index 00000000000..90cb39a3758 --- /dev/null +++ b/compiler/testData/codegen/box/casts/kt54318.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM_IR + +fun f(b: Int): Long? { + return try { + null + } catch (e: Throwable) { + if (b == 0) + throw e + else { + null + } + } +} + +fun box(): String { + f(0) + f(1) + return "OK" +} 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 a5f0dd4ed2c..6260f06f7e7 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 @@ -4793,6 +4793,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/casts/kt53677.kt"); } + @Test + @TestMetadata("kt54318.kt") + public void testKt54318() throws Exception { + runTest("compiler/testData/codegen/box/casts/kt54318.kt"); + } + @Test @TestMetadata("lambdaToUnitCast.kt") public void testLambdaToUnitCast() throws Exception {