1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
4 /* { dg-options "-mdejagnu-cpu=power7 -O2" } */
5 
6 /* This used to ICE.  During gimplification, "i" is widened to an unsigned
7    int.  We used to fail at expand time as we tried to cram an SImode item
8    into a QImode memory slot.  This has been fixed to properly truncate the
9    shift amount when splatting it into a vector.  */
10 
11 typedef unsigned char v16ui __attribute__((vector_size(16)));
12 
vslb(v16ui v,unsigned char i)13 v16ui vslb(v16ui v, unsigned char i)
14 {
15 	return v << i;
16 }
17 
18 /* { dg-final { scan-assembler "vspltb" } } */
19 /* { dg-final { scan-assembler "vslb" } } */
20