@@ -68,20 +68,31 @@ func client() {
6868
6969@inlinable
7070public func forbidMacrosInInlinableCode( ) {
71- if #available( _iOS9Aligned, * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
72- if #available( _iOS9, _macOS10_11, * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
73- if #available( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 , * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
74- if #unavailable( _iOS9Aligned) { } // expected-error {{availability macro cannot be used in inlinable global function}}
75- if #unavailable( _iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in inlinable global function}}
76- if #unavailable( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
71+ if #available( _iOS9Aligned, * ) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
72+ if #available( _iOS9, _macOS10_11, * ) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
73+ if #available( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 , * ) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
74+ if #unavailable( _iOS9Aligned) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
75+ if #unavailable( _iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
76+ if #unavailable( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 ) { } // expected-error {{availability macro cannot be used in an '@inlinable' function}}
7777}
7878
7979@_alwaysEmitIntoClient
8080public func forbidMacrosInInlinableCode1( ) {
81- if #available( _iOS9Aligned, * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
82- if #available( _iOS9, _macOS10_11, * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
83- if #available( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 , * ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
84- if #unavailable( _iOS9Aligned) { } // expected-error {{availability macro cannot be used in inlinable global function}}
85- if #unavailable( _iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in inlinable global function}}
86- if #unavailable( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 ) { } // expected-error {{availability macro cannot be used in inlinable global function}}
81+ if #available( _iOS9Aligned, * ) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
82+ if #available( _iOS9, _macOS10_11, * ) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
83+ if #available( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 , * ) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
84+ if #unavailable( _iOS9Aligned) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
85+ if #unavailable( _iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
86+ if #unavailable( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 ) { } // expected-error {{availability macro cannot be used in an '@_alwaysEmitIntoClient' function}}
87+ }
88+
89+ @available ( _iOS8Aligned, * )
90+ @_backDeploy ( _iOS9Aligned)
91+ public func forbidMacrosInInlinableCode2( ) {
92+ if #available( _iOS9Aligned, * ) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
93+ if #available( _iOS9, _macOS10_11, * ) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
94+ if #available( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 , * ) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
95+ if #unavailable( _iOS9Aligned) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
96+ if #unavailable( _iOS9, _macOS10_11) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
97+ if #unavailable( iOS 9 . 0 , _macOS10_11, tvOS 9 . 0 ) { } // expected-error {{availability macro cannot be used in a '@_backDeploy' function}}
8798}
0 commit comments