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

475228
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
475228
From: Fedora GDB patches <invalid@email.com>
475228
Date: Fri, 27 Oct 2017 21:07:50 +0200
475228
Subject: gdb-physname-pr11734-test.patch
475228
475228
;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
475228
;;=fedoratest
475228
475228
http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html
475228
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734-1.cc
475228
@@ -0,0 +1,30 @@
475228
+/* This testcase is part of GDB, the GNU debugger.
475228
+
475228
+   Copyright 2010 Free Software Foundation, Inc.
475228
+
475228
+   This program is free software; you can redistribute it and/or modify
475228
+   it under the terms of the GNU General Public License as published by
475228
+   the Free Software Foundation; either version 3 of the License, or
475228
+   (at your option) any later version.
475228
+
475228
+   This program is distributed in the hope that it will be useful,
475228
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+   GNU General Public License for more details.
475228
+
475228
+   You should have received a copy of the GNU General Public License
475228
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+   Please email any bugs, comments, and/or additions to this file to:
475228
+   bug-gdb@gnu.org  */
475228
+
475228
+#include "pr11734.h"
475228
+
475228
+int
475228
+main ()
475228
+{
475228
+  pr11734 *p = new pr11734;
475228
+  p->foo ();
475228
+  return 0;
475228
+}
475228
+
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734-2.cc
475228
@@ -0,0 +1,27 @@
475228
+/* This testcase is part of GDB, the GNU debugger.
475228
+
475228
+   Copyright 2010 Free Software Foundation, Inc.
475228
+
475228
+   This program is free software; you can redistribute it and/or modify
475228
+   it under the terms of the GNU General Public License as published by
475228
+   the Free Software Foundation; either version 3 of the License, or
475228
+   (at your option) any later version.
475228
+
475228
+   This program is distributed in the hope that it will be useful,
475228
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+   GNU General Public License for more details.
475228
+
475228
+   You should have received a copy of the GNU General Public License
475228
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+   Please email any bugs, comments, and/or additions to this file to:
475228
+   bug-gdb@gnu.org  */
475228
+
475228
+#include "pr11734.h"
475228
+
475228
+void
475228
+pr11734::foo(void)
475228
+{
475228
+}
475228
+
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734-3.cc
475228
@@ -0,0 +1,27 @@
475228
+/* This testcase is part of GDB, the GNU debugger.
475228
+
475228
+   Copyright 2010 Free Software Foundation, Inc.
475228
+
475228
+   This program is free software; you can redistribute it and/or modify
475228
+   it under the terms of the GNU General Public License as published by
475228
+   the Free Software Foundation; either version 3 of the License, or
475228
+   (at your option) any later version.
475228
+
475228
+   This program is distributed in the hope that it will be useful,
475228
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+   GNU General Public License for more details.
475228
+
475228
+   You should have received a copy of the GNU General Public License
475228
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+   Please email any bugs, comments, and/or additions to this file to:
475228
+   bug-gdb@gnu.org  */
475228
+
475228
+#include "pr11734.h"
475228
+
475228
+void
475228
+pr11734::foo (int a)
475228
+{
475228
+}
475228
+
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734-4.cc
475228
@@ -0,0 +1,27 @@
475228
+/* This testcase is part of GDB, the GNU debugger.
475228
+
475228
+   Copyright 2010 Free Software Foundation, Inc.
475228
+
475228
+   This program is free software; you can redistribute it and/or modify
475228
+   it under the terms of the GNU General Public License as published by
475228
+   the Free Software Foundation; either version 3 of the License, or
475228
+   (at your option) any later version.
475228
+
475228
+   This program is distributed in the hope that it will be useful,
475228
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+   GNU General Public License for more details.
475228
+
475228
+   You should have received a copy of the GNU General Public License
475228
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+   Please email any bugs, comments, and/or additions to this file to:
475228
+   bug-gdb@gnu.org  */
475228
+
475228
+#include "pr11734.h"
475228
+
475228
+void
475228
+pr11734::foo (char *a)
475228
+{
475228
+}
475228
+
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734.exp
475228
@@ -0,0 +1,55 @@
475228
+# Copyright 2010 Free Software Foundation, Inc.
475228
+#
475228
+# Contributed by Red Hat, originally written by Keith Seitz.
475228
+#
475228
+# This program is free software; you can redistribute it and/or modify
475228
+# it under the terms of the GNU General Public License as published by
475228
+# the Free Software Foundation; either version 3 of the License, or
475228
+# (at your option) any later version.
475228
+#
475228
+# This program is distributed in the hope that it will be useful,
475228
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+# GNU General Public License for more details.
475228
+#
475228
+# You should have received a copy of the GNU General Public License
475228
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+# This file is part of the gdb testsuite.
475228
+
475228
+if { [skip_cplus_tests] } { continue }
475228
+
475228
+set testfile "pr11734"
475228
+set class $testfile
475228
+
475228
+set srcfiles {}
475228
+for {set i 1} {$i < 5} {incr i} {
475228
+    lappend srcfiles $testfile-$i.cc
475228
+}
475228
+
475228
+prepare_for_testing pr11734 $testfile $srcfiles {c++ debug}
475228
+
475228
+if {![runto_main]} {
475228
+    perror "couldn't run to breakpoint"
475228
+    continue
475228
+}
475228
+
475228
+# An array holding the overload types for the method pr11734::foo.  The
475228
+# first element is the overloaded method parameter.  The second element
475228
+# is the expected source file number, e.g. "pr11734-?.cc".
475228
+array set tests {
475228
+    "char*"  4
475228
+    "int"    3
475228
+    ""       2
475228
+}
475228
+
475228
+# Test each overload instance twice: once quoted, once unquoted
475228
+foreach ovld [array names tests] {
475228
+    set method "${class}::foo\($ovld\)"
475228
+    set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*"
475228
+    gdb_test "break $method" $result
475228
+    gdb_test "break '$method'" $result
475228
+}
475228
+
475228
+gdb_exit
475228
+return 0
475228
diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h
475228
new file mode 100644
475228
--- /dev/null
475228
+++ b/gdb/testsuite/gdb.cp/pr11734.h
475228
@@ -0,0 +1,28 @@
475228
+/* This testcase is part of GDB, the GNU debugger.
475228
+
475228
+   Copyright 2010 Free Software Foundation, Inc.
475228
+
475228
+   This program is free software; you can redistribute it and/or modify
475228
+   it under the terms of the GNU General Public License as published by
475228
+   the Free Software Foundation; either version 3 of the License, or
475228
+   (at your option) any later version.
475228
+
475228
+   This program is distributed in the hope that it will be useful,
475228
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
475228
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
475228
+   GNU General Public License for more details.
475228
+
475228
+   You should have received a copy of the GNU General Public License
475228
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
475228
+
475228
+   Please email any bugs, comments, and/or additions to this file to:
475228
+   bug-gdb@gnu.org  */
475228
+
475228
+class pr11734
475228
+{
475228
+ public:
475228
+  void foo ();
475228
+  void foo (int);
475228
+  void foo (char *);
475228
+};
475228
+