# Having this file here magically tells dejagnu that the treelang
# directory is worthy of testing
-# This file is basically treelang.exp with treelang replaced with treelang.
+# This file is basically gcc.exp with gcc replaced with treelang.
# This file is loaded by the tool init file (eg: unix.exp). It provides
-# default definitions for treelang_start, etc. and other supporting cast members.
+# default definitions for treelang_start, etc. and other supporting cast
+# members.
-# These globals are used by treelang_start if no compiler arguments are provided.
-# They are also used by the various testsuites to define the environment:
-# where to find stdio.h, libc.a, etc.
+# These globals are used by treelang_start if no compiler arguments are
+# provided. They are also used by the various testsuites to define the
+# environment: where to find stdio.h, libc.a, etc.
load_lib libgloss.exp
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# TREELANG_UNDER_TEST is the compiler under test.
global TOOL_EXECUTABLE
global treelang_libgcc_s_path
+
+ # We set LC_ALL and LANG to C so that we get the same error messages as expected.
+ setenv LC_ALL C
+ setenv LANG C
+
+
if { $treelang_initialized == 1 } { return; }
if ![info exists TREELANG_UNDER_TEST] then {
if ![info exists tmpdir] then {
set tmpdir /tmp
}
- if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
- set gluefile ${tmpdir}/treelang-testglue.o;
- set result [build_wrapper $gluefile];
- if { $result != "" } {
- set gluefile [lindex $result 0];
- set wrap_flags [lindex $result 1];
- } else {
- unset gluefile
- }
- }
+
+ treelang_maybe_build_wrapper "${tmpdir}/treelang-testglue.o"
set treelang_libgcc_s_path "${rootme}"
set compiler [lindex $TREELANG_UNDER_TEST 0]
if { "$mldir" == "." } {
continue
}
- if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] == 1 } {
+ if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append treelang_libgcc_s_path ":${rootme}/${mldir}"
}
}
global treelang_libgcc_s_path
set ld_library_path ".:${treelang_libgcc_s_path}"
- lappend options "libs=-ltreelang"
+ set_ld_library_path_env_vars
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
# TOOL_OPTIONS must come first, so that it doesn't override testcase
# specific options.
if [info exists TOOL_OPTIONS] {
- set options [concat "additional_flags=$TOOL_OPTIONS" $options];
+ set options [concat "{additional_flags=$TOOL_OPTIONS}" $options];
}
# If we have built libtreelang along with the compiler (which usually