OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [try-catch-7.m] - Blame information for rev 754

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Test for graceful compilation of @synchronized statements.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-fobjc-exceptions" } */
5
 
6
#include "../objc-obj-c++-shared/TestsuiteObject.h"
7
 
8
@interface Derived: TestsuiteObject
9
- (id) meth;
10
@end
11
 
12
@implementation Derived
13
- (id) meth {
14
  return self;
15
}
16
 
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;
26
}
27
@end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.