| 1 |
/* Contributed by Nicola Pero <[email protected]>, February 2011. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-additional-options "-Wno-objc-root-class" } */ |
| 4 |
|
| 5 |
/* Test that the 'objc_exception' attribute is accepted for |
| 6 |
@interfaces, but not for anything else. */ |
| 7 |
|
| 8 |
#include <objc/objc.h> |
| 9 |
|
| 10 |
/* Fine. */ |
| 11 |
__attribute__ ((objc_exception)) |
| 12 |
@interface MyClass |
| 13 |
{ |
| 14 |
Class isa; |
| 15 |
} |
| 16 |
@end |
| 17 |
|
| 18 |
/* Fine. */ |
| 19 |
__attribute__ ((__objc_exception__)) |
| 20 |
@interface MyClass2 |
| 21 |
{ |
| 22 |
Class isa; |
| 23 |
} |
| 24 |
@end |
| 25 |
|
| 26 |
__attribute__ ((objc_exception)) |
| 27 |
@protocol MyProtocol; /* { dg-warning "ignored" } */ |
| 28 |
|
| 29 |
__attribute__ ((objc_exception)) |
| 30 |
int myVariable; /* { dg-warning "ignored" } */ |
| 31 |
|
| 32 |
__attribute__ ((objc_exception)) |
| 33 |
int myFunction (int argument); /* { dg-warning "ignored" } */ |