Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec-cell-3.c
blobb941ab186fa15c01cbe2f60d05dcfd04f50764d7
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" } */
5 /* Test the vec_splats and vec_promote VMX intrinsics. */
6 #include <altivec.h>
8 extern void abort (void);
10 vector int a = {0, 0, 0, 0};
11 int main1(int t) __attribute__((noinline));
12 int main1(int t)
14 int i;
15 vector int b = vec_splats(0);
16 if (__builtin_memcmp (&a, &b, sizeof(vector int)))
17 abort ();
19 b = vec_splats(t);
20 if (__builtin_memcmp (&a, &b, sizeof(vector int)))
21 abort ();
23 b = vec_promote(0, 1);
24 if (vec_extract (b, 1) != 0)
25 abort ();
27 b = vec_promote(t, t);
28 if (vec_extract (b, t) != 0)
29 abort ();
31 return 0;
34 int main(void)
36 return main1 (0);