2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-abs-int-fwrapv.p8.c
blob8c284ff35b89c9bfca2a9fc7d479ca3867f5ede4
1 /* Verify that overloaded built-ins for vec_abs with int
2 inputs produce the right results when -mcpu=power8 is specified. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2 -mcpu=power8 -fwrapv" } */
7 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
9 #include <altivec.h>
11 vector signed int
12 test1 (vector signed int x)
14 return vec_abs (x);
17 /* { dg-final { scan-assembler-times "vspltisw|vxor" 1 } } */
18 /* { dg-final { scan-assembler-times "vsubuwm" 1 } } */
19 /* { dg-final { scan-assembler-times "vmaxsw" 1 } } */