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

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