1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_float } */
3 /* { dg-add-options bind_pic_locally } */
4 
5 #include <stdarg.h>
6 #include "tree-vect.h"
7 
8 #define N 20
9 
10 float a[N];
11 float e[N];
12 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13 float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
14 float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
15 int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
16 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
17 int ia[N];
18 
19 __attribute__ ((noinline)) int
main1()20 main1 ()
21 {
22   int i;
23 
24   for (i = 0; i < N; i++)
25     {
26       a[i] = b[i] + c[i] + d[i];
27       e[i] = b[i] + c[i] + d[i];
28       ia[i] = ib[i] + ic[i];
29     }
30 
31   /* check results:  */
32   for (i = 0; i <N; i++)
33     {
34       float fres = b[i] + c[i] + d[i];
35       int ires = ib[i] + ic[i];
36       if (a[i] != fres || e[i] != fres || ia[i] != ires)
37         abort ();
38     }
39 
40   return 0;
41 }
42 
main(void)43 int main (void)
44 {
45   check_vect ();
46 
47   return main1 ();
48 }
49 
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
51 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
52