IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-1char.c
blob5a1c03d113fbb3b6453a62c7c1d0602d0f66188e
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 #define DIFF 242
9 unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10 unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
12 __attribute__ ((noinline)) void
13 main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
15 int i;
16 unsigned char udiff = 2;
17 unsigned char umax = x;
18 unsigned char umin = x;
20 for (i = 0; i < N; i++) {
21 udiff += (unsigned char)(ub[i] - uc[i]);
24 for (i = 0; i < N; i++) {
25 umax = umax < uc[i] ? uc[i] : umax;
28 for (i = 0; i < N; i++) {
29 umin = umin > uc[i] ? uc[i] : umin;
32 /* check results: */
33 if (udiff != DIFF)
34 abort ();
35 if (umax != max_result)
36 abort ();
37 if (umin != min_result)
38 abort ();
41 int main (void)
43 check_vect ();
45 main1 (100, 100, 1);
46 main1 (0, 15, 0);
47 return 0;
50 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
51 /* { dg-final { cleanup-tree-dump "vect" } } */