2007-03-22 08:00:08 +01:00
|
|
|
# Damn dejagnu for not having proper library search paths for load_lib.
|
|
|
|
# We have to explicitly load everything that gcc-dg.exp wants to load.
|
|
|
|
|
|
|
|
proc load_gcc_lib { filename } {
|
|
|
|
global srcdir loaded_libs
|
|
|
|
|
|
|
|
load_file $srcdir/../../gcc/testsuite/lib/$filename
|
|
|
|
set loaded_libs($filename) ""
|
|
|
|
}
|
|
|
|
|
|
|
|
load_lib dg.exp
|
2013-06-20 18:48:26 +02:00
|
|
|
|
|
|
|
# Required to use gcc-dg.exp - however, the latter should NOT be
|
|
|
|
# loaded until ${tool}_target_compile is defined since it uses that
|
|
|
|
# to determine default LTO options.
|
|
|
|
|
|
|
|
load_gcc_lib prune.exp
|
|
|
|
load_gcc_lib target-libpath.exp
|
|
|
|
load_gcc_lib wrapper.exp
|
2014-12-12 11:31:44 +01:00
|
|
|
load_gcc_lib target-supports.exp
|
|
|
|
load_gcc_lib target-utils.exp
|
2013-06-20 18:48:26 +02:00
|
|
|
load_gcc_lib gcc-defs.exp
|
|
|
|
load_gcc_lib timeout.exp
|
|
|
|
load_gcc_lib file-format.exp
|
2007-03-22 08:00:08 +01:00
|
|
|
load_gcc_lib target-supports-dg.exp
|
|
|
|
load_gcc_lib scanasm.exp
|
|
|
|
load_gcc_lib scandump.exp
|
|
|
|
load_gcc_lib scanrtl.exp
|
|
|
|
load_gcc_lib scantree.exp
|
|
|
|
load_gcc_lib scanipa.exp
|
2008-11-26 19:51:07 +01:00
|
|
|
load_gcc_lib timeout-dg.exp
|
2013-06-20 18:48:26 +02:00
|
|
|
load_gcc_lib torture-options.exp
|
2012-03-16 10:51:06 +01:00
|
|
|
load_gcc_lib fortran-modules.exp
|
2007-03-22 08:00:08 +01:00
|
|
|
|
|
|
|
set dg-do-what-default run
|
|
|
|
|
|
|
|
#
|
|
|
|
# GCC_UNDER_TEST is the compiler under test.
|
|
|
|
#
|
|
|
|
|
|
|
|
set libgomp_compile_options ""
|
|
|
|
|
|
|
|
#
|
|
|
|
# libgomp_init
|
|
|
|
#
|
|
|
|
|
|
|
|
if [info exists TOOL_OPTIONS] {
|
|
|
|
set multilibs [get_multilibs $TOOL_OPTIONS]
|
|
|
|
} else {
|
|
|
|
set multilibs [get_multilibs]
|
|
|
|
}
|
|
|
|
|
|
|
|
proc libgomp_init { args } {
|
|
|
|
global srcdir blddir objdir tool_root_dir
|
|
|
|
global libgomp_initialized
|
|
|
|
global tmpdir
|
|
|
|
global blddir
|
|
|
|
global gluefile wrap_flags
|
|
|
|
global ALWAYS_CFLAGS
|
|
|
|
global CFLAGS
|
|
|
|
global TOOL_EXECUTABLE TOOL_OPTIONS
|
|
|
|
global GCC_UNDER_TEST
|
|
|
|
global TESTING_IN_BUILD_TREE
|
|
|
|
global target_triplet
|
|
|
|
global always_ld_library_path
|
|
|
|
|
|
|
|
set blddir [lookfor_file [get_multilibs] libgomp]
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2009-12-01 00:30:57 +01:00
|
|
|
# Many hosts now default to a non-ASCII C locale, however, so
|
|
|
|
# they can set a charset encoding here if they need.
|
|
|
|
if { [ishost "*-*-cygwin*"] } {
|
|
|
|
setenv LC_ALL C.ASCII
|
|
|
|
setenv LANG C.ASCII
|
|
|
|
}
|
|
|
|
|
2007-03-22 08:00:08 +01:00
|
|
|
if ![info exists GCC_UNDER_TEST] then {
|
|
|
|
if [info exists TOOL_EXECUTABLE] {
|
|
|
|
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
|
|
|
} else {
|
|
|
|
set GCC_UNDER_TEST "[find_gcc]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ![info exists tmpdir] {
|
|
|
|
set tmpdir "/tmp"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [info exists gluefile] {
|
|
|
|
unset gluefile
|
|
|
|
}
|
|
|
|
|
|
|
|
if {![info exists CFLAGS]} {
|
|
|
|
set CFLAGS ""
|
|
|
|
}
|
|
|
|
|
re PR testsuite/40699 (All sparcv9 libjava execution tests fail on Solaris 11/SPARC)
gcc/testsuite/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* lib/gcc-defs.exp, lib/target-libpath.exp, lib/objc.exp,
lib/gfortran.exp, lib/g++.exp, lib/obj-c++.exp, lib/c-torture.exp,
lib/gcc-dg.exp, lib/gnat.exp, g++.dg/compat/compat.exp,
g++.dg/compat/struct-layout-1.exp: Revert 2009-06-30 commit.
libstdc++-v3/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libstdc++.exp: Revert 2009-06-30 commit.
libjava/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libjava.exp: Revert 2009-06-30 commit.
libgomp/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libgomp.exp: Revert 2009-07-02 and 2009-06-30 commits.
* testsuite/libgomp.c/c.exp, testsuite/libgomp.c++/c++.exp,
testsuite/libgomp.fortran/fortran.exp: Revert 2009-06-30 commits.
libffi/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
2009-06-30 commits.
libmudflap/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libmudflap.exp: Revert 2009-06-30 commit.
From-SVN: r149508
2009-07-11 08:10:49 +02:00
|
|
|
# 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]
|
|
|
|
if {$gccdir != ""} {
|
|
|
|
set gccdir [file dirname $gccdir]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Compute what needs to be put into LD_LIBRARY_PATH
|
|
|
|
set always_ld_library_path ".:${blddir}/.libs"
|
|
|
|
|
2014-11-13 15:07:09 +01:00
|
|
|
# Get offload-related variables from environment (exported by Makefile)
|
|
|
|
set offload_targets [getenv OFFLOAD_TARGETS]
|
|
|
|
set offload_additional_options [getenv OFFLOAD_ADDITIONAL_OPTIONS]
|
|
|
|
set offload_additional_lib_paths [getenv OFFLOAD_ADDITIONAL_LIB_PATHS]
|
|
|
|
|
|
|
|
# Add liboffloadmic build directory in LD_LIBRARY_PATH to support
|
|
|
|
# non-fallback testing for Intel MIC targets
|
|
|
|
if { [string match "*-intelmic-*" $offload_targets]
|
|
|
|
|| [string match "*-intelmicemul-*" $offload_targets] } {
|
|
|
|
append always_ld_library_path ":${blddir}/../liboffloadmic/.libs"
|
|
|
|
append always_ld_library_path ":${blddir}/../liboffloadmic/plugin/.libs"
|
|
|
|
# libstdc++ is required by liboffloadmic
|
|
|
|
append always_ld_library_path ":${blddir}/../libstdc++-v3/src/.libs"
|
|
|
|
}
|
|
|
|
|
|
|
|
if { $offload_additional_lib_paths != "" } {
|
|
|
|
append always_ld_library_path "${offload_additional_lib_paths}"
|
|
|
|
}
|
|
|
|
|
re PR testsuite/40699 (All sparcv9 libjava execution tests fail on Solaris 11/SPARC)
gcc/testsuite/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* lib/gcc-defs.exp, lib/target-libpath.exp, lib/objc.exp,
lib/gfortran.exp, lib/g++.exp, lib/obj-c++.exp, lib/c-torture.exp,
lib/gcc-dg.exp, lib/gnat.exp, g++.dg/compat/compat.exp,
g++.dg/compat/struct-layout-1.exp: Revert 2009-06-30 commit.
libstdc++-v3/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libstdc++.exp: Revert 2009-06-30 commit.
libjava/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libjava.exp: Revert 2009-06-30 commit.
libgomp/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libgomp.exp: Revert 2009-07-02 and 2009-06-30 commits.
* testsuite/libgomp.c/c.exp, testsuite/libgomp.c++/c++.exp,
testsuite/libgomp.fortran/fortran.exp: Revert 2009-06-30 commits.
libffi/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
2009-06-30 commits.
libmudflap/
PR testsuite/40699
PR testsuite/40707
PR testsuite/40709
* testsuite/lib/libmudflap.exp: Revert 2009-06-30 commit.
From-SVN: r149508
2009-07-11 08:10:49 +02:00
|
|
|
# Compute what needs to be added to the existing LD_LIBRARY_PATH.
|
|
|
|
if {$gccdir != ""} {
|
|
|
|
# Add AIX pthread directory first.
|
|
|
|
if { [llength [glob -nocomplain ${gccdir}/pthread/libgcc_s*.a]] >= 1 } {
|
|
|
|
append always_ld_library_path ":${gccdir}/pthread"
|
|
|
|
}
|
|
|
|
append always_ld_library_path ":${gccdir}"
|
|
|
|
set compiler [lindex $GCC_UNDER_TEST 0]
|
|
|
|
|
|
|
|
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 always_ld_library_path ":${gccdir}/${mldir}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-22 08:00:08 +01:00
|
|
|
set ALWAYS_CFLAGS ""
|
2008-08-21 17:37:05 +02:00
|
|
|
if { $blddir != "" } {
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
|
2009-12-22 23:11:27 +01:00
|
|
|
# targets that use libgomp.a%s in their specs need a -B option
|
|
|
|
# for uninstalled testing.
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/.libs"
|
2008-08-21 17:37:05 +02:00
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
|
|
|
|
lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
|
|
|
|
}
|
2007-03-22 08:00:08 +01:00
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
|
|
|
|
|
|
|
|
# We use atomic operations in the testcases to validate results.
|
|
|
|
if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
|
2011-07-28 22:35:32 +02:00
|
|
|
&& [check_effective_target_ia32] } {
|
2007-03-22 08:00:08 +01:00
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
|
|
|
|
}
|
2007-03-23 20:25:19 +01:00
|
|
|
|
|
|
|
if [istarget *-*-darwin*] {
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
|
|
|
|
}
|
|
|
|
|
2007-03-22 08:00:08 +01:00
|
|
|
if [istarget sparc*-*-*] {
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [info exists TOOL_OPTIONS] {
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make sure that lines are not wrapped. That can confuse the
|
|
|
|
# error-message parsing machinery.
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
|
|
|
|
|
2012-04-11 22:15:35 +02:00
|
|
|
# Disable caret
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-fno-diagnostics-show-caret"
|
|
|
|
|
2013-09-20 19:52:29 +02:00
|
|
|
# Disable color diagnostics
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-color=never"
|
2014-11-13 15:07:09 +01:00
|
|
|
|
|
|
|
# Used for support non-fallback offloading.
|
|
|
|
# Help GCC to find target mkoffload.
|
|
|
|
if { $offload_additional_options != "" } {
|
|
|
|
lappend ALWAYS_CFLAGS "additional_flags=${offload_additional_options}"
|
|
|
|
}
|
2007-03-22 08:00:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# libgomp_target_compile -- compile a source file
|
|
|
|
#
|
|
|
|
|
|
|
|
proc libgomp_target_compile { source dest type options } {
|
|
|
|
global blddir
|
|
|
|
global libgomp_compile_options
|
|
|
|
global gluefile wrap_flags
|
|
|
|
global ALWAYS_CFLAGS
|
|
|
|
global GCC_UNDER_TEST
|
|
|
|
global lang_test_file
|
|
|
|
global lang_library_path
|
|
|
|
global lang_link_flags
|
2014-07-03 20:45:35 +02:00
|
|
|
global lang_include_flags
|
|
|
|
global lang_source_re
|
2007-03-22 08:00:08 +01:00
|
|
|
|
2008-08-21 17:37:05 +02:00
|
|
|
if { [info exists lang_test_file] } {
|
|
|
|
if { $blddir != "" } {
|
2009-01-20 01:59:24 +01:00
|
|
|
# Some targets use libgfortran.a%s in their specs, so they need
|
|
|
|
# a -B option for uninstalled testing.
|
|
|
|
lappend options "additional_flags=-B${blddir}/${lang_library_path}"
|
2008-08-21 17:37:05 +02:00
|
|
|
lappend options "ldflags=-L${blddir}/${lang_library_path}"
|
|
|
|
}
|
|
|
|
lappend options "ldflags=${lang_link_flags}"
|
2014-07-03 20:45:35 +02:00
|
|
|
if { [info exists lang_include_flags] \
|
|
|
|
&& [regexp ${lang_source_re} ${source}] } {
|
|
|
|
lappend options "additional_flags=${lang_include_flags}"
|
|
|
|
}
|
2007-03-22 08:00:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
|
|
|
|
lappend options "libs=${gluefile}"
|
|
|
|
lappend options "ldflags=${wrap_flags}"
|
|
|
|
}
|
|
|
|
|
|
|
|
lappend options "additional_flags=[libio_include_flags]"
|
2008-11-26 19:51:07 +01:00
|
|
|
lappend options "timeout=[timeout_value]"
|
2007-03-22 08:00:08 +01:00
|
|
|
lappend options "compiler=$GCC_UNDER_TEST"
|
|
|
|
|
|
|
|
set options [concat $libgomp_compile_options $options]
|
|
|
|
|
|
|
|
if [info exists ALWAYS_CFLAGS] {
|
|
|
|
set options [concat "$ALWAYS_CFLAGS" $options]
|
|
|
|
}
|
|
|
|
|
|
|
|
set options [dg-additional-files-options $options $source]
|
|
|
|
|
|
|
|
set result [target_compile $source $dest $type $options]
|
|
|
|
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
proc libgomp_option_help { } {
|
|
|
|
send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
proc libgomp_option_proc { option } {
|
|
|
|
if [regexp "^--additional_options," $option] {
|
|
|
|
global libgomp_compile_options
|
|
|
|
regsub "--additional_options," $option "" option
|
|
|
|
foreach x [split $option ","] {
|
|
|
|
lappend libgomp_compile_options "additional_flags=$x"
|
|
|
|
}
|
|
|
|
return 1
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
2014-11-13 14:56:22 +01:00
|
|
|
|
|
|
|
# Return 1 if offload device is available.
|
|
|
|
proc check_effective_target_offload_device { } {
|
|
|
|
return [check_runtime_nocache offload_device_available_ {
|
|
|
|
#include <omp.h>
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
int a;
|
|
|
|
#pragma omp target map(from: a)
|
|
|
|
a = omp_is_initial_device ();
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
} ]
|
|
|
|
}
|