Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse-18.c
blobfc0224f8f6d185901db11928961764a9bb5a8265
1 /* { dg-do run } */
2 /* { dg-options "-O3 -msse2" } */
4 #include "sse2-check.h"
6 #include <emmintrin.h>
8 __m128i foo (char) __attribute__((noinline));
9 __m128i foo (char x) {
10 return _mm_set1_epi8(x);
12 __m128i bar (char) __attribute__((noinline));
13 __m128i bar (char x) {
14 return _mm_set_epi8 (x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
17 static void
18 sse2_test (void) {
19 int i, j;
20 union u { __m128i v; char c[16]; };
21 union u x, y;
23 for (i = -128; i <= 127; i++)
25 x.v = foo ((char)i);
26 y.v = bar ((char)i);
27 for (j=0; j<16; j++)
28 if (x.c[j] != y.c[j])
29 abort();