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

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