Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse-18.c
blob6a1352b828e2620882da8675aeba8c96d4fe80fb
1 /* { dg-do run } */
2 /* { dg-options "-O3 -msse2" } */
3 /* { dg-require-effective-target sse2 } */
5 #include "sse2-check.h"
7 #include <emmintrin.h>
9 __m128i foo (char) __attribute__((noinline));
10 __m128i foo (char x) {
11 return _mm_set1_epi8(x);
13 __m128i bar (char) __attribute__((noinline));
14 __m128i bar (char x) {
15 return _mm_set_epi8 (x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
18 static void
19 sse2_test (void) {
20 int i, j;
21 union u { __m128i v; char c[16]; };
22 union u x, y;
24 for (i = -128; i <= 127; i++)
26 x.v = foo ((char)i);
27 y.v = bar ((char)i);
28 for (j=0; j<16; j++)
29 if (x.c[j] != y.c[j])
30 abort();