Blame SOURCES/gdb-6.5-bz109921-DW_AT_decl_file-test.patch

26bbde
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
26bbde
26bbde
It is duplicite to its upstream variant:
26bbde
http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html
26bbde
http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
26bbde
2007-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
26bbde
	    Daniel Jacobowitz  <dan@codesourcery.com>
26bbde
26bbde
	* gdb.base/included.c, gdb.base/included.exp,
26bbde
	gdb.base/included.h: New files.
26bbde
26bbde
------------------------------------------------------------------------------
26bbde
26bbde
2007-01-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
26bbde
26bbde
	* gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
26bbde
	gdb.dwarf2/dw2-included.h: New files.
26bbde
be09dc
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.c
be09dc
===================================================================
be09dc
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
be09dc
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.c	2016-02-16 09:52:29.861247534 +0100
26bbde
@@ -0,0 +1,26 @@
26bbde
+/* This testcase is part of GDB, the GNU debugger.
26bbde
+
26bbde
+   Copyright 2006 Free Software Foundation, Inc.
26bbde
+
26bbde
+   This program is free software; you can redistribute it and/or modify
26bbde
+   it under the terms of the GNU General Public License as published by
26bbde
+   the Free Software Foundation; either version 2 of the License, or
26bbde
+   (at your option) any later version.
26bbde
+
26bbde
+   This program is distributed in the hope that it will be useful,
26bbde
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
26bbde
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26bbde
+   GNU General Public License for more details.
26bbde
+ 
26bbde
+   You should have received a copy of the GNU General Public License
26bbde
+   along with this program; if not, write to the Free Software
26bbde
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
26bbde
+   USA.  */
26bbde
+
26bbde
+#include "dw2-included.h"
26bbde
+
26bbde
+int
26bbde
+main()
26bbde
+{
26bbde
+  return 0;
26bbde
+}
be09dc
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp
be09dc
===================================================================
be09dc
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
be09dc
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.exp	2016-02-16 09:52:36.481292330 +0100
26bbde
@@ -0,0 +1,47 @@
26bbde
+# Copyright 2006 Free Software Foundation, Inc.
26bbde
+
26bbde
+# This program is free software; you can redistribute it and/or modify
26bbde
+# it under the terms of the GNU General Public License as published by
26bbde
+# the Free Software Foundation; either version 2 of the License, or
26bbde
+# (at your option) any later version.
26bbde
+# 
26bbde
+# This program is distributed in the hope that it will be useful,
26bbde
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26bbde
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26bbde
+# GNU General Public License for more details.
26bbde
+# 
26bbde
+# You should have received a copy of the GNU General Public License
26bbde
+# along with this program; if not, write to the Free Software
26bbde
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26bbde
+
26bbde
+# Minimal DWARF-2 unit test
26bbde
+
26bbde
+# This test can only be run on targets which support DWARF-2.
26bbde
+# For now pick a sampling of likely targets.
26bbde
+if {![istarget *-*-linux*]
26bbde
+    && ![istarget *-*-gnu*]
26bbde
+    && ![istarget *-*-elf*]
26bbde
+    && ![istarget *-*-openbsd*]
26bbde
+    && ![istarget arm-*-eabi*]
26bbde
+    && ![istarget powerpc-*-eabi*]} {
26bbde
+    return 0  
26bbde
+}
26bbde
+
26bbde
+set testfile "dw2-included"
26bbde
+set srcfile ${testfile}.c
be09dc
+set binfile [standard_output_file ${testfile}]
26bbde
+
26bbde
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
26bbde
+    return -1
26bbde
+}
26bbde
+
26bbde
+gdb_exit
26bbde
+gdb_start
26bbde
+gdb_reinitialize_dir $srcdir/$subdir
26bbde
+gdb_load ${binfile}
26bbde
+
26bbde
+gdb_test "set listsize 1" ""
26bbde
+gdb_test "list integer" "int integer;\r"
26bbde
+gdb_test "ptype integer" "type = int\r"
26bbde
+# Path varies depending on the build location.
26bbde
+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\nint integer;\r"
be09dc
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.h
be09dc
===================================================================
be09dc
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
be09dc
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-included.h	2016-02-16 09:52:29.862247541 +0100
26bbde
@@ -0,0 +1,20 @@
26bbde
+/* This testcase is part of GDB, the GNU debugger.
26bbde
+
26bbde
+   Copyright 2006 Free Software Foundation, Inc.
26bbde
+
26bbde
+   This program is free software; you can redistribute it and/or modify
26bbde
+   it under the terms of the GNU General Public License as published by
26bbde
+   the Free Software Foundation; either version 2 of the License, or
26bbde
+   (at your option) any later version.
26bbde
+
26bbde
+   This program is distributed in the hope that it will be useful,
26bbde
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
26bbde
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26bbde
+   GNU General Public License for more details.
26bbde
+ 
26bbde
+   You should have received a copy of the GNU General Public License
26bbde
+   along with this program; if not, write to the Free Software
26bbde
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
26bbde
+   USA.  */
26bbde
+
26bbde
+int integer;