]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/testsuite/gas/elf/elf.exp
* gas/elf.exp: Don't run for sh64*-*-linux*, because it sets the
[thirdparty/binutils-gdb.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 && ![istarget sh64*-*-linux*]
41 } then {
42 set target_machine ""
43 if {[istarget "mips*-*-*"]} then {
44 set target_machine -mips
45 }
46 if {[istarget m32r*-*-*]} then {
47 set target_machine -m32r
48 }
49 run_dump_test "ehopt0"
50 run_dump_test "section0"
51 run_dump_test "section1"
52 run_list_test "section2" "$target_machine" "-al"
53 }