Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-outer-4i.c
bloba244ac20ac25458e23707da98577ad546936c792
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 96
7 #define M 128
8 unsigned char in[N+M];
9 unsigned short out[N];
11 /* Outer-loop vectorization. */
12 /* Multiple-types in the inner-loop. */
14 __attribute__ ((noinline))
15 unsigned short
16 foo (){
17 int i,j;
18 unsigned short diff;
19 unsigned short s=0;
21 for (i = 0; i < N; i++) {
22 diff = 0;
23 for (j = 0; j < M; j+=8) {
24 diff += in[j+i];
26 s+=diff;
28 return s;
31 int main (void)
33 check_vect ();
34 int i;
35 unsigned short s;
37 for (i = 0; i < N+M; i++)
38 in[i] = (unsigned char)i;
40 s = foo ();
42 if (s != 34048)
43 abort ();
45 return 0;
48 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
49 /* { dg-final { cleanup-tree-dump "vect" } } */