@@ -69,47 +69,95 @@ foo bar
69
69
let _: Int = 1
70
70
#endif
71
71
72
+ #if !compiler(>=4.1)
73
+ // There should be no error here.
74
+ foo bar
75
+ #else
76
+ let _: Int = 1
77
+ #endif
78
+
72
79
#if (swift(>=2.2))
73
80
let _: Int = 1
74
81
#else
75
82
// There should be no error here.
76
83
foo bar
77
84
#endif
78
85
86
+ #if (compiler(>=4.1))
87
+ let _: Int = 1
88
+ #else
89
+ // There should be no error here.
90
+ foo bar
91
+ #endif
92
+
79
93
#if swift(>=99.0) || swift(>=88.1.1)
80
94
// There should be no error here.
81
95
foo bar baz // expected-error 2 {{consecutive statements}}
82
96
#else
83
97
undefinedElse ( ) // expected-error {{use of unresolved identifier 'undefinedElse'}}
84
98
#endif
85
99
100
+ #if compiler(>=99.0) || compiler(>=88.1.1)
101
+ // There should be no error here.
102
+ foo bar baz // expected-error 2 {{consecutive statements}}
103
+ #else
104
+ undefinedElse ( ) // expected-error {{use of unresolved identifier 'undefinedElse'}}
105
+ #endif
106
+
86
107
#if swift(>=99.0) || FOO
87
108
undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
88
109
#else
89
110
undefinedElse ( )
90
111
#endif
91
112
113
+ #if compiler(>=99.0) || FOO
114
+ undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
115
+ #else
116
+ undefinedElse ( )
117
+ #endif
118
+
92
119
#if swift(>=99.0) && FOO
93
120
// There should be no error here.
94
121
foo bar baz // expected-error 2 {{consecutive statements}}
95
122
#else
96
123
undefinedElse ( ) // expected-error {{use of unresolved identifier 'undefinedElse'}}
97
124
#endif
98
125
126
+ #if compiler(>=99.0) && FOO
127
+ // There should be no error here.
128
+ foo bar baz // expected-error 2 {{consecutive statements}}
129
+ #else
130
+ undefinedElse ( ) // expected-error {{use of unresolved identifier 'undefinedElse'}}
131
+ #endif
132
+
99
133
#if FOO && swift(>=2.2)
100
134
undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
101
135
#else
102
136
// There should be no error here.
103
137
foo bar baz // expected-error 2 {{consecutive statements}}
104
138
#endif
105
139
140
+ #if FOO && compiler(>=4.0)
141
+ undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
142
+ #else
143
+ // There should be no error here.
144
+ foo bar baz // expected-error 2 {{consecutive statements}}
145
+ #endif
146
+
106
147
#if swift(>=2.2) && swift(>=1)
107
148
undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
108
149
#else
109
150
// There should be no error here.
110
151
foo bar baz // expected-error 2 {{consecutive statements}}
111
152
#endif
112
153
154
+ #if compiler(>=4.1) && compiler(>=4)
155
+ undefinedIf ( ) // expected-error {{use of unresolved identifier 'undefinedIf'}}
156
+ #else
157
+ // There should be no error here.
158
+ foo bar baz // expected-error 2 {{consecutive statements}}
159
+ #endif
160
+
113
161
// ---------------------------------------------------------------------------
114
162
// SR-4031: Compound name in compilation condition
115
163
// See test/Parse/ConditionalCompilation/compoundName_swift4.swift for Swfit 4 behavior
0 commit comments