]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-m68k/m68k.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-m68k / m68k.exp
CommitLineData
0b2e31dc 1# Expect script for run_dump_test based ld-m68k tests.
250d07de 2# Copyright (C) 2006-2021 Free Software Foundation, Inc.
0b2e31dc 3#
f96b4a7b
NC
4# This file is part of the GNU Binutils.
5#
6# This program is free software; you can redistribute it and/or modify
0b2e31dc 7# it under the terms of the GNU General Public License as published by
f96b4a7b 8# the Free Software Foundation; either version 3 of the License, or
0b2e31dc 9# (at your option) any later version.
f96b4a7b 10#
0b2e31dc
NS
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
f96b4a7b 15#
0b2e31dc
NS
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
f96b4a7b
NC
18# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19# MA 02110-1301, USA.
0b2e31dc
NS
20#
21# Test m68k object merging
22
23if { ![is_elf_format] || ![istarget m68k-*-*] } {
24 return
25}
26
27# List contains test-items with 3 items followed by 2 lists:
897aea50
MR
28# 0:name 1:ld early options 2:ld late options 3:assembler options
29# 4:filenames of assembler files 5: action and options. 6: name of output file
0b2e31dc
NS
30
31# Actions:
32# objdump: Apply objdump options on result. Compare with regex (last arg).
33# nm: Apply nm options on result. Compare with regex (last arg).
34# readelf: Apply readelf options on result. Compare with regex (last arg).
35
36set m68k_mergeok_tests {
897aea50 37 {"merge isa-a isa-a:nodiv" "-T merge.ld" "" ""
cf869cce 38 {isaa.s isaa-nodiv.s} {{objdump -p isaa.d}} "isaa-nodiv"}
897aea50 39 {"merge isa-a isa-b" "-T merge.ld" "" ""
0b2e31dc 40 {isaa.s isab.s} {{objdump -p isab.d}} "isab"}
897aea50 41 {"merge isa-a isa-aplus" "-T merge.ld" "" ""
0b2e31dc 42 {isaa.s isaaplus.s} {{objdump -p isaaplus.d}} "isaplus"}
897aea50 43 {"merge isa-b isa-b:nousp" "-T merge.ld" "" ""
0b2e31dc 44 {isab.s isab-nousp.s} {{objdump -p isab.d}} "isab"}
897aea50 45 {"merge isa-a isa-a:mac" "-T merge.ld" "" ""
0b2e31dc 46 {isaa.s isaa-mac.s} {{objdump -p isaa-mac.d}} "isaa-mac"}
897aea50 47 {"merge isa-b isa-b:float" "-T merge.ld" "" ""
0b2e31dc
NS
48 {isab.s isab-float.s} {{objdump -p isab-float.d}} "isab-float"}}
49
50run_ld_link_tests $m68k_mergeok_tests
a9d34880
RS
51
52run_dump_test "merge-error-1a"
53run_dump_test "merge-error-1b"
54run_dump_test "merge-error-1c"
55run_dump_test "merge-error-1d"
56run_dump_test "merge-error-1e"
57run_dump_test "merge-ok-1a"
58run_dump_test "merge-ok-1b"
fb405f8a 59run_dump_test "merge-ok-1c"
cc3e26be
RS
60
61foreach { id sources } { a { plt1.s } b { plt1-empty.s plt1.s } } {
353a0210 62 foreach arch { 68020 cpu32 isab isac } {
cc3e26be 63 run_ld_link_tests [list \
bab55c05
AM
64 [list "PLT 1$id ($arch)" \
65 "-shared -T plt1.ld --hash-style=sysv" "" "-m$arch" \
cc3e26be
RS
66 $sources [list [list objdump -dr plt1-$arch.d]] \
67 plt1-${id}-${arch}.so]]
68 }
69}
cf869cce
NC
70
71if { [istarget m68k-*-linux*] } then {
72 run_dump_test "tls-gd-1"
73 run_dump_test "tls-gd-2"
74 run_dump_test "tls-gd-ie-1"
75 run_dump_test "tls-ie-1"
76 run_dump_test "tls-ld-1"
77 run_dump_test "tls-ld-2"
e5f2b1de
NC
78
79 set m68k_tls_tests {
80 {"TLS definition"
897aea50 81 "-shared" "" "" {tls-def-1.s}
e5f2b1de
NC
82 {{nm -ngD tls-def-1.d}}
83 "tls-def-1.so"}
84 {"TLS direct symbol use"
bab55c05 85 "-shared --hash-style=sysv tmpdir/tls-def-1.so" "" "" {tls-gd-1.s}
e5f2b1de
NC
86 {{nm -ngD tls-gd-1.d2} {readelf -d tls-gd-1.d3}}
87 "tls-gd-1.so"}
88 {"TLS indirect symbol use"
bab55c05 89 "--copy-dt-needed-entries --hash-style=sysv tmpdir/tls-gd-1.so -rpath-link ./" "" "" {tls-main-1.s}
e5f2b1de
NC
90 {{readelf -d tls-main-1.d}}
91 "tls-main-1"}}
92
93 run_ld_link_tests $m68k_tls_tests
cf869cce 94}
85f7484a
PB
95
96run_dump_test "attr-gnu-4-00"
97run_dump_test "attr-gnu-4-01"
98run_dump_test "attr-gnu-4-02"
99run_dump_test "attr-gnu-4-10"
100run_dump_test "attr-gnu-4-11"
101run_dump_test "attr-gnu-4-12"
102run_dump_test "attr-gnu-4-20"
103run_dump_test "attr-gnu-4-21"
104run_dump_test "attr-gnu-4-22"