1/* { dg-do run } */
2/* { dg-options "-O2 -msse2" } */
3/* { dg-require-effective-target sse2 } */
4#include "sse2-check.h"
5#include <xmmintrin.h>
6extern void abort();
7int untrue = 0;
8typedef union {
9  __v4sf v;
10  float f[4];
11} u;
12void foo (u, u) __attribute__((noinline));
13void foo (u a, u b) {
14  if (b.f[0] != 7.0 || b.f[1] != 8.0 || b.f[2] != 3.0 || b.f[3] != 4.0)
15    abort();
16}
17void bar (__v4sf, __v4sf) __attribute__((noinline));
18void bar (__v4sf a __attribute((unused)), __v4sf b __attribute((unused))) { untrue = 0;}
19__v4sf setupa () __attribute((noinline));
20__v4sf setupa () { __v4sf t = { 1.0, 2.0, 3.0, 4.0 }; return t; }
21__v4sf setupb () __attribute((noinline));
22__v4sf setupb () { __v4sf t = { 5.0, 6.0, 7.0, 8.0 }; return t; }
23void __attribute__((noinline))
24sse2_test(void) {
25  u a, b;
26  a.v = setupa ();
27  b.v = setupb ();
28  if (untrue)
29    bar(a.v, b.v);
30  b.v = (__v4sf) _mm_movehl_ps ((__m128)a.v, (__m128)b.v);
31  foo (a, b);
32}
33