1 /* Verify that overloaded built-ins for vec_abs with int
2    inputs produce the right results when -mcpu=power8 is specified.  */
3 
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2 -mdejagnu-cpu=power8 -fwrapv" } */
7 
8 #include <altivec.h>
9 
10 vector signed int
test1(vector signed int x)11 test1 (vector signed int x)
12 {
13   return vec_abs (x);
14 }
15 
16 /* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */
17 /* { dg-final { scan-assembler-times "vsubuwm" 1 } } */
18 /* { dg-final { scan-assembler-times "vmaxsw" 1 } } */
19 
20