diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/powerpc/darwin-abi-2.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/powerpc/darwin-abi-2.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/darwin-abi-2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/darwin-abi-2.c new file mode 100644 index 000000000..4764831e8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/darwin-abi-2.c @@ -0,0 +1,24 @@ +/* { dg-do run { target powerpc*-*-darwin* } } */ + +/* You might think you'd need -maltivec for this, but actually you + don't; GCC will happily do everything in GPRs, and it still + tests that the ABI is correct. */ + +#include <stdio.h> +#include <stdlib.h> + +#define vector __attribute__((vector_size(16))) + +int main(void) +{ + vector unsigned int v = { 100, 200, 300, 400 }; + vector unsigned int w = { 4, 5, 6, 7 }; + char x[64]; + sprintf (x, "%lvu,%d,%lvu", v, 1, w); + if (strcmp (x, "100 200 300 400,1,4 5 6 7") != 0) + { + puts (x); + abort (); + } + return 0; +} |