Add support to GDB for the Renesas rl78 architecture.
[external/binutils.git] / gas / testsuite / gas / mep / complex-relocs.exp
1 # complex relocations testsuite
2
3 proc ld_test { objects ldflags dest test } {
4     set ld_output [target_link $objects $dest $ldflags]
5     if [string match "" $ld_output] then { pass $test } else { fail $test }
6 }
7
8 proc ld_test_error { objects ldflags dest test } {
9     set ld_output [target_link $objects $dest $ldflags]
10     if [string match "" $ld_output] then { fail $test } else { pass $test }
11 }
12
13 proc objdump_test { exec flags dest test } {
14     set objdump [find_binutils_prog objdump]
15     verbose -log "$objdump $flags $exec > $dest"
16     catch "exec $objdump $flags $exec > $dest" objdump_output
17     if [string match "" $objdump_output] then { pass $test } else { fail $test }
18 }
19
20 proc regexp_test { file1 file2 test } {
21     if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
22 }
23
24
25 global srcdir subdir
26 if [istarget mep*-*-*] {
27
28     # test that complex relocs between files work, generally
29     gas_test relocs-junk1.s {-mconfig=default -o relocs-junk1.o} {} {assembling relocs-junk1}
30     gas_test relocs-syms.s {-mconfig=default -o relocs-syms.o} {} {assembling relocs-syms}
31     gas_test relocs-junk2.s {-mconfig=default -o relocs-junk2.o} {} {assembling relocs-junk2}
32     gas_test relocs-refs.s {-mconfig=default -o relocs-refs.o} {} {assembling relocs-refs}
33     ld_test {relocs-junk1.o relocs-syms.o relocs-junk2.o relocs-refs.o} {--defsym __stack=0x1ffff0 --defsym __sbss_end=0x1000 -e 1233 -EL} {relocs.x} {linking relocs.x}
34     objdump_test {relocs.x} {-dzs} {relocs.dump} {disassembling relocs.x}
35     regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly for relocs.x}
36
37     foreach test {3} {
38         # perform specific negative boundary tests
39         gas_test "relocs-bad$test.s" [list -mconfig=default -o "relocs-bad$test.o"] {} [list assembling "relocs-bad$test"]
40         ld_test_error "relocs-bad$test.o" {-e 1233 -EL} "relocs-bad$test.x" [list linking "relocs-bad$test"]
41     }
42 }