diff options
author | jconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-29 17:18:56 +0000 |
---|---|---|
committer | jconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-29 17:18:56 +0000 |
commit | 11d7a4a8425232343a432774278a9bb45c2808aa (patch) | |
tree | efdd1ab793ac316941d024a50ef06fc8645356c3 /gcc | |
parent | e1f6aa48a996ba7146a2f28559631745d2c92efb (diff) | |
download | gcc-11d7a4a8425232343a432774278a9bb45c2808aa.tar.gz |
2007-01-29 Josh Conner <jconner@apple.com>
* gcc.target/powerpc/altivec-24.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/altivec-24.c | 36 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa9f672331e..41f6dd82307 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-01-29 Josh Conner <jconner@apple.com> + + * gcc.target/powerpc/altivec-24.c: New test. + 2007-01-29 Simon Martin <simartin@users.sourceforge.net> PR c++/28266 diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-24.c b/gcc/testsuite/gcc.target/powerpc/altivec-24.c new file mode 100644 index 00000000000..cb1a66832e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/altivec-24.c @@ -0,0 +1,36 @@ +/* { dg-do run { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +#include <altivec.h> +#include "altivec_check.h" + +extern void abort (void); + +typedef int v4si __attribute__ ((vector_size (16))); + +#define MAGIC_NUMBER 12345 + +v4si my_vect; +int my_array[4] __attribute__ ((aligned (16))); + +void initialize (int a) +{ + my_vect = (v4si) {0, a, 2, 3}; + vec_st (my_vect, 0, my_array); +} + +int verify (void) +{ + if (my_array[1] != MAGIC_NUMBER) + abort (); +} + +int main (void) +{ + altivec_check (); /* Exit if hardware doesn't support AltiVec. */ + initialize (MAGIC_NUMBER); + verify (); + return 0; +} + |