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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c++/] [parallel-1.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 735 jeremybenn
#include 
2
 
3
extern "C" void abort (void);
4
 
5
int
6
foo (void)
7
{
8
  return 10;
9
}
10
 
11
main ()
12
{
13
  int A = 0;
14
 
15
  #pragma omp parallel if (foo () > 10) shared (A)
16
    {
17
      A = omp_get_num_threads ();
18
    }
19
 
20
  if (A != 1)
21
    abort ();
22
 
23
  #pragma omp parallel if (foo () == 10) num_threads (3) shared (A)
24
    {
25
      A = omp_get_num_threads ();
26
    }
27
 
28
  if (A != 3)
29
    abort ();
30
 
31
  #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A)
32
    {
33
      A = omp_get_num_threads ();
34
    }
35
 
36
  if (A != 10)
37
    abort ();
38
 
39
  return 0;
40
}

powered by: WebSVN 2.1.0

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