summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/structret1.C
blob: e9d4fd0ff9fa90c3a42c76517cf2e2eade5d5a8f (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 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 ();
  }
}

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