OSDN Git Service

PR tree-optimization/40238
[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 <stdio.h>
5 #include "tree-vect.h"
6
7 #define N 128 
8
9 __attribute__ ((noinline)) int
10 main1 ()
11 {
12   int i;
13   unsigned short sout[N*8];
14   unsigned int iout[N*8];
15
16   for (i = 0; i < N; i++)
17     {
18       sout[i*4] = 8;
19       sout[i*4 + 1] = 18;
20       sout[i*4 + 2] = 28;
21       sout[i*4 + 3] = 38;
22
23       iout[i*4] = 8;
24       iout[i*4 + 1] = 18;
25       iout[i*4 + 2] = 28;
26       iout[i*4 + 3] = 38;
27     }
28
29   /* check results:  */
30   for (i = 0; i < N; i++)
31     {
32       if (sout[i*4] != 8 
33          || sout[i*4 + 1] != 18
34          || sout[i*4 + 2] != 28
35          || sout[i*4 + 3] != 38
36          || iout[i*4] != 8
37          || iout[i*4 + 1] != 18
38          || iout[i*4 + 2] != 28
39          || iout[i*4 + 3] != 38)
40         abort ();
41     }
42
43   return 0;
44 }
45
46 int main (void)
47 {
48   check_vect ();
49
50   main1 ();
51
52   return 0;
53 }
54
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
56 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect"  } } */
57 /* { dg-final { cleanup-tree-dump "vect" } } */
58