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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [abi/] [dcast1.C] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 28 Jan 2003 
5
 
6
// PR 9433. segfault at runtime.
7
 
8
struct A        { virtual void f() {}; };
9
struct B        {int b;};
10
struct C : A, B { virtual void f() {}; int c;};
11
struct D : C    {int d;};
12
struct E : C    {int e;};
13
struct F : protected D, E  {int f;};
14
struct H : virtual F {int h;};
15
struct I : H  {int i;};
16
struct J : H  {int j;};
17
struct K : I, J { virtual void f() {}; int k; };
18
struct M : K  {int m;};
19
struct N : M  {int n;};
20
struct O : M  {int o;};
21
struct P : N, O { virtual void f() {}; int p;};
22
 
23
int main()
24
{
25
  P obj;
26
  A* a1 = (D *) (&obj);
27
  H* hp = dynamic_cast(a1);
28
  return hp != 0;
29
}

powered by: WebSVN 2.1.0

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