PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-3.c
blobf8ca94dd17db81d8be824dfb2f023517f05d7c04
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 int arr1[N];
11 int arr2[N];
12 int k = 0;
13 int m = 3, i = 0;
15 /* vectorization of induction.
16 Peeling to align the store is also applied. */
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" } } */