This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] New rs6000 altivec test


I noticed during some recent work that the function
rs6000_expand_vector_set() in the rs6000 backend is not being exercised
by our testsuite.  Attached is a test to do so - verified by running on
a powerpc-apple-darwin machine.

OK for mainline?

- Josh

2007-01-25  Josh Conner  <jconner@apple.com>

	* gcc.target/powerpc/altivec-24.c: New test.


:ADDPATCH testsuite:
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec" } */

#include <altivec.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)
{
  initialize (MAGIC_NUMBER);
  verify ();
  return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]