-# 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,
# 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>
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
}
}
# 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
}
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