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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [lock-1.c] - Blame information for rev 810

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

Line No. Rev Author Line
1 735 jeremybenn
#include <omp.h>
2
#include <stdlib.h>
3
 
4
int
5
main (void)
6
{
7
  int l = 0;
8
  omp_nest_lock_t lock;
9
  omp_init_nest_lock (&lock);
10
  if (omp_test_nest_lock (&lock) != 1)
11
    abort ();
12
  if (omp_test_nest_lock (&lock) != 2)
13
    abort ();
14
#pragma omp parallel if (0) reduction (+:l)
15
  {
16
    /* In OpenMP 2.5 this was supposed to return 3,
17
       but in OpenMP 3.0 the parallel region has a different
18
       task and omp_*_lock_t are owned by tasks, not by threads.  */
19
    if (omp_test_nest_lock (&lock) != 0)
20
      l++;
21
  }
22
  if (l)
23
    abort ();
24
  if (omp_test_nest_lock (&lock) != 3)
25
    abort ();
26
  omp_unset_nest_lock (&lock);
27
  omp_unset_nest_lock (&lock);
28
  omp_unset_nest_lock (&lock);
29
  omp_destroy_nest_lock (&lock);
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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