Blame SOURCES/gdb-physname-pr12273-test.patch

e1d87d
http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html
e1d87d
e1d87d
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc	2011-02-03 22:31:01.000000000 +0100
e1d87d
@@ -0,0 +1,37 @@
e1d87d
+/* This test case is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2010 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 3 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
e1d87d
+
e1d87d
+template <typename T>
e1d87d
+class GDB
e1d87d
+{
e1d87d
+ public:
e1d87d
+   static int simple (void) { return 0; }
e1d87d
+   static int harder (T a) { return 1; }
e1d87d
+   template <typename X>
e1d87d
+   static X even_harder (T a) { return static_cast<X> (a); }
e1d87d
+   int operator == (GDB const& other)
e1d87d
+   { return 1; }
e1d87d
+};
e1d87d
+
e1d87d
+int main(int argc, char **argv)
e1d87d
+{
e1d87d
+   GDB<int> a, b;
e1d87d
+   if (a == b)
e1d87d
+     return GDB<char>::harder('a') + GDB<int>::harder(3)
e1d87d
+	+ GDB<char>::even_harder<int> ('a');
e1d87d
+   return GDB<int>::simple ();
e1d87d
+}
e1d87d
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp	2011-02-03 22:31:01.000000000 +0100
e1d87d
@@ -0,0 +1,46 @@
e1d87d
+# Copyright 2010 Free Software Foundation, Inc.
e1d87d
+#
e1d87d
+# Contributed by Red Hat, originally written by Keith Seitz.
e1d87d
+#
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 3 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+#
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+#
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
e1d87d
+
e1d87d
+# This file is part of the gdb testsuite.
e1d87d
+
e1d87d
+if {[skip_cplus_tests]} { continue }
e1d87d
+
e1d87d
+set testfile "pr12273"
e1d87d
+# Do NOT compile with debug flag.
e1d87d
+prepare_for_testing pr12273 $testfile $testfile.cc {c++}
e1d87d
+
e1d87d
+gdb_test_no_output "set language c++"
e1d87d
+
e1d87d
+# A list of minimal symbol names to check.
e1d87d
+# Note that GDB<char>::even_harder<int>(char) is quoted and includes
e1d87d
+# the return type.  This is necessary because this is the demangled name
e1d87d
+# of the minimal symbol.
e1d87d
+set min_syms [list \
e1d87d
+		  "GDB<int>::operator ==" \
e1d87d
+		  "GDB<int>::operator==(GDB<int> const&)" \
e1d87d
+		  "GDB<char>::harder(char)" \
e1d87d
+		  "GDB<int>::harder(int)" \
e1d87d
+		  {"int GDB<char>::even_harder<int>(char)"} \
e1d87d
+		  "GDB<int>::simple()"]
e1d87d
+
e1d87d
+foreach sym $min_syms {
e1d87d
+    if {[gdb_breakpoint $sym]} {
e1d87d
+	pass "setting breakpoint at $sym"
e1d87d
+    }
e1d87d
+}
e1d87d
+
e1d87d
+gdb_exit