mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the generic type lowering algorithm described in "docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion type to the type expected by the ABI. Change IRGen to use the swift calling convention (swiftcc) for native swift functions. Use the 'swiftself' attribute on self parameters and for closures contexts. Use the 'swifterror' parameter for swift error parameters. Change functions in the runtime that are called as native swift functions to use the swift calling convention. rdar://19978563
23 lines
963 B
Swift
23 lines
963 B
Swift
// RUN: %target-swift-frontend -Xllvm -new-mangling-for-tests %s -import-objc-header %S/Inputs/serialized-objc-header.h -emit-ir -g -o - | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
protocol Named {
|
|
var name : String { get }
|
|
}
|
|
|
|
// initializer.Person.init (initializer.Person.Type)() -> initializer.Person
|
|
// CHECK: define hidden {{.*}}%C11initializer6Person* @_T011initializer6PersonCACycfc(%C11initializer6Person*{{.*}}) {{.*}} {
|
|
|
|
// initializer.Person.__allocating_init (initializer.Person.Type)() -> initializer.Person
|
|
// CHECK: define hidden {{.*}}%C11initializer6Person* @_T011initializer6PersonCACycfC(%swift.type*{{.*}}) {{.*}} {
|
|
// CHECK: call {{.*}}%C11initializer6Person* @_T011initializer6PersonCACycfc(%C11initializer6Person* {{.*}}%3), !dbg ![[ALLOCATING_INIT:.*]]
|
|
|
|
// CHECK-DAG: ![[ALLOCATING_INIT]] = !DILocation(line: 0, scope
|
|
class Person : Named {
|
|
var name : String { get { return "No Name" } }
|
|
var age = 0
|
|
}
|
|
|
|
var person = Person()
|