LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-1char-big-array.c
blobe762f4890cc5792555c1f3de82d53068a52f3b47
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 256
8 unsigned char ub[N];
9 unsigned char uc[N];
10 unsigned char diff;
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 diff = 2;
21 for (i = 0; i < N; i++) {
22 ub[i] = i;
23 uc[i] = i;
24 if (i%16 == 0)
26 ub[i] = i+2;
27 diff += 2;
29 if (uc[i] > max_result)
30 max_result = uc[i];
31 if (uc[i] < min_result)
32 min_result = uc[i];
34 asm volatile ("" ::: "memory");
36 for (i = 0; i < N; i++) {
37 udiff += (unsigned char) (ub[i] - uc[i]);
40 for (i = 0; i < N; i++) {
41 umax = umax < uc[i] ? uc[i] : umax;
44 for (i = 0; i < N; i++) {
45 umin = umin > uc[i] ? uc[i] : umin;
48 /* check results: */
49 if (udiff != diff)
50 abort ();
51 if (umax != max_result)
52 abort ();
53 if (umin != min_result)
54 abort ();
57 int main (void)
59 check_vect ();
61 main1 (100, 100, 1);
62 main1 (0, 15, 0);
63 return 0;
66 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_min_max } } } */