PR tree-optimization/85826 - ICE in gimple-ssa-warn-restruct on
[official-gcc.git] / gcc / testsuite / gcc.dg / vmx / insert.c
blob39cd75d879ca3602e0920d1f524f9c7c739348bd
1 #include "harness.h"
3 static void test()
5 vector unsigned char va = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
6 vector signed char vb = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
7 vector unsigned short vc = {0,1,2,3,4,5,6,7};
8 vector signed short vd = {-4,-3,-2,-1,0,1,2,3};
9 vector unsigned int ve = {0,1,2,3};
10 vector signed int vf = {-2,-1,0,1};
11 vector float vg = {-2.0f,-1.0f,0.0f,1.0f};
13 check (vec_all_eq (vec_insert (16, va, 5),
14 ((vector unsigned char)
15 {0,1,2,3,4,16,6,7,8,9,10,11,12,13,14,15})),
16 "vec_insert (va)");
17 check (vec_all_eq (vec_insert (-16, vb, 0),
18 ((vector signed char)
19 {-16,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7})),
20 "vec_insert (vb)");
21 check (vec_all_eq (vec_insert (16, vc, 7),
22 ((vector unsigned short){0,1,2,3,4,5,6,16})),
23 "vec_insert (vc)");
24 check (vec_all_eq (vec_insert (-16, vd, 3),
25 ((vector signed short){-4,-3,-2,-16,0,1,2,3})),
26 "vec_insert (vd)");
27 check (vec_all_eq (vec_insert (16, ve, 2),
28 ((vector unsigned int){0,1,16,3})),
29 "vec_insert (ve)");
30 check (vec_all_eq (vec_insert (-16, vf, 1),
31 ((vector signed int){-2,-16,0,1})),
32 "vec_insert (vf)");
33 check (vec_all_eq (vec_insert (-16.0f, vg, 0),
34 ((vector float){-16.0f,-1.0f,0.0f,1.0f})),
35 "vec_insert (vg)");