target-support.exp (check_ultrasparc_hw_available): New function.

* lib/target-support.exp (check_ultrasparc_hw_available):
	New function.
	(is-effective-target): Check $arg for ultrasparc_hw.
	(is-effective-target-keyword): Likewise.
	* gcc.dg/vect/vect.exp: Call check_effective_target_ultrasparc_hw
	when determining what to do on sparc platforms.
	* gcc.dg/20001013-1.c: Check for an ultrasparc_hw target.
	* gcc.dg/20001101-1.c: Likewise.
	* gcc.dg/20001101-2.c: Likewise.
	* gcc.dg/ultrasp9.c: Likewise.
	* gcc.dg/ultrasp10.c: Likewise.
	* gcc.target/sparc/pdist-3.c: Likewise.

From-SVN: r126589
This commit is contained in:
Nathan Froyd 2007-07-12 14:29:23 +00:00 committed by Nathan Froyd
parent d872ada017
commit d566f2e600
9 changed files with 71 additions and 6 deletions

View File

@ -1,3 +1,18 @@
2007-07-12 Nathan Froyd <froydnj@codesourcery.com>
* lib/target-support.exp (check_ultrasparc_hw_available):
New function.
(is-effective-target): Check $arg for ultrasparc_hw.
(is-effective-target-keyword): Likewise.
* gcc.dg/vect/vect.exp: Call check_effective_target_ultrasparc_hw
when determining what to do on sparc platforms.
* gcc.dg/20001013-1.c: Check for an ultrasparc_hw target.
* gcc.dg/20001101-1.c: Likewise.
* gcc.dg/20001101-2.c: Likewise.
* gcc.dg/ultrasp9.c: Likewise.
* gcc.dg/ultrasp10.c: Likewise.
* gcc.target/sparc/pdist-3.c: Likewise.
2007-07-12 Daniel Jacobowitz <dan@codesourcery.com>
* gcc.target/mips/save-restore-5.c: Add -mno-abicalls.

View File

@ -1,4 +1,4 @@
/* { dg-do run { target sparc*-*-* } } */
/* { dg-do run { target { sparc*-*-* && ultrasparc_hw } } } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
extern void abort (void);

View File

@ -1,4 +1,4 @@
/* { dg-do run { target sparc*-*-* } } */
/* { dg-do run { target { sparc*-*-* && ultrasparc_hw } } } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
extern void abort (void);

View File

@ -1,4 +1,4 @@
/* { dg-do run { target sparc*-*-* } } */
/* { dg-do run { target { sparc*-*-* && ultrasparc_hw } } } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
extern void abort (void);

View File

@ -1,6 +1,6 @@
/* PR target/11965 */
/* Originator: <jk@tools.de> */
/* { dg-do run { target sparc*-*-* } } */
/* { dg-do run { target { sparc*-*-* && ultrasparc_hw } } } */
/* { dg-options "-O -mcpu=ultrasparc" } */
/* This used to fail on 32-bit Ultrasparc because GCC emitted

View File

@ -1,6 +1,6 @@
/* PR optimization/11018 */
/* Originator: <partain@dcs.gla.ac.uk> */
/* { dg-do run { target sparc*-*-* } } */
/* { dg-do run { target { sparc*-*-* && ultrasparc_hw } } } */
/* { dg-options "-O2 -mcpu=ultrasparc" } */
/* This used to fail on 32-bit Ultrasparc because

View File

@ -63,7 +63,11 @@ if [istarget "powerpc*-*-*"] {
set dg-do-what-default run
} elseif [istarget "sparc*-*-*"] {
lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis"
set dg-do-what-default run
if [check_effective_target_ultrasparc_hw] {
set dg-do-what-default run
} else {
set dg-do-what-default compile
}
} elseif [istarget "alpha*-*-*"] {
# Alpha's vectorization capabilities are extremely limited.
# It's more effort than its worth disabling all of the tests

View File

@ -1,4 +1,5 @@
/* { dg-do run } */
/* { dg-require-effective-target ultrasparc_hw } */
/* { dg-options "-mcpu=ultrasparc -mvis -O1" } */
typedef long long int64_t;

View File

@ -1528,6 +1528,51 @@ proc check_effective_target_powerpc_altivec { } {
}
}
# The VxWorks SPARC simulator accepts only EM_SPARC executables and
# chokes on EM_SPARC32PLUS or EM_SPARCV9 executables. Return 1 if the
# test environment appears to run executables on such a simulator.
proc check_effective_target_ultrasparc_hw { } {
global et_ultrasparc_hw_saved
global tool
if [info exists et_ultrasparc_hw_saved] {
verbose "check_ultrasparc_hw_available returning saved $et_ultrasparc_hw_saved" 2
} else {
set et_ultrasparc_hw_saved 0
# Set up, compile, and execute a simple test program. The
# program will be compiled with -mcpu=ultrasparc to instruct the
# assembler to produce EM_SPARC32PLUS executables.
set src svect[pid].c
set exe svect[pid].x
set f [open $src "w"]
puts $f "int main() { return 0; }"
close $f
verbose "check_ultrasparc_hw_available compiling testfile $src" 2
set lines [${tool}_target_compile $src $exe executable "additional_flags=-mcpu=ultrasparc"]
file delete $src
if [string match "" $lines] then {
# No error message, compilation succeeded.
set result [${tool}_load "./$exe" "" ""]
set status [lindex $result 0]
remote_file build delete $exe
verbose "check_ultrasparc_hw_available testfile status is <$status>" 2
if { $status == "pass" } then {
set et_ultrasparc_hw_saved 1
}
} else {
verbose "check_ultrasparc_hw_available testfile compilation failed" 2
}
}
return $et_ultrasparc_hw_saved
}
# Return 1 if the target supports hardware vector shift operation.
proc check_effective_target_vect_shift { } {