This both eliminates bogus failures in the testsuite on SPARC64/Linux when you configure --with-cpu=v8 and enables more tests on SPARC/Solaris (which is by default configured --with-cpu=v9).
Tested on SPARC64/Linux and SPARC/Solaris, applied on mainline and 4.7 branch. 2012-04-09 Eric Botcazou <ebotca...@adacore.com> * lib/target-supports.exp (check_effective_target_sparc_v9): New. (check_effective_target_sync_long_long): Add SPARC case. (check_effective_target_sync_long_long_runtime): Likewise. (check_effective_target_sync_int_long): Adjust SPARC case. (check_effective_target_sync_char_short): Likewise. -- Eric Botcazou
Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 186176) +++ lib/target-supports.exp (working copy) @@ -2551,7 +2551,22 @@ proc check_effective_target_ultrasparc_v } "-mcpu=niagara3"] } -# Return 1 if this is a Sparc target with VIS enabled. +# Return 1 if this is a SPARC-V9 target. + +proc check_effective_target_sparc_v9 { } { + if { [istarget sparc*-*-*] } { + return [check_no_compiler_messages sparc_v9 object { + int main (void) { + asm volatile ("return %i7+8"); + return 0; + } + }] + } else { + return 0 + } +} + +# Return 1 if this is a SPARC target with VIS enabled. proc check_effective_target_sparc_vis { } { if { [istarget sparc*-*-*] } { @@ -3730,7 +3745,8 @@ proc check_effective_target_sync_long_lo if { [istarget x86_64-*-*] || [istarget i?86-*-*]) || [istarget arm*-*-*] - || [istarget alpha*-*-*] } { + || [istarget alpha*-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_lp64]) } { return 1 } else { return 0 @@ -3775,6 +3791,10 @@ proc check_effective_target_sync_long_lo } "" ] } elseif { [istarget alpha*-*-*] } { return 1 + } elseif { ([istarget sparc*-*-*] + && [check_effective_target_lp64] + && [check_effective_target_ultrasparc_hw]) } { + return 1 } else { return 0 } @@ -3800,8 +3820,7 @@ proc check_effective_target_sync_int_lon || [istarget hppa*-*linux*] || [istarget s390*-*-*] || [istarget powerpc*-*-*] - || [istarget sparc64-*-*] - || [istarget sparcv9-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [check_effective_target_mips_llsc] } { set et_sync_int_long_saved 1 } @@ -3830,8 +3849,7 @@ proc check_effective_target_sync_char_sh || [istarget hppa*-*linux*] || [istarget s390*-*-*] || [istarget powerpc*-*-*] - || [istarget sparc64-*-*] - || [istarget sparcv9-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [check_effective_target_mips_llsc] } { set et_sync_char_short_saved 1 }