aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.gb/sig19.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.gb/sig19.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.gb/sig19.C38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.gb/sig19.C b/gcc/testsuite/g++.old-deja/g++.gb/sig19.C
new file mode 100644
index 00000000000..160a4a3bd49
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.gb/sig19.C
@@ -0,0 +1,38 @@
+// Special g++ Options: -fhandle-signatures
+// GROUPS passed gb sigptr initialization virtual
+// Test initialization of signature pointer with object from abstract class.
+
+extern "C"
+{
+ int printf (char *, ...);
+}
+
+class C
+{
+public:
+ virtual char * f (void) = 0;
+ virtual char * g (int) = 0;
+};
+
+class D : public C
+{
+public:
+ char * f (void) { return "PA"; }
+ char * g (int) { return "SS"; }
+};
+
+signature S
+{
+ char * f (void);
+ char * g (int);
+};
+
+int main (void)
+{
+ C * p = new D;
+ S * q = p;
+
+ printf ("%s%s\n", q->f (), q->g (0));
+
+ return 0;
+}