diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-23 10:57:59 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-23 10:57:59 +0000 |
commit | 41aea0093e7f44d47ccc24f92190d44b58fc7fb1 (patch) | |
tree | 00d37a8caa57c4cada7e20a68cfc6490ccfee7c6 /gcc/testsuite/objc.dg | |
parent | 58979379f80aec77c2ee664b9d4a1b2f9bc49d49 (diff) | |
download | gcc-41aea0093e7f44d47ccc24f92190d44b58fc7fb1.tar.gz |
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
Diffstat (limited to 'gcc/testsuite/objc.dg')
-rw-r--r-- | gcc/testsuite/objc.dg/attributes/objc-exception-1.m | 32 |
1 files changed, 32 insertions, 0 deletions
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 <nicola.pero@meta-innovation.com>, February 2011. */ +/* { dg-do compile } */ + +/* Test that the 'objc_exception' attribute is accepted for + @interfaces, but not for anything else. */ + +#include <objc/objc.h> + +/* 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" } */ |