diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt index 9eab6ab0c3a..e513daac4f0 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt @@ -1058,7 +1058,8 @@ internal abstract class FunctionGenerationContext( } fun generateFrameCheck() { - call(context.llvm.checkCurrentFrameFunction, listOf(slotsPhi!!)) + if (!context.shouldOptimize()) + call(context.llvm.checkCurrentFrameFunction, listOf(slotsPhi!!)) } inline fun ifThenElse( diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index b449ad04a79..9a670e74e11 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -5135,7 +5135,6 @@ dynamicTest("interop_exceptions_throwThroughBridge") { interopTest("interop_exceptions_cCallback") { disabled = (project.testTarget == 'wasm32') // Uses exceptions source = "interop/exceptions/cCallback.kt" - expectedExitStatusChecker = { it == 0 } outputChecker = { s -> s.contains("CATCH IN C++") } interop = "exceptions_cCallback" } diff --git a/kotlin-native/backend.native/tests/filecheck/suspend_returnNothing.kt b/kotlin-native/backend.native/tests/filecheck/suspend_returnNothing.kt index 7ec9ff31bed..359b68b49f7 100644 --- a/kotlin-native/backend.native/tests/filecheck/suspend_returnNothing.kt +++ b/kotlin-native/backend.native/tests/filecheck/suspend_returnNothing.kt @@ -18,7 +18,7 @@ suspend fun suspendForever(): Int = suspendCoroutineUninterceptedOrReturn { } // CHECK-LABEL: define %struct.ObjHeader* @"kfun:$fooCOROUTINE -// CHECK-NOT: ; Function Attrs: noreturn +// CHECK-NOT: ; Function Attrs: {{.*}}noreturn // CHECK-LABEL: define %struct.ObjHeader* @"kfun:#foo(){}kotlin.Nothing" suspend fun foo(): Nothing { suspendForever()