testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-simd-clone-2.c
blobe31280ad15d3cf478ea7e9871dd8b555092e37ad
1 /* { dg-require-effective-target vect_simd_clones } */
2 /* { dg-additional-options "-fopenmp-simd" } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
5 #include "tree-vect.h"
7 #ifndef N
8 #define N 1024
9 #endif
11 int array[N] __attribute__((aligned (32)));
13 #pragma omp declare simd simdlen(4) notinbranch aligned(a:16) uniform(a) linear(b)
14 #pragma omp declare simd simdlen(4) notinbranch aligned(a:32) uniform(a) linear(b)
15 #ifdef __aarch64__
16 #pragma omp declare simd simdlen(2) notinbranch aligned(a:16) uniform(a) linear(b)
17 #pragma omp declare simd simdlen(2) notinbranch aligned(a:32) uniform(a) linear(b)
18 #else
19 #pragma omp declare simd simdlen(8) notinbranch aligned(a:16) uniform(a) linear(b)
20 #pragma omp declare simd simdlen(8) notinbranch aligned(a:32) uniform(a) linear(b)
21 #endif
22 __attribute__((noinline)) void
23 foo (int *a, int b, int c)
24 /* { dg-warning {unsupported simdlen 8 \(amdgcn\)} "" { target amdgcn*-*-* } .-1 } */
25 /* { dg-warning {unsupported simdlen 4 \(amdgcn\)} "" { target amdgcn*-*-* } .-2 } */
27 a[b] = c;
30 __attribute__((noinline, noclone)) void
31 bar ()
33 int i;
34 #pragma omp simd
35 for (i = 0; i < N; ++i)
36 foo (array, i, i * array[i]);
39 __attribute__((noinline, noclone)) void
40 baz ()
42 int i;
43 for (i = 0; i < N; i++)
44 array[i] = 5 * (i & 7);
47 int
48 main ()
50 int i;
51 check_vect ();
52 baz ();
53 bar ();
54 #pragma GCC novector
55 for (i = 0; i < N; i++)
56 if (array[i] != 5 * (i & 7) * i)
57 abort ();
58 return 0;