sim: bfin: skip .c/.S tests if no compiler is available
[external/binutils.git] / sim / testsuite / sim / bfin / allinsn.exp
1 # Analog Devices Blackfin simulator testsuite
2
3 if [istarget bfin-*-elf] {
4     # all machines
5     set all_machs "bfin"
6
7     # See if we have a preprocessor available.
8     if { [target_compile $srcdir/$subdir/usp.S compilercheck.x "preprocess" \
9           [list "incdir=$srcdir/$subdir"]] == "" } {
10         set has_cpp 1
11     } {
12         verbose -log "Can't execute preprocessor"
13         set has_cpp 0
14     }
15
16     # See if we have a compiler available.
17     if { [target_compile $srcdir/$subdir/argc.c compilercheck.x "executable" \
18           [list "incdir=$srcdir/$subdir" "additional_flags=-msim"]] == "" } {
19         set has_cc 1
20     } {
21         verbose -log "Can't execute C compiler"
22         set has_cc 0
23     }
24
25     foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.\[csS\]]] {
26         # If we don't have a compiler available, skip tests :(.
27         if { $has_cpp == 0 && [string match "*.S" $src] } {
28             untested $src
29             continue
30         }
31         if { $has_cc == 0 && [string match "*.c" $src] } {
32             untested $src
33             continue
34         }
35
36         # If we're only testing specific files and this isn't one of them,
37         # skip it.
38         if ![runtest_file_p $runtests $src] {
39             continue
40         }
41         run_sim_test $src $all_machs
42     }
43 }