summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/regstack.C
blob: 5b8334733325407247fde713d8f1fcc8991fce49 (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
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-options "-O2" }

inline double foo (double x)
{
  register double r;
  asm volatile ("fsqrt" : "=t" (r) : "0" (x));
  return r;
}

struct X
{
  ~X() {}
};

int b;

double bar (X x)
{
  if (b)
    return 1.0;
  return 36.0 * foo (36.0);
}

int main ()
{
  X x;
  if (bar (x) != 216.0)
    return 1;
  return 0;
}