Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse4_1-set-epi32-1.c
blob989e4f7086f738fa230215d80d2a9da1c11bad91
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
5 #include "sse4_1-check.h"
7 #ifdef DEBUG
8 #include <stdio.h>
9 #endif
11 #include <emmintrin.h>
13 static void
14 __attribute__((noinline))
15 test (unsigned int *v)
17 union
19 __m128i x;
20 unsigned int i[4];
21 } u;
22 unsigned int i;
24 u.x = _mm_set_epi32 (v[3], v[2], v[1], v[0]);
26 for (i = 0; i < sizeof (v) / sizeof (v[0]); i++)
27 if (v[i] != u.i[i])
29 #ifdef DEBUG
30 printf ("%i: 0x%x != 0x%x\n", i, v[i], u.i[i]);
31 #endif
32 abort ();
36 static void
37 sse4_1_test (void)
39 unsigned int v[4]
40 = { 0x7B5B5465, 0x73745665, 0x63746F72, 0x5D53475D };
41 test (v);