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

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