• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 interface or protocol declarations}}
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 interface or protocol declarations}}
25
26- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
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