2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-outer-4m.c
blob6e032f13c4f2655356900a743d2d2c944bccb1b8
1 /* { dg-require-effective-target vect_int } */
2 #include <stdarg.h>
3 #include "tree-vect.h"
5 #define N 40
6 #define M 128
7 unsigned short in[N+M];
8 unsigned int out[N];
10 /* Outer-loop vectorization. */
11 /* Not vectorized due to multiple-types in the inner-loop. */
13 __attribute__ ((noinline)) unsigned int
14 foo (){
15 int i,j;
16 unsigned int diff;
17 unsigned int s=0;
19 for (i = 0; i < N; i++) {
20 diff = 0;
21 for (j = 0; j < M; j+=8) {
22 diff += in[j+i];
24 s+=((unsigned short)diff>>3);
26 return s;
29 int main (void)
31 int i, j;
32 unsigned int diff;
33 unsigned int s=0,sum=0;
35 check_vect ();
37 for (i = 0; i < N+M; i++) {
38 in[i] = i;
41 sum=foo ();
43 for (i = 0; i < N; i++) {
44 diff = 0;
45 for (j = 0; j < M; j+=8) {
46 diff += in[j+i];
48 s += ((unsigned short)diff>>3);
51 if (s != sum)
52 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
58 /* { dg-final { cleanup-tree-dump "vect" } } */