view gcc/testsuite/g++.dg/abi/structret1.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

// { dg-do run { target ia64-*-* } }
// { dg-options "-fabi-version=0" }

extern "C" void abort ();

struct ConstructedObject {
  ConstructedObject() {};
  ~ConstructedObject() {};
  ConstructedObject(const ConstructedObject &from) {};
};

struct FrameworkObject {
  ConstructedObject action();
};

ConstructedObject FrameworkObject::action() {
  void *r32, *r33;

  asm("mov %0 = r32\nmov %1 = r33" : "=r"(r32), "=r"(r33) : );
  if (this != r33) {
    abort ();
  }
  return ConstructedObject();
}

int main()
{
  FrameworkObject slawa;
  slawa.action();
  return 0;
}