2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-set-epi64x-1.c
blob67510b59c7edeb49a7209311656925c4c1685146
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 test (unsigned long long *v)
16 union
18 __m128i x;
19 unsigned long long i[2];
20 } u;
21 unsigned int i;
23 u.x = _mm_set_epi64x (v[1], v[0]);
25 for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
26 if (v[i] != u.i[i])
28 #ifdef DEBUG
29 printf ("%i: 0x%llx != 0x%llx\n", i, v[i], u.i[i]);
30 #endif
31 abort ();
35 static void
36 sse2_test (void)
38 unsigned long long v[2]
39 = { 0x7B5B546573745665LL, 0x63746F725D53475DLL };
40 test (v);