]>
Commit | Line | Data |
---|---|---|
1c732eb7 NP |
1 | /* Test that Objective-C exceptions cause an error with -fobjc-exceptions. */ |
2 | /* { dg-do compile } */ | |
3 | ||
4 | @class Object; | |
5 | ||
6 | int dummy (int number, Object *o) | |
7 | { | |
5287cfd5 | 8 | @try { /* { dg-error ".-fobjc-exceptions. is required to enable Objective-C exception syntax" } */ |
1c732eb7 | 9 | number++; |
46270f14 | 10 | @throw o; /* Nothing, error has already been produced. */ |
1c732eb7 NP |
11 | } |
12 | @catch (id object) | |
13 | { | |
14 | number++; | |
46270f14 | 15 | @throw; /* Nothing, error has already been produced. */ |
1c732eb7 NP |
16 | } |
17 | @finally | |
18 | { | |
19 | number++; | |
20 | } | |
21 | ||
46270f14 | 22 | @synchronized (o) /* Nothing, error has already been produced. */ |
1c732eb7 NP |
23 | { |
24 | number++; | |
25 | } | |
26 | ||
27 | return number; | |
28 | } |