aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig30.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.gb/sig30.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.gb/sig30.C48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.gb/sig30.C b/gcc/testsuite/g++.old-deja/g++.gb/sig30.C
new file mode 100644
index 00000000000..3e93e114b86
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.gb/sig30.C
@@ -0,0 +1,48 @@
+// Special g++ Options: -fhandle-signatures
+// GROUPS passed gb sigptr multiple-inheritance
+// Test calling overwritten virtual functions through signature pointer.
+
+extern "C"
+{
+ int printf (char *, ...);
+}
+
+class C
+{
+public:
+ char * text1;
+ C () { text1 = "PA"; }
+ virtual char * f (void) = 0;
+};
+
+class D
+{
+public:
+ char * text2;
+ D () { text2 = "SS"; }
+ virtual char * g (void) = 0;
+};
+
+class E : public C, public D
+{
+public:
+ E () : C (), D () { };
+ char * f (void) { return text1; }
+ char * g (void) { return text2; }
+};
+
+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;
+}