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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [ctor2.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 14 Mar 2003 
5
 
6
// PR 9629. The vtable is not set up until the base initializers have
7
// run.
8
 
9
struct A {
10
  static A *a;
11
  A ();
12
};
13
A *A::a;
14
A::A () {a = this;}
15
 
16
struct B {
17
  static A *a;
18
  B (A *);
19
};
20
A *B::a;
21
B::B(A *a_) {a = a_;}
22
 
23
struct C : virtual public A, public B {
24
  C();
25
};
26
C::C () : B(this) {}
27
 
28
struct D : virtual public C {};
29
 
30
int main()
31
{
32
  new D();
33
  return A::a != B::a;
34
}

powered by: WebSVN 2.1.0

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