mirror of
https://github.com/apple/swift.git
synced 2026-11-04 00:12:11 +01:00
The accepted spelling of the official attribute is `@c`. In the fullness of time, it would be confusing that tests for `@c` refer to the old spelling (`@_cdecl`).
41 lines
1.1 KiB
Swift
41 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) \
|
|
// RUN: -disable-objc-interop \
|
|
// RUN: -F %clang-importer-sdk-path/frameworks %s \
|
|
// RUN: -import-objc-header %S/Inputs/objc_implementation.h -emit-ir \
|
|
// RUN: -target %target-future-triple > %t.ir
|
|
// RUN: %FileCheck --input-file %t.ir %s
|
|
|
|
@implementation @c
|
|
public func implFunc(_ param: Int32) {}
|
|
|
|
@implementation @c
|
|
public func implFuncCName(_ param: Int32) {}
|
|
|
|
@implementation @c(implFuncRenamed_C)
|
|
public func implFuncRenamed_Swift(param: Int32) {}
|
|
|
|
public func fn() {
|
|
implFunc(2)
|
|
implFuncCName(3)
|
|
implFuncRenamed_Swift(param: 4)
|
|
}
|
|
|
|
/// implFunc(_:)
|
|
// CHECK-LABEL: define{{.*}} void @implFunc
|
|
|
|
// CHECK-NOT: define{{.*}} swiftcc void @"$s16c_implementation8implFuncyys5Int32VF"
|
|
|
|
/// inplFuncCName(_:)
|
|
// CHECK-LABEL: define{{.*}} void @"\01_implFuncAsmName"
|
|
|
|
// CHECK-NOT: define{{.*}} swiftcc void @"$s16c_implementation13implFuncCNameyys5Int32VF"
|
|
|
|
/// fn()
|
|
// CHECK-LABEL: define{{.*}} swiftcc void @"$s16c_implementation2fnyyF"
|
|
// CHECK: call void @implFunc
|
|
// CHECK: call void @"\01_implFuncAsmName"
|
|
// CHECK: call void @implFuncRenamed_C
|
|
// CHECK: ret void
|
|
// CHECK: }
|
|
|