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

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