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

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