summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm-run.c
blob: 80578849a7ba08a886e44a61c9e0a4efa6666f77 (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
/* { dg-do run } */
/* { dg-options "-O2 -msse -fipa-ra" } */

typedef double v2df __attribute__((vector_size (16)));

static v2df __attribute__((noinline))
bar (v2df a)
{
  return a + (v2df){ 3.0, 3.0 };
}

v2df __attribute__((noinline))
foo (v2df y)
{
  return y + bar (y);
}

int
main (void)
{
  int success;
  union {
    v2df v;
    double d[2];
  } u;

  u.v = foo ((v2df){ 5.0, 5.0});
  success = (u.d[0] == 13.0
	     && u.d[1] == 13.0);

  return !success;
}