Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-outer-4f.c
blobc6cc4a8d1a408eb3d062083850f41d56c96b1b96
1 /* { dg-require-effective-target vect_int } */
2 #include <stdarg.h>
3 #include "tree-vect.h"
5 #define N 96
6 #define M 128
7 unsigned short in[N+M];
8 unsigned int out[N];
9 unsigned char arr[N];
11 /* Outer-loop vectorization. */
12 /* Not vectorized due to multiple-types in the inner-loop. */
14 __attribute__ ((noinline)) unsigned int
15 foo (){
16 int i,j;
17 unsigned int diff;
18 unsigned int s=0;
20 for (i = 0; i < N; i++) {
21 arr[i] = 3;
22 diff = 0;
23 for (j = 0; j < M; j+=8) {
24 diff += in[j+i];
26 s+=diff;
28 return s;
31 __attribute__ ((noinline)) unsigned int
32 bar (int i, unsigned int diff, unsigned short *in)
34 int j;
35 for (j = 0; j < M; j+=8) {
36 diff += in[j+i];
38 return diff;
41 int main (void)
43 int i, j;
44 unsigned int diff;
45 unsigned int s=0,sum=0;
47 check_vect ();
49 for (i = 0; i < N+M; i++) {
50 in[i] = i;
53 sum=foo ();
55 for (i = 0; i < N; i++) {
56 arr[i] = 3;
57 diff = 0;
58 diff = bar (i, diff, in);
59 s += diff;
62 if (s != sum)
63 abort ();
65 return 0;
68 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
69 /* { dg-final { cleanup-tree-dump "vect" } } */