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