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/] [pr39154.c] - Blame information for rev 308

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

Line No. Rev Author Line
1 273 jeremybenn
/* PR middle-end/39154 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -std=gnu99" } */
4
 
5
extern void abort (void);
6
 
7
int n = 20;
8
 
9
int
10
main (void)
11
{
12
  int a[n], b[n][n];
13
 
14
#pragma omp parallel for
15
    for (int i = 0; i < n; i++)
16
      {
17
        a[i] = i + 1;
18
#pragma omp parallel for
19
        for (int j = 0; j < n; j++)
20
          b[i][j] = a[i];
21
      }
22
 
23
  for (int i = 0; i < n; i++)
24
    {
25
      for (int j = 0; j < n; j++)
26
        if (b[i][j] != i + 1)
27
          abort ();
28
      if (a[i] != i + 1)
29
        abort ();
30
    }
31
 
32
#pragma omp parallel for shared (n, a, b)
33
    for (int i = 0; i < n; i++)
34
      {
35
        a[i] = i + 3;
36
#pragma omp parallel for
37
        for (int j = 0; j < n; j++)
38
          b[i][j] = a[i];
39
      }
40
 
41
  for (int i = 0; i < n; i++)
42
    {
43
      for (int j = 0; j < n; j++)
44
        if (b[i][j] != i + 3)
45
          abort ();
46
      if (a[i] != i + 3)
47
        abort ();
48
    }
49
 
50
#pragma omp parallel for
51
    for (int i = 0; i < n; i++)
52
      {
53
        a[i] = i + 5;
54
#pragma omp parallel for shared (n, a, b)
55
        for (int j = 0; j < n; j++)
56
          b[i][j] = a[i];
57
      }
58
 
59
  for (int i = 0; i < n; i++)
60
    {
61
      for (int j = 0; j < n; j++)
62
        if (b[i][j] != i + 5)
63
          abort ();
64
      if (a[i] != i + 5)
65
        abort ();
66
    }
67
 
68
#pragma omp parallel for shared (n, a, b)
69
    for (int i = 0; i < n; i++)
70
      {
71
        a[i] = i + 7;
72
#pragma omp parallel for shared (n, a, b)
73
        for (int j = 0; j < n; j++)
74
          b[i][j] = a[i];
75
      }
76
 
77
  for (int i = 0; i < n; i++)
78
    {
79
      for (int j = 0; j < n; j++)
80
        if (b[i][j] != i + 7)
81
          abort ();
82
      if (a[i] != i + 7)
83
        abort ();
84
    }
85
 
86
#pragma omp parallel for private (a, b)
87
    for (int i = 0; i < n; i++)
88
      {
89
        a[i] = i + 1;
90
#pragma omp parallel for
91
        for (int j = 0; j < n; j++)
92
          b[i][j] = a[i];
93
      }
94
 
95
#pragma omp parallel for private (a, b)
96
    for (int i = 0; i < n; i++)
97
      {
98
        a[i] = i + 1;
99
#pragma omp parallel for private (b)
100
        for (int j = 0; j < n; j++)
101
          b[i][j] = a[i];
102
      }
103
 
104
  return 0;
105
}

powered by: WebSVN 2.1.0

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