view gcc/testsuite/g++.dg/torture/pr39678.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR target/39678 */
/* { dg-do run } */
/* { dg-options "-Wno-psabi" } */
struct Y {};
struct X {
  struct Y y;
  __complex__ float val;
};

struct X __attribute__((noinline))
foo (float *p)
{
  struct X x;
  __real x.val = p[0];
  __imag x.val = p[1];
  return x;
}
extern "C" void abort (void);
float a[2] = { 3., -2. };
int main()
{
  struct X x = foo(a);
  if (__real x.val != 3. || __imag x.val != -2.)
    abort ();
  return 0;
}