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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [nestedfn-3.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
/* { dg-do run } */
2
 
3
#include <omp.h>
4
 
5
extern void abort (void);
6
 
7
int
8
main (void)
9
{
10
  int i = 5, l = 0;
11
  int foo (void) { return i == 6; }
12
  int bar (void) { return i - 3; }
13
 
14
  omp_set_dynamic (0);
15
 
16
#pragma omp parallel if (foo ()) num_threads (bar ()) reduction (|:l)
17
  if (omp_get_num_threads () != 1)
18
    l = 1;
19
 
20
  i++;
21
 
22
#pragma omp parallel if (foo ()) num_threads (bar ()) reduction (|:l)
23
  if (omp_get_num_threads () != 3)
24
    l = 1;
25
 
26
  i++;
27
 
28
#pragma omp master
29
  if (bar () != 4)
30
    abort ();
31
 
32
#pragma omp single
33
  {
34
    if (foo ())
35
      abort ();
36
    i--;
37
    if (! foo ())
38
      abort ();
39
  }
40
 
41
  if (l)
42
    abort ();
43
 
44
  i = 8;
45
#pragma omp atomic
46
  l += bar ();
47
 
48
  if (l != 5)
49
    abort ();
50
 
51
  return 0;
52
}

powered by: WebSVN 2.1.0

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