# Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
|
|
|
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
# the Free Software Foundation; either version 3 of the License, or
|
# the Free Software Foundation; either version 3 of the License, or
|
# (at your option) any later version.
|
# (at your option) any later version.
|
#
|
#
|
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
#
|
#
|
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
# along with GCC; see the file COPYING3. If not see
|
# along with GCC; see the file COPYING3. If not see
|
# .
|
# .
|
|
|
# This file was written by Janis Johnson,
|
# This file was written by Janis Johnson,
|
|
|
|
|
# Test interoperability of two compilers that follow the same ABI, or
|
# Test interoperability of two compilers that follow the same ABI, or
|
# compatibility of two versions of GCC.
|
# compatibility of two versions of GCC.
|
#
|
#
|
# Each test has a main program that does nothing but call a function,
|
# Each test has a main program that does nothing but call a function,
|
# plus two additional source files that contain parts of a program that
|
# plus two additional source files that contain parts of a program that
|
# rely on the ABI. those source files are compiled into relocatable
|
# rely on the ABI. those source files are compiled into relocatable
|
# object files with both compilers. Executables are built using various
|
# object files with both compilers. Executables are built using various
|
# combinations of those object files, with the main program compiled
|
# combinations of those object files, with the main program compiled
|
# with the compiler under test and using that compiler's runtime support.
|
# with the compiler under test and using that compiler's runtime support.
|
|
|
# The including .exp file must define these callback procedures.
|
# The including .exp file must define these callback procedures.
|
if [string match "" [info procs "compat-use-alt-compiler"]] then {
|
if [string match "" [info procs "compat-use-alt-compiler"]] then {
|
error "Proc compat-use-alt-compiler is not defined."
|
error "Proc compat-use-alt-compiler is not defined."
|
}
|
}
|
if [string match "" [info procs "compat-use-tst-compiler"]] then {
|
if [string match "" [info procs "compat-use-tst-compiler"]] then {
|
error "Proc compat-use-tst-compiler is not defined."
|
error "Proc compat-use-tst-compiler is not defined."
|
}
|
}
|
|
|
# Each test is run with each pair of compiler options from this list.
|
# Each test is run with each pair of compiler options from this list.
|
# The first set of options in each pair is used by the compiler under
|
# The first set of options in each pair is used by the compiler under
|
# test, and the second set is used by the alternate compiler.
|
# test, and the second set is used by the alternate compiler.
|
# The default option lists can be overridden by
|
# The default option lists can be overridden by
|
# COMPAT_OPTIONS="[list [list {tst_1} {alt_1}]...[list {tst_n} {alt_n}]]"
|
# COMPAT_OPTIONS="[list [list {tst_1} {alt_1}]...[list {tst_n} {alt_n}]]"
|
# where tst_i and alt_i are lists of options. You can put this in the
|
# where tst_i and alt_i are lists of options. You can put this in the
|
# environment before site.exp is written or add it to site.exp directly.
|
# environment before site.exp is written or add it to site.exp directly.
|
if ![info exists COMPAT_OPTIONS] {
|
if ![info exists COMPAT_OPTIONS] {
|
set COMPAT_OPTIONS [list \
|
set COMPAT_OPTIONS [list \
|
[list {} {}]]
|
[list {} {}]]
|
}
|
}
|
|
|
set option_list $COMPAT_OPTIONS
|
set option_list $COMPAT_OPTIONS
|
|
|
# Subsets of tests can be selectively disabled by members of this list:
|
# Subsets of tests can be selectively disabled by members of this list:
|
# - ATTRIBUTE: disable all tests using the __attribute__ extension,
|
# - ATTRIBUTE: disable all tests using the __attribute__ extension,
|
# - COMPLEX_INT: disable all tests using the complex integral types extension,
|
# - COMPLEX_INT: disable all tests using the complex integral types extension,
|
# - VA: disable all tests using the variable number of arguments feature,
|
# - VA: disable all tests using the variable number of arguments feature,
|
# - ZERO_ARRAY: disable all tests using the zero-sized arrays extension.
|
# - ZERO_ARRAY: disable all tests using the zero-sized arrays extension.
|
# The default skip lists can be overriden by
|
# The default skip lists can be overriden by
|
# COMPAT_SKIPS="[list {skip_1}...{skip_n}]"
|
# COMPAT_SKIPS="[list {skip_1}...{skip_n}]"
|
# where skip_i are skip identifiers. You can put this in the environment
|
# where skip_i are skip identifiers. You can put this in the environment
|
# before site.exp is written or add it to site.exp directly.
|
# before site.exp is written or add it to site.exp directly.
|
if ![info exists COMPAT_SKIPS] {
|
if ![info exists COMPAT_SKIPS] {
|
set COMPAT_SKIPS [list {}]
|
set COMPAT_SKIPS [list {}]
|
}
|
}
|
|
|
global compat_skip_list
|
global compat_skip_list
|
set compat_skip_list $COMPAT_SKIPS
|
set compat_skip_list $COMPAT_SKIPS
|
|
|
load_lib dg.exp
|
load_lib dg.exp
|
load_lib gcc-dg.exp
|
load_lib gcc-dg.exp
|
|
|
#
|
#
|
# compat-obj -- compile to an object file
|
# compat-obj -- compile to an object file
|
#
|
#
|
# SOURCE is the source file
|
# SOURCE is the source file
|
# DEST is the object file
|
# DEST is the object file
|
# OPTALL is the list of compiler options to use with all tests
|
# OPTALL is the list of compiler options to use with all tests
|
# OPTFILE is the list of compiler options to use with this file
|
# OPTFILE is the list of compiler options to use with this file
|
# OPTSTR is the options to print with test messages
|
# OPTSTR is the options to print with test messages
|
# XFAILDATA is the xfail data to be passed to the compiler
|
# XFAILDATA is the xfail data to be passed to the compiler
|
#
|
#
|
proc compat-obj { source dest optall optfile optstr xfaildata } {
|
proc compat-obj { source dest optall optfile optstr xfaildata } {
|
global testcase
|
global testcase
|
global tool
|
global tool
|
global compiler_conditional_xfail_data
|
global compiler_conditional_xfail_data
|
global compat_skip_list
|
global compat_skip_list
|
|
|
# Add the skip specifiers.
|
# Add the skip specifiers.
|
foreach skip $compat_skip_list {
|
foreach skip $compat_skip_list {
|
if { ![string match $skip ""] } {
|
if { ![string match $skip ""] } {
|
lappend optall "-DSKIP_$skip"
|
lappend optall "-DSKIP_$skip"
|
}
|
}
|
}
|
}
|
|
|
# Set up the options for compiling this file.
|
# Set up the options for compiling this file.
|
set options ""
|
set options ""
|
lappend options "additional_flags=$optfile $optall"
|
lappend options "additional_flags=$optfile $optall"
|
|
|
set compiler_conditional_xfail_data $xfaildata
|
set compiler_conditional_xfail_data $xfaildata
|
set comp_output [${tool}_target_compile "$source" "$dest" object $options]
|
set comp_output [${tool}_target_compile "$source" "$dest" object $options]
|
${tool}_check_compile "$testcase $dest compile" $optstr $dest $comp_output
|
${tool}_check_compile "$testcase $dest compile" $optstr $dest $comp_output
|
}
|
}
|
|
|
# compat-run -- link and run an executable
|
# compat-run -- link and run an executable
|
#
|
#
|
# TESTNAME is the mixture of object files to link
|
# TESTNAME is the mixture of object files to link
|
# OBJLIST is the list of object files to link
|
# OBJLIST is the list of object files to link
|
# DEST is the name of the executable
|
# DEST is the name of the executable
|
# OPTALL is a list of compiler and linker options to use for all tests
|
# OPTALL is a list of compiler and linker options to use for all tests
|
# OPTFILE is a list of compiler and linker options to use for this test
|
# OPTFILE is a list of compiler and linker options to use for this test
|
# OPTSTR is the list of options to list in messages
|
# OPTSTR is the list of options to list in messages
|
#
|
#
|
proc compat-run { testname objlist dest optall optfile optstr } {
|
proc compat-run { testname objlist dest optall optfile optstr } {
|
global testcase
|
global testcase
|
global tool
|
global tool
|
|
|
# Check that all of the objects were built successfully.
|
# Check that all of the objects were built successfully.
|
foreach obj [split $objlist] {
|
foreach obj [split $objlist] {
|
if ![file exists $obj] then {
|
if ![file exists $obj] then {
|
unresolved "$testcase $testname link $optstr"
|
unresolved "$testcase $testname link $optstr"
|
unresolved "$testcase $testname execute $optstr"
|
unresolved "$testcase $testname execute $optstr"
|
return
|
return
|
}
|
}
|
}
|
}
|
|
|
# Set up the options for linking this test.
|
# Set up the options for linking this test.
|
set options ""
|
set options ""
|
lappend options "additional_flags=$optfile $optall"
|
lappend options "additional_flags=$optfile $optall"
|
|
|
# Link the objects into an executable.
|
# Link the objects into an executable.
|
set comp_output [${tool}_target_compile "$objlist" $dest executable \
|
set comp_output [${tool}_target_compile "$objlist" $dest executable \
|
"$options"]
|
"$options"]
|
if ![${tool}_check_compile "$testcase $testname link" "" \
|
if ![${tool}_check_compile "$testcase $testname link" "" \
|
$dest $comp_output] then {
|
$dest $comp_output] then {
|
unresolved "$testcase $testname execute $optstr"
|
unresolved "$testcase $testname execute $optstr"
|
return
|
return
|
}
|
}
|
|
|
# Run the self-checking executable.
|
# Run the self-checking executable.
|
if ![string match "*/*" $dest] then {
|
if ![string match "*/*" $dest] then {
|
set dest "./$dest"
|
set dest "./$dest"
|
}
|
}
|
set result [${tool}_load $dest "" ""]
|
set result [${tool}_load $dest "" ""]
|
set status [lindex $result 0]
|
set status [lindex $result 0]
|
if { $status == "pass" } then {
|
if { $status == "pass" } then {
|
remote_file build delete $dest
|
remote_file build delete $dest
|
}
|
}
|
$status "$testcase $testname execute $optstr"
|
$status "$testcase $testname execute $optstr"
|
}
|
}
|
|
|
#
|
#
|
# compat-get-options-main -- get target requirements for a test and
|
# compat-get-options-main -- get target requirements for a test and
|
# options for the primary source file and the test as a whole
|
# options for the primary source file and the test as a whole
|
#
|
#
|
# SRC is the full pathname of the primary source file.
|
# SRC is the full pathname of the primary source file.
|
#
|
#
|
proc compat-get-options-main { src } {
|
proc compat-get-options-main { src } {
|
# dg-options sets a variable called dg-extra-tool-flags.
|
# dg-options sets a variable called dg-extra-tool-flags.
|
set dg-extra-tool-flags ""
|
set dg-extra-tool-flags ""
|
|
|
# dg-require-* sets dg-do-what.
|
# dg-require-* sets dg-do-what.
|
upvar dg-do-what dg-do-what
|
upvar dg-do-what dg-do-what
|
|
|
set tmp [dg-get-options $src]
|
set tmp [dg-get-options $src]
|
foreach op $tmp {
|
foreach op $tmp {
|
set cmd [lindex $op 0]
|
set cmd [lindex $op 0]
|
if { ![string compare "dg-options" $cmd] \
|
if { ![string compare "dg-options" $cmd] \
|
|| [string match "dg-require-*" $cmd] } {
|
|| [string match "dg-require-*" $cmd] } {
|
set status [catch "$op" errmsg]
|
set status [catch "$op" errmsg]
|
if { $status != 0 } {
|
if { $status != 0 } {
|
perror "src: $errmsg for \"$op\"\n"
|
perror "src: $errmsg for \"$op\"\n"
|
unresolved "$src: $errmsg for \"$op\""
|
unresolved "$src: $errmsg for \"$op\""
|
return
|
return
|
}
|
}
|
} elseif { ![string compare "dg-xfail-if" $cmd] } {
|
} elseif { ![string compare "dg-xfail-if" $cmd] } {
|
warning "compat.exp does not support $cmd in primary source file"
|
warning "compat.exp does not support $cmd in primary source file"
|
} else {
|
} else {
|
# Ignore unrecognized dg- commands, but warn about them.
|
# Ignore unrecognized dg- commands, but warn about them.
|
warning "compat.exp does not support $cmd"
|
warning "compat.exp does not support $cmd"
|
}
|
}
|
}
|
}
|
|
|
# Return flags to use for compiling the primary source file and for
|
# Return flags to use for compiling the primary source file and for
|
# linking.
|
# linking.
|
return ${dg-extra-tool-flags}
|
return ${dg-extra-tool-flags}
|
}
|
}
|
|
|
#
|
#
|
# compat-get-options -- get special tool flags to use for a secondary
|
# compat-get-options -- get special tool flags to use for a secondary
|
# source file
|
# source file
|
#
|
#
|
# SRC is the full pathname of the source file.
|
# SRC is the full pathname of the source file.
|
# The result is a list of options to use.
|
# The result is a list of options to use.
|
#
|
#
|
# This code is copied from proc dg-test in dg.exp from DejaGNU.
|
# This code is copied from proc dg-test in dg.exp from DejaGNU.
|
#
|
#
|
proc compat-get-options { src } {
|
proc compat-get-options { src } {
|
# dg-options sets a variable called dg-extra-tool-flags.
|
# dg-options sets a variable called dg-extra-tool-flags.
|
set dg-extra-tool-flags ""
|
set dg-extra-tool-flags ""
|
|
|
# dg-xfail-if sets compiler_conditional_xfail_data.
|
# dg-xfail-if sets compiler_conditional_xfail_data.
|
global compiler_conditional_xfail_data
|
global compiler_conditional_xfail_data
|
set compiler_conditional_xfail_data ""
|
set compiler_conditional_xfail_data ""
|
|
|
# dg-xfail-if needs access to dg-do-what.
|
# dg-xfail-if needs access to dg-do-what.
|
upvar dg-do-what dg-do-what
|
upvar dg-do-what dg-do-what
|
|
|
set tmp [dg-get-options $src]
|
set tmp [dg-get-options $src]
|
foreach op $tmp {
|
foreach op $tmp {
|
set cmd [lindex $op 0]
|
set cmd [lindex $op 0]
|
if { ![string compare "dg-options" $cmd] \
|
if { ![string compare "dg-options" $cmd] \
|
|| ![string compare "dg-xfail-if" $cmd] } {
|
|| ![string compare "dg-xfail-if" $cmd] } {
|
set status [catch "$op" errmsg]
|
set status [catch "$op" errmsg]
|
if { $status != 0 } {
|
if { $status != 0 } {
|
perror "src: $errmsg for \"$op\"\n"
|
perror "src: $errmsg for \"$op\"\n"
|
unresolved "$src: $errmsg for \"$op\""
|
unresolved "$src: $errmsg for \"$op\""
|
return
|
return
|
}
|
}
|
} elseif { [string match "dg-require-*" $cmd] } {
|
} elseif { [string match "dg-require-*" $cmd] } {
|
warning "compat.exp does not support $cmd in secondary source files"
|
warning "compat.exp does not support $cmd in secondary source files"
|
} else {
|
} else {
|
# Ignore unrecognized dg- commands, but warn about them.
|
# Ignore unrecognized dg- commands, but warn about them.
|
warning "compat.exp does not support $cmd"
|
warning "compat.exp does not support $cmd"
|
}
|
}
|
}
|
}
|
|
|
return ${dg-extra-tool-flags}
|
return ${dg-extra-tool-flags}
|
}
|
}
|
|
|
#
|
#
|
# compat-execute -- compile with compatible compilers
|
# compat-execute -- compile with compatible compilers
|
#
|
#
|
# SRC1 is the full pathname of the main file of the testcase.
|
# SRC1 is the full pathname of the main file of the testcase.
|
# SID identifies a test suite in the names of temporary files.
|
# SID identifies a test suite in the names of temporary files.
|
# USE_ALT is nonzero if we're using an alternate compiler as well as
|
# USE_ALT is nonzero if we're using an alternate compiler as well as
|
# the compiler under test.
|
# the compiler under test.
|
#
|
#
|
proc compat-execute { src1 sid use_alt } {
|
proc compat-execute { src1 sid use_alt } {
|
global srcdir tmpdir
|
global srcdir tmpdir
|
global option_list
|
global option_list
|
global tool
|
global tool
|
global verbose
|
global verbose
|
global testcase
|
global testcase
|
global gluefile
|
global gluefile
|
global compiler_conditional_xfail_data
|
global compiler_conditional_xfail_data
|
global dg-do-what-default
|
global dg-do-what-default
|
|
|
# Get extra flags for this test from the primary source file, and
|
# Get extra flags for this test from the primary source file, and
|
# process other dg-* options that this suite supports. Warn about
|
# process other dg-* options that this suite supports. Warn about
|
# unsupported flags.
|
# unsupported flags.
|
verbose "compat-execute: $src1" 1
|
verbose "compat-execute: $src1" 1
|
set dg-do-what [list ${dg-do-what-default} "" P]
|
set dg-do-what [list ${dg-do-what-default} "" P]
|
set extra_flags_1 [compat-get-options-main $src1]
|
set extra_flags_1 [compat-get-options-main $src1]
|
|
|
# Check whether this test is supported for this target.
|
# Check whether this test is supported for this target.
|
if { [lindex ${dg-do-what} 1 ] == "N" } {
|
if { [lindex ${dg-do-what} 1 ] == "N" } {
|
unsupported "$src1"
|
unsupported "$src1"
|
verbose "$src1 not supported on this target, skipping it" 3
|
verbose "$src1 not supported on this target, skipping it" 3
|
return
|
return
|
}
|
}
|
|
|
# Set up the names of the other source files.
|
# Set up the names of the other source files.
|
regsub "_main.*" $src1 "" base
|
regsub "_main.*" $src1 "" base
|
regsub ".*/" $base "" base
|
regsub ".*/" $base "" base
|
regsub "_main" $src1 "_x" src2
|
regsub "_main" $src1 "_x" src2
|
regsub "_main" $src1 "_y" src3
|
regsub "_main" $src1 "_y" src3
|
|
|
# Use the dg-options mechanism to specify extra flags for this test.
|
# Use the dg-options mechanism to specify extra flags for this test.
|
# The extra flags in each file are used to compile that file, and the
|
# The extra flags in each file are used to compile that file, and the
|
# extra flags in *_main.* are also used for linking.
|
# extra flags in *_main.* are also used for linking.
|
set extra_flags_2 [compat-get-options $src2]
|
set extra_flags_2 [compat-get-options $src2]
|
set compile_xfail_2 $compiler_conditional_xfail_data
|
set compile_xfail_2 $compiler_conditional_xfail_data
|
set extra_flags_3 [compat-get-options $src3]
|
set extra_flags_3 [compat-get-options $src3]
|
set compile_xfail_3 $compiler_conditional_xfail_data
|
set compile_xfail_3 $compiler_conditional_xfail_data
|
|
|
# Define the names of the object files.
|
# Define the names of the object files.
|
regsub "sid" "sid_main_tst.o" $sid obj1
|
regsub "sid" "sid_main_tst.o" $sid obj1
|
regsub "sid" "sid_x_tst.o" $sid obj2_tst
|
regsub "sid" "sid_x_tst.o" $sid obj2_tst
|
regsub "sid" "sid_x_alt.o" $sid obj2_alt
|
regsub "sid" "sid_x_alt.o" $sid obj2_alt
|
regsub "sid" "sid_y_tst.o" $sid obj3_tst
|
regsub "sid" "sid_y_tst.o" $sid obj3_tst
|
regsub "sid" "sid_y_alt.o" $sid obj3_alt
|
regsub "sid" "sid_y_alt.o" $sid obj3_alt
|
|
|
# Get the base name of this test, for use in messages.
|
# Get the base name of this test, for use in messages.
|
set testcase "$src1"
|
set testcase "$src1"
|
# Remove the $srcdir and $tmpdir prefixes from $src1. (It would
|
# Remove the $srcdir and $tmpdir prefixes from $src1. (It would
|
# be possible to use "regsub" here, if we were careful to escape
|
# be possible to use "regsub" here, if we were careful to escape
|
# all regular expression characters in $srcdir and $tmpdir, but
|
# all regular expression characters in $srcdir and $tmpdir, but
|
# that would be more complicated that this approach.)
|
# that would be more complicated that this approach.)
|
if {[string first "$srcdir/" "$src1"] == 0} {
|
if {[string first "$srcdir/" "$src1"] == 0} {
|
set testcase [string range "$src1" [string length "$srcdir/"] end]
|
set testcase [string range "$src1" [string length "$srcdir/"] end]
|
}
|
}
|
if {[string first "$tmpdir/" "$testcase"] == 0} {
|
if {[string first "$tmpdir/" "$testcase"] == 0} {
|
set testcase [string range "$testcase" [string length "$tmpdir/"] end]
|
set testcase [string range "$testcase" [string length "$tmpdir/"] end]
|
set testcase "tmpdir-$testcase"
|
set testcase "tmpdir-$testcase"
|
}
|
}
|
regsub "_main.*" $testcase "" testcase
|
regsub "_main.*" $testcase "" testcase
|
# Set up the base name of executable files so they'll be unique.
|
# Set up the base name of executable files so they'll be unique.
|
regsub -all "\[./\]" $testcase "-" execbase
|
regsub -all "\[./\]" $testcase "-" execbase
|
|
|
# If we couldn't rip $srcdir out of `src1' then just do the best we can.
|
# If we couldn't rip $srcdir out of `src1' then just do the best we can.
|
# The point is to reduce the unnecessary noise in the logs. Don't strip
|
# The point is to reduce the unnecessary noise in the logs. Don't strip
|
# out too much because different testcases with the same name can confuse
|
# out too much because different testcases with the same name can confuse
|
# `test-tool'.
|
# `test-tool'.
|
if [string match "/*" $testcase] then {
|
if [string match "/*" $testcase] then {
|
set testcase "[file tail [file dirname $src1]]/[file tail $src1]"
|
set testcase "[file tail [file dirname $src1]]/[file tail $src1]"
|
}
|
}
|
|
|
# Loop through all of the option lists used for this test.
|
# Loop through all of the option lists used for this test.
|
|
|
set count 0
|
set count 0
|
foreach option_pair $option_list {
|
foreach option_pair $option_list {
|
|
|
# Pick out each set of options.
|
# Pick out each set of options.
|
set tst_option [lindex $option_pair 0]
|
set tst_option [lindex $option_pair 0]
|
set alt_option [lindex $option_pair 1]
|
set alt_option [lindex $option_pair 1]
|
set optstr ""
|
set optstr ""
|
if { ![string match $tst_option ""] \
|
if { ![string match $tst_option ""] \
|
|| ![string match $alt_option ""] } then {
|
|| ![string match $alt_option ""] } then {
|
set optstr "\"$tst_option\",\"$alt_option\""
|
set optstr "\"$tst_option\",\"$alt_option\""
|
}
|
}
|
verbose "Testing $testcase, $optstr" 1
|
verbose "Testing $testcase, $optstr" 1
|
|
|
# There's a unique name for each executable we generate, based on
|
# There's a unique name for each executable we generate, based on
|
# the set of options and how the pieces of the tests are compiled.
|
# the set of options and how the pieces of the tests are compiled.
|
set execname1 "${execbase}-${count}1"
|
set execname1 "${execbase}-${count}1"
|
set execname2 "${execbase}-${count}2"
|
set execname2 "${execbase}-${count}2"
|
set execname3 "${execbase}-${count}3"
|
set execname3 "${execbase}-${count}3"
|
set execname4 "${execbase}-${count}4"
|
set execname4 "${execbase}-${count}4"
|
incr count
|
incr count
|
|
|
remote_file build delete $execname1
|
remote_file build delete $execname1
|
remote_file build delete $execname2
|
remote_file build delete $execname2
|
remote_file build delete $execname3
|
remote_file build delete $execname3
|
remote_file build delete $execname4
|
remote_file build delete $execname4
|
|
|
# Compile pieces with the alternate compiler; we'll catch problems
|
# Compile pieces with the alternate compiler; we'll catch problems
|
# later. Skip this if we don't have an alternate compiler.
|
# later. Skip this if we don't have an alternate compiler.
|
if { $use_alt != 0 } then {
|
if { $use_alt != 0 } then {
|
compat-use-alt-compiler
|
compat-use-alt-compiler
|
compat-obj "$src2" "$obj2_alt" $alt_option $extra_flags_2 \
|
compat-obj "$src2" "$obj2_alt" $alt_option $extra_flags_2 \
|
$optstr $compile_xfail_2
|
$optstr $compile_xfail_2
|
compat-obj "$src3" "$obj3_alt" $alt_option $extra_flags_3 \
|
compat-obj "$src3" "$obj3_alt" $alt_option $extra_flags_3 \
|
$optstr $compile_xfail_3
|
$optstr $compile_xfail_3
|
}
|
}
|
|
|
# Compile pieces with the compiler under test.
|
# Compile pieces with the compiler under test.
|
compat-use-tst-compiler
|
compat-use-tst-compiler
|
compat-obj "$src1" "$obj1" $tst_option $extra_flags_1 $optstr ""
|
compat-obj "$src1" "$obj1" $tst_option $extra_flags_1 $optstr ""
|
compat-obj "$src2" "$obj2_tst" $tst_option $extra_flags_2 \
|
compat-obj "$src2" "$obj2_tst" $tst_option $extra_flags_2 \
|
$optstr $compile_xfail_2
|
$optstr $compile_xfail_2
|
compat-obj "$src3" "$obj3_tst" $tst_option $extra_flags_3 \
|
compat-obj "$src3" "$obj3_tst" $tst_option $extra_flags_3 \
|
$optstr $compile_xfail_3
|
$optstr $compile_xfail_3
|
|
|
# Link (using the compiler under test), run, and clean up tests.
|
# Link (using the compiler under test), run, and clean up tests.
|
compat-run "${obj2_tst}-${obj3_tst}" \
|
compat-run "${obj2_tst}-${obj3_tst}" \
|
"$obj1 $obj2_tst $obj3_tst" $execname1 \
|
"$obj1 $obj2_tst $obj3_tst" $execname1 \
|
$tst_option $extra_flags_1 $optstr
|
$tst_option $extra_flags_1 $optstr
|
|
|
# If we've got an alternate compiler try some combinations.
|
# If we've got an alternate compiler try some combinations.
|
if { $use_alt != 0 } then {
|
if { $use_alt != 0 } then {
|
compat-run "${obj2_tst}-${obj3_alt}" "$obj1 $obj2_tst $obj3_alt" \
|
compat-run "${obj2_tst}-${obj3_alt}" "$obj1 $obj2_tst $obj3_alt" \
|
$execname2 $tst_option $extra_flags_1 $optstr
|
$execname2 $tst_option $extra_flags_1 $optstr
|
compat-run "${obj2_alt}-${obj3_tst}" "$obj1 $obj2_alt $obj3_tst" \
|
compat-run "${obj2_alt}-${obj3_tst}" "$obj1 $obj2_alt $obj3_tst" \
|
$execname3 $tst_option $extra_flags_1 $optstr
|
$execname3 $tst_option $extra_flags_1 $optstr
|
compat-run "${obj2_alt}-${obj3_alt}" "$obj1 $obj2_alt $obj3_alt" \
|
compat-run "${obj2_alt}-${obj3_alt}" "$obj1 $obj2_alt $obj3_alt" \
|
$execname4 $tst_option $extra_flags_1 $optstr
|
$execname4 $tst_option $extra_flags_1 $optstr
|
}
|
}
|
|
|
# Clean up object files.
|
# Clean up object files.
|
set files [glob -nocomplain ${sid}_*.o]
|
set files [glob -nocomplain ${sid}_*.o]
|
if { $files != "" } {
|
if { $files != "" } {
|
foreach objfile $files {
|
foreach objfile $files {
|
if { ![info exists gluefile] || $objfile != $gluefile } {
|
if { ![info exists gluefile] || $objfile != $gluefile } {
|
eval "remote_file build delete $objfile"
|
eval "remote_file build delete $objfile"
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|