Files
swift-mirror/test/IRGen/vtable.sil
John McCall 2969c4a7a6 Give static/class methods the SIL method convention instead of
just making them thin.

Among other things, this allows us to pass the metatype self
value with the swiftself convention, which has various advantages.
2016-04-07 10:39:18 -07:00

56 lines
2.0 KiB
Plaintext

// RUN: %target-swift-frontend -emit-ir %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-runtime
// REQUIRES: executable_test
// REQUIRES: CPU=x86_64
sil_stage canonical
import Builtin
import Swift
class C {
required init()
}
// CHECK: [[C:%C6vtable1C]] = type <{ %swift.refcounted }>
sil @_TFC6vtable1CCfMS0_FT_S0_ : $@convention(method) (@thick C.Type) -> @owned C
sil @_TFC6vtable1CcfMS0_FT_S0_ : $@convention(method) (@owned C) -> @owned C
sil @_TFC6vtable1Cd : $@convention(method) (@owned C) -> @owned Builtin.NativeObject
sil @_TFC6vtable1CD : $@convention(method) (@owned C) -> ()
// CHECK-objc: @_TMfC6vtable1C = internal global [[C_METADATA_T:<{.*\* }>]] <{
// CHECK-objc: void ([[C]]*)* @_TFC6vtable1CD,
// CHECK-objc: i8** @_TWVBo,
// CHECK-objc: i64 ptrtoint (%objc_class* @_TMmC6vtable1C to i64),
// CHECK-objc: %objc_class* @"OBJC_CLASS_$_SwiftObject",
// CHECK-objc: %swift.opaque* @_objc_empty_cache,
// CHECK-objc: %swift.opaque* null,
// CHECK-objc: i64 add (i64 ptrtoint ({ i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* }* @_DATA__TtC6vtable1C to i64), i64 1),
// CHECK-objc: i32 3, i32 0, i32 16, i16 7, i16 0,
// CHECK-objc: i32 112, i32 16,
// CHECK-objc: @_TMnC6vtable1C
// CHECK-objc: [[C]]* (%swift.type*)* @_TFC6vtable1CCfMS0_FT_S0_,
// CHECK-objc: [[C]]* ([[C]]*)* @_TFC6vtable1CcfMS0_FT_S0_
// CHECK-objc: }>
// CHECK-native: @_TMfC6vtable1C = internal global [[C_METADATA_T:<{.*\* }>]] <{
// CHECK-native: void ([[C]]*)* @_TFC6vtable1CD,
// CHECK-native: i8** @_TWVBo,
// CHECK-native: i64 0,
// CHECK-native: %swift.type* null,
// CHECK-native: %swift.opaque* null,
// CHECK-native: %swift.opaque* null,
// CHECK-native: i64 1,
// CHECK-native: i32 3, i32 0, i32 16, i16 7, i16 0,
// CHECK-native: i32 112, i32 16,
// CHECK-native: @_TMnC6vtable1C
// CHECK-native: [[C]]* (%swift.type*)* @_TFC6vtable1CCfMS0_FT_S0_,
// CHECK-native: [[C]]* ([[C]]*)* @_TFC6vtable1CcfMS0_FT_S0_
// CHECK-native: }>
sil_vtable C {
#C.init!allocator.1: _TFC6vtable1CCfMS0_FT_S0_
#C.init!initializer.1: _TFC6vtable1CcfMS0_FT_S0_
}