62 lines · plain
1// RUN: %clang_cc1 -fblocks -ast-dump %s | FileCheck %s2 3__attribute__((swift_attr("@actor")))4@interface View5@end6 7// CHECK-LABEL: InterfaceDecl {{.*}} View8// CHECK-NEXT: SwiftAttrAttr {{.*}} "@actor"9 10#pragma clang attribute push(__attribute__((swift_attr("@sendable"))), apply_to=objc_interface)11@interface Contact12@end13#pragma clang attribute pop14 15// CHECK-LABEL: InterfaceDecl {{.*}} Contact16// CHECK-NEXT: SwiftAttrAttr {{.*}} "@sendable"17 18#define SWIFT_SENDABLE __attribute__((swift_attr("@Sendable")))19 20@interface InTypeContext21- (nullable id)test:(nullable SWIFT_SENDABLE id)obj SWIFT_SENDABLE;22@end23 24// CHECK-LABEL: InterfaceDecl {{.*}} InTypeContext25// CHECK-NEXT: MethodDecl {{.*}} - test: 'id _Nullable':'id'26// CHECK-NEXT: ParmVarDecl {{.*}} obj 'SWIFT_SENDABLE id _Nullable':'id'27// CHECK-NEXT: SwiftAttrAttr {{.*}} "@Sendable"28 29@interface Generic<T: SWIFT_SENDABLE id>30@end31 32// CHECK-LABEL: InterfaceDecl {{.*}} Generic33// CHECK-NEXT: TypeParamDecl {{.*}} T bounded 'SWIFT_SENDABLE id':'id'34 35typedef SWIFT_SENDABLE Generic<id> Alias;36 37// CHECK-LABEL: TypedefDecl {{.*}} Alias 'Generic<id>'38// CHECK-NEXT: ObjectType {{.*}} 'Generic<id>'39// CHECK-NEXT: SwiftAttrAttr {{.*}} "@Sendable"40 41SWIFT_SENDABLE42typedef struct {43 void *ptr;44} SendableStruct;45 46// CHECK-LABEL: TypedefDecl {{.*}} SendableStruct 'struct SendableStruct'47// CHECK: SwiftAttrAttr {{.*}} "@Sendable"48 49@interface TestAttrPlacementInBlock150-(void) withHandler: (void (SWIFT_SENDABLE ^)(id)) handler;51@end52 53// CHECK-LABEL: ObjCInterfaceDecl {{.*}} TestAttrPlacementInBlock154// CHECK: handler 'SWIFT_SENDABLE void (^)(id)':'void (^)(id)'55 56@interface TestAttrPlacementInBlock257-(void) withHandler: (void (^ SWIFT_SENDABLE)(id)) handler;58@end59 60// CHECK-LABEL: ObjCInterfaceDecl {{.*}} TestAttrPlacementInBlock261// CHECK: handler 'SWIFT_SENDABLE void (^)(id)':'void (^)(id)'62