28 lines · plain
1// RUN: %clang -target x86_64-apple-darwin -fsyntax-only -Xclang -verify %s2// RUN: %clang -target x86_64-apple-darwin -x objective-c++ -fsyntax-only -Xclang -verify %s3 4@interface NSObject5@end6 7__attribute__((objc_class_stub))8@interface MissingSubclassingRestrictedAttribute : NSObject // expected-error {{'objc_class_stub' attribute cannot be specified on a class that does not have the 'objc_subclassing_restricted' attribute}}9@end10 11__attribute__((objc_class_stub))12__attribute__((objc_subclassing_restricted))13@interface ValidClassStubAttribute : NSObject14@end15 16@implementation ValidClassStubAttribute // expected-error {{cannot declare implementation of a class declared with the 'objc_class_stub' attribute}}17@end18 19@implementation ValidClassStubAttribute (MyCategory)20@end21 22__attribute__((objc_class_stub(123))) // expected-error {{'objc_class_stub' attribute takes no arguments}}23@interface InvalidClassStubAttribute : NSObject24@end25 26__attribute__((objc_class_stub)) // expected-error {{'objc_class_stub' attribute only applies to Objective-C interfaces}}27int cannotHaveObjCClassStubAttribute(void) {}28