diff options
Diffstat (limited to 'gcc/testsuite/gcc.apple/apple-altivec-8.c')
-rw-r--r-- | gcc/testsuite/gcc.apple/apple-altivec-8.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-8.c b/gcc/testsuite/gcc.apple/apple-altivec-8.c new file mode 100644 index 00000000000..fb2389526d2 --- /dev/null +++ b/gcc/testsuite/gcc.apple/apple-altivec-8.c @@ -0,0 +1,36 @@ +/* { dg-do run { target powerpc*-*-* } } */ +/* { dg-options "-maltivec -O2" } */ + +/* ICEs at -O1 or more */ + +#include <altivec.h> + +extern void abort(); + +int main() +{ + + const static vector float vINF = + ( vector float ) ( ( vector unsigned int ) ( 0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000 ) ); + + unsigned int af[4] = { + (unsigned int)0x7F800000, + (unsigned int)0x7F800000, + (unsigned int)0x7F800000, + (unsigned int)0x7F800000}; + + union u { + vector float vf; + unsigned int ai[4]; + }vu; + + int i; + + vu.vf = vINF; + + for (i=0; i < 4; i++) + if (af[i] != vu.ai[i]) + abort(); + + return 0; +} |