Upload Tizen:Base source
[external/binutils.git] / gas / testsuite / gas / mt / relocs.exp
1 # Relocation test.
2 # This test is special because it exercises the linker's 
3
4 proc ld_test { objects ldflags dest test } {
5     set ld_output [target_link $objects $dest $ldflags]
6     if [string match "" $ld_output] then { pass $test } else { fail $test }
7 }
8
9
10 proc objdump_test { exec flags dest test } {
11     set objcopy [find_binutils_prog objdump]
12     verbose -log "$objcopy $flags $exec > $dest"
13     catch "exec $objcopy $flags $exec > $dest" objdump_output
14     if [string match "" $objdump_output] then { pass $test } else { fail $test }
15 }
16
17 proc regexp_test { file1 file2 test } {
18     if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
19 }
20
21
22 global srcdir subdir
23 if [istarget mt-*] {
24     gas_test "relocs1.s" {-o relocs1.o} {} {assembling relocs1}
25
26     #    gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
27     #    ld_test {relocs1.o relocs2.o} {} {relocs.x} {linking relocs.x}
28     #    objdump_test {relocs.x} {-ds} {relocs.dump} {disassembling relocs.x}
29     #    regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly}
30
31     gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
32     ld_test {relocs1.o relocs2.o} {} {relocs.x} {linking relocs.x}
33     objdump_test {relocs.x} {-ds} {relocs.dump} {disassembling relocs.x}
34     regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly}
35 }