Rebase.
[official-gcc.git] / libgomp / testsuite / libgomp.c / simd-2.c
blobb485fcb6f6f6db511005ec68db61c8732ace87c0
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-additional-options "-msse2" { target sse2_runtime } } */
4 /* { dg-additional-options "-mavx" { target avx_runtime } } */
6 extern void abort ();
7 __UINTPTR_TYPE__ arr[1027];
9 __attribute__((noinline, noclone)) void
10 foo ()
12 int i, v;
13 #pragma omp simd private (v) safelen(16)
14 for (i = 0; i < 1027; i++)
15 arr[i] = (__UINTPTR_TYPE__) &v;
18 int
19 main ()
21 int i, j, cnt = 0;
22 __UINTPTR_TYPE__ arr2[16];
23 foo ();
24 for (i = 0; i < 1027; i++)
26 for (j = 0; j < cnt; j++)
27 if (arr[i] == arr2[j])
28 break;
29 if (j != cnt)
30 continue;
31 if (cnt == 16)
32 abort ();
33 arr2[cnt++] = arr[i];
35 return 0;