PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-4.c
blobdfe5bc14458c856122f48bd6bc6a50092d7729e1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 __attribute__ ((noinline)) int main1 ()
9 {
10 unsigned int arr1[N];
11 unsigned short arr2[N];
12 unsigned int k = 0;
13 unsigned short m = 3;
14 int i = 0;
16 /* Vectorization of induction with multiple data types. */
18 do {
19 k = k + 2;
20 arr1[i] = k;
21 m = k + 3;
22 arr2[i] = m;
23 i++;
24 } while (i < N);
26 /* check results: */
27 for (i = 0; i < N; i++)
29 if (arr1[i] != 2+2*i || arr2[i] != 5 + 2*i)
30 abort ();
33 return 0;
36 int main (void)
38 check_vect ();
40 return main1 ();
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */