PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr57741-2.c
blobdf63a49927d38badb2503787bcd828b796116199
1 /* PR tree-optimization/57741 */
2 /* { dg-require-effective-target vect_float } */
3 /* { dg-additional-options "-ffast-math" } */
5 #include "tree-vect.h"
7 extern void abort (void);
9 __attribute__((noinline, noclone)) void
10 foo (float *p, float *q, float x)
12 int i;
13 p = (float *) __builtin_assume_aligned (p, 32);
14 q = (float *) __builtin_assume_aligned (q, 32);
15 float f = 1.0f, g = 2.0f;
16 for (i = 0; i < 1024; i++)
18 *p++ = f;
19 f += x;
21 for (i = 0; i < 1024; i++)
23 *q++ = g;
24 g += 0.5f;
28 float p[1024] __attribute__((aligned (32))) = { 17.0f };
29 float q[1024] __attribute__((aligned (32))) = { 17.0f };
31 int
32 main ()
34 int i;
35 check_vect ();
36 foo (p, q, 1.5f);
37 for (i = 0; i < 1024; i++)
38 if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f)
39 abort ();
40 return 0;
43 /* { dg-final { scan-tree-dump-times "vectorized 2 loop" 1 "vect" } } */