Files
swift-mirror/test/attr/attr_cdecl_official_async.swift
Alexis Laferrière ae6bf75378 Sema: Basic type-checking of @cdecl on global functions
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.
2025-04-11 11:34:40 -07:00

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 { }