2004-04-30 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gas / testsuite / gas / elf / elf.exp
CommitLineData
98944905
RH
1#
2# elf tests
3#
4
633a0b73 5proc run_list_test { name suffix opts readelf_pipe } {
5b5032eb
L
6 global READELF
7 global srcdir subdir
8 set testname "elf $name list"
02e07694 9 set file $srcdir/$subdir/$name
5b5032eb 10 gas_run ${name}.s "$opts -o dump.o" ">&dump.out"
5c1aa77e
L
11 if { ![string match "" $opts]
12 && [regexp_diff "dump.out" "${file}.l"] } then {
5b5032eb
L
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"
633a0b73 18 catch "exec $READELF -s dump.o $readelf_pipe > dump.out\n" comp_output
5b5032eb
L
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
fa6b2d59 25 if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then {
5b5032eb
L
26 fail $testname
27 verbose "output is [file_contents "dump.out"]" 2
28 return
29 }
30 pass $testname
31}
32
98944905 33# We're testing bits in obj-elf -- don't run on anything else.
966d5bec
ILT
34if { ([istarget "*-*-elf*"]
35 || [istarget "*-*-linux*"]
36 || [istarget "sparc*-*-solaris*"]
37 || [istarget "mips*-*-irix6*"])
38 && ![istarget *-*-linux*aout*]
f48026f7 39 && ![istarget *-*-linux*coff*]
966d5bec 40 && ![istarget *-*-linux*oldld*]
42bf09b2 41 && ![istarget sh64*-*-linux*]
966d5bec 42} then {
fa6b2d59 43 set target_machine ""
9e0665bc 44 if {[istarget "mips*-*-*"]} then {
fa6b2d59
L
45 set target_machine -mips
46 }
6a7715f4
NC
47 if {[istarget m32r*-*-*]} then {
48 set target_machine -m32r
49 }
1ff55c93 50 run_dump_test "ehopt0"
f5842774
L
51 run_dump_test "group0a"
52 run_dump_test "group0b"
53 run_list_test "group1" "" "" ""
98944905 54 run_dump_test "section0"
8ee99f93 55 run_dump_test "section1"
633a0b73 56 run_list_test "section2" "$target_machine" "-al" ""
34f70875 57 run_dump_test "section3"
eba874d8 58 run_dump_test "symver"
633a0b73 59 run_list_test "type" "" "" "| grep \"1 \\\[FONT\\\]\""
98944905 60}
This page took 0.214173 seconds and 4 git commands to generate.