OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-16.c
1 /* { dg-require-effective-target vect_long_long } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 64
7
8 char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
9
10 __attribute__ ((noinline)) int
11 foo (int len, long long *z) {
12   int i;
13
14   for (i=0; i<len; i++) {
15     z[i] = x[i];
16   }
17 }
18
19
20 int main (void)
21 {
22   char i;
23   long long z[N+4];
24
25   check_vect ();
26
27   foo (N,z+2);
28
29   for (i=0; i<N; i++) {
30     if (z[i+2] != x[i])
31       abort ();
32   }
33   
34   return 0;
35 }
36
37 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_unpack } } } } */
39 /* { dg-final { cleanup-tree-dump "vect" } } */
40