]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/testsuite/gas/mt/relocs.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / gas / testsuite / gas / mt / relocs.exp
1 # Copyright (C) 2012-2021 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
16
17 # Relocation test.
18 # This test is special because it exercises the linker's
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
26 proc objdump_test { exec flags dest test } {
27 set objcopy [find_binutils_prog objdump]
28 verbose -log "$objcopy $flags $exec > $dest"
29 catch "exec $objcopy $flags $exec > $dest" objdump_output
30 if [string match "" $objdump_output] then { pass $test } else { fail $test }
31 }
32
33 proc regexp_test { file1 file2 test } {
34 if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
35 }
36
37
38 if [istarget mt-*] {
39 gas_test "relocs1.s" {-o relocs1.o} {} {assembling relocs1}
40
41 # gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
42 # ld_test {relocs1.o relocs2.o} {} {relocs.x} {linking relocs.x}
43 # objdump_test {relocs.x} {-ds} {relocs.dump} {disassembling relocs.x}
44 # regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly}
45
46 gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
47 ld_test {relocs1.o relocs2.o} {} {relocs.x} {linking relocs.x}
48 objdump_test {relocs.x} {-ds} {relocs.dump} {disassembling relocs.x}
49 regexp_test {relocs.dump} "$srcdir/$subdir/relocs.d" {matching disassembly}
50 }