]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/g++.dg/compat/struct-layout-1.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / compat / struct-layout-1.exp
index b9f63295301260e10ce80fabf5f2042a8793327a..71e76189a1ad98316af94b1420c00db1e5783fc7 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
@@ -11,9 +11,8 @@
 # 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., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
 #
 # This file was written by Jakub Jelinek, <jakub@redhat.com>
 # Based on compat.exp writte by Janis Johnson, <janis187@us.ibm.com>
@@ -61,6 +60,8 @@ proc compat-use-alt-compiler { } {
        set ALWAYS_CXXFLAGS ""
        set ld_library_path $alt_ld_library_path
        set_ld_library_path_env_vars
+       restore_gcc_exec_prefix_env_var
+       clear_effective_target_cache
     }
 }
 
@@ -90,6 +91,9 @@ proc compat-use-tst-compiler { } {
 # This must be done after the compat-use-*-compiler definitions.
 load_lib compat.exp
 
+# Provide the g++-dg-prune routine (gcc-dp.exp is loaded by compat.exp)
+load_lib g++-dg.exp
+
 g++_init
 
 # Save variables for the C++ compiler under test, which each test will
@@ -122,15 +126,18 @@ if [info exists ALT_CXX_UNDER_TEST] then {
 }
 
 set tstobjdir "$tmpdir/g++.dg-struct-layout-1"
-set generator "$tmpdir/g++.dg-struct-layout-1_generate"
+set generator "$tmpdir/g++.dg-struct-layout-1_generate.exe"
 
 set generator_src "$srcdir/$subdir/struct-layout-1_generate.c"
 set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-random.c"
 set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-random_r.c"
 set generator_cmd "-o $generator $generator_src"
 
-set status [remote_exec host "$HOSTCC $HOSTCFLAGS $generator_cmd"]
+# Temporarily switch to the environment of the host compiler.
+restore_ld_library_path_env_vars
+set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
 set status [lindex $status 0]
+set_ld_library_path_env_vars
 if { $status == 0 } then {
     file delete -force $tstobjdir
     file mkdir $tstobjdir