i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-20.c
bloba9ef1c04c70510797006d8782dcc6abf2908e4f4
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 int a[N];
9 int b[N];
11 __attribute__ ((noinline)) int
12 foo (){
13 int i,j;
14 int sum,x,y;
16 for (i = 0; i < N/2; i++) {
17 sum = 0;
18 x = b[2*i];
19 y = b[2*i+1];
20 for (j = 0; j < N; j++) {
21 sum += j;
23 a[2*i] = sum + x;
24 a[2*i+1] = sum + y;
28 int main (void)
30 int i,j;
31 int sum;
33 check_vect ();
35 for (i=0; i<N; i++)
36 b[i] = i;
38 foo ();
40 /* check results: */
41 #pragma GCC novector
42 for (i=0; i<N/2; i++)
44 sum = 0;
45 for (j = 0; j < N; j++)
46 sum += j;
47 if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
48 abort();
51 return 0;
54 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */