1 extern void abort (void);
2 
3 uint16x4_t
test_vext_u16_1(uint16x4_t a,uint16x4_t b)4 test_vext_u16_1 (uint16x4_t a, uint16x4_t b)
5 {
6   return vext_u16 (a, b, 1);
7 }
8 
9 uint16x4_t
test_vext_u16_2(uint16x4_t a,uint16x4_t b)10 test_vext_u16_2 (uint16x4_t a, uint16x4_t b)
11 {
12   return vext_u16 (a, b, 2);
13 }
14 
15 uint16x4_t
test_vext_u16_3(uint16x4_t a,uint16x4_t b)16 test_vext_u16_3 (uint16x4_t a, uint16x4_t b)
17 {
18   return vext_u16 (a, b, 3);
19 }
20 
21 int
main(int argc,char ** argv)22 main (int argc, char **argv)
23 {
24   int i, off;
25   uint16_t arr1[] = {0, 1, 2, 3};
26   uint16x4_t in1 = vld1_u16 (arr1);
27   uint16_t arr2[] = {4, 5, 6, 7};
28   uint16x4_t in2 = vld1_u16 (arr2);
29   uint16_t exp[4];
30   uint16x4_t expected;
31   uint16x4_t actual = test_vext_u16_1 (in1, in2);
32 
33   for (i = 0; i < 4; i++)
34     exp[i] = i + 1;
35   expected = vld1_u16 (exp);
36   for (i = 0; i < 4; i++)
37     if (actual[i] != expected[i])
38       abort ();
39 
40   actual = test_vext_u16_2 (in1, in2);
41   for (i = 0; i < 4; i++)
42     exp[i] = i + 2;
43   expected = vld1_u16 (exp);
44   for (i = 0; i < 4; i++)
45     if (actual[i] != expected[i])
46       abort ();
47 
48   actual = test_vext_u16_3 (in1, in2);
49   for (i = 0; i < 4; i++)
50     exp[i] = i + 3;
51   expected = vld1_u16 (exp);
52   for (i = 0; i < 4; i++)
53     if (actual[i] != expected[i])
54       abort ();
55 
56   return 0;
57 }
58 
59