2c2fa1
2005-01-25  Elena Zannoni  <ezannoni@redhat.com>
2c2fa1
2c2fa1
        * gdb.base/move-dir.exp: New test.
2c2fa1
        * gdb.base/move-dir.c: Ditto.
2c2fa1
        * gdb.base/move-dir.h: Ditto.
2c2fa1
2c2fa1
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c
2c2fa1
===================================================================
2c2fa1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
2c2fa1
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c	2008-12-07 23:57:41.000000000 +0100
2c2fa1
@@ -0,0 +1,10 @@
2c2fa1
+#include <stdio.h>
2c2fa1
+#include <stdlib.h>
2c2fa1
+#include "move-dir.h"
2c2fa1
+
2c2fa1
+int main() {
2c2fa1
+   const char* hw = "hello world.";
2c2fa1
+   printf ("%s\n", hw);;
2c2fa1
+   other();
2c2fa1
+}
2c2fa1
+
2c2fa1
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
2c2fa1
===================================================================
2c2fa1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
2c2fa1
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp	2008-12-07 10:13:01.000000000 +0100
2c2fa1
@@ -0,0 +1,57 @@
2c2fa1
+#   Copyright 2005
2c2fa1
+#   Free Software Foundation, Inc.
2c2fa1
+
2c2fa1
+# This program is free software; you can redistribute it and/or modify
2c2fa1
+# it under the terms of the GNU General Public License as published by
2c2fa1
+# the Free Software Foundation; either version 2 of the License, or
2c2fa1
+# (at your option) any later version.
2c2fa1
+# 
2c2fa1
+# This program is distributed in the hope that it will be useful,
2c2fa1
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2c2fa1
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2c2fa1
+# GNU General Public License for more details.
2c2fa1
+# 
2c2fa1
+# You should have received a copy of the GNU General Public License
2c2fa1
+# along with this program; if not, write to the Free Software
2c2fa1
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
2c2fa1
+
2c2fa1
+set testfile "move-dir"
2c2fa1
+set srcfile ${testfile}.c
2c2fa1
+set incfile ${testfile}.h
2c2fa1
+set binfile ${objdir}/${subdir}/${testfile}
2c2fa1
+
2c2fa1
+set testdir "${objdir}/${subdir}/incdir"
2c2fa1
+
2c2fa1
+remote_exec build "mkdir $testdir"
2c2fa1
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}"
2c2fa1
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} ${testdir}"
2c2fa1
+
2c2fa1
+set additional_flags "additional_flags=-I${subdir}/incdir"
2c2fa1
+
2c2fa1
+if  { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
2c2fa1
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
2c2fa1
+}
2c2fa1
+
2c2fa1
+# Create and source the file that provides information about the compiler
2c2fa1
+# used to compile the test case.
2c2fa1
+
2c2fa1
+if [get_compiler_info ${binfile}] {
2c2fa1
+    return -1;
2c2fa1
+}
2c2fa1
+
2c2fa1
+
2c2fa1
+set oldtimeout $timeout
2c2fa1
+set timeout [expr "$timeout + 60"]
2c2fa1
+
2c2fa1
+# Start with a fresh gdb.
2c2fa1
+
2c2fa1
+gdb_exit
2c2fa1
+gdb_start
2c2fa1
+gdb_test "cd ../.." "" ""
2c2fa1
+gdb_load ${binfile}
2c2fa1
+gdb_test "list main" ".*hw.*other.*" "found main"
2c2fa1
+gdb_test "list other" ".*ostring.*" "found include file"
2c2fa1
+
2c2fa1
+
2c2fa1
+set timeout $oldtimeout
2c2fa1
+return 0
2c2fa1
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h
2c2fa1
===================================================================
2c2fa1
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
2c2fa1
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h	2008-12-07 10:13:01.000000000 +0100
2c2fa1
@@ -0,0 +1,7 @@
2c2fa1
+#include <stdlib.h>
2c2fa1
+
2c2fa1
+void other() {
2c2fa1
+  const char* ostring = "other";
2c2fa1
+  printf ("%s\n", ostring);;
2c2fa1
+}
2c2fa1
+