Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse2-vec-2.c
blob6f5c514aa3cdb1babc0ff6d861be40944e268a7d
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2 } */
5 #include "sse2-check.h"
7 #include <emmintrin.h>
9 static void
10 sse2_test (void)
12 union
14 __m128i x;
15 char c[16];
16 short s[8];
17 int i[4];
18 long long ll[2];
19 } val1;
20 long long res[2];
21 int masks[2];
22 int i;
24 for (i = 0; i < 16; i++)
25 val1.c[i] = i;
27 res[0] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 0);
28 res[1] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 1);
30 for (i = 0; i < 2; i++)
31 masks[i] = i;
33 for (i = 0; i < 2; i++)
34 if (res[i] != val1.ll [masks[i]])
35 abort ();