1
1
// RUN: %empty-directory(%t)
2
-
3
- // Ensure @_backDeploy attributes and function bodies are printed in
4
- // swiftinterface files.
5
- // RUN: %target-swiftc_driver -emit-module -o %t/Test.swiftmodule -emit-module-interface-path %t/Test.swiftinterface %s -enable-library-evolution -verify-emitted-module-interface -module-name Test \
6
- // RUN: -Xfrontend -define-availability -Xfrontend "_macOS12_1:macOS 12.1" \
7
- // RUN: -Xfrontend -define-availability -Xfrontend "_myProject 1.0:macOS 12.1, iOS 15.1"
8
- // RUN: %FileCheck %s --check-prefix FROMSOURCE --check-prefix CHECK < %t/Test.swiftinterface
9
-
10
- // FIXME(backDeploy): Remove this step in favor of a test that exercises using
11
- // a back deployed API from a test library so that we can avoid -merge-modules
12
-
13
- // Ensure @_backDeploy attributes and function bodies are present after
14
- // deserializing .swiftmodule files.
15
- // RUN: %target-swift-frontend -emit-module -o /dev/null -merge-modules %t/Test.swiftmodule -disable-objc-attr-requires-foundation-module -emit-module-interface-path %t/TestFromModule.swiftinterface -module-name Test \
2
+ // RUN: %target-swift-emit-module-interface(%t/Test.swiftinterface) %s \
16
3
// RUN: -define-availability "_macOS12_1:macOS 12.1" \
17
4
// RUN: -define-availability "_myProject 1.0:macOS 12.1, iOS 15.1"
18
- // RUN: %FileCheck %s --check-prefix FROMMODULE --check-prefix CHECK < %t/TestFromModule.swiftinterface
5
+ // RUN: %target-swift-typecheck-module-from-interface(%t/Test.swiftinterface)
6
+ // RUN: %FileCheck %s < %t/Test.swiftinterface
19
7
20
8
public struct TopLevelStruct {
21
9
// CHECK: @_backDeploy(before: macOS 12.0)
22
- // FROMSOURCE: public func backDeployedFunc_SinglePlatform() -> Swift.Int { return 42 }
23
- // FROMMODULE: public func backDeployedFunc_SinglePlatform() -> Swift.Int
10
+ // CHECK: public func backDeployedFunc_SinglePlatform() -> Swift.Int { return 42 }
24
11
@available ( macOS 11 . 0 , * )
25
12
@_backDeploy ( before: macOS 12.0 )
26
13
public func backDeployedFunc_SinglePlatform( ) -> Int { return 42 }
27
14
28
15
// CHECK: @_backDeploy(before: macOS 12.0)
29
16
// CHECK: @_backDeploy(before: iOS 15.0)
30
- // FROMSOURCE: public func backDeployedFunc_MultiPlatform() -> Swift.Int { return 43 }
31
- // FROMMODULE: public func backDeployedFunc_MultiPlatform() -> Swift.Int
17
+ // CHECK: public func backDeployedFunc_MultiPlatform() -> Swift.Int { return 43 }
32
18
@available ( macOS 11 . 0 , iOS 14 . 0 , * )
33
19
@_backDeploy ( before: macOS 12.0 , iOS 15 . 0 )
34
20
public func backDeployedFunc_MultiPlatform( ) -> Int { return 43 }
35
21
36
22
// CHECK: @_backDeploy(before: macOS 12.0)
37
- // FROMSOURCE: public var backDeployedComputedProperty: Swift.Int {
38
- // FROMSOURCE: get { 44 }
39
- // FROMSOURCE: }
40
- // FROMMODULE: public var backDeployedComputedProperty: Swift.Int
23
+ // CHECK: public var backDeployedComputedProperty: Swift.Int {
24
+ // CHECK: get { 44 }
25
+ // CHECK: }
41
26
@available ( macOS 11 . 0 , * )
42
27
@_backDeploy ( before: macOS 12.0 )
43
28
public var backDeployedComputedProperty : Int { 44 }
44
29
45
30
// CHECK: @_backDeploy(before: macOS 12.0)
46
- // FROMSOURCE: public var backDeployedPropertyWithAccessors: Swift.Int {
47
- // FROMSOURCE: get { 45 }
48
- // FROMSOURCE: }
49
- // FROMMODULE: public var backDeployedPropertyWithAccessors: Swift.Int
31
+ // CHECK: public var backDeployedPropertyWithAccessors: Swift.Int {
32
+ // CHECK: get { 45 }
33
+ // CHECK: }
50
34
@available ( macOS 11 . 0 , * )
51
35
@_backDeploy ( before: macOS 12.0 )
52
36
public var backDeployedPropertyWithAccessors : Int {
53
37
get { 45 }
54
38
}
55
39
56
40
// CHECK: @_backDeploy(before: macOS 12.0)
57
- // FROMSOURCE: public subscript(index: Swift.Int) -> Swift.Int {
58
- // FROMSOURCE: get { 46 }
59
- // FROMSOURCE: }
60
- // FROMMODULE: public subscript(index: Swift.Int) -> Swift.Int
41
+ // CHECK: public subscript(index: Swift.Int) -> Swift.Int {
42
+ // CHECK: get { 46 }
43
+ // CHECK: }
61
44
@available ( macOS 11 . 0 , * )
62
45
@_backDeploy ( before: macOS 12.0 )
63
46
public subscript( index: Int ) -> Int {
@@ -66,25 +49,22 @@ public struct TopLevelStruct {
66
49
}
67
50
68
51
// CHECK: @_backDeploy(before: macOS 12.0)
69
- // FROMSOURCE: public func backDeployTopLevelFunc1() -> Swift.Int { return 47 }
70
- // FROMMODULE: public func backDeployTopLevelFunc1() -> Swift.Int
52
+ // CHECK: public func backDeployTopLevelFunc1() -> Swift.Int { return 47 }
71
53
@available ( macOS 11 . 0 , * )
72
54
@_backDeploy ( before: macOS 12.0 )
73
55
public func backDeployTopLevelFunc1( ) -> Int { return 47 }
74
56
75
57
// MARK: - Availability macros
76
58
77
59
// CHECK: @_backDeploy(before: macOS 12.1)
78
- // FROMSOURCE: public func backDeployTopLevelFunc2() -> Swift.Int { return 48 }
79
- // FROMMODULE: public func backDeployTopLevelFunc2() -> Swift.Int
60
+ // CHECK: public func backDeployTopLevelFunc2() -> Swift.Int { return 48 }
80
61
@available ( macOS 11 . 0 , * )
81
62
@_backDeploy ( before: _macOS12_1)
82
63
public func backDeployTopLevelFunc2( ) -> Int { return 48 }
83
64
84
65
// CHECK: @_backDeploy(before: macOS 12.1)
85
66
// CHECK: @_backDeploy(before: iOS 15.1)
86
- // FROMSOURCE: public func backDeployTopLevelFunc3() -> Swift.Int { return 49 }
87
- // FROMMODULE: public func backDeployTopLevelFunc3() -> Swift.Int
67
+ // CHECK: public func backDeployTopLevelFunc3() -> Swift.Int { return 49 }
88
68
@available ( macOS 11 . 0 , iOS 14 . 0 , * )
89
69
@_backDeploy ( before: _myProject 1.0 )
90
70
public func backDeployTopLevelFunc3( ) -> Int { return 49 }
0 commit comments