diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 5a44e492fbc..e88e21e41de 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -6088,6 +6088,21 @@ if (isAppleTarget(project)) { } swiftSources = ['framework/forwardDeclarations/'] } + + frameworkTest("testFrameworkUsesFoundationModule") { + framework("Bar") { + sources = ["framework/use_foundation_module/framework.kt"] + } + swiftSources = [] + doLast { + def frameworkPath = "$testOutputFramework/testFrameworkUsesFoundationModule/$target/Bar.framework" + def moduleMapContent = file("$frameworkPath/Modules/module.modulemap").text + def useFoundationPattern = ~"use Foundation" + if (!useFoundationPattern.matcher(moduleMapContent).find()) { + throw new Error("Expected use of Foundation module:\n$moduleMapContent") + } + } + } } /** diff --git a/kotlin-native/backend.native/tests/framework/use_foundation_module/framework.kt b/kotlin-native/backend.native/tests/framework/use_foundation_module/framework.kt new file mode 100644 index 00000000000..9a4fe485107 --- /dev/null +++ b/kotlin-native/backend.native/tests/framework/use_foundation_module/framework.kt @@ -0,0 +1,8 @@ +/* + * 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. + */ + +package shared + +fun shared() {} \ No newline at end of file