mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-22 18:45:10 +08:00
altivec-24.c: New test.
2007-01-29 Josh Conner <jconner@apple.com> * gcc.target/powerpc/altivec-24.c: New test. From-SVN: r121294
This commit is contained in:
parent
abc67de15a
commit
99af1cca0d
@ -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
|
||||
|
36
gcc/testsuite/gcc.target/powerpc/altivec-24.c
Normal file
36
gcc/testsuite/gcc.target/powerpc/altivec-24.c
Normal file
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user