* gas/config/tc-avr.c: Change ISA for devices with USB support to
[external/binutils.git] / gas / testsuite / gas / mep / complex-relocs.exp
1 # Copyright 2012
2 # Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
17
18 # complex relocations testsuite
19
20 proc ld_test { objects ldflags dest test } {
21     set ld_output [target_link $objects $dest $ldflags]
22     if [string match "" $ld_output] then { pass $test } else { fail $test }
23 }
24
25 proc ld_test_error { objects ldflags dest test } {
26     set ld_output [target_link $objects $dest $ldflags]
27     if [string match "" $ld_output] then { fail $test } else { pass $test }
28 }
29
30 proc objdump_test { exec flags dest test } {
31     set objdump [find_binutils_prog objdump]
32     verbose -log "$objdump $flags $exec > $dest"
33     catch "exec $objdump $flags $exec > $dest" objdump_output
34     if [string match "" $objdump_output] then { pass $test } else { fail $test }
35 }
36
37 proc regexp_test { file1 file2 test } {
38     if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
39 }
40
41
42 global srcdir subdir
43 if [istarget mep*-*-*] {
44
45     # test that complex relocs between files work, generally
46     gas_test relocs-junk1.s {-mconfig=default -o relocs-junk1.o} {} {assembling relocs-junk1}
47     gas_test relocs-syms.s {-mconfig=default -o relocs-syms.o} {} {assembling relocs-syms}
48     gas_test relocs-junk2.s {-mconfig=default -o relocs-junk2.o} {} {assembling relocs-junk2}
49     gas_test relocs-refs.s {-mconfig=default -o relocs-refs.o} {} {assembling relocs-refs}
50     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}
51     objdump_test {relocs.x} {-dzs} {relocs.dump} {disassembling relocs.x}
52     regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly for relocs.x}
53
54     foreach test {3} {
55         # perform specific negative boundary tests
56         gas_test "relocs-bad$test.s" [list -mconfig=default -o "relocs-bad$test.o"] {} [list assembling "relocs-bad$test"]
57         ld_test_error "relocs-bad$test.o" {-e 1233 -EL} "relocs-bad$test.x" [list linking "relocs-bad$test"]
58     }
59 }