]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/testsuite/gas/elf/elf.exp
* gas/m68hc11/m68hc11.exp: Fix tests for 2.15
[thirdparty/binutils-gdb.git] / gas / testsuite / gas / elf / elf.exp
1 #
2 # elf tests
3 #
4
5 proc run_list_test { name suffix opts readelf_pipe } {
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 { ![string match "" $opts]
12 && [regexp_diff "dump.out" "${file}.l"] } then {
13 fail $testname
14 verbose "output is [file_contents "dump.out"]" 2
15 return
16 }
17 send_log "$READELF -s dump.o > dump.out\n"
18 catch "exec $READELF -s dump.o $readelf_pipe > dump.out\n" comp_output
19 if ![string match "" $comp_output] then {
20 send_log "$comp_output\n"
21 fail $testname
22 return
23 }
24 verbose_eval {[file_contents "dump.out"]} 3
25 if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then {
26 fail $testname
27 verbose "output is [file_contents "dump.out"]" 2
28 return
29 }
30 pass $testname
31 }
32
33 # We're testing bits in obj-elf -- don't run on anything else.
34 if { ([istarget "*-*-elf*"]
35 || [istarget "*-*-linux*"]
36 || [istarget "m6811-*"]
37 || [istarget "m6812-*"]
38 || [istarget "sparc*-*-solaris*"]
39 || [istarget "mips*-*-irix6*"])
40 && ![istarget *-*-linux*aout*]
41 && ![istarget *-*-linux*coff*]
42 && ![istarget *-*-linux*oldld*]
43 && ![istarget sh64*-*-linux*]
44 } then {
45 set target_machine ""
46 if {[istarget "mips*-*-*"]} then {
47 set target_machine -mips
48 }
49 if {[istarget m32r*-*-*]} then {
50 set target_machine -m32r
51 }
52 run_dump_test "ehopt0"
53 run_dump_test "group0a"
54 run_dump_test "group0b"
55 run_dump_test "group1a"
56 run_dump_test "group1b"
57 run_dump_test "section0"
58 run_dump_test "section1"
59 run_list_test "section2" "$target_machine" "-al" ""
60 run_dump_test "section3"
61 run_dump_test "section4"
62 run_dump_test "symver"
63 run_list_test "type" "" "" "| grep \"1 \\\[FONT\\\]\""
64 }