mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This implements basic checks on the validity of the @cdecl attribute and ensures the parameters and result types are representable in C. Many more diagnostics will need to be updated to verify full representability in C.
12 lines
418 B
Swift
12 lines
418 B
Swift
// RUN: %target-typecheck-verify-swift -enable-objc-interop -disable-availability-checking -enable-experimental-feature CDecl
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: swift_feature_CDecl
|
|
|
|
@_cdecl("async") // expected-error{{@_cdecl global function cannot be asynchronous}}
|
|
func asynchronous() async { }
|
|
|
|
@cdecl("async2") // expected-error{{@cdecl global function cannot be asynchronous}}
|
|
func asynchronous2() async { }
|
|
|