comparison libgomp/testsuite/libgomp.c/simd-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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 ();
6 __UINTPTR_TYPE__ arr[1027];
7
8 __attribute__((noinline, noclone)) void
9 foo ()
10 {
11 int i, v;
12 #pragma omp simd private (v) safelen(16)
13 for (i = 0; i < 1027; i++)
14 arr[i] = (__UINTPTR_TYPE__) &v;
15 }
16
17 int
18 main ()
19 {
20 int i, j, cnt = 0;
21 __UINTPTR_TYPE__ arr2[16];
22 foo ();
23 for (i = 0; i < 1027; i++)
24 {
25 for (j = 0; j < cnt; j++)
26 if (arr[i] == arr2[j])
27 break;
28 if (j != cnt)
29 continue;
30 if (cnt == 16)
31 abort ();
32 arr2[cnt++] = arr[i];
33 }
34 return 0;
35 }