PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vect-aggressive.c
blob1ea111795a48f1cf69884f041023f45777cf1941
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx2 } */
3 /* { dg-options "-mavx2 -O3 -fopenmp-simd -fdump-tree-vect-details" } */
5 #include "avx2-check.h"
6 #define N 64
7 float a[N];
8 int c[N];
10 __attribute__ ((noinline)) int
11 foo ()
13 int i, res = 0;
14 #pragma omp simd safelen(8)
15 for (i=0; i<N; i++)
17 float t = a[i];
18 if (t > 0.0f & t < 1.0e+2f)
19 if (c[i] != 0)
20 res += 1;
22 return res;
25 __attribute__ ((noinline)) float
26 hundred ()
28 return 100.0f;
31 static void
32 avx2_test (void)
34 int i, res;
35 for (i=0; i<N; i++)
37 c[i] = i % 4;
38 if (i < N / 2)
39 a[i] = (float) (i + 1);
40 else
41 a[i] = (float) i + hundred ();
43 if (foo () != 24)
44 abort ();
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */