Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-7.c
blob80604321b98531c700fe61ba51d80176ee68be2b
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
5 #include <stdio.h>
7 #define N 64
9 #define DOT1 43680
10 #define DOT2 -20832
12 signed short X[N] __attribute__ ((__aligned__(16)));
13 signed short Y[N] __attribute__ ((__aligned__(16)));
14 unsigned char CX[N] __attribute__ ((__aligned__(16)));
16 __attribute__ ((noinline)) void
17 foo1(int len) {
18 int i;
19 int result1 = 0;
20 short prod;
22 for (i=0; i<len; i++) {
23 result1 += (X[i] * Y[i]);
24 CX[i] = 5;
27 if (result1 != DOT1)
28 abort ();
32 int main (void)
34 int i, dot1, dot2;
36 check_vect ();
38 for (i=0; i<N; i++) {
39 X[i] = i;
40 Y[i] = 64-i;
41 CX[i] = i;
44 foo1 (N);
46 return 0;
49 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */
50 /* { dg-final { cleanup-tree-dump "vect" } } */