| // RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all -module-name="SILDeclRef" %s |
| |
| // Check that SILDeclRefs with interface types can be parsed properly. |
| |
| sil_stage canonical |
| |
| import Builtin |
| import Swift |
| import SwiftShims |
| |
| public protocol P { |
| func foo() -> Int32 |
| func foo(n: Int32) |
| } |
| |
| extension P { |
| func boo() -> Int32 |
| } |
| |
| public class Base : P { |
| public func foo() -> Int32 |
| public func foo(n: Int32) |
| public func foo(f: Float) -> Int32 |
| deinit |
| init() |
| } |
| |
| public class Derived1 : Base { |
| override public func foo() -> Int32 |
| override public func foo(n: Int32) |
| override public func foo(f: Float) -> Int32 |
| deinit |
| override init() |
| } |
| |
| public class Derived2 : Base { |
| override public func foo() -> Int32 |
| override public func foo(n: Int32) |
| override public func foo(f: Float) -> Int32 |
| deinit |
| override init() |
| } |
| |
| public func testP(p: P) -> Int32 |
| |
| public func testBase(b: Base) -> Int32 |
| |
| // P.boo() -> Int32 |
| sil @_TFE10SILDeclRefPS_1P3boofT_Vs5Int32 : $@convention(method) <Self where Self : P> (@in_guaranteed Self) -> Int32 |
| |
| // Int32.init(_builtinIntegerLiteral : Builtin.Int2048) -> Int32 |
| sil public_external [transparent] [serialized] @_TFVs5Int32CfT22_builtinIntegerLiteralBi2048__S_ : $@convention(method) (Builtin.Int2048, @thin Int32.Type) -> Int32 |
| |
| // Base.foo() -> Int32 |
| sil @_TFC10SILDeclRef4Base3foofT_Vs5Int32 : $@convention(method) (@guaranteed Base) -> Int32 |
| |
| // Base.foo(n : Int32) -> () |
| sil @_TFC10SILDeclRef4Base3foofT1nVs5Int32_T_ : $@convention(method) (Int32, @guaranteed Base) -> () |
| |
| // Base.foo(f : Float) -> Int32 |
| sil @_TFC10SILDeclRef4Base3foofT1fSf_Vs5Int32 : $@convention(method) (Float, @guaranteed Base) -> Int32 |
| |
| // Base.__deallocating_deinit |
| sil @_TFC10SILDeclRef4BaseD : $@convention(method) (@owned Base) -> () |
| |
| // Base.deinit |
| sil @_TFC10SILDeclRef4Based : $@convention(method) (@guaranteed Base) -> @owned Builtin.NativeObject |
| |
| // Base.init() -> Base |
| sil @_TFC10SILDeclRef4BasecfT_S0_ : $@convention(method) (@owned Base) -> @owned Base |
| |
| // protocol witness for P.foo() -> Int32 in conformance Base |
| sil [transparent] [thunk] @_TTWC10SILDeclRef4BaseS_1PS_FS1_3foofT_Vs5Int32 : $@convention(witness_method) (@in_guaranteed Base) -> Int32 |
| |
| // protocol witness for P.foo(n : Int32) -> () in conformance Base |
| sil [transparent] [thunk] @_TTWC10SILDeclRef4BaseS_1PS_FS1_3foofT1nVs5Int32_T_ : $@convention(witness_method) (Int32, @in_guaranteed Base) -> () |
| |
| // Derived1.foo() -> Int32 |
| sil @_TFC10SILDeclRef8Derived13foofT_Vs5Int32 : $@convention(method) (@guaranteed Derived1) -> Int32 |
| |
| // Derived1.foo(n : Int32) -> () |
| sil @_TFC10SILDeclRef8Derived13foofT1nVs5Int32_T_ : $@convention(method) (Int32, @guaranteed Derived1) -> () |
| |
| // Derived1.foo(f : Float) -> Int32 |
| sil @_TFC10SILDeclRef8Derived13foofT1fSf_Vs5Int32 : $@convention(method) (Float, @guaranteed Derived1) -> Int32 |
| |
| // Derived1.__deallocating_deinit |
| sil @_TFC10SILDeclRef8Derived1D : $@convention(method) (@owned Derived1) -> () |
| |
| // Derived1.deinit |
| sil @_TFC10SILDeclRef8Derived1d : $@convention(method) (@guaranteed Derived1) -> @owned Builtin.NativeObject |
| |
| // Derived1.init() -> Derived1 |
| sil @_TFC10SILDeclRef8Derived1cfT_S0_ : $@convention(method) (@owned Derived1) -> @owned Derived1 |
| |
| // Derived2.foo() -> Int32 |
| sil @_TFC10SILDeclRef8Derived23foofT_Vs5Int32 : $@convention(method) (@guaranteed Derived2) -> Int32 |
| |
| // Derived2.foo(n : Int32) -> () |
| sil @_TFC10SILDeclRef8Derived23foofT1nVs5Int32_T_ : $@convention(method) (Int32, @guaranteed Derived2) -> () |
| |
| // Derived2.foo(f : Float) -> Int32 |
| sil @_TFC10SILDeclRef8Derived23foofT1fSf_Vs5Int32 : $@convention(method) (Float, @guaranteed Derived2) -> Int32 |
| |
| // Derived2.__deallocating_deinit |
| sil @_TFC10SILDeclRef8Derived2D : $@convention(method) (@owned Derived2) -> () |
| |
| // Derived2.deinit |
| sil @_TFC10SILDeclRef8Derived2d : $@convention(method) (@guaranteed Derived2) -> @owned Builtin.NativeObject |
| |
| // Derived2.init() -> Derived2 |
| sil @_TFC10SILDeclRef8Derived2cfT_S0_ : $@convention(method) (@owned Derived2) -> @owned Derived2 |
| |
| // testP(p : P) -> Int32 |
| sil @_TF10SILDeclRef5testPFT1pPS_1P__Vs5Int32 : $@convention(thin) (@in P) -> Int32 |
| |
| // testBase(b : Base) -> Int32 |
| sil @_TF10SILDeclRef8testBaseFT1bCS_4Base_Vs5Int32 : $@convention(thin) (@owned Base) -> Int32 |
| |
| sil_vtable Derived1 { |
| #Base.foo!1: (Base) -> () -> Int32 : _TFC10SILDeclRef8Derived13foofT_Vs5Int32 // Derived1.foo() -> Int32 |
| #Base.foo!1: (Base) -> (Int32) -> () : _TFC10SILDeclRef8Derived13foofT1nVs5Int32_T_ // Derived1.foo(n : Int32) -> () |
| #Base.foo!1: (Base) -> (Float) -> Int32 : _TFC10SILDeclRef8Derived13foofT1fSf_Vs5Int32 // Derived1.foo(f : Float) -> Int32 |
| #Base.init!initializer.1: (Base.Type) -> () -> Base : _TFC10SILDeclRef8Derived1cfT_S0_ // Derived1.init() -> Derived1 |
| #Derived1.deinit!deallocator: (Derived1) -> () -> () : _TFC10SILDeclRef8Derived1D // Derived1.__deallocating_deinit |
| } |
| |
| sil_vtable Derived2 { |
| #Base.foo!1: (Base) -> () -> Int32 : _TFC10SILDeclRef8Derived23foofT_Vs5Int32 // Derived2.foo() -> Int32 |
| #Base.foo!1: (Base) -> (Int32) -> () : _TFC10SILDeclRef8Derived23foofT1nVs5Int32_T_ // Derived2.foo(n : Int32) -> () |
| #Base.foo!1: (Base) -> (Float) -> Int32 : _TFC10SILDeclRef8Derived23foofT1fSf_Vs5Int32 // Derived2.foo(f : Float) -> Int32 |
| #Base.init!initializer.1: (Base.Type) -> () -> Base : _TFC10SILDeclRef8Derived2cfT_S0_ // Derived2.init() -> Derived2 |
| #Derived2.deinit!deallocator: (Derived2) -> () -> () : _TFC10SILDeclRef8Derived2D // Derived2.__deallocating_deinit |
| } |
| |
| sil_witness_table [serialized] Base: P module SILDeclRef { |
| method #P.foo!1: <Self where Self : P> (Self) -> () -> Int32 : @_TTWC10SILDeclRef4BaseS_1PS_FS1_3foofT_Vs5Int32 // protocol witness for P.foo() -> Int32 in conformance Base |
| method #P.foo!1: <Self where Self : P> (Self) -> (Int32) -> () : @_TTWC10SILDeclRef4BaseS_1PS_FS1_3foofT1nVs5Int32_T_ // protocol witness for P.foo(n : Int32) -> () in conformance Base |
| } |
| |
| sil_default_witness_table P { |
| no_default |
| no_default |
| } |
| |