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

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