Special case handlign for m32r port
[external/binutils.git] / gas / testsuite / gas / elf / elf.exp
1 #
2 # elf tests
3 #
4
5 proc run_list_test { name suffix opts } {
6     global READELF
7     global srcdir subdir
8     set testname "elf $name list"
9     set file $srcdir/$subdir/$name
10     gas_run ${name}.s "$opts -o dump.o" ">&dump.out"
11     if { [regexp_diff "dump.out" "${file}.l"] } then {
12         fail $testname
13         verbose "output is [file_contents "dump.out"]" 2
14         return
15     }
16     send_log "$READELF -s dump.o > dump.out\n"
17     catch "exec $READELF -s dump.o > dump.out\n" comp_output
18     if ![string match "" $comp_output] then {
19         send_log "$comp_output\n"
20         fail $testname
21         return
22     }
23     verbose_eval {[file_contents "dump.out"]} 3
24     if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then {
25         fail $testname
26         verbose "output is [file_contents "dump.out"]" 2
27         return
28     }
29     pass $testname
30 }
31
32 # We're testing bits in obj-elf -- don't run on anything else.
33 if { ([istarget "*-*-elf*"]             
34       || [istarget "*-*-linux*"]
35       || [istarget "sparc*-*-solaris*"]
36       || [istarget "mips*-*-irix6*"])
37      && ![istarget *-*-linux*aout*]
38      && ![istarget *-*-linux*coff*]
39      && ![istarget *-*-linux*oldld*]
40 } then {
41     set target_machine ""
42     if {[istarget "mips*-*-*"] || [istarget v850-*-*]} then {
43         set target_machine -mips
44     }
45     if {[istarget m32r*-*-*]} then {
46         set target_machine -m32r
47     }
48     run_dump_test "ehopt0"
49     run_dump_test "section0" 
50     run_dump_test "section1" 
51     run_list_test "section2" "$target_machine" "-al"
52 }