OSDN Git Service

* gcc.dg/vect/vect-reduc-dot-s16b.c: Mark functions noinline.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-70.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 12
7
8 struct s{
9   int m;
10   int n[N][N][N];
11 };
12
13 struct test1{
14   struct s a; /* array a.n is unaligned */
15   int b;
16   int c;
17   struct s e[N]; /* array e.n is aligned */
18 };
19
20 __attribute__ ((noinline))
21 int main1 ()
22 {
23   int i,j;
24   struct test1 tmp1;
25
26   for (i = 0; i < N; i++)
27     for (j = 3; j < N-3; j++)
28       {
29         tmp1.e[i].n[1][2][j] = 8;
30       }
31
32   /* check results:  */
33   for (i = 0; i < N; i++)
34     for (j = 3; j < N-3; j++)
35     {
36       if (tmp1.e[i].n[1][2][j] != 8)
37           abort ();
38     }
39   
40   /* not consecutive */
41   for (i = 0; i < N; i++)
42     for (j = 3; j < N-3; j++)
43       { 
44         tmp1.e[j].n[1][2][j] = 8;
45       }
46   
47   /* check results:  */
48   for (i = 0; i < N; i++)
49     for (j = 3; j < N-3; j++)
50     {
51       if (tmp1.e[j].n[1][2][j] != 8)
52           abort ();
53     }
54     
55   return 0;
56 }
57        
58 int main (void)
59 {
60   check_vect ();
61     
62   return main1 ();
63 }
64           
65 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
66 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
67 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } } */
68 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {! vector_alignment_reachable} } } } */
69 /* { dg-final { cleanup-tree-dump "vect" } } */