PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-vect-iv-2.c
blob131d2d9e03f44ed680cb49c71673908511c9236f
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 __attribute__ ((noinline))
9 int main1 ()
11 int arr1[N];
12 int k = 0;
13 int m = 3, i = 0;
15 /* Vectorization of induction that is used after the loop. */
17 do {
18 k = k + 2;
19 arr1[i] = k;
20 m = m + k;
21 i++;
22 } while (i < N);
24 /* check results: */
25 for (i = 0; i < N; i++)
27 if (arr1[i] != 2+2*i)
28 abort ();
31 return m + k;
34 int main (void)
36 int res;
38 check_vect ();
40 res = main1 ();
41 if (res != 32 + 275)
42 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */