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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [task-2.c] - Blame information for rev 320

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

Line No. Rev Author Line
1 273 jeremybenn
extern void abort (void);
2
 
3
int
4
f1 (void)
5
{
6
  int a = 6, e = 0;
7
  int nested (int x)
8
  {
9
    return x + a;
10
  }
11
  #pragma omp task
12
  {
13
    int n = nested (5);
14
    if (n != 11)
15
      #pragma omp atomic
16
        e += 1;
17
  }
18
  #pragma omp taskwait
19
  return e;
20
}
21
 
22
int
23
f2 (void)
24
{
25
  int a = 6, e = 0;
26
  int nested (int x)
27
  {
28
    return x + a;
29
  }
30
  a = nested (4);
31
  #pragma omp task
32
  {
33
    if (a != 10)
34
      #pragma omp atomic
35
        e += 1;
36
  }
37
  #pragma omp taskwait
38
  return e;
39
}
40
 
41
int
42
main (void)
43
{
44
  int e = 0;
45
  #pragma omp parallel num_threads(4) reduction(+:e)
46
  {
47
    e += f1 ();
48
    e += f2 ();
49
  }
50
  if (e)
51
    abort ();
52
  return 0;
53
}

powered by: WebSVN 2.1.0

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