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

Subversion Repositories openrisc

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

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
#pragma omp parallel reduction (+:l) num_threads (1)
11
  {
12
    if (omp_test_nest_lock (&lock) != 1)
13
      l++;
14
    if (omp_test_nest_lock (&lock) != 2)
15
      l++;
16
  #pragma omp task if (0) shared (lock, l)
17
    {
18
      if (omp_test_nest_lock (&lock) != 0)
19
        l++;
20
    }
21
  #pragma omp taskwait
22
    if (omp_test_nest_lock (&lock) != 3)
23
      l++;
24
    omp_unset_nest_lock (&lock);
25
    omp_unset_nest_lock (&lock);
26
    omp_unset_nest_lock (&lock);
27
  }
28
  if (l)
29
    abort ();
30
  omp_destroy_nest_lock (&lock);
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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