OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-86.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 int a[N];
9
10 __attribute__ ((noinline))
11 int main1 (int n)
12 {
13   int i, j, k;
14   int b[N];
15
16   for (i = 0; i < n; i++)
17     {
18       for (j = 0; j < n; j++)
19         {
20           k = i + n;
21           a[j] = k;
22         }
23       b[i] = k;
24     }
25
26
27   for (j = 0; j < n; j++)
28     if (a[j] != i + n - 1)
29       abort();  
30
31   for (i = 0; i < n; i++)
32     if (b[i] != i + n)
33       abort();  
34
35   return 0;
36 }
37
38 int main (void)
39
40   check_vect ();
41
42   main1 (N);
43   main1 (0);
44   main1 (1);
45   main1 (2);
46   main1 (N-1);
47
48   return 0;
49 }
50
51 /* Fails for targets that don't vectorize PLUS (e.g alpha).  */
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
54 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
55 /* { dg-final { cleanup-tree-dump "vect" } } */