diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 1883baa3ccd..7764bf2cdb5 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4460,6 +4460,18 @@ dynamicTest("kt36639") { |""".stripMargin() } +for (i in 0..2) { + dynamicTest("kt42796_$i") { + clangTool = "clang++" + disabled = (project.target.name != project.hostName) + source = "produce_dynamic/kt-42796/main-${i}.kt" + cSource = "$projectDir/produce_dynamic/kt-42796/main.cpp" + goldValue = "" + clangFlags = ["-DTEST=$i", "-Werror"] + } +} + + dynamicTest("interop_concurrentRuntime") { disabled = (project.target.name != project.hostName) disabled = true // KT-43180 diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-0.kt b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-0.kt new file mode 100644 index 00000000000..e87c0c27544 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-0.kt @@ -0,0 +1,8 @@ +/* + * 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. + */ + +package empty + +internal fun internalZerro() = 0 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-1.kt b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-1.kt new file mode 100644 index 00000000000..4ca5c679755 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-1.kt @@ -0,0 +1,8 @@ +/* + * 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. + */ + +package empty.nonempty + +fun one() = 1 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-2.kt b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-2.kt new file mode 100644 index 00000000000..697a9b6b7f5 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main-2.kt @@ -0,0 +1,8 @@ +/* + * 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. + */ + +package empty.nonempty.internalEmpty + +internal fun two() = 3 \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main.cpp b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main.cpp new file mode 100644 index 00000000000..97fb2c774d4 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-42796/main.cpp @@ -0,0 +1,13 @@ +#include "testlib_api.h" + +#define __ testlib_symbols()-> +#define T_(x) testlib_kref_ ## x + + +int +main() { +#if TEST == 1 + __ kotlin.root.empty.nonempty.one(); +#endif + return 0; +}