Merge from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vmx / extract.c
blob6fc472557026d98b35853334410969e5bf555a74
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_extract (va, 5) == 5, "vec_extract (va, 5)");
14 check (vec_extract (vb, 0) == -8, "vec_extract (vb, 0)");
15 check (vec_extract (vc, 7) == 7, "vec_extract (vc, 7)");
16 check (vec_extract (vd, 3) == -1, "vec_extract (vd, 3)");
17 check (vec_extract (ve, 2) == 2, "vec_extract (ve, 2)");
18 check (vec_extract (vf, 1) == -1, "vec_extract (vf, 1)");
19 check (vec_extract (vg, 0) == -2.0f, "vec_extract (vg, 0)");