aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/lib/libstdc++.exp
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/lib/libstdc++.exp')
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp135
1 files changed, 58 insertions, 77 deletions
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 3b69a945798..47493cb6155 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -50,6 +50,7 @@ load_lib libgloss.exp
load_gcc_lib target-supports.exp
load_lib prune.exp
load_lib dg-options.exp
+load_gcc_lib target-libpath.exp
# Useful for debugging. Pass the name of a variable and the verbosity
# threshold (number of -v's on the command line).
@@ -81,7 +82,7 @@ proc libstdc++_init { testfile } {
global cxx cxxflags
global includes
global gluefile wrap_flags
- global original_ld_library_path
+ global ld_library_path
global target_triplet
set blddir [lookfor_file [get_multilibs] libstdc++-v3]
@@ -119,26 +120,6 @@ proc libstdc++_init { testfile } {
v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"]
v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"]
- # Setup LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found.
- # Find the existing LD_LIBRARY_PATH.
- if [info exists env(LD_LIBRARY_PATH)] {
- set original_ld_library_path $env(LD_LIBRARY_PATH)
- # For HP-UX
- } elseif [info exists env(SHLIB_PATH)] {
- set original_ld_library_path $env(SHLIB_PATH)
- # For Darwin:
- } elseif [info exists env(DYLD_LIBRARY_PATH)] {
- set original_ld_library_path $env(DYLD_LIBRARY_PATH)
- # For Solaris 32 bit:
- } elseif [info exists env(LD_LIBRARY_PATH_32)] {
- set original_ld_library_path $env(LD_LIBRARY_PATH_32)
- # For Solaris 64 bit:
- } elseif [info exists env(LD_LIBRARY_PATH_64)] {
- set original_ld_library_path $env(LD_LIBRARY_PATH_64)
- } else {
- set original_ld_library_path ""
- }
-
# Locate libgcc.a so we don't need to account for different values of
# SHLIB_EXT on different platforms
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
@@ -149,41 +130,31 @@ proc libstdc++_init { testfile } {
# Compute what needs to be added to the existing LD_LIBRARY_PATH.
if {$gccdir != ""} {
- set ld_library_path ""
- append ld_library_path ":${gccdir}"
- set compiler ${gccdir}/g++
- if { [is_remote host] == 0 && [which $compiler] != 0 } {
- foreach i "[exec $compiler --print-multi-lib]" {
- set mldir ""
- regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
- set mldir [string trimright $mldir "\;@"]
- if { "$mldir" == "." } {
- continue
- }
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
- append ld_library_path ":${gccdir}/${mldir}"
+ set ld_library_path ""
+ append ld_library_path ":${gccdir}"
+ set compiler ${gccdir}/g++
+ append ld_library_path ":${blddir}/src/.libs"
+
+ if { [is_remote host] == 0 && [which $compiler] != 0 } {
+ foreach i "[exec $compiler --print-multi-lib]" {
+ set mldir ""
+ regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
+ set mldir [string trimright $mldir "\;@"]
+ if { "$mldir" == "." } {
+ continue
+ }
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+ append ld_library_path ":${gccdir}/${mldir}"
+ }
}
}
- }
- append ld_library_path ":${blddir}/src/.libs"
-
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The right way to do this would be to modify
- # unix.exp -- but that's not an option since it's part of DejaGNU
- # proper, so we do it here.
- # The same applies to darwin (DYLD_LIBRARY_PATH), solaris 32 bit
- # (LD_LIBRARY_PATH_32), solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
- # (SHLIB_PATH).
- setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
- setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
- setenv LD_LIBRARYN32_PATH "$ld_library_path:$original_ld_library_path"
- setenv LD_LIBRARY64_PATH "$ld_library_path:$original_ld_library_path"
- setenv LD_RUN_PATH "$ld_library_path:$original_ld_library_path"
- setenv LD_LIBRARY_PATH_32 "$ld_library_path:$original_ld_library_path"
- setenv LD_LIBRARY_PATH_64 "$ld_library_path:$original_ld_library_path"
- setenv DYLD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
- verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
+
+ set_ld_library_path_env_vars
+ if [info exists env(LD_LIBRARY_PATH)] {
+ verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
+ }
+ } else {
+ set compiler [transform "g++"]
}
# Do a bunch of handstands and backflips for cross compiling and
@@ -207,6 +178,14 @@ proc libstdc++_init { testfile } {
set cxx [transform "g++"]
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
set includes "-I${srcdir}"
+ # Guess at the location of the installed locale files.
+ # (It would be nice if "gcc --print-file-name" could find
+ # message files, but it cannot.)
+ set absolute_cxx [which $cxx]
+ if { $absolute_cxx != "" } {
+ set localedir "[file dirname $absolute_cxx]/../share/locale"
+ }
+ set cxxflags "$cxxflags -DLOCALEDIR=\"$localedir\""
}
}
@@ -282,13 +261,13 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
}
# True if the library supports wchar_t.
-set libstdc++_wchar_t 0
+set v3-wchar_t 0
# True if the library supports threads.
-set libstdc++_threads 0
+set v3-threads 0
# A string naming object files to be linked into all tests.
-set libstdc++_test_objs ""
+set v3-test_objs ""
# Called from libstdc++-dg-test above. Calls back into system's
# target_compile to actually do the work.
@@ -299,7 +278,7 @@ proc v3_target_compile { source dest type options } {
global cxxflags
global includes
global blddir
- global libstdc++_test_objs
+ global v3-test_objs
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
@@ -313,7 +292,7 @@ proc v3_target_compile { source dest type options } {
set cxx_final [concat $cxx_final $includes]
# Link the support objects into executables.
if { $type == "executable" } {
- set cxx_final [concat $cxx_final ${libstdc++_test_objs}]
+ set cxx_final [concat $cxx_final ${v3-test_objs}]
}
lappend options "compiler=$cxx_final"
@@ -322,33 +301,33 @@ proc v3_target_compile { source dest type options } {
}
# Build the support objects linked in with the libstdc++ tests. In
-# addition, set libstdc++_wchar_t, libstdc++_threads, and libstdc++_test_objs
+# addition, set v3-wchar_t, v3-threads, and v3-test_objs
# appropriately.
-proc libstdc++_build_support {} {
+proc v3-build_support {} {
global srcdir
- global libstdc++_wchar_t
- global libstdc++_threads
- global libstdc++_test_objs
+ global v3-wchar_t
+ global v3-threads
+ global v3-test_objs
# Figure out whether or not the library supports certain features.
- set libstdc++_wchar_t 0
- set libstdc++_threads 0
- set libstdc++_test_objs ""
+ set v3-wchar_t 0
+ set v3-threads 0
+ set v3-test_objs ""
set config_src "config.cc"
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"]
- foreach l $preprocessed {
- if { [string first "_GLIBCXX_USE_WCHAR_T" $l] != -1 } {
- verbose -log "wchar_t support detected"
- set libstdc++_wchar_t 1
- } elseif { [string first "_GLIBCXX_HAVE_GTHR_DEFAULT" $l] != -1 } {
- verbose -log "thread support detected"
- set libstdc++_threads 1
- }
+ if { [string first "_GLIBCXX_USE_WCHAR_T" $preprocessed] != -1 } {
+ verbose -log "wchar_t support detected"
+ set v3-wchar_t 1
+ }
+ if { [string first "__GTHREADS" $preprocessed] != -1 } {
+ verbose -log "thread support detected"
+ set v3-threads 1
}
# Try to build the PO files that are used by some of the locale
@@ -366,11 +345,13 @@ proc libstdc++_build_support {} {
[list testsuite_abi.cc testsuite_allocator.cc testsuite_hooks.cc]
foreach f $source_files {
set object_file [file rootname $f].o
+ # Compile with "-w" so that warnings issued by the compiler
+ # do not prevent compilation.
if { [v3_target_compile $srcdir/$f $object_file "object" \
- "incdir=$srcdir"]
+ [list "incdir=$srcdir" "additional_flags=-w"]]
!= "" } {
error "could not compile $f"
}
- append libstdc++_test_objs "$object_file "
+ append v3-test_objs "$object_file "
}
}