i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-4.c
bloba6c29956f3b84ee0def117bdc886219bf07ec2d0
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 int a[N];
10 /* induction variable k advances through inner and outer loops. */
12 __attribute__ ((noinline)) int
13 foo (int n){
14 int i,j,k=0;
15 int sum;
17 if (n<=0)
18 return 0;
20 for (i = 0; i < N; i++) {
21 sum = 0;
22 for (j = 0; j < n; j+=2) {
23 sum += k++;
25 a[i] = sum + j;
29 int main (void)
31 int i,j,k=0;
32 int sum;
34 check_vect ();
36 for (i=0; i<N; i++)
37 a[i] = i;
39 foo (N);
41 /* check results: */
42 #pragma GCC novector
43 for (i=0; i<N; i++)
45 sum = 0;
46 for (j = 0; j < N; j+=2)
47 sum += k++;
48 if (a[i] != sum + j)
49 abort();
52 return 0;
55 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */