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