1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
2 | // rdar://16462586 |
3 | |
4 | __attribute__((objc_runtime_name)) // expected-error {{'objc_runtime_name' attribute takes one argument}} |
5 | @interface BInterface |
6 | @end |
7 | |
8 | __attribute__((objc_runtime_name(123))) // expected-error {{'objc_runtime_name' attribute requires a string}} |
9 | @protocol BProtocol1 |
10 | @end |
11 | |
12 | __attribute__((objc_runtime_name("MySecretNamespace.Protocol"))) |
13 | @protocol Protocol |
14 | @end |
15 | |
16 | __attribute__((objc_runtime_name("MySecretNamespace.Message"))) |
17 | @interface Message <Protocol> { |
18 | __attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}} |
19 | id MyIVAR; |
20 | } |
21 | __attribute__((objc_runtime_name("MySecretNamespace.Message"))) |
22 | @property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}} |
23 | |
24 | - (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}} |
25 | |
26 | - (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}} |
27 | |
28 | @end |
29 | |
30 | __attribute__((objc_runtime_name("MySecretNamespace.ForwardClass"))) |
31 | @class ForwardClass; // expected-error {{prefix attribute must be followed by an interface or protocol}} |
32 | |
33 | __attribute__((objc_runtime_name("MySecretNamespace.ForwardProtocol"))) |
34 | @protocol ForwardProtocol; |
35 | |
36 | __attribute__((objc_runtime_name("MySecretNamespace.Message"))) |
37 | @implementation Message // expected-error {{prefix attribute must be followed by an interface or protocol}} |
38 | __attribute__((objc_runtime_name("MySecretNamespace.Message"))) |
39 | - (id) MyMethod { |
40 | return MyIVAR; |
41 | } |
42 | @end |
43 | |