Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr70963.c
blob3e64e0ec28ff0b8f1071108bae1e96b81edb2376
1 /* { dg-do run { target powerpc64*-*-* } } */
2 /* { dg-require-effective-target p8vector_hw } */
3 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-mcpu=power8" } */
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include <altivec.h>
11 static int failed;
12 static void test (void);
14 static void check (int result, const char *name)
16 if (!result)
18 failed++;
19 printf ("fail %s\n", name);
23 int main (void)
25 test ();
26 if (failed)
27 abort ();
28 return 0;
31 vector double x = { 81.0, 76.0 };
32 vector long long y = { 81, 76 };
34 static void test()
36 vector long long a = vec_cts (x, 0);
37 vector double b = vec_ctf (a, 0);
38 vector long long c = __builtin_vsx_xvcvdpuxds_scale (x, 0);
39 vector double d = vec_ctf (c, 0);
40 check (vec_all_eq (a, y), "vec_cts");
41 check (vec_all_eq (b, x), "vec_ctf");
42 check (vec_all_eq (c, y), "xvcvdpuxds");
43 check (vec_all_eq (d, x), "vec_ctf unsigned");