summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/objc-gc-attr.m
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-08-24 16:33:25 +0000
committerAnders Carlsson <andersca@mac.com>2008-08-24 16:33:25 +0000
commitc7c20702b1e31c2d80e8a4855fddfb8628cba039 (patch)
treee2f8dd2f3cd9609e3918257462ed38079f1ba8fc /clang/test/SemaObjC/objc-gc-attr.m
parentbf667e23d113319bc2161879a0f588ba6509105c (diff)
downloadbcm5719-llvm-c7c20702b1e31c2d80e8a4855fddfb8628cba039.tar.gz
bcm5719-llvm-c7c20702b1e31c2d80e8a4855fddfb8628cba039.zip
Fix silly bug in objc_gc attribute parsing and add test case
llvm-svn: 55286
Diffstat (limited to 'clang/test/SemaObjC/objc-gc-attr.m')
-rw-r--r--clang/test/SemaObjC/objc-gc-attr.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/objc-gc-attr.m b/clang/test/SemaObjC/objc-gc-attr.m
new file mode 100644
index 00000000000..1f2db346a1b
--- /dev/null
+++ b/clang/test/SemaObjC/objc-gc-attr.m
@@ -0,0 +1,8 @@
+// RUN: clang -fsyntax-only -verify %s
+static id __attribute((objc_gc(weak))) a;
+static id __attribute((objc_gc(strong))) b;
+
+static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
+static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
+static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute requires 1 argument(s)}}
+static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}}
OpenPOWER on IntegriCloud