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

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