aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-11 00:36:52 -0500
committerMike Frysinger <vapier@gentoo.org>2021-11-26 19:51:15 -0500
commit264dcc17cc4d2252d58bda347dfd78c1b78517da (patch)
tree31da57f3638243a7ff8c24c940dcd21e5842d6db /sim/testsuite/bfin
parentc0d6a6e5828882040bbb55bafea6b188a18fc000 (diff)
downloadgdb-264dcc17cc4d2252d58bda347dfd78c1b78517da.zip
gdb-264dcc17cc4d2252d58bda347dfd78c1b78517da.tar.gz
gdb-264dcc17cc4d2252d58bda347dfd78c1b78517da.tar.bz2
sim: testsuite: unify basic C compiler checks
Both bfin & cris ports test the C compiler to see if it works, but in their own way. Unify the checks in the common code so we can leverage them in more ports in the future, and collapse the bfin & cris code.
Diffstat (limited to 'sim/testsuite/bfin')
-rw-r--r--sim/testsuite/bfin/allinsn.exp34
1 files changed, 4 insertions, 30 deletions
diff --git a/sim/testsuite/bfin/allinsn.exp b/sim/testsuite/bfin/allinsn.exp
index d5269da..a9dc084 100644
--- a/sim/testsuite/bfin/allinsn.exp
+++ b/sim/testsuite/bfin/allinsn.exp
@@ -1,42 +1,16 @@
# Analog Devices Blackfin simulator testsuite
+# Set a default CPU to satisfy bfin-elf-gcc requirements. BF537 should work
+# with all standard Blackfin toolchains.
+set CC_FOR_TARGET "[find_gcc] -mcpu=bf537"
sim_init
+unset CC_FOR_TARGET
if [istarget bfin-*-elf] {
# all machines
set all_machs "bfin"
- global objdir
-
- # See if we have a preprocessor available.
- if { [target_compile $srcdir/$subdir/usp.S $objdir/compilercheck.x "preprocess" \
- [list "incdir=$srcdir/$subdir"]] == "" } {
- set has_cpp 1
- } {
- verbose -log "Can't execute preprocessor"
- set has_cpp 0
- }
-
- # See if we have a compiler available.
- if { [target_compile $srcdir/$subdir/argc.c $objdir/compilercheck.x "executable" \
- [list "incdir=$srcdir/$subdir" "additional_flags=-msim"]] == "" } {
- set has_cc 1
- } {
- verbose -log "Can't execute C compiler"
- set has_cc 0
- }
-
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.\[csS\]]] {
- # If we don't have a compiler available, skip tests :(.
- if { $has_cpp == 0 && [string match "*.S" $src] } {
- untested $src
- continue
- }
- if { $has_cc == 0 && [string match "*.c" $src] } {
- untested $src
- continue
- }
-
# If we're only testing specific files and this isn't one of them,
# skip it.
if ![runtest_file_p $runtests $src] {