blob: 98f39fb90013f5b4b7086e4561de3b01e39bbf73 [file] [log] [blame]
Fariborz Jahaniana2e5deb2014-07-16 19:44:34 +00001// 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> {
Aaron Ballmanadf66b62017-11-26 20:01:12 +000018__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
Fariborz Jahaniana2e5deb2014-07-16 19:44:34 +000019 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
Aaron Ballmanadf66b62017-11-26 20:01:12 +000024- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
Fariborz Jahaniana2e5deb2014-07-16 19:44:34 +000025
Aaron Ballmanadf66b62017-11-26 20:01:12 +000026- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
Fariborz Jahaniana2e5deb2014-07-16 19:44:34 +000027
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