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

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