2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-15.c
blobc96daf8ad9b63feae45a1233da67b41bf0d82687
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 char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
14 unsigned char CX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
16 __attribute__ ((noinline)) void
17 foo1(int len) {
18 int i;
19 int result1 = 0;
21 for (i=0; i<len; i++) {
22 result1 += (X[i] * Y[i]);
23 CX[i] = 5;
26 if (result1 != DOT1)
27 abort ();
31 int main (void)
33 int i, dot1, dot2;
35 check_vect ();
37 for (i=0; i<N; i++) {
38 X[i] = i;
39 Y[i] = 64-i;
40 CX[i] = i;
43 foo1 (N);
45 return 0;
48 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_sdot_hi || vect_unpack } } } } */
49 /* { dg-final { cleanup-tree-dump "vect" } } */