Files
swift-mirror/test/SILGen/capture-canonicalization.swift
Slava Pestov 94ce4c2ac3 SIL: Only give closures shared linkage if they're going to be serialized
Otherwise, we don't want them to be linkonce_odr at the LLVM level
to avoid unnecessary link-time overhead.
2017-03-31 20:26:27 -07:00

15 lines
318 B
Swift

// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
struct Foo<T> {}
struct Bar {}
extension Foo where T == Bar {
func foo(x: T) -> Bar {
// CHECK-LABEL: sil private @{{.*}}3foo{{.*}}4foo2{{.*}} : $@convention(thin) (Bar) -> Bar
func foo2() -> Bar {
return x
}
return foo2()
}
}