]> gcc.gnu.org Git - gcc.git/commitdiff
Move proc gcc_target_object_format from ecos.exp to file-format.exp
authorNick Clifton <nickc@cygnus.com>
Wed, 30 Jun 1999 01:36:45 +0000 (01:36 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Wed, 30 Jun 1999 01:36:45 +0000 (01:36 +0000)
From-SVN: r27842

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/special/ecos.exp
gcc/testsuite/lib/c-torture.exp
gcc/testsuite/lib/file-format.exp [new file with mode: 0644]
gcc/testsuite/lib/gcc-dg.exp

index 7cd8d551e401807b44c57785510a5ec3132090d6..169fc8e399ec4884da7777cf36c0f34872c864c3 100644 (file)
@@ -1,3 +1,15 @@
+1999-06-29  Nick Clifton  <nickc@cygnus.com>
+
+       * lib/file-format.exp: New file: Move definition of proc 
+       gcc_target_object_format to here from
+       gcc.dg/special/ecos.exp.
+
+       * lib/c-torture.exp: Include lib file-format.exp.
+       * lib/gcc-dg.exp: Include lib file-format.exp.
+
+       * gcc.dg/special/ecos.exp: Remove definition of proc
+       gcc_target_object_format.
+       
 Mon Jun 28 08:20:51 1999  Jeffrey A Law  (law@cygnus.com)
 
        * gcc.c-torture/execute/990628-1.c: New test.
index dc54df6eea1731daee854edb425c6700bd36ba9d..f1a5f79904d70a1537366323abf41515b158ee46 100644 (file)
 # Load support procs.
 load_lib gcc-dg.exp
 
-###################################
-# proc gcc_target_object_format { }
-###################################
-
-proc gcc_target_object_format { } { 
-    global gcc_target_object_format_saved
-
-    if [info exists gcc_target_object_format_saved] {
-        verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2
-        return $gcc_target_object_format_saved
-    } else {
-
-        set objdump_name [find_binutils_prog objdump]
-        set open_file [open objfmtst.c w]
-        puts $open_file "void foo(void) { }"
-        close $open_file
-        
-        gcc_target_compile objfmtst.c objfmtst.o object ""
-        
-        set output [exec $objdump_name --file-headers objfmtst.o ]
-        
-        file delete objfmtst.o
-        
-        if ![ regexp "file format (.*)arch" $output dummy objformat ]  {
-            verbose "Could not parse objdump output" 2
-            set gcc_target_object_format_saved unknown
-        } else {
-            switch -regexp $objformat {
-                elf          {
-                    verbose "gcc_target_object_format returning elf" 2
-                    set gcc_target_object_format_saved elf
-                } 
-                ecoff        {
-                    verbose "gcc_target_object_format returning ecoff" 2
-                    set gcc_target_object_format_saved ecoff
-                }
-                coff         {
-                    verbose "gcc_target_object_format returning coff" 2
-                    set gcc_target_object_format_saved coff
-                }
-                a\.out       {
-                    verbose "gcc_target_object_format returning a.out" 2
-                    set gcc_target_object_format_saved a.out
-                }
-                default      {
-                    verbose "gcc_target_object_format returning unknown" 2
-                    set gcc_target_object_format_saved unknown
-                }
-            }
-        }
-        return $gcc_target_object_format_saved
-    }
-}
+###############################
+# proc gcc_target_object_format {}
+###############################
+# has been moved to:  gcc/testsuite/lib/file-format.exp
 
 ###############################
 # proc check_weak_available { }
index e2031d87bcdab29701eee0e06b702afb84745850..839c32caa80e25b77a7b053214b2c8e36f3f7cce 100644 (file)
@@ -19,6 +19,8 @@
 
 # This file was written by Rob Savoye. (rob@cygnus.com)
 
+load_lib file-format.exp
+
 # The default option list can be overridden by
 # TORTURE_OPTIONS="{ { list1 } ... { listN } }"
 
diff --git a/gcc/testsuite/lib/file-format.exp b/gcc/testsuite/lib/file-format.exp
new file mode 100644 (file)
index 0000000..2d53faf
--- /dev/null
@@ -0,0 +1,73 @@
+#   Copyright (C) 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# egcs-bugs@egcs.cygnus.com
+
+# This file defines a proc for determining the file format in use by the
+# target.  This is useful for tests that are only supported by certain file
+# formats.  This procedure is defined in a seperate file so that it can be
+# included by other expect library files.
+
+proc gcc_target_object_format { } { 
+    global gcc_target_object_format_saved
+
+    if [info exists gcc_target_object_format_saved] {
+        verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2
+    } else {
+        set objdump_name [find_binutils_prog objdump]
+        set open_file [open objfmtst.c w]
+        puts $open_file "void foo(void) { }"
+        close $open_file
+        
+        gcc_target_compile objfmtst.c objfmtst.o object ""
+        
+        set output [exec $objdump_name --file-headers objfmtst.o ]
+        
+        file delete objfmtst.o
+        
+        if ![ regexp "file format (.*)arch" $output dummy objformat ]  {
+            verbose "Could not parse objdump output" 2
+            set gcc_target_object_format_saved unknown
+        } else {
+            switch -regexp $objformat {
+                elf          {
+                    set gcc_target_object_format_saved elf
+                } 
+                ecoff        {
+                    set gcc_target_object_format_saved ecoff
+                }
+                coff         {
+                    set gcc_target_object_format_saved coff
+                }
+                a\.out       {
+                    set gcc_target_object_format_saved a.out
+                }
+                pe       {
+                    set gcc_target_object_format_saved pe
+                }
+                default      {
+                    verbose "Unknown file format: $objformat" 3
+                    set gcc_target_object_format_saved unknown
+                }
+            }
+           
+            verbose "gcc_target_object_format returning $gcc_target_object_format_saved" 2
+        }
+    }
+
+    return $gcc_target_object_format_saved
+}
index 04cb8b798d193add5daaf14f19f08cfcf9d2cb09..a5741100ed89131c1c2a95b8287d3d6998de3c7d 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
 # Define gcc callbacks for dg.exp.
 
 load_lib dg.exp
+load_lib file-format.exp
 
 proc gcc-dg-test { prog do_what extra_tool_flags } {
     # Set up the compiler flags, based on what we're going to do.
This page took 0.087952 seconds and 5 git commands to generate.