1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
4 
5 #include "sse4_1-check.h"
6 
7 #ifdef DEBUG
8 #include <stdio.h>
9 #endif
10 
11 #include <emmintrin.h>
12 
13 static void
14 __attribute__((noinline))
test(unsigned long long * v)15 test (unsigned long long *v)
16 {
17   union
18     {
19       __m128i x;
20       unsigned long long i[2];
21     } u;
22   unsigned int i;
23 
24   u.x = _mm_set_epi64x (v[1], v[0]);
25 
26   for (i = 0; i < sizeof (u) / sizeof (v[0]); i++)
27     if (v[i] != u.i[i])
28       {
29 #ifdef DEBUG
30 	printf ("%i: 0x%llx != 0x%llx\n", i, v[i], u.i[i]);
31 #endif
32 	abort ();
33       }
34 }
35 
36 static void
sse4_1_test(void)37 sse4_1_test (void)
38 {
39   unsigned long long v[2]
40     = { 0x7B5B546573745665LL, 0x63746F725D53475DLL };
41   test (v);
42 }
43