Commit | Line | Data |
---|---|---|
98944905 RH |
1 | # |
2 | # elf tests | |
3 | # | |
4 | ||
fa6b2d59 | 5 | proc run_list_test { name suffix opts } { |
5b5032eb L |
6 | global READELF |
7 | global srcdir subdir | |
8 | set testname "elf $name list" | |
02e07694 | 9 | set file $srcdir/$subdir/$name |
5b5032eb L |
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 | |
fa6b2d59 | 24 | if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then { |
5b5032eb L |
25 | fail $testname |
26 | verbose "output is [file_contents "dump.out"]" 2 | |
27 | return | |
28 | } | |
29 | pass $testname | |
30 | } | |
31 | ||
98944905 | 32 | # We're testing bits in obj-elf -- don't run on anything else. |
966d5bec ILT |
33 | if { ([istarget "*-*-elf*"] |
34 | || [istarget "*-*-linux*"] | |
35 | || [istarget "sparc*-*-solaris*"] | |
36 | || [istarget "mips*-*-irix6*"]) | |
37 | && ![istarget *-*-linux*aout*] | |
f48026f7 | 38 | && ![istarget *-*-linux*coff*] |
966d5bec | 39 | && ![istarget *-*-linux*oldld*] |
42bf09b2 | 40 | && ![istarget sh64*-*-linux*] |
966d5bec | 41 | } then { |
fa6b2d59 | 42 | set target_machine "" |
9e0665bc | 43 | if {[istarget "mips*-*-*"]} then { |
fa6b2d59 L |
44 | set target_machine -mips |
45 | } | |
6a7715f4 NC |
46 | if {[istarget m32r*-*-*]} then { |
47 | set target_machine -m32r | |
48 | } | |
e16bb312 NC |
49 | if {[istarget xscale*-*-elf]} then { |
50 | set target_machine -miwmmxt | |
51 | } | |
1ff55c93 | 52 | run_dump_test "ehopt0" |
98944905 | 53 | run_dump_test "section0" |
8ee99f93 | 54 | run_dump_test "section1" |
fa6b2d59 | 55 | run_list_test "section2" "$target_machine" "-al" |
98944905 | 56 | } |