diff options
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/lto.exp | 11 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 50 |
2 files changed, 59 insertions, 2 deletions
diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 7b51fdd2f6f..7d0620faa0e 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -32,7 +32,7 @@ proc lto_prune_warns { text } { # Sun ld warns about common symbols with differing sizes. Unlike GNU ld # --warn-common (off by default), they cannot be disabled. - regsub -all "(^|\n)ld: warning: symbol `\[^\n\]*' has differing sizes:" $text "" text + regsub -all "(^|\n)ld: warning: symbol \[`'\]\[^\n\]*' has differing sizes:" $text "" text regsub -all "(^|\n)\[ \t\]*\[\(\]file \[^\n\]* value=\[^\n\]*; file \[^\n\]* value=\[^\n\]*\[)\];" $text "" text regsub -all "(^|\n)\[ \t\]*\[^\n\]* definition taken" $text "" text @@ -110,6 +110,7 @@ set lto_skip_list $LTO_SKIPS load_lib dg.exp load_lib gcc-dg.exp +load_lib gcc.exp # lto-obj -- compile to an object file # @@ -137,7 +138,13 @@ proc lto-obj { source dest optall optfile optstr xfaildata } { lappend options "additional_flags=$optall $optfile" set compiler_conditional_xfail_data $xfaildata - set comp_output [${tool}_target_compile "$source" "$dest" object $options] + + # Allow C source files to mix freely with other languages + if [ string match "*.c" $source ] then { + set comp_output [gcc_target_compile "$source" "$dest" object $options] + } else { + set comp_output [${tool}_target_compile "$source" "$dest" object $options] + } # Prune unimportant visibility warnings before checking output. set comp_output [lto_prune_warns $comp_output] ${tool}_check_compile "$testcase $dest assemble" $optstr $dest $comp_output diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a36127e95b..1cdc53b4983 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -992,6 +992,30 @@ proc check_vmx_hw_available { } { }] } +proc check_ppc_recip_hw_available { } { + return [check_cached_effective_target ppc_recip_hw_available { + # Some simulators may not support FRE/FRES/FRSQRTE/FRSQRTES + # For now, disable on Darwin + if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { + expr 0 + } else { + set options "-mpowerpc-gfxopt -mpowerpc-gpopt -mpopcntb" + check_runtime_nocache ppc_recip_hw_available { + volatile double d_recip, d_rsqrt, d_four = 4.0; + volatile float f_recip, f_rsqrt, f_four = 4.0f; + int main() + { + asm volatile ("fres %0,%1" : "=f" (f_recip) : "f" (f_four)); + asm volatile ("fre %0,%1" : "=d" (d_recip) : "d" (d_four)); + asm volatile ("frsqrtes %0,%1" : "=f" (f_rsqrt) : "f" (f_four)); + asm volatile ("frsqrte %0,%1" : "=f" (d_rsqrt) : "d" (d_four)); + return 0; + } + } $options + } + }] +} + # Return 1 if the target supports executing AltiVec and Cell PPU # instructions, 0 otherwise. Cache the result. @@ -2972,6 +2996,8 @@ proc is-effective-target { arg } { } else { switch $arg { "vmx_hw" { set selected [check_vmx_hw_available] } + "vsx_hw" { set selected [check_vsx_hw_available] } + "ppc_recip_hw" { set selected [check_ppc_recip_hw_available] } "named_sections" { set selected [check_named_sections_available] } "gc_sections" { set selected [check_gc_sections_available] } "cxa_atexit" { set selected [check_cxa_atexit_available] } @@ -2991,6 +3017,8 @@ proc is-effective-target-keyword { arg } { # These have different names for their check_* procs. switch $arg { "vmx_hw" { return 1 } + "vsx_hw" { return 1 } + "ppc_recip_hw" { return 1 } "named_sections" { return 1 } "gc_sections" { return 1 } "cxa_atexit" { return 1 } @@ -3305,6 +3333,28 @@ proc check_effective_target_correct_iso_cpp_string_wchar_protos { } { }] } +# Return 1 if GNU as is used. + +proc check_effective_target_gas { } { + global use_gas_saved + global tool + + if {![info exists use_gas_saved]} { + # Check if the as used by gcc is GNU as. + set gcc_as [lindex [${tool}_target_compile "-print-prog-name=as" "" "none" ""] 0] + # Provide /dev/null as input, otherwise gas times out reading from + # stdin. + set status [remote_exec host "$gcc_as" "-v /dev/null"] + set as_output [lindex $status 1] + if { [ string first "GNU" $as_output ] >= 0 } { + set use_gas_saved 1 + } else { + set use_gas_saved 0 + } + } + return $use_gas_saved +} + # Return 1 if the compiler has been configure with link-time optimization # (LTO) support. |