OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [thunk1.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run { target i?86-*-* x86_64-*-* s390*-*-* alpha*-*-* ia64-*-* sparc*-*-* } }
2
 
3
#include 
4
 
5
extern "C" void abort ();
6
 
7
struct A {
8
  virtual void f (int, ...) {}
9
  int i;
10
};
11
 
12
struct B : virtual public A {
13
};
14
 
15
struct C : public B {
16
  C ();
17
  virtual void f (int, ...);
18
};
19
 
20
extern C* cp;
21
 
22
C::C () { cp = this; }
23
 
24
void C::f (int i, ...) {
25
  if (this != cp)
26
    abort ();
27
  va_list ap;
28
  if (i != 3)
29
    abort ();
30
  va_start (ap, i);
31
  if (va_arg (ap, int) != 7)
32
    abort ();
33
  va_end (ap);
34
}
35
 
36
C* cp = new C;
37
 
38
int main ()
39
{
40
  cp->f (3, 7);
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.