summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C')
-rwxr-xr-xgcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C b/gcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C
new file mode 100755
index 0000000..f739a28
--- /dev/null
+++ b/gcc_arm/testsuite/g++.old-deja/g++.gb/sig02.C
@@ -0,0 +1,45 @@
+// Special g++ Options: -fhandle-signatures
+// GROUPS passed gb sigptr assignment
+// Test assigning objects of different classes to local signature pointer.
+
+extern "C"
+{
+ int printf (char *, ...);
+}
+
+class C
+{
+public:
+ char * f (void) { return "PA"; }
+};
+
+class D
+{
+public:
+ char * f (void) { return "SS"; }
+};
+
+signature S
+{
+ char * f (void);
+};
+
+int main (void)
+{
+ C a;
+ D b;
+ S * p;
+ int i;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ p = &a;
+ else
+ p = &b;
+ printf ("%s", p->f ());
+ }
+ printf ("\n");
+
+ return 0;
+}