file-format.exp (gcc_target_object_format): Use remote_exec to call objdump.
authorJoseph Myers <joseph@codesourcery.com>
Sun, 9 Sep 2007 01:10:17 +0000 (02:10 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sun, 9 Sep 2007 01:10:17 +0000 (02:10 +0100)
gcc/testsuite:
* lib/file-format.exp (gcc_target_object_format): Use remote_exec
to call objdump.
* lib/scanasm.exp (scan-assembler-dem, scan-assembler-dem-not):
Use remote_exec to call c++filt.
* lib/target-supports-dg.exp (dg-require-host-local): New.
* gcc.misc-tests/options.exp: Allow .exe in command paths.
* g++.dg/parse/repo1.C: Use dg-require-host-local.
* g++.dg/rtti/repo1.C: Likewise.
* g++.dg/template/repo1.C: Likewise.
* g++.dg/template/repo2.C: Likewise.
* g++.dg/template/repo3.C: Likewise.
* g++.dg/template/repo4.C: Likewise.
* g++.dg/template/repo5.C: Likewise.
* g++.old-deja/g++.pt/instantiate4.C: Likewise.
* g++.old-deja/g++.pt/instantiate6.C: Likewise.
* g++.old-deja/g++.pt/repo1.C: Likewise.
* g++.old-deja/g++.pt/repo2.C: Likewise.
* g++.old-deja/g++.pt/repo3.C: Likewise.
* g++.old-deja/g++.pt/repo4.C: Likewise.
* gcc.dg/cpp/trad/builtins.c: Likewise.

libstdc++-v3:
* testsuite/lib/libstdc++.exp (v3-build-support): Specify output
file for preprocessing.  Use remote_exec to call ar and ranlib.

From-SVN: r128283

21 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/repo1.C
gcc/testsuite/g++.dg/rtti/repo1.C
gcc/testsuite/g++.dg/template/repo1.C
gcc/testsuite/g++.dg/template/repo2.C
gcc/testsuite/g++.dg/template/repo3.C
gcc/testsuite/g++.dg/template/repo4.C
gcc/testsuite/g++.dg/template/repo5.C
gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C
gcc/testsuite/g++.old-deja/g++.pt/instantiate6.C
gcc/testsuite/g++.old-deja/g++.pt/repo1.C
gcc/testsuite/g++.old-deja/g++.pt/repo2.C
gcc/testsuite/g++.old-deja/g++.pt/repo3.C
gcc/testsuite/g++.old-deja/g++.pt/repo4.C
gcc/testsuite/gcc.dg/cpp/trad/builtins.c
gcc/testsuite/gcc.misc-tests/options.exp
gcc/testsuite/lib/file-format.exp
gcc/testsuite/lib/scanasm.exp
gcc/testsuite/lib/target-supports-dg.exp
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/lib/libstdc++.exp

index b29fc791803b92048c300dc1db8bfe4f08d5dc1d..06d1e728f1f2e16e70164ec8ae44d9a75b134fde 100644 (file)
@@ -1,3 +1,26 @@
+2007-09-09  Joseph Myers  <joseph@codesourcery.com>
+
+       * lib/file-format.exp (gcc_target_object_format): Use remote_exec
+       to call objdump.
+       * lib/scanasm.exp (scan-assembler-dem, scan-assembler-dem-not):
+       Use remote_exec to call c++filt.
+       * lib/target-supports-dg.exp (dg-require-host-local): New.
+       * gcc.misc-tests/options.exp: Allow .exe in command paths.
+       * g++.dg/parse/repo1.C: Use dg-require-host-local.
+       * g++.dg/rtti/repo1.C: Likewise.
+       * g++.dg/template/repo1.C: Likewise.
+       * g++.dg/template/repo2.C: Likewise.
+       * g++.dg/template/repo3.C: Likewise.
+       * g++.dg/template/repo4.C: Likewise.
+       * g++.dg/template/repo5.C: Likewise.
+       * g++.old-deja/g++.pt/instantiate4.C: Likewise.
+       * g++.old-deja/g++.pt/instantiate6.C: Likewise.
+       * g++.old-deja/g++.pt/repo1.C: Likewise.
+       * g++.old-deja/g++.pt/repo2.C: Likewise.
+       * g++.old-deja/g++.pt/repo3.C: Likewise.
+       * g++.old-deja/g++.pt/repo4.C: Likewise.
+       * gcc.dg/cpp/trad/builtins.c: Likewise.
+
 2007-09-08  Zdenek Dvorak  <ook@ucw.cz>
 
        PR tree-optimization/32283
index 44f004b83958406cd059515ea0c97bd38a5ff042..efadd58723eb1473694b1a9b889c439a94cff351 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 
 extern "C" inline void f() {}
 
index 54b52b397aaf3f031b4a6765d54ffd976697647c..7ff813bcdfeb93ed3b2d090c7a1640c65c5b123a 100644 (file)
@@ -1,5 +1,6 @@
 // PR c++/22204
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 
 #include <typeinfo>
 template<int>
index 08eea8883ddb1ee394302cb261f5bc2f86973211..cb4c5a1eb243703ff58c2abf75452ec896dc45e0 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 
 struct A {
   A();
index d2e080138112e47ec44175242d36e3df30389b52..3618997dc2a8ba021ec7bd66b7081fccde4f4fde 100644 (file)
@@ -1,5 +1,6 @@
 // PR c++/17163
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 
 template <int __inst>
 struct __Atomicity_lock
index dfc085a211bfa243fefe872dcc8ab693c2e665a3..49a8fa5bfe4f0b39d5fec6df375f9d68cf06c171 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-frepo -DF='a'" }
+// { dg-require-host-local "" }
 
 template <typename A, typename B> void f () {}
 template <typename A, typename B> void g () { f<int,int>(); }
index bd07f9580f9bbd83659b785a1de811bc7779dcbb..27714b5f1157b98efe23e358b373e6ad54905a6a 100644 (file)
@@ -1,6 +1,7 @@
 // PR c++/17775
 // { dg-options "-frepo" }
 // { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
 
 namespace { 
   struct Foo {}; 
index 334b0a53ce0380ad04c1bf9fa1a8efbd2c45a01e..0d2893eee9114a3e4610e60fdb99dce05148aff7 100644 (file)
@@ -1,6 +1,7 @@
 // PR c++/25625
 // { dg-options "-frepo" } 
 // { dg-final { cleanup-repo-files } }
+// { dg-require-host-local "" }
 
 template< typename T, T N > struct integral_c {
   static const T value = N;
index 031b6badf7fc5cabca5b0fc3ad32a1b5052dd656..9c1aaf58f3ed95edb3f39644819e68a5d3cc2927 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link }
 // { dg-options "-frepo -Werror" }
+// { dg-require-host-local "" }
 // Build then link:
 
 
index beccdc253fe179e51f0f43fc9f96274276045915..a1223fc5d8581a9c8a2ffdff2933bdeb0a7c0840 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link }
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 // Build then link:
 
 // Simplified from testcase by Erez Louidor Lior <s3824888@techst02.technion.ac.il>
index c04b69e103437fd39e4a11e4b92fd72908f3fe6d..f3fdddc7f52270f99f7870a10192e389c9862c33 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link }
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 
 // Bug: g++ complains about duplicate explicit instantiations with -frepo.
 // From Jason Merrill <jason@cygnus.com>
index c05fa108136048a0d313590ed4720be1f5a7ece9..b40961c1558a0ed5cb9ba71da7a14c5ad8714d84 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link  }
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 // Test that collect2 isn't confused by GNU ld's "In function `foo':" message.
 // Contributed by Jason Merrill <jason@cygnus.com>
 
