diff options
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.gb/sig28.C')
-rwxr-xr-x | gcc_arm/testsuite/g++.old-deja/g++.gb/sig28.C | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.gb/sig28.C b/gcc_arm/testsuite/g++.old-deja/g++.gb/sig28.C new file mode 100755 index 0000000..4edff68 --- /dev/null +++ b/gcc_arm/testsuite/g++.old-deja/g++.gb/sig28.C @@ -0,0 +1,46 @@ +// Special g++ Options: -fhandle-signatures +// GROUPS passed gb sigptr multiple-inheritance +// Test correct adjustment of `this' pointer in case of multiple inheritance. + +extern "C" +{ + int printf (char *, ...); +} + +class C +{ + char * text; +public: + C () { text = "PA"; } + char * f (void) { return text; } +}; + +class D +{ + char * text; +public: + D () { text = "SS"; } + char * g (void) { return text; } +}; + +class E : public C, public D +{ +public: + E () : C (), D () { } +}; + +signature S +{ + char * f (void); + char * g (void); +}; + +int main (void) +{ + E a; + S * p = &a; + + printf ("%s%s\n", p->f (), p->g ()); + + return 0; +} |