Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / objc.dg / try-catch-7.m
blobb1e1cd191c6aec47fb7652d21b336d6dff90d1ad
1 /* Test for graceful compilation of @synchronized statements.  */
3 /* { dg-do compile } */
4 /* { dg-options "-fobjc-exceptions" } */
6 #include <objc/Object.h>
8 @interface Derived: Object
9 - (id) meth;
10 @end
12 @implementation Derived
13 - (id) meth {
14   return self;
17 static Derived* rewriteDict(void) {
18   static Derived *sDict = 0;
19   if (sDict == 0) {
20     @synchronized ([Derived class]) {
21       if (sDict == 0)
22         sDict = [Derived new];
23     }
24   } 
25   return sDict;
27 @end