|
| 1 | +// REQUIRES: OS=macosx |
| 2 | +// RUN: %empty-directory(%t) |
| 3 | + |
| 4 | +// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/before_move.tbd -D BEFORE_MOVE -module-name Foo -enable-library-evolution -emit-sil -o %t/before_move.sil |
| 5 | +// RUN: %FileCheck %s < %t/before_move.tbd |
| 6 | +// RUN: %FileCheck %s --check-prefix=CHECK-SIL < %t/before_move.sil |
| 7 | + |
| 8 | +// RUN: %target-swift-frontend %s -emit-module -emit-module-path %t/FooCore.swiftmodule -D AFTER_MOVE_FOO_CORE -module-name FooCore -enable-library-evolution |
| 9 | +// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/after_move.tbd -D AFTER_MOVE_FOO -module-name Foo -I %t -enable-library-evolution -emit-sil -o %t/after_move.sil |
| 10 | +// RUN: %FileCheck %s < %t/after_move.tbd |
| 11 | +// RUN: %FileCheck %s --check-prefix=CHECK-SIL < %t/after_move.sil |
| 12 | + |
| 13 | +// CHECK: '_$s3Foo4DateC14getCurrentYearSiyFZ' |
| 14 | +// CHECK: '_$s3Foo9DateValueV4yearACSi_tcfC' |
| 15 | +// CHECK: '_$s3Foo9DateValueV4yearSivg' |
| 16 | + |
| 17 | +// CHECK-SIL: sil [available 10.7] @$s3Foo4DateC14getCurrentYearSiyFZ : $@convention(method) (@thick Date.Type) -> Int |
| 18 | +// CHECK-SIL: sil [available 10.7] @$s3Foo9DateValueV4yearACSi_tcfC : $@convention(method) (Int, @thin DateValue.Type) -> @out DateValue |
| 19 | +// CHECK-SIL: sil [available 10.7] @$s3Foo9DateValueV4yearSivg : $@convention(method) (@in_guaranteed DateValue) -> Int |
| 20 | + |
| 21 | +#if BEFORE_MOVE |
| 22 | + |
| 23 | +@available(OSX 10.7, *) |
| 24 | +public class Date { |
| 25 | + public static func getCurrentYear() -> Int { return 2020 } |
| 26 | +} |
| 27 | + |
| 28 | +@available(OSX 10.7, *) |
| 29 | +public struct DateValue { |
| 30 | + public init(year: Int) {} |
| 31 | + public var year: Int { return 2020 } |
| 32 | +} |
| 33 | + |
| 34 | +#endif |
| 35 | + |
| 36 | +#if AFTER_MOVE_FOO_CORE |
| 37 | + |
| 38 | +@available(OSX 10.7, *) |
| 39 | +@_originallyDefinedIn(module: "Foo", OSX 10.9) |
| 40 | +public class Date {} |
| 41 | + |
| 42 | +@available(OSX 10.7, *) |
| 43 | +@_originallyDefinedIn(module: "Foo", OSX 10.9) |
| 44 | +public struct DateValue {} |
| 45 | + |
| 46 | +#endif |
| 47 | + |
| 48 | +#if AFTER_MOVE_FOO |
| 49 | + |
| 50 | +@_exported import FooCore |
| 51 | + |
| 52 | +public extension Date { |
| 53 | + public static func getCurrentYear() -> Int { return 2020 } |
| 54 | +} |
| 55 | + |
| 56 | +public extension DateValue { |
| 57 | + public init(year: Int) { self.init(year: 2020) } |
| 58 | + public var year: Int { return 2020 } |
| 59 | +} |
| 60 | + |
| 61 | +#endif |
0 commit comments