OSDN Git Service

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