Add compile command to each testcase
[gcc-vect-testsuite.git] / slp-9.c
blob7e1ede4b3f8511c75edaa9493315f1e2fe26ff09
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 int
14 foo1(int len) {
15 int i;
17 for (i=0; i<len/2; i++) {
18 result[2*i] = X[2*i] * Y[2*i];
19 result[2*i+1] = X[2*i+1] * Y[2*i+1];
23 int main (void)
25 int i;
27 check_vect ();
29 for (i=0; i<N; i++) {
30 X[i] = i;
31 Y[i] = 64-i;
32 __asm__ volatile ("");
35 foo1 (N);
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 } } }*/
46 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
47 /* { dg-final { cleanup-tree-dump "vect" } } */