summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/objc-asm-attribute-neg-test.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/objc-asm-attribute-neg-test.m')
-rw-r--r--test/SemaObjC/objc-asm-attribute-neg-test.m20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/SemaObjC/objc-asm-attribute-neg-test.m b/test/SemaObjC/objc-asm-attribute-neg-test.m
index 98f39fb900..9941189357 100644
--- a/test/SemaObjC/objc-asm-attribute-neg-test.m
+++ b/test/SemaObjC/objc-asm-attribute-neg-test.m
@@ -19,7 +19,7 @@ __attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-erro
id MyIVAR;
}
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
-@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}}
+@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}}}
- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
@@ -28,15 +28,23 @@ __attribute__((objc_runtime_name("MySecretNamespace.Message")))
@end
__attribute__((objc_runtime_name("MySecretNamespace.ForwardClass")))
-@class ForwardClass; // expected-error {{prefix attribute must be followed by an interface or protocol}}
+@class ForwardClass; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}
__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 {
+@implementation Message
+// expected-error@+1 {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
+- (id) MyMethod __attribute__((objc_runtime_name("MySecretNamespace.Message"))) {
return MyIVAR;
}
+
+-(int)getMyProperty { return 0; }
+-(void)setMyProperty:(int)arg {}
@end
+
+@interface NoImpl @end
+
+// expected-error@+1 {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
+__attribute__((objc_runtime_name("MySecretNamespace.Message")))
+@implementation NoImpl @end