libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-mult-s16.c
blob6b094868064e9b86c40018363564f356220125a5
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9 short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 int result[N];
12 /* short->int widening-mult */
13 __attribute__ ((noinline)) int
14 foo1(int len) {
15 int i;
17 for (i=0; i<len; i++) {
18 result[i] = X[i] * Y[i];
22 int main (void)
24 int i;
26 check_vect ();
28 for (i=0; i<N; i++) {
29 X[i] = i;
30 Y[i] = 64-i;
31 __asm__ volatile ("");
34 foo1 (N);
36 #pragma GCC novector
37 for (i=0; i<N; i++) {
38 if (result[i] != X[i] * Y[i])
39 abort ();
42 return 0;
45 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */