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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [sync-2.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Make sure that @synchronized parses and a very basic test runs.  */
2
/* { dg-options "-fobjc-exceptions -fgnu-runtime" } */
3
 
4
#include "../objc-obj-c++-shared/TestsuiteObject.h"
5
 
6
int main (void)
7
{
8
  TestsuiteObject *a = [TestsuiteObject new];
9
  TestsuiteObject *b = [TestsuiteObject new];
10
  TestsuiteObject *c = [TestsuiteObject new];
11
 
12
  /* This single-threaded test just checks that @synchronized() uses a
13
     recursive mutex, and that the runtime at least doesn't crash
14
     immediately upon finding it.
15
  */
16
  @synchronized (a)
17
    {
18
      @synchronized (a)
19
        {
20
          @synchronized (b)
21
            {
22
              @synchronized (b)
23
                {
24
                  @synchronized (c)
25
                    {
26
                      @synchronized (c)
27
                        {
28
                          return 0;
29
                        }
30
                    }
31
                }
32
            }
33
        }
34
    }
35
}

powered by: WebSVN 2.1.0

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