diff --git a/test/TBD/specialize_attr.swift b/test/TBD/specialize_attr.swift new file mode 100644 index 0000000000000..2007fcedaf7ac --- /dev/null +++ b/test/TBD/specialize_attr.swift @@ -0,0 +1,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(_ x : T) -> T { return x } + +@_specialize(exported: false, where T == Int) +@_specialize(exported: true, where T == Float) +internal func fooInternal(_ x : T) -> T { return x } + +@_specialize(exported: false, where T == Int) +@_specialize(exported: true, where T == Float) +private func fooPrivate(_ x : T) -> T { return x } + +public struct S { + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + public func foo(_ x : T) -> T { return x } + + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + internal func fooInternal(_ x : T) -> T { return x } + + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + private func fooPrivate(_ x : T) -> T { return x } +} + +public class C { + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + public func foo(_ x : T) -> T { return x } + + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + internal func fooInternal(_ x : T) -> T { return x } + + @_specialize(exported: false, where T == Int) + @_specialize(exported: true, where T == Float) + private func fooPrivate(_ x : T) -> T { return x } +} diff --git a/test/TBD/specialize_verify.swift b/test/TBD/specialize_verify.swift deleted file mode 100644 index e7942965a5c73..0000000000000 --- a/test/TBD/specialize_verify.swift +++ /dev/null @@ -1,7 +0,0 @@ -// REQUIRES: VENDOR=apple -// RUN: %target-swift-frontend -emit-ir -o/dev/null -O -module-name test -validate-tbd-against-ir=missing %s - -@_specialize(exported: true, where T == Float) -public func foo(_ x : T) -> T { - return x -}