summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vec-scal-opt.c
blob: f5e54e71aa023d5ad29a54640bb96d6d73c90dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-require-effective-target vect_shift } */
/* { dg-require-effective-target vect_int } */

#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
#define vector(elcount, type)  \
__attribute__((vector_size((elcount)*sizeof(type)))) type

short k;

int main (int argc, char *argv[]) {
   k = argc;
   vector(8, short) v0 = {argc,1,2,3,4,5,6,7};
   vector(8, short) v2 = {k,   k,k,k,k,k,k,k};
   vector(8, short) r1;

   r1 = v0 >> v2;

   return vidx(short, r1, 0);
}

/* { dg-final { scan-tree-dump-times ">> k.\[0-9_\]*" 1 "veclower" { target vect_shift_scalar } } } */
/* { dg-final { cleanup-tree-dump "veclower" } } */