PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / lto / simd-function_0.c
blob59f419b67145ef84b0df56b528e6a5646339e13f
1 /* { dg-lto-do link } */
2 /* { dg-require-effective-target vect_simd_clones } */
3 /* { dg-require-effective-target avx2 } */
4 /* { dg-lto-options { { -fopenmp-simd -O3 -ffast-math -mavx2 -flto -flto-partition=max } } } */
6 #define SIZE 4096
7 float x[SIZE];
10 #pragma omp declare simd
11 float
12 __attribute__ ((noinline))
13 my_mul (float x, float y) {
14 return x * y;
17 __attribute__ ((noinline))
18 int foo ()
20 int i = 0;
21 #pragma omp simd safelen (16)
22 for (i = 0; i < SIZE; i++)
23 x[i] = my_mul ((float)i, 9932.3323);
24 return (int)x[0];
27 int main ()
29 int i = 0;
30 for (i = 0; i < SIZE; i++)
31 x[i] = my_mul ((float) i, 9932.3323);
32 foo ();
33 return (int)x[0];