Blame SOURCES/gdb-6.3-test-movedir-20050125.patch

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