1 /* { dg-require-effective-target vect_int } */
2 
3 #include <stdarg.h>
4 #include "tree-vect.h"
5 
6 #define N 96
7 #define M 128
8 unsigned char in[N+M];
9 unsigned short out[N];
10 
11 /* Outer-loop vectorization. */
12 /* Multiple-types in the inner-loop.  */
13 
14 __attribute__ ((noinline))
15 unsigned short
foo()16 foo (){
17   int i,j;
18   unsigned short diff;
19   unsigned short s=0;
20 
21   for (i = 0; i < N; i++) {
22     diff = 0;
23     for (j = 0; j < M; j+=8) {
24       diff += in[j+i];
25     }
26     s+=diff;
27   }
28   return s;
29 }
30 
main(void)31 int main (void)
32 {
33   check_vect ();
34   int i;
35   unsigned short s;
36 
37   for (i = 0; i < N+M; i++)
38     in[i] = (unsigned char)i;
39 
40   s = foo ();
41 
42   if (s != 34048)
43     abort ();
44 
45   return 0;
46 }
47 
48 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
49