annotate clang/test/SemaObjC/class-stub-attr.m @ 180:680fa57a2f20

fix compile errors.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 30 May 2020 17:44:06 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang -target x86_64-apple-darwin -fsyntax-only -Xclang -verify %s
anatofuz
parents:
diff changeset
2 // RUN: %clang -target x86_64-apple-darwin -x objective-c++ -fsyntax-only -Xclang -verify %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @interface NSObject
anatofuz
parents:
diff changeset
5 @end
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 __attribute__((objc_class_stub))
anatofuz
parents:
diff changeset
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}}
anatofuz
parents:
diff changeset
9 @end
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 __attribute__((objc_class_stub))
anatofuz
parents:
diff changeset
12 __attribute__((objc_subclassing_restricted))
anatofuz
parents:
diff changeset
13 @interface ValidClassStubAttribute : NSObject
anatofuz
parents:
diff changeset
14 @end
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 @implementation ValidClassStubAttribute // expected-error {{cannot declare implementation of a class declared with the 'objc_class_stub' attribute}}
anatofuz
parents:
diff changeset
17 @end
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 @implementation ValidClassStubAttribute (MyCategory)
anatofuz
parents:
diff changeset
20 @end
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 __attribute__((objc_class_stub(123))) // expected-error {{'objc_class_stub' attribute takes no arguments}}
anatofuz
parents:
diff changeset
23 @interface InvalidClassStubAttribute : NSObject
anatofuz
parents:
diff changeset
24 @end
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 __attribute__((objc_class_stub)) // expected-error {{'objc_class_stub' attribute only applies to Objective-C interfaces}}
anatofuz
parents:
diff changeset
27 int cannotHaveObjCClassStubAttribute() {}