summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/objc-gc-attr.m
diff options
context:
space:
mode:
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