1 /* Test to verify that the vec_extract from a vector of
2 signed chars remains signed. */
3 /* { dg-do run } */
4 /* { dg-options "-ansi -mdejagnu-cpu=power8 " } */
5 /* { dg-require-effective-target p8vector_hw } */
6
7 #include <altivec.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10
11 int test1(signed char sc) {
12 int sce;
13
14 vector signed char v = vec_splats(sc);
15 sce = vec_extract(v,0);
16
17 if (sce != sc)
18 abort();
19 return 0;
20 }
21
22 int main()
23 {
24 test1 (0xf6);
25 test1 (0x76);
26 test1 (0x06);
27 return 0;
28 }