Index: gdb/testsuite/gdb.cp/baseenum.cc |
diff --git a/gdb/testsuite/gdb.cp/expand-sals.cc b/gdb/testsuite/gdb.cp/baseenum.cc |
similarity index 57% |
copy from gdb/testsuite/gdb.cp/expand-sals.cc |
copy to gdb/testsuite/gdb.cp/baseenum.cc |
index 71f72f9b05c17e17a4f8decd45f60d6020602400..66e30db5842d0f29b460abef150a1325c6299773 100644 |
--- a/gdb/testsuite/gdb.cp/expand-sals.cc |
+++ b/gdb/testsuite/gdb.cp/baseenum.cc |
@@ -1,8 +1,6 @@ |
/* This testcase is part of GDB, the GNU debugger. |
- Copyright (C) 2009-2012 Free Software Foundation, Inc. |
- |
- This file is part of GDB. |
+ 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 |
@@ -17,37 +15,66 @@ |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
-int |
-func () |
+class A |
{ |
- return 42; /* func-line */ |
-} |
+public: |
+ enum E {X,Y,Z}; |
+}; |
+ |
+class B1 : public A |
+{ |
+}; |
-volatile int global_x; |
+class B2 : public A |
+{ |
+}; |
-class A |
+class C : public B1, public B2 |
{ |
public: |
- A () |
- { |
- global_x = func (); /* caller-line */ |
- } |
+ void test(E e); |
}; |
-/* class B is here just to make the `func' calling line above having multiple |
- instances - multiple locations. Template cannot be used as its instances |
- would have different function names which get discarded by GDB |
- expand_line_sal_maybe. */ |
+void C::test(E e) |
+{ |
+ if (e == X) // breakpoint 1 |
+ { |
+ } |
+} |
-class B : public A |
+namespace N |
{ |
-}; |
+ class A |
+ { |
+ public: |
+ enum E {X, Y, Z}; |
+ }; |
-int |
-main (void) |
+ class B1 {}; |
+ class B2 : public A {}; |
+ |
+ class C : public B1, public B2 |
+ { |
+ public: |
+ void test (E e); |
+ }; |
+ |
+ void |
+ C::test (E e) |
+ { |
+ if (e == X) // breakpoint 2 |
+ { |
+ } |
+ } |
+} |
+ |
+int main() |
{ |
- A a; |
- B b; |
+ C c; |
+ c.test(A::X); |
+ N::C nc; |
+ nc.test (N::A::X); |
return 0; |
} |
+ |