From: No Author Date: Tue, 28 Jan 2003 17:25:50 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.2.2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c7dbc291d6b9b53c495f9c0ba53c4924e2047f;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_2-branch'. From-SVN: r61985 --- diff --git a/gcc/testsuite/g++.dg/abi/dcast1.C b/gcc/testsuite/g++.dg/abi/dcast1.C new file mode 100644 index 000000000000..402684ff4467 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/dcast1.C @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 28 Jan 2003 + +// PR 9433. segfault at runtime. + +struct A { virtual void f() {}; }; +struct B {int b;}; +struct C : A, B { virtual void f() {}; int c;}; +struct D : C {int d;}; +struct E : C {int e;}; +struct F : protected D, E {int f;}; +struct H : virtual F {int h;}; +struct I : H {int i;}; +struct J : H {int j;}; +struct K : I, J { virtual void f() {}; int k; }; +struct M : K {int m;}; +struct N : M {int n;}; +struct O : M {int o;}; +struct P : N, O { virtual void f() {}; int p;}; + +int main() +{ + P obj; + A* a1 = (D *) (&obj); + H* hp = dynamic_cast(a1); + return hp != 0; +}