blob: b1e1cd191c6aec47fb7652d21b336d6dff90d1ad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* Test for graceful compilation of @synchronized statements. */
/* { dg-do compile } */
/* { dg-options "-fobjc-exceptions" } */
#include <objc/Object.h>
@interface Derived: Object
- (id) meth;
@end
@implementation Derived
- (id) meth {
return self;
}
static Derived* rewriteDict(void) {
static Derived *sDict = 0;
if (sDict == 0) {
@synchronized ([Derived class]) {
if (sDict == 0)
sDict = [Derived new];
}
}
return sDict;
}
@end
|