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