3232// REQUIRES: executable_test
3333// REQUIRES: VENDOR=apple
3434
35- // rdar://90525337
36- // UNSUPPORTED: swift_test_mode_optimize
37-
3835// ---- (0) Prepare SDK
3936// RUN: %empty-directory(%t)
4037// RUN: %empty-directory(%t/SDK_ABI)
@@ -119,34 +116,34 @@ testPrint(handle: #dsohandle, "check")
119116testPrint ( handle: libraryHandle ( ) , " check " )
120117
121118if isV2OrLater ( ) {
122- assert ( !v2APIsAreStripped( ) )
119+ precondition ( !v2APIsAreStripped( ) )
123120}
124121
125122// CHECK-ABI: library: trivial
126123// CHECK-BD: client: trivial
127124trivial ( )
128125
129- assert ( try ! pleaseThrow ( false ) )
126+ precondition ( try ! pleaseThrow ( false ) )
130127do {
131128 _ = try pleaseThrow ( true )
132129 fatalError ( " Should have thrown " )
133130} catch {
134- assert ( error as? BadError == BadError . bad)
131+ precondition ( error as? BadError == BadError . bad)
135132}
136133
137134do {
138135 let zero = MutableInt . zero
139- assert ( zero. value == 0 )
136+ precondition ( zero. value == 0 )
140137
141138 var int = MutableInt ( 5 )
142139
143140 // CHECK-ABI: library: 5
144141 // CHECK-BD: client: 5
145142 int. print ( )
146143
147- assert ( int. increment ( by: 2 ) == 7 )
148- assert ( genericIncrement ( & int, by: 3 ) == 10 )
149- assert ( int. decrement ( by: 1 ) == 9 )
144+ precondition ( int. increment ( by: 2 ) == 7 )
145+ precondition ( genericIncrement ( & int, by: 3 ) == 10 )
146+ precondition ( int. decrement ( by: 1 ) == 9 )
150147
151148 var incrementable : any Incrementable = int. toIncrementable ( )
152149
@@ -156,13 +153,13 @@ do {
156153
157154 let int2 = MutableInt ( 0x7BB7914B )
158155 for (i, expectedByte) in [ 0x4B , 0x91 , 0xB7 , 0x7B ] . enumerated ( ) {
159- assert ( int2 [ byteAt: i] == expectedByte)
156+ precondition ( int2 [ byteAt: i] == expectedByte)
160157 }
161158}
162159
163160do {
164161 let zero = ReferenceInt . zero
165- assert ( zero. value == 0 )
162+ precondition ( zero. value == 0 )
166163
167164 var int = ReferenceInt ( 42 )
168165
@@ -172,13 +169,13 @@ do {
172169
173170 do {
174171 let copy = int. copy ( )
175- assert ( int !== copy)
176- assert ( copy. value == 42 )
172+ precondition ( int !== copy)
173+ precondition ( copy. value == 42 )
177174 }
178175
179- assert ( int. increment ( by: 2 ) == 44 )
180- assert ( genericIncrement ( & int, by: 3 ) == 47 )
181- assert ( int. decrement ( by: 46 ) == 1 )
176+ precondition ( int. increment ( by: 2 ) == 44 )
177+ precondition ( genericIncrement ( & int, by: 3 ) == 47 )
178+ precondition ( int. decrement ( by: 46 ) == 1 )
182179
183180 var incrementable : any Incrementable = int. toIncrementable ( )
184181
188185
189186 let int2 = MutableInt ( 0x08AFAB76 )
190187 for (i, expectedByte) in [ 0x76 , 0xAB , 0xAF , 0x08 ] . enumerated ( ) {
191- assert ( int2 [ byteAt: i] == expectedByte)
188+ precondition ( int2 [ byteAt: i] == expectedByte)
192189 }
193190}
0 commit comments