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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [pr29947-1.c] - Blame information for rev 861

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

Line No. Rev Author Line
1 273 jeremybenn
/* PR libgomp/29947 */
2
 
3
/* { dg-do run } */
4
 
5
extern void abort (void);
6
 
7
int cnt;
8
 
9
void
10
test1 (long j1, long k1, long j2, long k2)
11
{
12
  long i, e = 0, c = 0;
13
#pragma omp parallel reduction (+:e,c)
14
  {
15
#pragma omp for schedule (dynamic)
16
    for (i = j1; i <= k1; ++i)
17
      {
18
        if (i < j2 || i > k2)
19
          ++e;
20
        ++c;
21
      }
22
#pragma omp atomic
23
    ++cnt;
24
  }
25
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
26
    abort ();
27
}
28
 
29
void
30
test2 (long j1, long k1, long j2, long k2)
31
{
32
  long i, e = 0, c = 0;
33
#pragma omp parallel reduction (+:e,c)
34
  {
35
#pragma omp for schedule (dynamic)
36
    for (i = k1; i >= j1; --i)
37
      {
38
        if (i < j2 || i > k2)
39
          ++e;
40
        ++c;
41
      }
42
#pragma omp atomic
43
    ++cnt;
44
  }
45
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
46
    abort ();
47
}
48
 
49
void
50
test3 (long j1, long k1, long j2, long k2)
51
{
52
  long i, e = 0, c = 0;
53
#pragma omp parallel reduction (+:e,c)
54
  {
55
#pragma omp for schedule (guided)
56
    for (i = j1; i <= k1; ++i)
57
      {
58
        if (i < j2 || i > k2)
59
          ++e;
60
        ++c;
61
      }
62
#pragma omp atomic
63
    ++cnt;
64
  }
65
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
66
    abort ();
67
}
68
 
69
void
70
test4 (long j1, long k1, long j2, long k2)
71
{
72
  long i, e = 0, c = 0;
73
#pragma omp parallel reduction (+:e,c)
74
  {
75
#pragma omp for schedule (guided)
76
    for (i = k1; i >= j1; --i)
77
      {
78
        if (i < j2 || i > k2)
79
          ++e;
80
        ++c;
81
      }
82
#pragma omp atomic
83
    ++cnt;
84
  }
85
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
86
    abort ();
87
}
88
 
89
void
90
test5 (long j1, long k1, long j2, long k2)
91
{
92
  long i, e = 0, c = 0;
93
#pragma omp parallel reduction (+:e,c)
94
  {
95
#pragma omp for schedule (dynamic) ordered
96
    for (i = j1; i <= k1; ++i)
97
      {
98
        if (i < j2 || i > k2)
99
          ++e;
100
#pragma omp ordered
101
        ++c;
102
      }
103
#pragma omp atomic
104
    ++cnt;
105
  }
106
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
107
    abort ();
108
}
109
 
110
void
111
test6 (long j1, long k1, long j2, long k2)
112
{
113
  long i, e = 0, c = 0;
114
#pragma omp parallel reduction (+:e,c)
115
  {
116
#pragma omp for schedule (dynamic) ordered
117
    for (i = k1; i >= j1; --i)
118
      {
119
        if (i < j2 || i > k2)
120
          ++e;
121
#pragma omp ordered
122
        ++c;
123
      }
124
#pragma omp atomic
125
    ++cnt;
126
  }
127
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
128
    abort ();
129
}
130
 
131
void
132
test7 (long j1, long k1, long j2, long k2)
133
{
134
  long i, e = 0, c = 0;
135
#pragma omp parallel reduction (+:e,c)
136
  {
137
#pragma omp for schedule (guided) ordered
138
    for (i = j1; i <= k1; ++i)
139
      {
140
        if (i < j2 || i > k2)
141
          ++e;
142
#pragma omp ordered
143
        ++c;
144
      }
145
#pragma omp atomic
146
    ++cnt;
147
  }
148
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
149
    abort ();
150
}
151
 
152
void
153
test8 (long j1, long k1, long j2, long k2)
154
{
155
  long i, e = 0, c = 0;
156
#pragma omp parallel reduction (+:e,c)
157
  {
158
#pragma omp for schedule (guided) ordered
159
    for (i = k1; i >= j1; --i)
160
      {
161
        if (i < j2 || i > k2)
162
          ++e;
163
#pragma omp ordered
164
        ++c;
165
      }
166
#pragma omp atomic
167
    ++cnt;
168
  }
169
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
170
    abort ();
171
}
172
 
