Add a test for KT-54318

This commit is contained in:
Pavel Mikhailovskii
2022-10-10 13:47:34 +02:00
parent 5fdfd4a421
commit 0947834f0d
3 changed files with 31 additions and 0 deletions
@@ -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 {
+19
View File
@@ -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"
}
@@ -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 {