openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-9.c
blob4fb6953cced876c2a1e5761b0f94968c5774da9e
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fno-early-inlining" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 64
9 short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11 int result[N];
13 /* short->int widening-mult */
14 int
15 foo1(int len) {
16 int i;
18 for (i=0; i<len/2; i++) {
19 result[2*i] = X[2*i] * Y[2*i];
20 result[2*i+1] = X[2*i+1] * Y[2*i+1];
24 int main (void)
26 int i;
28 check_vect ();
30 for (i=0; i<N; i++) {
31 X[i] = i;
32 Y[i] = 64-i;
33 __asm__ volatile ("");
36 foo1 (N);
38 #pragma GCC novector
39 for (i=0; i<N; i++) {
40 if (result[i] != X[i] * Y[i])
41 abort ();
44 return 0;
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } }*/
48 /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { target vect_widen_mult_hi_to_si } } } */