From d8c9536eddc3a9e5808c6607641331dc03ebbb70 Mon Sep 17 00:00:00 2001 From: Elena Lepilkina Date: Fri, 29 Oct 2021 17:40:09 +0300 Subject: [PATCH] [K/N] Fixes in tests and check function in optimized mode --- .../org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt | 3 ++- kotlin-native/backend.native/tests/build.gradle | 1 - .../backend.native/tests/filecheck/suspend_returnNothing.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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()