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

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