Index: gdb/testsuite/gdb.cp/typeid.cc |
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.c b/gdb/testsuite/gdb.cp/typeid.cc |
similarity index 55% |
copy from gdb/testsuite/gdb.threads/attach-stopped.c |
copy to gdb/testsuite/gdb.cp/typeid.cc |
index d9699382709060ca0be4c3e020565a0c167041ab..7120031f03c1091bdd820d1d242a2094896e0a3c 100644 |
--- a/gdb/testsuite/gdb.threads/attach-stopped.c |
+++ b/gdb/testsuite/gdb.cp/typeid.cc |
@@ -1,6 +1,6 @@ |
/* This testcase is part of GDB, the GNU debugger. |
- Copyright 2008-2012 Free Software Foundation, Inc. |
+ Copyright 2013 Free Software Foundation, Inc. |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
@@ -15,36 +15,46 @@ |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
-/* This program is intended to be started outside of gdb, then |
- manually stopped via a signal. */ |
+#include <typeinfo> |
-#include <stddef.h> |
-#include <unistd.h> |
-#ifdef USE_THREADS |
-#include <pthread.h> |
-#endif |
+int i; |
+char *cp; |
+const char *ccp; |
+char ca[5]; |
-static void *func (void *arg) |
+struct Base |
{ |
- sleep (10000); /* Ridiculous time, but we will eventually kill it. */ |
- sleep (10000); /* Second sleep. */ |
- return NULL; |
-} |
+ virtual ~Base() { } |
+}; |
-int main () |
+struct VB1 : public virtual Base |
{ |
+}; |
-#ifndef USE_THREADS |
+struct VB2 : public virtual Base |
+{ |
+}; |
- func (NULL); |
+struct Derived : public VB1, VB2 |
+{ |
+}; |
-#else |
+Derived d; |
- pthread_t th; |
- pthread_create (&th, NULL, func, NULL); |
- pthread_join (th, NULL); |
+Base *b = &d; |
+VB1 *vb1 = &d; |
+VB1 *vb2 = &d; |
-#endif |
+const Base *bv = &d; |
+ |
+int main () |
+{ |
+ const std::type_info &xi = typeid(i); |
+ const std::type_info &xcp = typeid(cp); |
+ const std::type_info &xccp = typeid(ccp); |
+ const std::type_info &xca = typeid(ca); |
+ const std::type_info &xd = typeid(d); |
+ const std::type_info &xb = typeid(b); |
return 0; |
} |