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