mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
1) Don't force ObjC interop just to enable gratuitous `@objc deinit`. 2) Prefer `-enable-objc-interop` over `REQUIRES: objc_interop`.
58 lines
2.3 KiB
Plaintext
58 lines
2.3 KiB
Plaintext
// RUN: %target-sil-opt -enable-sil-verify-all %s -devirtualizer | %FileCheck %s
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
import SwiftShims
|
|
|
|
class X
|
|
{
|
|
private func ping() -> Int
|
|
deinit
|
|
init()
|
|
}
|
|
|
|
class Y : X
|
|
{
|
|
deinit
|
|
override init()
|
|
}
|
|
|
|
sil [serialized] @_TFC14devirt_access21X4pingfS0_FT_Si : $@convention(method) (@guaranteed X) -> Int
|
|
sil public_external [transparent] @_TFSi33_convertFromBuiltinIntegerLiteralfMSiFBI_Si : $@convention(thin) (Builtin.IntLiteral, @thin Int.Type) -> Int
|
|
sil @_TFC14devirt_access21Xd : $@convention(method) (@guaranteed X) -> @owned Builtin.NativeObject
|
|
sil @_TFC14devirt_access21XD : $@convention(method) (@guaranteed X) -> ()
|
|
sil @_TFC14devirt_access21XcfMS0_FT_S0_ : $@convention(method) (@owned X) -> @owned X
|
|
sil @_TFC14devirt_access21XCfMS0_FT_S0_ : $@convention(thin) (@thick X.Type) -> @owned X
|
|
sil @_TFC14devirt_access21Yd : $@convention(method) (@guaranteed Y) -> @owned Builtin.NativeObject
|
|
sil @_TFC14devirt_access21YD : $@convention(method) (@guaranteed Y) -> ()
|
|
sil @_TFC14devirt_access21YcfMS0_FT_S0_ : $@convention(method) (@owned Y) -> @owned Y
|
|
sil @_TFC14devirt_access21YCfMS0_FT_S0_ : $@convention(thin) (@thick Y.Type) -> @owned Y
|
|
|
|
//CHECK-LABEL: sil @Case
|
|
//CHECK: function_ref @_TFC14devirt_access21X4pingfS0_FT_Si : $@convention(method) (@guaranteed X)
|
|
//CHECK-NOT: class_method
|
|
//CHECK: apply
|
|
//CHECK: return
|
|
sil @Case : $@convention(thin) (@owned Y) -> Int {
|
|
bb0(%0 : $Y):
|
|
debug_value %0 : $Y, let, name "a" // id: %1
|
|
strong_retain %0 : $Y // id: %2
|
|
%3 = upcast %0 : $Y to $X // users: %4, %5
|
|
%4 = class_method %3 : $X, #X.ping : (X) -> () -> Int, $@convention(method) (@guaranteed X) -> Int // user: %5
|
|
%5 = apply %4(%3) : $@convention(method) (@guaranteed X) -> Int // user: %7
|
|
strong_release %0 : $Y // id: %6
|
|
return %5 : $Int // id: %7
|
|
}
|
|
|
|
sil_vtable X {
|
|
#X.ping: @_TFC14devirt_access21X4pingfS0_FT_Si // devirt_access2.X.ping (devirt_access2.X)() -> Swift.Int
|
|
#X.init!initializer: @_TFC14devirt_access21XcfMS0_FT_S0_ // devirt_access2.X.init (devirt_access2.X.Type)() -> devirt_access2.X
|
|
}
|
|
|
|
sil_vtable Y {
|
|
#X.ping: @_TFC14devirt_access21X4pingfS0_FT_Si [inherited]
|
|
#X.init!initializer: @_TFC14devirt_access21YcfMS0_FT_S0_ [inherited]
|
|
}
|