aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-19 18:39:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-19 18:39:17 +0000
commit2e8f00c8d632b6cd7c73f9103ea74c4d90c7bf23 (patch)
tree812898169a754be99cadc40829868bd3d6a3973e
parentdd0cb9097ff4a9c88cb6a3cd377245ecb260c120 (diff)
objective-c test case for __attribute__((unused)) on method arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93887 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaObjC/method-unused-attribute.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaObjC/method-unused-attribute.m b/test/SemaObjC/method-unused-attribute.m
new file mode 100644
index 0000000000..a4e53210c2
--- /dev/null
+++ b/test/SemaObjC/method-unused-attribute.m
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-parameter -verify %s
+
+@interface INTF
+- (void) correct_use_of_unused: (void *) notice : (id)another_arg;
+- (void) will_warn_unused_arg: (void *) notice : (id)warn_unused;
+- (void) unused_attr_on_decl_ignored: (void *) __attribute__((unused)) will_warn;
+@end
+
+@implementation INTF
+- (void) correct_use_of_unused: (void *) __attribute__((unused)) notice : (id) __attribute__((unused)) newarg{
+}
+- (void) will_warn_unused_arg: (void *) __attribute__((unused)) notice : (id)warn_unused {} // expected-warning {{unused parameter 'warn_unused'}}
+- (void) unused_attr_on_decl_ignored: (void *) will_warn{} // expected-warning {{unused parameter 'will_warn'}}
+@end
+