[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-shift-left-fwrapv.c
blob34264807b8985852f8e51ad6ebf4b3fc16a2ad28
1 /* Verify that overloaded built-ins for vec_sl produce the right results. */
2 /* This test covers the shift left tests with the -fwrapv option. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2 -fwrapv" } */
8 #include <altivec.h>
10 vector signed char
11 testsl_signed_char (vector signed char x, vector unsigned char y)
13 return vec_sl (x, y);
16 vector unsigned char
17 testsl_unsigned_char (vector unsigned char x, vector unsigned char y)
19 return vec_sl (x, y);
22 vector signed short
23 testsl_signed_short (vector signed short x, vector unsigned short y)
25 return vec_sl (x, y);
28 vector unsigned short
29 testsl_unsigned_short (vector unsigned short x, vector unsigned short y)
31 return vec_sl (x, y);
34 vector signed int
35 testsl_signed_int (vector signed int x, vector unsigned int y)
37 return vec_sl (x, y);
40 vector unsigned int
41 testsl_unsigned_int (vector unsigned int x, vector unsigned int y)
43 return vec_sl (x, y);
46 /* { dg-final { scan-assembler-times "vslb" 2 } } */
47 /* { dg-final { scan-assembler-times "vslh" 2 } } */
48 /* { dg-final { scan-assembler-times "vslw" 2 } } */