1 // RUN: %clang_cc1 -fblocks -ast-dump %s | FileCheck %s
3 __attribute__((swift_attr("@actor")))
7 // CHECK-LABEL: InterfaceDecl {{.*}} View
8 // CHECK-NEXT: SwiftAttrAttr {{.*}} "@actor"
10 #pragma clang attribute push(__attribute__((swift_attr("@sendable"))), apply_to=objc_interface)
13 #pragma clang attribute pop
15 // CHECK-LABEL: InterfaceDecl {{.*}} Contact
16 // CHECK-NEXT: SwiftAttrAttr {{.*}} "@sendable"
18 #define SWIFT_SENDABLE __attribute__((swift_attr("@Sendable")))
20 @interface InTypeContext
21 - (nullable id)test:(nullable SWIFT_SENDABLE id)obj SWIFT_SENDABLE;
24 // CHECK-LABEL: InterfaceDecl {{.*}} InTypeContext
25 // CHECK-NEXT: MethodDecl {{.*}} - test: 'id _Nullable':'id'
26 // CHECK-NEXT: ParmVarDecl {{.*}} obj 'SWIFT_SENDABLE id _Nullable':'id'
27 // CHECK-NEXT: SwiftAttrAttr {{.*}} "@Sendable"
29 @interface Generic<T: SWIFT_SENDABLE id>
32 // CHECK-LABEL: InterfaceDecl {{.*}} Generic
33 // CHECK-NEXT: TypeParamDecl {{.*}} T bounded 'SWIFT_SENDABLE id':'id'
35 typedef SWIFT_SENDABLE Generic<id> Alias;
37 // CHECK-LABEL: TypedefDecl {{.*}} Alias 'Generic<id>'
38 // CHECK-NEXT: ObjectType {{.*}} 'Generic<id>'
39 // CHECK-NEXT: SwiftAttrAttr {{.*}} "@Sendable"
46 // CHECK-LABEL: TypedefDecl {{.*}} SendableStruct 'struct SendableStruct':'SendableStruct'
47 // CHECK: SwiftAttrAttr {{.*}} "@Sendable"
49 @interface TestAttrPlacementInBlock1
50 -(void) withHandler: (void (SWIFT_SENDABLE ^)(id)) handler;
53 // CHECK-LABEL: ObjCInterfaceDecl {{.*}} TestAttrPlacementInBlock1
54 // CHECK: handler 'SWIFT_SENDABLE void (^)(id)':'void (^)(id)'
56 @interface TestAttrPlacementInBlock2
57 -(void) withHandler: (void (^ SWIFT_SENDABLE)(id)) handler;
60 // CHECK-LABEL: ObjCInterfaceDecl {{.*}} TestAttrPlacementInBlock2
61 // CHECK: handler 'SWIFT_SENDABLE void (^)(id)':'void (^)(id)'