Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-init-v2di-1.c
blob7dc80a320ed22d4db747fa95202346ca397af894
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
4 #include "sse2-check.h"
6 #ifdef DEBUG
7 #include <stdio.h>
8 #endif
10 #include <emmintrin.h>
12 static void
13 __attribute__((noinline))
14 check (__m128i x, unsigned long long *v, int j)
16 union
18 __m128i x;
19 unsigned long long i[2];
20 } u;
21 unsigned int i;
23 u.x = x;
25 for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
26 if (i == j)
28 if (v[i] != u.i[i])
30 #ifdef DEBUG
31 printf ("%i: 0x%llx != 0x%llx\n", i, v[i], u.i[i]);
32 #endif
33 abort ();
36 else if (u.i[i] != 0)
38 #ifdef DEBUG
39 printf ("%i: 0x%llx != 0\n", i, u.i[i]);
40 #endif
41 abort ();
45 static void
46 __attribute__((noinline))
47 test (unsigned long long *v)
49 __m128i x;
51 x = _mm_set_epi64x (0, v[0]);
52 check (x, v, 0);
53 x = _mm_set_epi64x (v[1], 0);
54 check (x, v, 1);
57 static void
58 sse2_test (void)
60 unsigned long long v[2]
61 = { 0x7B5B546573745665LL, 0x63746F725D53475DLL };
62 test (v);