Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-15.c
blob145bb5d7e9fefa0c7ef36fa9dae16d87608d9266
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 #define DOT1 43680
9 #define DOT2 -20832
11 signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 unsigned char CX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
15 __attribute__ ((noinline)) void
16 foo1(int len) {
17 int i;
18 int result1 = 0;
20 for (i=0; i<len; i++) {
21 result1 += (X[i] * Y[i]);
22 CX[i] = 5;
25 if (result1 != DOT1)
26 abort ();
30 int main (void)
32 int i, dot1, dot2;
34 check_vect ();
36 for (i=0; i<N; i++) {
37 X[i] = i;
38 Y[i] = 64-i;
39 CX[i] = i;
40 __asm__ volatile ("");
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" } } */