OSDN Git Service

* doc/loop.texi: Document possibility not to perform disambiguation
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-dot-s8c.c
1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 64
7
8 #define DOT3 43680
9
10 signed char X[N] __attribute__ ((__aligned__(16)));
11 signed char Y[N] __attribute__ ((__aligned__(16)));
12
13 /* char->int->int dot product. 
14    Not detected as a dot-product pattern.
15    Currently fails to be vectorized due to presence of type conversions. */
16 int
17 foo3(int len) {
18   int i;
19   int result = 0;
20
21   for (i=0; i<len; i++) {
22     result += (X[i] * Y[i]);
23   }
24   return result;
25 }
26
27 int main (void)
28 {
29   int i, dot3;
30
31   check_vect ();
32
33   for (i=0; i<N; i++) {
34     X[i] = i;
35     Y[i] = 64-i;
36   }
37
38   dot3 = foo3 (N);
39   if (dot3 != DOT3)
40     abort ();
41
42   return 0;
43 }
44
45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
46
47 /* { dg-final { cleanup-tree-dump "vect" } } */