[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-clrr-1.c
blobc72ae86cd32042ab4da95c67e2f5d07fb528eec3
1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-require-effective-target power10_ok } */
4 /* { dg-options "-mdejagnu-cpu=power10" } */
6 #include <altivec.h>
8 extern void abort (void);
10 /* Vector string clear right-most bytes of unsigned char. */
11 vector unsigned char
12 clrr (vector unsigned char arg, int n)
14 return vec_clrr (arg, n);
17 int main (int argc, char *argv [])
19 vector unsigned char input0 =
20 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
21 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
22 vector unsigned char expected0 =
23 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x0, 0x0, 0x0,
24 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 };
25 vector unsigned char expected1 =
26 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
27 0x9, 0xa, 0xb, 0xc, 0xd, 0x0, 0x0, 0x0 };
28 vector unsigned char expected2 =
29 { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
30 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x11 };
32 if (!vec_all_eq (clrr(input0, 5), expected0))
33 abort ();
34 if (!vec_all_eq (clrr(input0, 13), expected1))
35 abort ();
36 if (!vec_all_eq (clrr(input0, 19), expected2))
37 abort ();