|
1 | 1 | // RUN: %target-sil-opt -enable-sil-verify-all %s -cse | FileCheck %s
|
2 | 2 |
|
3 |
| -// XFAIL: linux |
4 |
| - |
5 | 3 | import Builtin
|
6 | 4 | import Swift
|
7 |
| -import Foundation |
8 | 5 |
|
9 | 6 | //////////////////////
|
10 | 7 | // Simple DCE Tests //
|
@@ -769,19 +766,6 @@ bb0(%0 : $B, %1 : $B):
|
769 | 766 | return %99 : $(@thick protocol<>.Type, @thick protocol<>.Type)
|
770 | 767 | }
|
771 | 768 |
|
772 |
| -// CHECK-LABEL: sil @cse_objc_protocol |
773 |
| -// CHECK: objc_protocol #XX : $Protocol |
774 |
| -// CHECK-NOT: objc_protocol |
775 |
| -// CHECK: tuple (%0 : $Protocol, %0 : $Protocol) |
776 |
| -// CHECK: return |
777 |
| -sil @cse_objc_protocol : $@convention(thin) () -> @owned (Protocol, Protocol) { |
778 |
| -bb0: |
779 |
| - %0 = objc_protocol #XX : $Protocol |
780 |
| - %1 = objc_protocol #XX : $Protocol |
781 |
| - %2 = tuple (%0: $Protocol, %1: $Protocol) |
782 |
| - return %2 : $(Protocol, Protocol) |
783 |
| -} |
784 |
| - |
785 | 769 |
|
786 | 770 | // CHECK-LABEL: sil @cse_objc_metatype_to_object
|
787 | 771 | // CHECK: value_metatype $@objc_metatype
|
@@ -1246,107 +1230,3 @@ bb0(%0 : $*Flyable):
|
1246 | 1230 | sil_witness_table hidden Airplane: Flyable module p2 {
|
1247 | 1231 | method #Flyable.fly!1: @_TTWV2p28AirplaneS_7FlyableS_FS1_3flyuRq_S1__fq_FT_T_ // protocol witness for p2.Flyable.fly <A where A: p2.Flyable> (A)() -> () in conformance p2.Airplane : p2.Flyable in p2
|
1248 | 1232 | }
|
1249 |
| - |
1250 |
| -@objc protocol Walkable { |
1251 |
| - func walk() |
1252 |
| -} |
1253 |
| - |
1254 |
| - class Bar : NSObject, Walkable { |
1255 |
| - override init() |
1256 |
| - func walk() |
1257 |
| - deinit |
1258 |
| -} |
1259 |
| - |
1260 |
| -func trytowalk(f: Walkable) |
1261 |
| - |
1262 |
| -// test.Bar.init (test.Bar.Type)() -> test.Bar |
1263 |
| -sil hidden @_TFC4test3BarcfMS0_FT_S0_ : $@convention(method) (@owned Bar) -> @owned Bar { |
1264 |
| -bb0(%0 : $Bar): |
1265 |
| - %1 = alloc_stack $Bar, let, name "sf" // users: %2, %6, %9, %10 |
1266 |
| - store %0 to %1#1 : $*Bar // id: %2 |
1267 |
| - %3 = upcast %0 : $Bar to $NSObject // user: %7 |
1268 |
| - %4 = super_method [volatile] %0 : $Bar, #NSObject.init!initializer.1.foreign : NSObject.Type -> () -> NSObject , $@convention(objc_method) (@owned NSObject) -> @owned NSObject // user: %7 |
1269 |
| - %7 = apply %4(%3) : $@convention(objc_method) (@owned NSObject) -> @owned NSObject // user: %8 |
1270 |
| - %8 = unchecked_ref_cast %7 : $NSObject to $Bar // users: %9, %11 |
1271 |
| - store %8 to %1#1 : $*Bar // id: %9 |
1272 |
| - dealloc_stack %1#0 : $*@local_storage Bar // id: %10 |
1273 |
| - return %8 : $Bar // id: %11 |
1274 |
| -} |
1275 |
| - |
1276 |
| -// test.Bar.__allocating_init (test.Bar.Type)() -> test.Bar |
1277 |
| -sil hidden @_TFC4test3BarCfMS0_FT_S0_ : $@convention(thin) (@thick Bar.Type) -> @owned Bar { |
1278 |
| -bb0(%0 : $@thick Bar.Type): |
1279 |
| - %1 = alloc_ref [objc] $Bar // user: %3 |
1280 |
| - // function_ref test.Bar.init (test.Bar.Type)() -> test.Bar |
1281 |
| - %2 = function_ref @_TFC4test3BarcfMS0_FT_S0_ : $@convention(method) (@owned Bar) -> @owned Bar // user: %3 |
1282 |
| - %3 = apply %2(%1) : $@convention(method) (@owned Bar) -> @owned Bar // user: %4 |
1283 |
| - return %3 : $Bar // id: %4 |
1284 |
| -} |
1285 |
| - |
1286 |
| -// @objc test.Bar.init (test.Bar.Type)() -> test.Bar |
1287 |
| -sil hidden @_TToFC4test3BarcfMS0_FT_S0_ : $@convention(objc_method) (@owned Bar) -> @owned Bar { |
1288 |
| -bb0(%0 : $Bar): |
1289 |
| - // function_ref test.Bar.init (test.Bar.Type)() -> test.Bar |
1290 |
| - %1 = function_ref @_TFC4test3BarcfMS0_FT_S0_ : $@convention(method) (@owned Bar) -> @owned Bar // user: %2 |
1291 |
| - %2 = apply %1(%0) : $@convention(method) (@owned Bar) -> @owned Bar // user: %3 |
1292 |
| - return %2 : $Bar // id: %3 |
1293 |
| -} |
1294 |
| - |
1295 |
| -// test.Bar.walk (test.Bar)() -> () |
1296 |
| -sil hidden @_TFC4test3Bar4walkfS0_FT_T_ : $@convention(method) (@guaranteed Bar) -> () { |
1297 |
| -bb0(%0 : $Bar): |
1298 |
| - debug_value %0 : $Bar, let, name "self" // id: %1 |
1299 |
| - %2 = tuple () // user: %3 |
1300 |
| - return %2 : $() // id: %3 |
1301 |
| -} |
1302 |
| - |
1303 |
| -// @objc test.Bar.walk (test.Bar)() -> () |
1304 |
| -sil hidden @_TToFC4test3Bar4walkfS0_FT_T_ : $@convention(objc_method) (Bar) -> () { |
1305 |
| -bb0(%0 : $Bar): |
1306 |
| - strong_retain %0 : $Bar // id: %1 |
1307 |
| - // function_ref test.Bar.walk (test.Bar)() -> () |
1308 |
| - %2 = function_ref @_TFC4test3Bar4walkfS0_FT_T_ : $@convention(method) (@guaranteed Bar) -> () // user: %3 |
1309 |
| - %3 = apply %2(%0) : $@convention(method) (@guaranteed Bar) -> () // user: %5 |
1310 |
| - strong_release %0 : $Bar // id: %4 |
1311 |
| - return %3 : $() // id: %5 |
1312 |
| -} |
1313 |
| - |
1314 |
| -// test.Bar.__deallocating_deinit |
1315 |
| -sil hidden @_TFC4test3BarD : $@convention(method) (@owned Bar) -> () { |
1316 |
| -bb0(%0 : $Bar): |
1317 |
| - debug_value %0 : $Bar, let, name "self" // id: %1 |
1318 |
| - %2 = super_method %0 : $Bar, #NSObject.deinit!deallocator.foreign : NSObject -> () , $@convention(objc_method) (NSObject) -> () // user: %4 |
1319 |
| - %3 = upcast %0 : $Bar to $NSObject // user: %4 |
1320 |
| - %4 = apply %2(%3) : $@convention(objc_method) (NSObject) -> () |
1321 |
| - %5 = tuple () // user: %6 |
1322 |
| - return %5 : $() // id: %6 |
1323 |
| -} |
1324 |
| - |
1325 |
| -// CHECK-LABEL: _TF4test9trytowalkFPS_8Walkable_T_ |
1326 |
| -// CHECK: bb0(%0 : $Walkable): |
1327 |
| -// CHECK-NEXT: open_existential_ref |
1328 |
| -// CHECK-NEXT: witness_method |
1329 |
| -// CHECK-NEXT: apply |
1330 |
| -// CHECK-NEXT: witness_method |
1331 |
| -// CHECK-NEXT: apply |
1332 |
| -// CHECK-NEXT: strong_release |
1333 |
| -// CHECK-NEXT: tuple |
1334 |
| -// CHECK-NEXT: return |
1335 |
| -// test.trytowalk (test.Walkable) -> () |
1336 |
| -sil hidden @_TF4test9trytowalkFPS_8Walkable_T_ : $@convention(thin) (@owned Walkable) -> () { |
1337 |
| -bb0(%0 : $Walkable): |
1338 |
| - %2 = open_existential_ref %0 : $Walkable to $@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable // users: %3, %4 |
1339 |
| - %3 = witness_method [volatile] $@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable, #Walkable.walk!1.foreign, %2 : $@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable : $@convention(objc_method) <τ_0_0 where τ_0_0 : Walkable> (τ_0_0) -> () // user: %4 |
1340 |
| - %4 = apply %3<@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable>(%2) : $@convention(objc_method) <τ_0_0 where τ_0_0 : Walkable> (τ_0_0) -> () |
1341 |
| - %5 = witness_method [volatile] $@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable, #Walkable.walk!1.foreign, %2 : $@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable : $@convention(objc_method) <τ_0_0 where τ_0_0 : Walkable> (τ_0_0) -> () // user: %6 |
1342 |
| - %6 = apply %5<@opened("7813D5BE-4C48-11E5-BD72-AC87A3294C0A") Walkable>(%2) : $@convention(objc_method) <τ_0_0 where τ_0_0 : Walkable> (τ_0_0) -> () |
1343 |
| - strong_release %0 : $Walkable // id: %8 |
1344 |
| - %9 = tuple () // user: %10 |
1345 |
| - return %9 : $() // id: %10 |
1346 |
| -} |
1347 |
| - |
1348 |
| -sil_vtable Bar { |
1349 |
| - #Bar.init!initializer.1: _TFC4test3BarcfMS0_FT_S0_ // test.Bar.init (test.Bar.Type)() -> test.Bar |
1350 |
| - #Bar.walk!1: _TFC4test3Bar4walkfS0_FT_T_ // test.Bar.walk (test.Bar)() -> () |
1351 |
| - #Bar.deinit!deallocator: _TFC4test3BarD // test.Bar.__deallocating_deinit |
1352 |
| -} |
0 commit comments