a174f68
archer archer-keiths-expr-cumulative
a174f68
b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc
a174f68
22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc
22d1e60
===================================================================
22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc	2016-02-15 23:34:32.196402773 +0100
a174f68
@@ -0,0 +1,36 @@
a174f68
+namespace A
a174f68
+{
a174f68
+  namespace B
a174f68
+  {
a174f68
+    int ab = 11;
a174f68
+  }
a174f68
+}
a174f68
+
a174f68
+namespace C
a174f68
+{
a174f68
+  namespace D
a174f68
+  {
a174f68
+    using namespace A::B;
a174f68
+
a174f68
+    int
a174f68
+    second()
a174f68
+    {
a174f68
+      ab;
a174f68
+      return 0;
a174f68
+    }
a174f68
+  }
a174f68
+
a174f68
+  int
a174f68
+  first()
a174f68
+  {
a174f68
+    //ab;
a174f68
+    return D::second();
a174f68
+  }
a174f68
+}
a174f68
+
a174f68
+int
a174f68
+main()
a174f68
+{
a174f68
+  //ab;
a174f68
+  return C::first();
a174f68
+}
22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp
22d1e60
===================================================================
22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp	2016-02-15 23:34:51.926542859 +0100
a174f68
@@ -0,0 +1,50 @@
a174f68
+# Copyright 2008 Free Software Foundation, Inc.
a174f68
+
a174f68
+# This program is free software; you can redistribute it and/or modify
a174f68
+# it under the terms of the GNU General Public License as published by
a174f68
+# the Free Software Foundation; either version 3 of the License, or
a174f68
+# (at your option) any later version.
a174f68
+#
a174f68
+# This program is distributed in the hope that it will be useful,
a174f68
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a174f68
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a174f68
+# GNU General Public License for more details.
a174f68
+#
a174f68
+# You should have received a copy of the GNU General Public License
a174f68
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
a174f68
+
a174f68
+set testfile namespace-nested-imports
a174f68
+set srcfile ${testfile}.cc
22d1e60
+set binfile [standard_output_file ${testfile}]
a174f68
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
a174f68
+    untested "Couldn't compile test program"
a174f68
+    return -1
a174f68
+}
a174f68
+
a174f68
+# Get things started.
a174f68
+
a174f68
+gdb_exit
a174f68
+gdb_start
a174f68
+gdb_reinitialize_dir $srcdir/$subdir
a174f68
+gdb_load ${binfile}
a174f68
+
a174f68
+############################################
a174f68
+if ![runto_main] then {
a174f68
+    perror "couldn't run to breakpoint main"
a174f68
+    continue
a174f68
+}
a174f68
+
a174f68
+gdb_test "print ab" "No symbol .* in current context."
a174f68
+
a174f68
+############################################
a174f68
+gdb_breakpoint C::first
a174f68
+gdb_continue_to_breakpoint "C::first"
a174f68
+
a174f68
+gdb_test "print ab" "No symbol .* in current context."
a174f68
+gdb_test "print C::D::ab" "= 11"
a174f68
+
a174f68
+############################################
a174f68
+gdb_breakpoint C::D::second
a174f68
+gdb_continue_to_breakpoint "C::D::second"
a174f68
+
a174f68
+gdb_test "print ab" "= 11"
22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc
22d1e60
===================================================================
22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc	2016-02-15 23:34:32.196402773 +0100
a174f68
@@ -0,0 +1,37 @@
a174f68
+
a174f68
+namespace A
a174f68
+{
a174f68
+  int _a = 11;
a174f68
+
a174f68
+  namespace B{
a174f68
+
a174f68
+    int ab = 22;
a174f68
+
a174f68
+    namespace C{
a174f68
+
a174f68
+      int abc = 33;
a174f68
+
a174f68
+      int second(){
a174f68
+        return 0;
a174f68
+      }
a174f68
+
a174f68
+    }
a174f68
+
a174f68
+    int first(){
a174f68
+      _a;
a174f68
+      ab;
a174f68
+      C::abc;
a174f68
+      return C::second();
a174f68
+    }
a174f68
+  }
a174f68
+}
a174f68
+
a174f68
+
a174f68
+int
a174f68
+main()
a174f68
+{
a174f68
+  A::_a;
a174f68
+  A::B::ab;
a174f68
+  A::B::C::abc;
a174f68
+  return A::B::first();
a174f68
+}
22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp
22d1e60
===================================================================
22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp	2016-02-15 23:34:51.926542859 +0100
a174f68
@@ -0,0 +1,69 @@
a174f68
+# Copyright 2008 Free Software Foundation, Inc.
a174f68
+
a174f68
+# This program is free software; you can redistribute it and/or modify
a174f68
+# it under the terms of the GNU General Public License as published by
a174f68
+# the Free Software Foundation; either version 3 of the License, or
a174f68
+# (at your option) any later version.
a174f68
+#
a174f68
+# This program is distributed in the hope that it will be useful,
a174f68
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a174f68
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a174f68
+# GNU General Public License for more details.
a174f68
+#
a174f68
+# You should have received a copy of the GNU General Public License
a174f68
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
a174f68
+
a174f68
+set testfile namespace-no-imports
a174f68
+set srcfile ${testfile}.cc
22d1e60
+set binfile [standard_output_file ${testfile}]
a174f68
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
a174f68
+    untested "Couldn't compile test program"
a174f68
+    return -1
a174f68
+}
a174f68
+
a174f68
+# Get things started.
a174f68
+
a174f68
+gdb_exit
a174f68
+gdb_start
a174f68
+gdb_reinitialize_dir $srcdir/$subdir
a174f68
+gdb_load ${binfile}
a174f68
+
a174f68
+############################################
a174f68
+if ![runto_main] then {
a174f68
+    perror "couldn't run to breakpoint main"
a174f68
+    continue
a174f68
+}
a174f68
+
a174f68
+gdb_test "print A::_a" "= 11"
a174f68
+gdb_test "print A::B::ab" "= 22"
a174f68
+gdb_test "print A::B::C::abc" "= 33"
a174f68
+
a174f68
+gdb_test "print _a" "No symbol .* in current context."
a174f68
+gdb_test "print ab" "No symbol .* in current context."
a174f68
+gdb_test "print abc" "No symbol .* in current context."
a174f68
+
a174f68
+############################################
a174f68
+gdb_breakpoint A::B::first
a174f68
+gdb_continue_to_breakpoint "A::B::first"
a174f68
+
a174f68
+gdb_test "print A::_a" "= 11"
a174f68
+gdb_test "print A::B::ab" "= 22"
a174f68
+gdb_test "print A::B::C::abc" "= 33"
a174f68
+
a174f68
+gdb_test "print _a" "= 11"
a174f68
+gdb_test "print ab" "= 22"
a174f68
+gdb_test "print C::abc" "= 33"
a174f68
+
a174f68
+gdb_test "print abc" "No symbol .* in current context."
a174f68
+
a174f68
+############################################
a174f68
+gdb_breakpoint A::B::C::second
a174f68
+gdb_continue_to_breakpoint "A::B::C::second"
a174f68
+
a174f68
+gdb_test "print A::_a" "= 11"
a174f68
+gdb_test "print A::B::ab" "= 22"
a174f68
+gdb_test "print A::B::C::abc" "= 33"
a174f68
+
a174f68
+gdb_test "print _a" "= 11"
a174f68
+gdb_test "print ab" "= 22"
a174f68
+gdb_test "print abc" "= 33"