1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 __attribute__((objc_runtime_name)) // expected-error {{'objc_runtime_name' attribute takes one argument}}
7 __attribute__((objc_runtime_name(123))) // expected-error {{expected string literal as argument of 'objc_runtime_name' attribute}}
11 __attribute__((objc_runtime_name("MySecretNamespace.Protocol")))
15 __attribute__((objc_runtime_name("MySecretNamespace.Message")))
16 @interface Message <Protocol> {
17 __attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
20 __attribute__((objc_runtime_name("MySecretNamespace.Message")))
21 @property int MyProperty; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}}}
23 - (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
25 - (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
29 __attribute__((objc_runtime_name("MySecretNamespace.ForwardClass")))
30 @class ForwardClass; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}
32 __attribute__((objc_runtime_name("MySecretNamespace.ForwardProtocol")))
33 @protocol ForwardProtocol;
35 @implementation Message
36 // expected-error@+1 {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
37 - (id) MyMethod __attribute__((objc_runtime_name("MySecretNamespace.Message"))) {
41 -(int)getMyProperty { return 0; }
42 -(void)setMyProperty:(int)arg {}
45 @interface NoImpl @end
47 // expected-error@+1 {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
48 __attribute__((objc_runtime_name("MySecretNamespace.Message")))
49 @implementation NoImpl @end