| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-additional-options "-msse2" { target sse2_runtime } } */ |
| 3 |
/* { dg-additional-options "-mavx" { target avx_runtime } } */ |
| 4 |
|
| 5 |
extern void abort (void); |
| 6 |
int a[1024], b = -1; |
| 7 |
|
| 8 |
int |
| 9 |
main () |
| 10 |
{ |
| 11 |
int i; |
| 12 |
#pragma omp parallel for simd ordered |
| 13 |
for (i = 0; i < 1024; i++) |
| 14 |
{ |
| 15 |
a[i] = i; |
| 16 |
#pragma omp ordered threads simd |
| 17 |
{ |
| 18 |
if (b + 1 != i) |
| 19 |
abort (); |
| 20 |
b = i; |
| 21 |
} |
| 22 |
a[i] += 3; |
| 23 |
} |
| 24 |
if (b != 1023) |
| 25 |
abort (); |
| 26 |
for (i = 0; i < 1024; i++) |
| 27 |
if (a[i] != i + 3) |
| 28 |
abort (); |
| 29 |
return 0; |
| 30 |
} |