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
27 lines
1.1 KiB
Swift
27 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend -emit-silgen -parse-as-library -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-ir -parse-as-library -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s -check-prefix=IR
|
|
|
|
// RUN: %target-swift-frontend -emit-silgen -parse-as-library -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -D REFERENCE | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-ir -parse-as-library -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -D REFERENCE | %FileCheck %s -check-prefix=IR
|
|
|
|
// REQUIRES: OS=macosx
|
|
|
|
import Foundation
|
|
import AppKit
|
|
|
|
@NSApplicationMain
|
|
class MyDelegate: NSApplicationDelegate {}
|
|
|
|
// CHECK-LABEL: sil @main
|
|
// CHECK: function_ref @NSApplicationMain
|
|
// IR-LABEL: define{{( protected)?}} i32 @main
|
|
// IR: call swiftcc i32 @NSApplicationMain
|
|
|
|
#if REFERENCE
|
|
// Ensure that we coexist with normal references to the functions we
|
|
// implicitly reference in the synthesized main.
|
|
func bar() {
|
|
NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
|
|
}
|
|
#endif
|