aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/pr46716.c
blob: 29c5e1e4920f1c4e97a084d2f751972637553a0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do run } */
/* { dg-options "-O2 -msse -mno-sse2" } */
/* { dg-require-effective-target sse } */

#include "sse-check.h"

typedef double V __attribute__ ((__vector_size__ (16), __may_alias__));
typedef union
{
  V x;
  double a[2];
} u;

#define EMM_FLT8(a) ((double *)&(a))

void __attribute__ ((noinline))
test (V s1, V s2)
{
  if (EMM_FLT8(s1)[0] != EMM_FLT8(s2)[0]
      || EMM_FLT8(s1)[1] != EMM_FLT8(s2)[1])
    abort ();
}

static void
sse_test (void)
{
  u s1;

  s1.a[0] = 1.0;
  s1.a[1] = 2.0;

  test (s1.x, s1.x);
}