mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This option is no longer necessary, because we emit weak definitions for any imported modules. Fixes rdar://158364032.
36 lines
920 B
Swift
36 lines
920 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %{python} %utils/split_file.py -o %t %s
|
|
|
|
// RUN: %target-swift-frontend -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library
|
|
// RUN: %target-swift-frontend -c -o %t/a.o %t/Main.swift -I %t -enable-experimental-feature Embedded
|
|
// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o %t/MyModule.o -o %t/a.out
|
|
// RUN: %target-run %t/a.out | %FileCheck %s
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
// BEGIN MyModule.swift
|
|
|
|
public func module_func() {
|
|
print("module_func")
|
|
}
|
|
|
|
public func module_generic_func<T: CustomStringConvertible>(t: T) {
|
|
print("module_generic_func: \(t)")
|
|
}
|
|
|
|
// BEGIN Main.swift
|
|
|
|
import MyModule
|
|
|
|
func test() {
|
|
module_func()
|
|
module_generic_func(t: 42)
|
|
}
|
|
|
|
test()
|
|
|
|
// CHECK: module_func
|
|
// CHECK: module_generic_func: 42
|