diff options
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-ia64/line.exp | 57 | ||||
-rw-r--r-- | ld/testsuite/ld-ia64/undefined.s | 152 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/line.exp | 6 |
4 files changed, 217 insertions, 6 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index c145f09..9abfc40 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-09-02 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/4986 + * ld-ia64/line.exp: New. + * ld-ia64/undefined.s: Likewise. + + * ld-x86-64/line.exp: Don't check CC. + 2007-08-31 H.J. Lu <hongjiu.lu@intel.com> PR ld/4986 diff --git a/ld/testsuite/ld-ia64/line.exp b/ld/testsuite/ld-ia64/line.exp new file mode 100644 index 0000000..2ebc7d6 --- /dev/null +++ b/ld/testsuite/ld-ia64/line.exp @@ -0,0 +1,57 @@ +# Test that the linker reports undefined symbol line number correctly. +# +# Copyright 2007 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +if { !([istarget "ia64-*-elf*"] + || [istarget "ia64-*-linux*"]) } { + return +} + +set testline "undefined line" + +if ![ld_assemble $as "-x $srcdir/$subdir/undefined.s" tmpdir/undefined.o] { + verbose "Unable to assemble test file!" 1 + unresolved $testline + return +} + +remote_file host delete "tmpdir/undefined" + +# Using -e start prevents the SunOS linker from trying to build a +# shared library. +send_log "$ld -e start -o tmpdir/undefined tmpdir/undefined.o\n" +set exec_output [run_host_cmd "$ld" "-e start -o tmpdir/undefined tmpdir/undefined.o"] + +send_log "$exec_output\n" +verbose "$exec_output" + +proc checkund { string testname } { + global exec_output + + if [string match "*$string*" $exec_output] { + pass $testname + } else { + fail $testname + } +} + +set ml "undefined.c:9: undefined reference to `*this_function_is_not_defined'" + +checkund $ml $testline diff --git a/ld/testsuite/ld-ia64/undefined.s b/ld/testsuite/ld-ia64/undefined.s new file mode 100644 index 0000000..d563c62 --- /dev/null +++ b/ld/testsuite/ld-ia64/undefined.s @@ -0,0 +1,152 @@ + .file "undefined.c" + .pred.safe_across_calls p1-p5,p16-p63 + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .section .debug_line,"",@progbits +.Ldebug_line0: + .text +.Ltext0: + .align 16 + .global function# + .proc function# +function: +[.LFB2:] + .file 1 "undefined.c" + .loc 1 8 0 + .prologue 12, 32 + .mii + .save ar.pfs, r33 + alloc r33 = ar.pfs, 0, 3, 0, 0 + .save rp, r32 + mov r32 = b0 + mov r34 = r1 + .body + .loc 1 9 0 + ;; + .mib + nop 0 + nop 0 + br.call.sptk.many b0 = this_function_is_not_defined# + .loc 1 10 0 + ;; + .loc 1 9 0 + .mmi + nop 0 + mov r1 = r34 + .loc 1 10 0 + mov b0 = r32 + .mib + nop 0 + mov ar.pfs = r33 + br.ret.sptk.many b0 +.LFE2: + .endp function# +.Letext0: + .section .debug_info + data4.ua 0x4c + data2.ua 0x2 + data4.ua @secrel(.Ldebug_abbrev0) + data1 0x8 + .uleb128 0x1 + data4.ua @secrel(.Ldebug_line0) + data8.ua .Letext0 + data8.ua .Ltext0 + data4.ua @secrel(.LASF0) + data1 0x1 + data4.ua @secrel(.LASF1) + .uleb128 0x2 + data1 0x1 + data4.ua @secrel(.LASF2) + data1 0x1 + data1 0x8 + data4.ua 0x48 + data8.ua .LFB2 + data8.ua .LFE2 + data1 0x2 + data1 0x7c + .sleb128 16 + .uleb128 0x3 + stringz "int" + data1 0x4 + data1 0x5 + data1 0x0 + .section .debug_abbrev + .uleb128 0x1 + .uleb128 0x11 + data1 0x1 + .uleb128 0x10 + .uleb128 0x6 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x25 + .uleb128 0xe + .uleb128 0x13 + .uleb128 0xb + .uleb128 0x3 + .uleb128 0xe + data1 0x0 + data1 0x0 + .uleb128 0x2 + .uleb128 0x2e + data1 0x0 + .uleb128 0x3f + .uleb128 0xc + .uleb128 0x3 + .uleb128 0xe + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb + .uleb128 0x49 + .uleb128 0x13 + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x40 + .uleb128 0xa + data1 0x0 + data1 0x0 + .uleb128 0x3 + .uleb128 0x24 + data1 0x0 + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + data1 0x0 + data1 0x0 + data1 0x0 + .section .debug_pubnames,"",@progbits + data4.ua 0x1b + data2.ua 0x2 + data4.ua @secrel(.Ldebug_info0) + data4.ua 0x50 + data4.ua 0x29 + stringz "function" + data4.ua 0x0 + .section .debug_aranges,"",@progbits + data4.ua 0x2c + data2.ua 0x2 + data4.ua @secrel(.Ldebug_info0) + data1 0x8 + data1 0x0 + data2.ua 0x0 + data2.ua 0x0 + data8.ua .Ltext0 + data8.ua .Letext0-.Ltext0 + data8.ua 0x0 + data8.ua 0x0 + .section .debug_str,"MS",@progbits,1 +.LASF0: + stringz "GNU C 4.1.2" +.LASF1: + stringz "undefined.c" +.LASF2: + stringz "function" diff --git a/ld/testsuite/ld-x86-64/line.exp b/ld/testsuite/ld-x86-64/line.exp index 0d92489..c68daaa 100644 --- a/ld/testsuite/ld-x86-64/line.exp +++ b/ld/testsuite/ld-x86-64/line.exp @@ -26,12 +26,6 @@ if { !([istarget "x86_64-*-elf*"] set testline "undefined line" -if { ![is_remote host] && [which $CC] == 0 } { - verbose "Could not find C compiler!" 1 - untested $testline - return -} - if ![ld_assemble $as "--64 $srcdir/$subdir/undefined.s" tmpdir/undefined.o] { verbose "Unable to assemble test file!" 1 unresolved $testline |