aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/cxx3.C
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/cxx3.C')
-rw-r--r--testsuite/cxx3.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/cxx3.C b/testsuite/cxx3.C
new file mode 100644
index 0000000..0a4ad7b
--- /dev/null
+++ b/testsuite/cxx3.C
@@ -0,0 +1,26 @@
+#include "cxx3.h"
+extern "C" void abort (void);
+
+void
+check (A *x, B *y)
+{
+ C d;
+ if (x->b () != 2)
+ abort ();
+ if (y->B::a () != 3)
+ abort ();
+ if (d.a () != 4)
+ abort ();
+ if (d.C::b () != 5)
+ abort ();
+}
+
+int
+main ()
+{
+ A x;
+ if (x.a () != 1)
+ abort ();
+ do_check (check, &x);
+ return 0;
+}