|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 |
|
3 |
| -// RUN: %target-swift-frontend -enable-library-evolution -emit-module -o %t/NoncopyableGenerics.swiftmodule -emit-module-interface-path %t/NoncopyableGenerics.swiftinterface -enable-experimental-feature NoncopyableGenerics %S/Inputs/NoncopyableGenerics.swift |
4 |
| -// RUN: %target-swift-frontend -emit-sil -sil-verify-all -I %t %s > /dev/null |
| 3 | +// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \ |
| 4 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 5 | +// RUN: -o %t/NoncopyableGenerics_Misc.swiftmodule \ |
| 6 | +// RUN: -emit-module-interface-path %t/NoncopyableGenerics_Misc.swiftinterface \ |
| 7 | +// RUN: %S/Inputs/NoncopyableGenerics_Misc.swift |
| 8 | + |
| 9 | +// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \ |
| 10 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 11 | +// RUN: -o %t/Swiftskell.swiftmodule \ |
| 12 | +// RUN: -emit-module-interface-path %t/Swiftskell.swiftinterface \ |
| 13 | +// RUN: %S/Inputs/Swiftskell.swift |
| 14 | + |
| 15 | +// Check the interfaces |
| 16 | + |
| 17 | +// RUN: %FileCheck %s --check-prefix=CHECK-MISC < %t/NoncopyableGenerics_Misc.swiftinterface |
| 18 | +// RUN: %FileCheck %s < %t/Swiftskell.swiftinterface |
5 | 19 |
|
6 | 20 | // REQUIRES: asserts
|
7 | 21 |
|
8 |
| -import NoncopyableGenerics |
| 22 | +import NoncopyableGenerics_Misc |
| 23 | + |
| 24 | +// CHECK-MISC: public struct rdar118697289_S1<Element> where Element : Swift.Copyable { |
| 25 | +// CHECK-MISC: public struct rdar118697289_S2<Element> where Element : Swift.Copyable { |
| 26 | +// CHECK-MISC: public static func pickOne<T>(_ a: T, _ b: T) -> T where T : Swift.Copyable |
| 27 | + |
| 28 | +// CHECK-MISC: extension NoncopyableGenerics_Misc._Toys : Swift.Copyable {} |
| 29 | +// CHECK-MISC: extension NoncopyableGenerics_Misc._Toys.rdar118697289_S1 : Swift.Copyable {} |
| 30 | +// CHECK-MISC: extension NoncopyableGenerics_Misc._Toys.rdar118697289_S2 : Swift.Copyable {} |
| 31 | + |
| 32 | +import Swiftskell |
| 33 | + |
| 34 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 35 | +// CHECK-NEXT: public protocol Show { |
| 36 | + |
| 37 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 38 | +// CHECK-NEXT: public func print(_ s: borrowing some Show & ~Copyable) |
| 39 | + |
| 40 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 41 | +// CHECK-NEXT: public protocol Eq { |
| 42 | + |
| 43 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 44 | +// CHECK-NEXT: extension Swiftskell.Eq { |
| 45 | + |
| 46 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 47 | +// CHECK-NEXT: extension Swiftskell.Eq where Self : Swift.Equatable { |
| 48 | + |
| 49 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 50 | +// CHECK-NEXT: public struct Vector<T> { |
| 51 | + |
| 52 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 53 | +// CHECK-NEXT: public enum Maybe<Value> { |
| 54 | + |
| 55 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 56 | +// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Show { |
| 57 | + |
| 58 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 59 | +// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Eq where Value : Swiftskell.Eq { |
| 60 | + |
| 61 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 62 | +// CHECK-NEXT: public func maybe<A, B>(_ defaultVal: B, _ fn: (consuming A) -> B) -> (consuming Swiftskell.Maybe<A>) -> B where B : Swift.Copyable |
| 63 | + |
| 64 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 65 | +// CHECK-NEXT: @inlinable public func fromMaybe<A>(_ defaultVal: A) -> (Swiftskell.Maybe<A>) -> A where A : Swift.Copyable { |
| 66 | + |
| 67 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 68 | +// CHECK-NEXT: public func isJust<A>(_ m: borrowing Swiftskell.Maybe<A>) -> Swift.Bool |
| 69 | + |
| 70 | + |
| 71 | +struct FileDescriptor: ~Copyable, Eq, Show { |
| 72 | + let id: Int |
| 73 | + |
| 74 | + func show() -> String { |
| 75 | + return "FileDescriptor(id:\(id))" |
| 76 | + } |
| 77 | + |
| 78 | + static func ==(_ a: borrowing Self, _ b: borrowing Self) -> Bool { |
| 79 | + return a.id == b.id |
| 80 | + } |
| 81 | +} |
0 commit comments