diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-16 16:16:04 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-16 16:16:04 +0000 |
| commit | 451b92ab6ab6148cbdfc057379aee13ac3a3b08d (patch) | |
| tree | bd444a867ae62b9ac0f5691e58211d58b95206df /clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m | |
| parent | f9ad21d22afa9a36c200138593993aa531422dd6 (diff) | |
| download | bcm5719-llvm-451b92ab6ab6148cbdfc057379aee13ac3a3b08d.tar.gz bcm5719-llvm-451b92ab6ab6148cbdfc057379aee13ac3a3b08d.zip | |
Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))
to be applied to class or protocols. This will direct IRGen
for Objective-C metadata to use the new name in various places
where class and protocol names are needed.
rdar:// 17631257
llvm-svn: 213167
Diffstat (limited to 'clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m')
| -rw-r--r-- | clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m b/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m new file mode 100644 index 00000000000..e9bef4cdb76 --- /dev/null +++ b/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// rdar://16462586 + +__attribute__((objc_runtime_name("MySecretNamespace.Protocol"))) +@protocol Protocol +@end + +__attribute__((objc_runtime_name("MySecretNamespace.Message"))) +@interface Message <Protocol> { +__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}} + id MyIVAR; +} +__attribute__((objc_runtime_name("MySecretNamespace.Message"))) +@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}} + +- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}} + +- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}} + +@end + +__attribute__((objc_runtime_name("MySecretNamespace.ForwardClass"))) +@class ForwardClass; // expected-error {{prefix attribute must be followed by an interface or protocol}} + +__attribute__((objc_runtime_name("MySecretNamespace.ForwardProtocol"))) +@protocol ForwardProtocol; + +__attribute__((objc_runtime_name("MySecretNamespace.Message"))) +@implementation Message // expected-error {{prefix attribute must be followed by an interface or protocol}} +__attribute__((objc_runtime_name("MySecretNamespace.Message"))) +- (id) MyMethod { + return MyIVAR; +} +@end |

