Index: gdb/testsuite/gdb.cp/member-name.cc |
diff --git a/gdb/testsuite/gdb.python/py-type.c b/gdb/testsuite/gdb.cp/member-name.cc |
similarity index 56% |
copy from gdb/testsuite/gdb.python/py-type.c |
copy to gdb/testsuite/gdb.cp/member-name.cc |
index bf3944385bfcef79b1e03dcbafcbc00ced50db5c..c30895ae0f94d467abfe32a07f15ac8226c8316a 100644 |
--- a/gdb/testsuite/gdb.python/py-type.c |
+++ b/gdb/testsuite/gdb.cp/member-name.cc |
@@ -1,6 +1,6 @@ |
/* This testcase is part of GDB, the GNU debugger. |
- Copyright 2009-2012 Free Software Foundation, Inc. |
+ Copyright 2003-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,60 +15,58 @@ |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
-struct s |
+struct B |
{ |
- int a; |
- int b; |
+ static int b; |
}; |
-typedef struct s TS; |
-TS ts; |
+int B::b = 23; |
-#ifdef __cplusplus |
-struct C |
+struct C : public B |
{ |
- int c; |
- int d; |
-}; |
+ static int x; |
-struct D : C |
-{ |
- int e; |
- int f; |
-}; |
+ struct inner |
+ { |
+ static int z; |
+ }; |
-template<typename T, int I, int C::*MP> |
-struct Temargs |
-{ |
+ int y; |
+ |
+ C () |
+ { |
+ // First breakpoint here |
+ y = x + inner::z; |
+ } |
+ |
+ int m () |
+ { |
+ // Second breakpoint here |
+ return x - y; |
+ } |
}; |
-Temargs<D, 23, &C::c> temvar; |
+int C::x = 23; |
+int C::inner::z = 0; |
-#endif |
+template<typename T> |
+struct Templ |
+{ |
+ static int y; |
-enum E |
-{ v1, v2, v3 |
+ int m() |
+ { |
+ // Third breakpoint here |
+ return Templ::y; |
+ } |
}; |
-int |
-main () |
+template<typename T> int Templ<T>::y = 23; |
+ |
+int main () |
{ |
- int ar[2] = {1,2}; |
- struct s st; |
-#ifdef __cplusplus |
C c; |
- c.c = 1; |
- c.d = 2; |
- D d; |
- d.e = 3; |
- d.f = 4; |
-#endif |
- enum E e; |
- |
- st.a = 3; |
- st.b = 5; |
- |
- e = v2; |
- |
- return 0; /* break to inspect struct and array. */ |
+ Templ<int> t; |
+ |
+ return c.m() + t.m(); |
} |