mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Specializations are implementation details, and thus shouldn't be public, even if they are specializing a public function. Without this downgrade, the ABI of a module depends on random internal code (could change inlining decisions etc.), as well as swiftc's optimiser.
24 lines
669 B
Swift
24 lines
669 B
Swift
// RUN: %target-swift-frontend -sil-serialize-all -O -parse-stdlib -parse-as-library -emit-sil %s | %FileCheck %s
|
|
|
|
// Make sure specialization of stdlib_binary_only functions are not marked
|
|
// shared. Marking them shared would make their visibility hidden. Because
|
|
// stdlib_binary_only implies public external linkage in other modules we would
|
|
// get linking errors.
|
|
|
|
@_silgen_name("unknown")
|
|
public func unknown() -> ()
|
|
|
|
@inline(never)
|
|
@_semantics("stdlib_binary_only")
|
|
public func doSomething3<T>(_ a:T) {
|
|
unknown()
|
|
}
|
|
|
|
struct A {}
|
|
@inline(never)
|
|
public func callDoSomething3() {
|
|
doSomething3(A())
|
|
}
|
|
|
|
// CHECK-NOT: sil {{.*}}shared{{.*}} {{.*}}12doSomething3
|