1224989Sjonathan/* { dg-do compile } */
2224989Sjonathan
3224989Sjonathan#define N 40
4224989Sjonathan#define M 128
5224989Sjonathansigned short in[N+M];
6224989Sjonathansigned short coeff[M];
7224989Sjonathanint out[N];
8224989Sjonathan
9224989Sjonathan/* Outer-loop vectorization. */
10224989Sjonathan
11224989Sjonathanvoid
12224989Sjonathanfoo (){
13224989Sjonathan  int i,j;
14224989Sjonathan  int diff;
15224989Sjonathan
16224989Sjonathan  for (i = 0; i < N; i++) {
17224989Sjonathan    diff = 0;
18224989Sjonathan    for (j = 0; j < M; j+=8) {
19224989Sjonathan      diff += in[j+i]*coeff[j];
20224989Sjonathan    }
21224989Sjonathan    out[i]=diff;
22224989Sjonathan  }
23224989Sjonathan}
24224989Sjonathan
25224989Sjonathan/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
26224989Sjonathan/* { dg-final { cleanup-tree-dump "vect" } } */
27224989Sjonathan