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

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