Add execution + assembler tests of AArch64 TRN Intrinsics.
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / simd / vtrns32.x
blobbf168d04076e42a536472e165ef005f893e3527f
1 extern void abort (void);
3 int32x2x2_t
4 test_vtrns32 (int32x2_t _a, int32x2_t _b)
6   return vtrn_s32 (_a, _b);
9 int
10 main (int argc, char **argv)
12   int i;
13   int32_t first[] = {1, 2};
14   int32_t second[] = {3, 4};
15   int32x2x2_t result = test_vtrns32 (vld1_s32 (first), vld1_s32 (second));
16   int32x2_t res1 = result.val[0], res2 = result.val[1];
17   int32_t exp1[] = {1, 3};
18   int32_t exp2[] = {2, 4};
19   int32x2_t expected1 = vld1_s32 (exp1);
20   int32x2_t expected2 = vld1_s32 (exp2);
22   for (i = 0; i < 2; i++)
23     if ((res1[i] != expected1[i]) || (res2[i] != expected2[i]))
24       abort ();
26   return 0;