From aee9b7aae3c6c21a3291f90a93f9a54ab218758a Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Thu, 29 Jun 2023 15:18:34 +0300 Subject: [PATCH] [K/N] Add a trivial test-case for KT-59167 --- kotlin-native/backend.native/tests/build.gradle | 8 ++++++++ .../backend.native/tests/interop/kt59167/kt59167.def | 9 +++++++++ .../backend.native/tests/interop/kt59167/main.kt | 11 +++++++++++ 3 files changed, 28 insertions(+) create mode 100644 kotlin-native/backend.native/tests/interop/kt59167/kt59167.def create mode 100644 kotlin-native/backend.native/tests/interop/kt59167/main.kt diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index fc1ca574795..0b86db01a5d 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4133,6 +4133,9 @@ if (PlatformInfo.isAppleTarget(project)) { it.defFile 'interop/objc/objCAction/objclib.def' it.headers "$projectDir/interop/objc/objCAction/objclib.h" } + createInterop("kt59167") { + it.defFile 'interop/kt59167/kt59167.def' + } } createInterop("withSpaces") { @@ -4941,6 +4944,11 @@ if (PlatformInfo.isAppleTarget(project)) { } UtilsKt.dependsOnPlatformLibs(it) } + + interopTest("interop_kt59167") { + source = 'interop/kt59167/main.kt' + interop = 'kt59167' + } } tasks.register("KT-50983", KonanDriverTest) { diff --git a/kotlin-native/backend.native/tests/interop/kt59167/kt59167.def b/kotlin-native/backend.native/tests/interop/kt59167/kt59167.def new file mode 100644 index 00000000000..8678caca6d7 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/kt59167/kt59167.def @@ -0,0 +1,9 @@ +language=Objective-C +--- +#import + +// We only need to touch the problematic header to trigger the problem, +// so actual code does not matter. +id dummy() { + return nil; +} \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/interop/kt59167/main.kt b/kotlin-native/backend.native/tests/interop/kt59167/main.kt new file mode 100644 index 00000000000..86480bb67b2 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/kt59167/main.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2023 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. + */ + +import kotlin.test.* +import kt59167.* + +fun main() { + assertNull(dummy()) +} \ No newline at end of file