aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
diff options
context:
space:
mode:
authorSterling Augustine <saugustine@google.com>2011-10-11 19:19:08 +0000
committerSterling Augustine <saugustine@google.com>2011-10-11 19:19:08 +0000
commit9c6c53f727812659468627db13addcc5e4f9342a (patch)
treeee8e2d306b1c39b6362fcf4abe385fd3ca64ea71 /gdb/testsuite/gdb.cp
parent205c306f8020479681add9d274b2c261acc48318 (diff)
downloadgdb-9c6c53f727812659468627db13addcc5e4f9342a.zip
gdb-9c6c53f727812659468627db13addcc5e4f9342a.tar.gz
gdb-9c6c53f727812659468627db13addcc5e4f9342a.tar.bz2
gdb/ChangeLog
2011-10-11 Sterling Augustine <saugustine@google.com> * dwarf2read.c (partial_die_parent_scope): Rearrange conditional logic. gdb/testsuite/ChangeLog 2011-10-11 Sterling Augustine <saugustine@google.com> * gdb.cp/Makefile.in: Add namespace-enum test. * gdb.cp/namespace-enum.exp: New file. * gdb.cp/namespace-enum.c: New file. * gdb.cp/namespace-enum-main.c: New file.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r--gdb/testsuite/gdb.cp/Makefile.in6
-rw-r--r--gdb/testsuite/gdb.cp/namespace-enum-main.cc5
-rw-r--r--gdb/testsuite/gdb.cp/namespace-enum.cc8
-rw-r--r--gdb/testsuite/gdb.cp/namespace-enum.exp42
4 files changed, 58 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in
index c4a1ec2..3b7ef16 100644
--- a/gdb/testsuite/gdb.cp/Makefile.in
+++ b/gdb/testsuite/gdb.cp/Makefile.in
@@ -7,9 +7,9 @@ EXECUTABLES = abstract-origin ambiguous annota2 annota3 anon-union \
exception expand-sals extern-c formatted-ref fpointer gdb1355 \
gdb2384 hang infcall-dlopen inherit koenig local m-data m-static \
mb-ctor mb-inline mb-templates member-ptr method misc namespace \
- namespace-nested-import nextoverthrow noparam nsdecl nsimport \
- nsnested nsnoimports nsrecurs nsstress nsusing operator oranking \
- overload overload-const ovldbreak pass-by-ref pr-1023 pr-1210 \
+ namespace-enum namespace-nested-import nextoverthrow noparam nsdecl \
+ nsimport nsnested nsnoimports nsrecurs nsstress nsusing operator \
+ oranking overload overload-const ovldbreak pass-by-ref pr-1023 pr-1210 \
pr-574 pr10728 pr12028 pr9631 printmethod psmang ptype-cv-cp \
re-set-overloaded ref-typ ref-typ2 rtti shadow smartp temargs \
templates try_catch typedef-operator userdef virtbase virtfunc \
diff --git a/gdb/testsuite/gdb.cp/namespace-enum-main.cc b/gdb/testsuite/gdb.cp/namespace-enum-main.cc
new file mode 100644
index 0000000..aaddb8a
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-enum-main.cc
@@ -0,0 +1,5 @@
+namespace foo {
+int aglobal = 0;
+}
+
+int main() {return 0;}
diff --git a/gdb/testsuite/gdb.cp/namespace-enum.cc b/gdb/testsuite/gdb.cp/namespace-enum.cc
new file mode 100644
index 0000000..3eaf48f
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-enum.cc
@@ -0,0 +1,8 @@
+enum A { A_A };
+enum A a = A_A;
+
+namespace foo
+{
+enum B { B_B };
+enum B b = B_B;
+};
diff --git a/gdb/testsuite/gdb.cp/namespace-enum.exp b/gdb/testsuite/gdb.cp/namespace-enum.exp
new file mode 100644
index 0000000..a8b26ec
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-enum.exp
@@ -0,0 +1,42 @@
+# Copyright 2011 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile namespace-enum
+set srcfile0 ${testfile}.cc
+set objfile0 ${testfile}.o
+set srcfile1 ${testfile}-main.cc
+set objfile1 ${testfile}-main.o
+set binfile ${testfile}
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile0" "$objdir/$subdir/$objfile0" object {debug c++}] != "" } {
+ untested namespace-enum.exp
+ return -1
+}
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
+ untested namespace-enum.exp
+ return -1
+}
+
+if { [gdb_compile "$objdir/$subdir/$objfile0 $objdir/$subdir/$objfile1" "${binfile}" executable {debug c++}] != "" } {
+ untested namespace-enum.exp
+ return -1
+}
+
+clean_restart ${binfile}
+gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type."
+gdb_test "print foo::B_B" "foo::B_B"
+gdb_test "print A_A" "A_A"
+