Files
kotlin-fork/kotlin-native/backend.native/tests/filecheck/replace_invoke_with_call.kt
T
Sergey Bogolepov b9bb56d9c6 [K/N] FileCheck-based tests
Introduce a simple infrastructure for testing produced bitcode with
FileCheck LLVM utility.

^KT-48925
2021-10-01 14:18:01 +00:00

31 lines
684 B
Kotlin

/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
fun flameThrower() {
throw Throwable("🔥")
}
// CHECK-LABEL: "kfun:#f1(){}"
fun f1() {
// CHECK: call void @"kfun:#flameThrower(){}"()
flameThrower()
// CHECK-LABEL: epilogue
}
// CHECK-LABEL: "kfun:#f2(){}"
fun f2() {
try {
// CHECK: invoke void @"kfun:#flameThrower(){}"()
flameThrower()
} catch (t: Throwable) {}
// CHECK-LABEL: epilogue
}
// CHECK-LABEL: "kfun:#main(){}"
fun main() {
f1()
f2()
// CHECK-LABEL: epilogue
}