[IR] Support try for MFVC

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2022-10-03 10:02:09 +02:00
committed by teamcity
parent f8aa3612f8
commit e1f886936c
8 changed files with 156 additions and 2 deletions
@@ -0,0 +1,38 @@
// CHECK_BYTECODE_LISTING
// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@JvmInline
value class DPoint(val x: Double, val y: Double)
fun tryExpr() = try {
DPoint(0.0, 1.0)
} catch(_: Throwable) {
DPoint(2.0, 3.0)
} finally {
DPoint(4.0, 5.0)
}
fun tryBody() {
try {
DPoint(0.0, 1.0)
} catch(_: Throwable) {
DPoint(2.0, 3.0)
} finally {
DPoint(4.0, 5.0)
}
val x: DPoint = try {
DPoint(0.0, 1.0)
} catch(_: Throwable) {
DPoint(2.0, 3.0)
} finally {
DPoint(4.0, 5.0)
}
}
// 1 tryExpr.*(\n .*)(\n .*)*(\n .*box-impl.*)(\n .*)*(\n .*box-impl.*)
// 0 tryExpr.*(\n .*)(\n .*)*(\n .*box-impl.*)(\n .*)*(\n .*box-impl.*)(\n .*)*(\n .*box-impl.*)
// 0 tryBody.*(\n .*)*(\n .*box-impl.*)