Run more ld tests when not native
[deliverable/binutils-gdb.git] / ld / testsuite / ld-mn10300 / mn10300.exp
CommitLineData
bfff1642 1# Expect script for ld-mn10300 tests
2571583a 2# Copyright (C) 2007-2017 Free Software Foundation, Inc.
bfff1642
NC
3#
4# This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17#
18
19if {!([istarget "am3*-*-*"]) && !([istarget "mn10300*-*-*"]) } {
20 return
21}
22
23# Set up a list as described in ld-lib.exp
24
569006e5 25set mn10300_tests {
bfff1642
NC
26 {
27 "am33 string merging"
897aea50 28 "-relax -Ttext 0x8000074" ""
bfff1642
NC
29 ""
30 { "i36434.s" "i36434-2.s" }
31 { {objdump -dz i36434.d} }
32 "i36434.x"
33 }
34 {
569006e5 35 "difference of two same-section symbols"
897aea50 36 "-Ttext 0" ""
bfff1642
NC
37 ""
38 { "i112045-1.s" }
39 { {objdump -d i112045-1.d} }
40 "i112045-1.x"
41 }
42 {
569006e5 43 "difference of two same-section symbols where the difference is held in another section"
897aea50 44 "-relax -Ttext 100" ""
bfff1642 45 ""
569006e5
NC
46 { "i112045-3.s" }
47 { {objdump -D i112045-3.d} }
48 "i112045-3.x"
bfff1642 49 }
b5f5fd96
NC
50 {
51 "relaxation and alignment directives"
897aea50 52 "-relax -Ttext 100 -Tbss 300" ""
b5f5fd96
NC
53 ""
54 { "i127740.s" }
55 { {objdump -d i127740.d} }
56 "i127740.x"
57 }
bfff1642
NC
58 {
59 "adjustment of symbols due to relaxation"
897aea50 60 "-Tdata 1f -Ttext 0 -relax" ""
569006e5
NC
61 ""
62 { "i135409-1.s" }
63 { {readelf --syms i135409-1.d} }
64 "i135409-1.x"
65 }
66 {
67 "adjustment of symbols due to relaxation (with alignment directives)"
897aea50 68 "-Tdata 1f -Ttext 0 -relax" ""
569006e5
NC
69 ""
70 { "i135409-2.s" }
71 { {readelf --syms i135409-2.d} }
72 "i135409-2.x"
73 }
b5f5fd96
NC
74 {
75 "adjustment of symbols due to relaxation (with a symbol in the deleted region)"
897aea50 76 "-Tdata 1f -Ttext 0 -relax" ""
b5f5fd96
NC
77 ""
78 { "i135409-3.s" }
79 { {objdump -d i135409-3.d} }
80 "i135409-3.x"
81 }
fc91707c 82 {
e23f1610 83 "adjusting a 16-bit forward branch"
897aea50 84 "-Ti135409-4.t -relax" ""
fc91707c
NC
85 ""
86 { "i135409-4.s" }
87 { {objdump -d i135409-4.d} }
88 "i135409-4.x"
89 }
e23f1610
NC
90 {
91 "adjusting a 16-bit backward branch"
897aea50 92 "-Ti135409-5.t -relax" ""
e23f1610
NC
93 ""
94 { "i135409-5.s" }
95 { {objdump -d i135409-5.d} }
96 "i135409-5.x"
97 }
e9e9cead
NC
98 {
99 "relaxing offsets into a merged string section"
897aea50 100 "-Ti143317.t -shared -relax" ""
e9e9cead
NC
101 ""
102 { "i143317.s" }
103 { {objdump -d i143317.d} }
104 "i143317.x"
105 }
569006e5
NC
106}
107
108run_ld_link_tests $mn10300_tests
109
110if {!([istarget "am3*-*-*"])} {
111 return
112}
113
114set am33_tests {
115 {
116 "difference of two same-section symbols (in a shared library)"
897aea50 117 "-shared" ""
bfff1642 118 ""
569006e5
NC
119 { "i112045-2.s" }
120 { {objdump -R i112045-2.d} }
121 "i112045-2.x"
bfff1642
NC
122 }
123}
124
125run_ld_link_tests $am33_tests
126
127proc i126256-test { } {
128 global CC
129 global ld
130 global srcdir
131 global subdir
132
133 set tmpdir tmpdir
569006e5
NC
134 set testname "Seg fault whilst linking one shared library into another when relaxation is enabled."
135
136 if {![is_remote host] && [which $CC] == 0} then {
137 return
138 }
bfff1642
NC
139
140 if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-1.c $tmpdir/i126256-1.o] } {
141 unresolved $testname
142 return
143 }
144
145 if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-2.c $tmpdir/i126256-2.o] } {
146 unresolved $testname
147 return
148 }
149
d9816402 150 if { ![ld_link $ld $tmpdir/i126256-1.so "-shared $tmpdir/i126256-1.o -e 0"]} {
bfff1642
NC
151 unresolved $testname
152 return
153 }
154
d9816402 155 if { ![ld_link $ld $tmpdir/i126256-2.so "--relax -shared $tmpdir/i126256-2.o $tmpdir/i126256-1.so -e 0"]} {
bfff1642
NC
156 fail $testname
157 return
158 }
159
160 pass $testname
161}
162
163i126256-test
This page took 0.403766 seconds and 4 git commands to generate.