summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-11-05 23:58:55 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-11-05 23:58:55 +0000
commit5a29e6aadb0eba1523f7f6ba36260bab3bb0616c (patch)
tree19e0994201d68040fe8bcca68c541b7388b567b7 /clang/test/SemaObjC
parent81eed943a36c6fc7fec245e32105a24790652133 (diff)
downloadbcm5719-llvm-5a29e6aadb0eba1523f7f6ba36260bab3bb0616c.tar.gz
bcm5719-llvm-5a29e6aadb0eba1523f7f6ba36260bab3bb0616c.zip
Patch for small addition to availability attribute.
This is to accept "NA" in place of vesion number for availability attribute. Used on introduced=NA to mean unavailable and deprecated=NA to mean nothing (not deprecated). rdar://18804883 llvm-svn: 221417
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/attr-availability-1.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/attr-availability-1.m b/clang/test/SemaObjC/attr-availability-1.m
index af0fcfe3537..063407adaee 100644
--- a/clang/test/SemaObjC/attr-availability-1.m
+++ b/clang/test/SemaObjC/attr-availability-1.m
@@ -95,3 +95,22 @@ id NSNibOwner, topNibObjects;
- (void)Meth1 __attribute__((availability(macosx,introduced=10.3_0))); // expected-warning {{use same version number separators '_' or '.'}}
- (void)Meth2 __attribute__((availability(macosx,introduced=10_3.1))); // expected-warning {{use same version number separators '_' or '.'}}
@end
+
+// rdar://18804883
+@protocol P18804883
+- (void)proto_method __attribute__((availability(macosx,introduced=10_1,deprecated=NA))); // means nothing (not deprecated)
+@end
+
+@interface A18804883 <P18804883>
+- (void)interface_method __attribute__((availability(macosx,introduced=NA))); // expected-note {{'interface_method' has been explicitly marked unavailable here}}
+- (void)strange_method __attribute__((availability(macosx,introduced=NA,deprecated=NA))); // expected-note {{'strange_method' has been explicitly marked unavailable here}}
+- (void) always_available __attribute__((availability(macosx,deprecated=NA)));
+@end
+
+void foo (A18804883* pa) {
+ [pa interface_method]; // expected-error {{'interface_method' is unavailable: not available on OS X}}
+ [pa proto_method];
+ [pa strange_method]; // expected-error {{'strange_method' is unavailable: not available on OS X}}
+ [pa always_available];
+}
+
OpenPOWER on IntegriCloud