From 41aea0093e7f44d47ccc24f92190d44b58fc7fb1 Mon Sep 17 00:00:00 2001 From: nicola Date: Wed, 23 Feb 2011 10:57:59 +0000 Subject: Removed conflict in usage of TYPE_LANG_SLOT_0 between Objective-C and C git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170436 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../objc.dg/attributes/objc-exception-1.m | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 gcc/testsuite/objc.dg/attributes/objc-exception-1.m (limited to 'gcc/testsuite/objc.dg') diff --git a/gcc/testsuite/objc.dg/attributes/objc-exception-1.m b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m new file mode 100644 index 00000000000..e7f6f856f8f --- /dev/null +++ b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m @@ -0,0 +1,32 @@ +/* Contributed by Nicola Pero , February 2011. */ +/* { dg-do compile } */ + +/* Test that the 'objc_exception' attribute is accepted for + @interfaces, but not for anything else. */ + +#include + +/* Fine. */ +__attribute__ ((objc_exception)) +@interface MyClass +{ + Class isa; +} +@end + +/* Fine. */ +__attribute__ ((__objc_exception__)) +@interface MyClass2 +{ + Class isa; +} +@end + +__attribute__ ((objc_exception)) +@protocol MyProtocol; /* { dg-warning "ignored" } */ + +__attribute__ ((objc_exception)) +int myVariable; /* { dg-warning "ignored" } */ + +__attribute__ ((objc_exception)) +int myFunction (int argument); /* { dg-warning "ignored" } */ -- cgit v1.2.1