OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-iv-7.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7 int result[N] = {8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38};
8  
9 __attribute__ ((noinline)) int main1 (int X)
10 {  
11   int arr[N];
12   int k = 3;
13   int m, i=0;
14   
15    /* Vectorization of induction with non-constant step X.  */
16
17    do { 
18         m = k + 5;
19         arr[i] = m;
20         k = k + X;
21         i++;
22    } while (i < N);
23
24   /* check results:  */
25   for (i = 0; i < N; i++)
26     {
27       if (arr[i] != result[i])
28         abort ();
29     }
30
31   return 0;
32 }
33
34 int main (void)
35
36   check_vect ();
37   
38   return main1 (2);
39
40
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
42 /* { dg-final { cleanup-tree-dump "vect" } } */