* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[deliverable/binutils-gdb.git] / ld / testsuite / ld-undefined / undefined.exp
CommitLineData
738844c1
ILT
1# Test that the linker reports undefined symbol errors correctly.
2# By Ian Lance Taylor, Cygnus Support
3#
4# Copyright (C) 1995 Free Software Foundation
5#
6# This file is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
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.
15#
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
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20set testund "undefined"
21set testfn "undefined function"
22set testline "undefined line"
23
ba7db991
ILT
24if { [which $CC] == 0 } {
25 untested $testund
26 untested $testfn
27 untested $testline
28 return
29}
30
738844c1
ILT
31if ![ld_compile "$CC -g" $srcdir$subdir/undefined.c tmpdir/undefined.o] {
32 unresolved $testund
33 unresolved $testfn
34 unresolved $testline
35 return
36}
37
38catch "exec rm -f tmpdir/undefined" exec_output
39
ba7db991
ILT
40# Using -e start prevents the SunOS linker from trying to build a
41# shared library.
42send_log "$ld -e start -o tmpdir/undefined tmpdir/undefined.o\n"
43verbose "$ld -e start -o tmpdir/undefined tmpdir/undefined.o"
738844c1 44
ba7db991 45catch "exec $ld -e start -o tmpdir/undefined tmpdir/undefined.o" exec_output
738844c1
ILT
46send_log "$exec_output\n"
47verbose "$exec_output"
48
49proc checkund { string testname } {
50 global exec_output
51
52 if [string match "*$string*" $exec_output] {
53 pass $testname
54 } else {
55 fail $testname
56 }
57}
58
59set mu "undefined reference to `this_function_is_not_defined'"
60checkund $mu $testund
61
ba7db991
ILT
62# ARM PE defaults to using stabs debugging, which we can't handle for
63# a COFF file.
64setup_xfail "arm*-*-pe*"
65
738844c1
ILT
66set mf "tmpdir/undefined.o: In function `function':"
67checkund $mf $testfn
68
ba7db991
ILT
69# COFF SH gets this test wrong--it reports line 10, because although
70# the jump is at line 9, the function address, and the reloc, is
71# stored at the end of the function.
72setup_xfail "sh-*-*"
73
74# ARM PE defaults to using stabs debugging, which we can't handle for
75# a COFF file.
76setup_xfail "arm*-*-pe*"
738844c1
ILT
77
78set ml "undefined.c:9: undefined reference to `this_function_is_not_defined'"
79checkund $ml $testline
This page took 0.132022 seconds and 4 git commands to generate.