index 9b218fcb206bd06ee2933026e2aaeba465608e51..7995030fe035929b7ebb255918902bef894e4bb7 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link }
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 // Test that we properly generate the vtable and such for C.
 // Contributed by scott snyder <snyder@fnal.gov>
 
index d1a2d70d9505d9220a9d5e5538c72622b1cf1f1c..6a0a55aba5557ecfb4d01bc081b72e1b90da11d8 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do link }
 // { dg-options "-frepo" }
+// { dg-require-host-local "" }
 // Build then link:
 
 template <class T>
index df2718983a1acb4d29d2abd2f0bd39277b5c50da..74798bbb47f55cf4789e7005a27896b94184752e 100644 (file)
@@ -50,3 +50,5 @@ int main ()
 
   return 0;
 }
+
+/* { dg-require-host-local "" } */
index b7a9cb5b5a1282e734f8eebb139a7b10cd12a6d6..1d4b779fe118294ce0928c93b74e6103156ea3c8 100644 (file)
@@ -36,15 +36,15 @@ proc check_for_options {language gcc_options compiler_pattern as_pattern ld_patt
     set gcc_output [gcc_target_compile $filename.c $filename.x executable $gcc_options]
     remote_file build delete $filename.c $filename.x $filename.gcno
 
-    if {![regexp -- "/$compiler -quiet.*$compiler_pattern" $gcc_output]} {
+    if {![regexp -- "/${compiler}(\\.exe)? -quiet.*$compiler_pattern" $gcc_output]} {
        fail "$test (compiler options)"
        return
     }
-    if {![regexp -- " *as .*$as_pattern" $gcc_output]} {
+    if {![regexp -- " *as(\\.exe)? .*$as_pattern" $gcc_output]} {
        fail "$test (assembler options)"
        return
     }
-    if {![regexp -- "/collect2 .*$ld_pattern" $gcc_output]} {
+    if {![regexp -- "/collect2(\\.exe)? .*$ld_pattern" $gcc_output]} {
        fail "$test (linker options)"
        return
     }
index 87bddd775f137a61834bd47731036af7a93e8a52..491cf1274d969469fc3dd4215471f2f8116d42d7 100644 (file)
@@ -48,9 +48,8 @@ proc gcc_target_object_format { } {
         ${tool}_target_compile objfmtst.c objfmtst.o object ""
        file delete objfmtst.c       
         
-       catch {
-          set output [exec $objdump_name --file-headers objfmtst.o ]
-        } output
+       set output [remote_exec host "$objdump_name" "--file-headers objfmtst.o"]
+       set output [lindex $output 1]
 
         file delete objfmtst.o
         
index 83d1d441d13eab9d009d090bc7d9379b1a32bb4b..0621e7d075b3df54bcc4826ca38507cd2a70b7e0 100644 (file)
@@ -217,9 +217,8 @@ proc scan-assembler-dem { args } {
     upvar 2 name testcase
     set output_file "[file rootname [file tail $testcase]].s"
 
-    set fd [open "| $cxxfilt < $output_file" r]
-    set text [read $fd]
-    close $fd
+    set output [remote_exec host "$cxxfilt" "" "$output_file"]
+    set text [lindex $output 1]
 
     if [regexp -- [lindex $args 0] $text] {
        pass "$testcase scan-assembler-dem [lindex $args 0]"
@@ -263,9 +262,8 @@ proc scan-assembler-dem-not { args } {
     upvar 2 name testcase
     set output_file "[file rootname [file tail $testcase]].s"
 
-    set fd [open "| $cxxfilt < $output_file" r]
-    set text [read $fd]
-    close $fd
+    set output [remote_exec host "$cxxfilt" "" "$output_file"]
+    set text [lindex $output 1]
 
     if ![regexp -- [lindex $args 0] $text] {
        pass "$testcase scan-assembler-dem-not [lindex $args 0]"
index 40f82171deac3455e53237435c77552c6a97534f..e7f9175fa6f378e2a8ed0623e052750431de6012 100644 (file)
@@ -150,6 +150,18 @@ proc dg-require-cxa-atexit { args } {
     }
 }
 
+# If the host is remote rather than the same as the build system, skip
+# this test.  Some tests are incompatible with DejaGnu's handling of
+# remote hosts, which involves copying the source file to the host and
+# compiling it with a relative path and "-o a.out".
+
+proc dg-require-host-local { args } {
+    if [ is_remote host ] {
+        upvar dg-do-what dg-do-what
+        set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+    }
+}
+
 # Check the flags with which the test will be run against options in
 # a test directive that will skip or xfail that test.  The DejaGnu proc
 # check_conditional_xfail will look at the options in compiler_flags, so
index 0f653f7d897bd375e9d9d0a4d213eff09a3e5c4b..3faf3ff83b0911a12fffa4a0676982b47bad981b 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-09  Joseph Myers  <joseph@codesourcery.com>
+
+       * testsuite/lib/libstdc++.exp (v3-build-support): Specify output
+       file for preprocessing.  Use remote_exec to call ar and ranlib.
+
 2007-09-08  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/bits/functional_hash.h: Add ext/numeric_traits.h.
index 70b588d20df96e2e5e29b15daaf298fdaebcc799..cc24fc9afbd6ca26b7d0036104ba31190abb0cbe 100644 (file)
@@ -452,12 +452,15 @@ proc v3-build_support { } {
     set libtest_objs ""
 
     set config_src "config.cc"
+    set config_out "config.ii"
     set f [open $config_src "w"]
     puts $f "#include <bits/c++config.h>"
     puts $f "#include <bits/gthr.h>"
     close $f
-    set preprocessed [v3_target_compile $config_src "" \
-                      preprocess "additional_flags=-dN"]
+    v3_target_compile $config_src $config_out preprocess "additional_flags=-dN"
+    set file [open $config_out r]
+    set preprocessed [read $file]
+    close $file
     if { [string first "_GLIBCXX_USE_WCHAR_T" $preprocessed] != -1 } {
        verbose -log "wchar_t support detected"
        set v3-wchar_t 1
@@ -509,9 +512,9 @@ proc v3-build_support { } {
     } else {
        set ar [transform "ar"]
     }
-    set arcommand "$ar -rc ./libtestc++.a ${libtest_objs}"
-    verbose -log "$arcommand"
-    set result [lindex [local_exec "$arcommand" "" "" 300] 0]
+    set arargs "-rc ./libtestc++.a ${libtest_objs}"
+    verbose -log "$ar $arargs"
+    set result [lindex [remote_exec host "$ar" "$arargs"] 0]
     verbose "link result is $result"
     if { $result == 0 } {
        if  [info exists env(RANLIB)] {
@@ -519,9 +522,9 @@ proc v3-build_support { } {
        } else {
            set ranlib [transform "ranlib"]
        }
-       set ranlibcommand "$ranlib ./libtestc++.a"
-       verbose -log "$ranlibcommand"
-       set result [lindex [local_exec "$ranlibcommand" "" "" 300] 0]
+       set ranlibargs "./libtestc++.a"
+       verbose -log "$ranlib $ranlibargs"
+       set result [lindex [remote_exec host "$ranlib" "$ranlibargs"] 0]
        if { $result != 0 } {
            error "could not link libtestc++.a"
        }