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/] [private-1.c] - Blame information for rev 300

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 a = 18;
4
 
5
void
6
f1 (int i, int j, int k)
7
{
8
  int l = 6, m = 7, n = 8;
9
#pragma omp parallel private(j, m) shared(k, n) firstprivate(i, l) \
10
            num_threads(1)
11
  {
12
    j = 6;
13
    m = 5;
14
    if (++a != 19 || ++i != 9 || j != 6 || ++l != 7 || m != 5 || ++n != 9)
15
      #pragma omp atomic
16
        k++;
17
  }
18
  if (a != 19 || i != 8 || j != 26 || k != 0 || l != 6 || m != 7 || n != 9)
19
    abort ();
20
}
21
 
22
int v1 = 1, v2 = 2, v5 = 5;
23
int err;
24
 
25
void
26
f2 (void)
27
{
28
  int v3 = 3;
29
#pragma omp sections private (v1) firstprivate (v2)
30
  {
31
  #pragma omp section
32
    {
33
      int v4 = 4;
34
      v1 = 7;
35
      #pragma omp parallel num_threads(1) firstprivate(v1, v2, v3, v4)
36
        {
37
          if (++v1 != 8 || ++v2 != 3 || ++v3 != 4 || ++v4 != 5 || ++v5 != 6)
38
            err = 1;
39
        }
40
      if (v1 != 7 || v2 != 2 || v3 != 3 || v4 != 4 || v5 != 6)
41
        abort ();
42
      if (err)
43
        abort ();
44
    }
45
  }
46
}
47
 
48
int
49
main (void)
50
{
51
  f1 (8, 26, 0);
52
  f2 ();
53
  return 0;
54
}

powered by: WebSVN 2.1.0

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