-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathspecialize_attr.swift
51 lines (40 loc) · 2.53 KB
/
specialize_attr.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// REQUIRES: VENDOR=apple
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing -O %s
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing -O %s
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing -O
// RUN: %target-swift-frontend -enable-library-evolution -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=missing %s -enable-testing -O
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
public func foo<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
internal func fooInternal<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
private func fooPrivate<T>(_ x : T) -> T { return x }
public struct S {
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
public func foo<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
internal func fooInternal<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
private func fooPrivate<T>(_ x : T) -> T { return x }
}
public class C {
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
public func foo<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
internal func fooInternal<T>(_ x : T) -> T { return x }
@_specialize(exported: false, where T == Int)
@_specialize(exported: true, where T == Float)
private func fooPrivate<T>(_ x : T) -> T { return x }
}