Blame SOURCES/gdb-test-expr-cumulative-archer.patch

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