[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec-24.c
blobd296fe2465804665dd1ce4565f805b81c54c89be
1 /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
2 /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-options "-maltivec" } */
6 #include <altivec.h>
8 extern void abort (void);
10 typedef int v4si __attribute__ ((vector_size (16)));
12 #define MAGIC_NUMBER 12345
14 v4si my_vect;
15 int my_array[4] __attribute__ ((aligned (16)));
17 void initialize (int a)
19 my_vect = (v4si) {0, a, 2, 3};
20 vec_st (my_vect, 0, my_array);
23 int verify (void)
25 if (my_array[1] != MAGIC_NUMBER)
26 abort ();
29 int main (void)
31 initialize (MAGIC_NUMBER);
32 verify ();
33 return 0;