1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-options "-maltivec" } */
4 /* Test the vec_splats and vec_promote VMX intrinsics. */
6 #include "altivec_check.h"
8 extern void abort (void);
10 vector int a = {0, 0, 0, 0};
11 int main1(int t) __attribute__((noinline));
15 vector int b = vec_splats(0);
16 if (__builtin_memcmp (&a, &b, sizeof(vector int)))
20 if (__builtin_memcmp (&a, &b, sizeof(vector int)))
23 b = vec_promote(0, 1);
24 if (vec_extract (b, 1) != 0)
27 b = vec_promote(t, t);
28 if (vec_extract (b, t) != 0)
36 altivec_check(); /* Exits if AltiVec not supported */