LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-half-u8.c
blobee0538c0635de5272e8a28016b1ffd9e2ff87401
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fno-ipa-icf" } */
4 #include "tree-vect.h"
6 #define N 32
7 #define COEF 32470
9 unsigned char in[N];
10 int out[N];
12 __attribute__ ((noinline)) void
13 foo ()
15 int i;
17 for (i = 0; i < N; i++)
18 out[i] = in[i] * COEF;
21 __attribute__ ((noinline)) void
22 bar ()
24 int i;
26 for (i = 0; i < N; i++)
27 out[i] = COEF * in[i];
30 int main (void)
32 int i;
34 check_vect ();
36 for (i = 0; i < N; i++)
38 in[i] = i;
39 __asm__ volatile ("");
42 foo ();
44 for (i = 0; i < N; i++)
45 if (out[i] != in[i] * COEF)
46 abort ();
48 bar ();
50 for (i = 0; i < N; i++)
51 if (out[i] != in[i] * COEF)
52 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
58 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
59 /* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */