OSDN Git Service

Merge branch 'trunk' of git://gcc.gnu.org/git/gcc into rework
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / slp-multitypes-1.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 128 
7
8 __attribute__ ((noinline)) int
9 main1 ()
10 {
11   int i;
12   unsigned short sout[N*8];
13   unsigned int iout[N*8];
14
15   for (i = 0; i < N; i++)
16     {
17       sout[i*4] = 8;
18       sout[i*4 + 1] = 18;
19       sout[i*4 + 2] = 28;
20       sout[i*4 + 3] = 38;
21
22       iout[i*4] = 8;
23       iout[i*4 + 1] = 18;
24       iout[i*4 + 2] = 28;
25       iout[i*4 + 3] = 38;
26     }
27
28   /* check results:  */
29   for (i = 0; i < N; i++)
30     {
31       if (sout[i*4] != 8 
32          || sout[i*4 + 1] != 18
33          || sout[i*4 + 2] != 28
34          || sout[i*4 + 3] != 38
35          || iout[i*4] != 8
36          || iout[i*4 + 1] != 18
37          || iout[i*4 + 2] != 28
38          || iout[i*4 + 3] != 38)
39         abort ();
40     }
41
42   return 0;
43 }
44
45 int main (void)
46 {
47   check_vect ();
48
49   main1 ();
50
51   return 0;
52 }
53
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
55 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect"  } } */
56 /* { dg-final { cleanup-tree-dump "vect" } } */
57