173
void
174
test9 (long j1, long k1, long j2, long k2)
175
{
176
  long i, e = 0, c = 0;
177
#pragma omp parallel for reduction (+:e,c) schedule (dynamic)
178
  for (i = j1; i <= k1; ++i)
179
    {
180
      if (i < j2 || i > k2)
181
        ++e;
182
      ++c;
183
    }
184
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
185
    abort ();
186
}
187
 
188
void
189
test10 (long j1, long k1, long j2, long k2)
190
{
191
  long i, e = 0, c = 0;
192
#pragma omp parallel for reduction (+:e,c) schedule (dynamic)
193
  for (i = k1; i >= j1; --i)
194
    {
195
      if (i < j2 || i > k2)
196
        ++e;
197
      ++c;
198
    }
199
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
200
    abort ();
201
}
202
 
203
void
204
test11 (long j1, long k1, long j2, long k2)
205
{
206
  long i, e = 0, c = 0;
207
#pragma omp parallel for reduction (+:e,c) schedule (guided)
208
  for (i = j1; i <= k1; ++i)
209
    {
210
      if (i < j2 || i > k2)
211
        ++e;
212
      ++c;
213
    }
214
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
215
    abort ();
216
}
217
 
218
void
219
test12 (long j1, long k1, long j2, long k2)
220
{
221
  long i, e = 0, c = 0;
222
#pragma omp parallel for reduction (+:e,c) schedule (guided)
223
  for (i = k1; i >= j1; --i)
224
    {
225
      if (i < j2 || i > k2)
226
        ++e;
227
      ++c;
228
    }
229
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
230
    abort ();
231
}
232
 
233
void
234
test13 (long j1, long k1, long j2, long k2)
235
{
236
  long i, e = 0, c = 0;
237
#pragma omp parallel for reduction (+:e,c) schedule (dynamic) ordered
238
  for (i = j1; i <= k1; ++i)
239
    {
240
      if (i < j2 || i > k2)
241
        ++e;
242
#pragma omp ordered
243
      ++c;
244
    }
245
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
246
    abort ();
247
}
248
 
249
void
250
test14 (long j1, long k1, long j2, long k2)
251
{
252
  long i, e = 0, c = 0;
253
#pragma omp parallel for reduction (+:e,c) schedule (dynamic) ordered
254
  for (i = k1; i >= j1; --i)
255
    {
256
      if (i < j2 || i > k2)
257
        ++e;
258
#pragma omp ordered
259
      ++c;
260
    }
261
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
262
    abort ();
263
}
264
 
265
void
266
test15 (long j1, long k1, long j2, long k2)
267
{
268
  long i, e = 0, c = 0;
269
#pragma omp parallel for reduction (+:e,c) schedule (guided) ordered
270
  for (i = j1; i <= k1; ++i)
271
    {
272
      if (i < j2 || i > k2)
273
        ++e;
274
#pragma omp ordered
275
      ++c;
276
    }
277
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
278
    abort ();
279
}
280
 
281
void
282
test16 (long j1, long k1, long j2, long k2)
283
{
284
  long i, e = 0, c = 0;
285
#pragma omp parallel for reduction (+:e,c) schedule (guided) ordered
286
  for (i = k1; i >= j1; --i)
287
    {
288
      if (i < j2 || i > k2)
289
        ++e;
290
#pragma omp ordered
291
      ++c;
292
    }
293
  if (e || (c != j2 > k2 ? 0 : k2 - j2 + 1))
294
    abort ();
295
}
296
 
297
int
298
__attribute__((noinline))
299
test (long j1, long k1, long j2, long k2)
300
{
301
  test1 (j1, k1, j2, k2);
302
  test2 (j1, k1, j2, k2);
303
  test3 (j1, k1, j2, k2);
304
  test4 (j1, k1, j2, k2);
305
  test5 (j1, k1, j2, k2);
306
  test6 (j1, k1, j2, k2);
307
  test7 (j1, k1, j2, k2);
308
  test8 (j1, k1, j2, k2);
309
  test9 (j1, k1, j2, k2);
310
  test10 (j1, k1, j2, k2);
311
  test11 (j1, k1, j2, k2);
312
  test12 (j1, k1, j2, k2);
313
  test13 (j1, k1, j2, k2);
314
  test14 (j1, k1, j2, k2);
315
  test15 (j1, k1, j2, k2);
316
  test16 (j1, k1, j2, k2);
317
  return cnt;
318
}
319
 
320
int
321
main (void)
322
{
323
  test (1, 5, 1, 5);
324
  test (5, 5, 5, 5);
325
  test (5, 4, 5, 4);
326
  test (5, 1, 5, 1);
327
  return 0;
328
}

powered by: WebSVN 2.1.0

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