Reverting merge from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr57741-3.c
blob5258ca7842252e174448b79c1d323c95d329027f
1 /* PR tree-optimization/57741 */
2 /* { dg-do run } */
3 /* { dg-require-effective-target vect_float } */
4 /* { dg-additional-options "-ffast-math" } */
6 #include "tree-vect.h"
8 extern void abort (void);
10 float p[1024] __attribute__((aligned (32))) = { 17.0f };
11 float q[1024] __attribute__((aligned (32))) = { 17.0f };
12 char r[1024] __attribute__((aligned (32))) = { 1 };
14 __attribute__((noinline, noclone)) void
15 foo (float x)
17 int i;
18 float f = 1.0f, g = 2.0f;
19 for (i = 0; i < 1024; i++)
21 p[i] = f;
22 f += x;
23 q[i] = g;
24 g += 0.5f;
25 r[i]++;
29 int
30 main ()
32 int i;
33 check_vect ();
34 r[0] = 0;
35 foo (1.5f);
36 for (i = 0; i < 1024; i++)
37 if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f || r[i] != 1)
38 abort ();
39 return 0;
42 /* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" } } */
43 /* { dg-final { cleanup-tree-dump "vect" } } */