2000-10-31 Philip Blundell <philb@gnu.org>
[binutils.git] / ld / testsuite / ld-scripts / defined.exp
blob6da26bc3bc2a54ec2d73ae50df23e6330a2be6f3
1 # Test DEFINED in a linker script.
2 # By Ian Lance Taylor, Cygnus Support.
4 set testname "DEFINED"
5 set prms_id 5699
7 if ![ld_assemble $as $srcdir/$subdir/defined.s tmpdir/def.o] {
8 unresolved $testname
9 return
12 if ![ld_simple_link $ld tmpdir/def "-T $srcdir/$subdir/defined.t tmpdir/def.o"] {
13 fail $testname
14 } else {
15 if ![ld_nm $nm tmpdir/def] {
16 unresolved $testname
17 } else {
18 if {![info exists nm_output(value1)] \
19 || ![info exists nm_output(value2)]} {
20 send_log "bad output from nm\n"
21 verbose "bad output from nm"
22 fail $testname
23 } else {
24 if {$nm_output(value1) != 1} {
25 send_log "value1 == $nm_output(value1)\n"
26 verbose "value1 == $nm_output(value1)"
27 fail $testname
28 } else {
29 if {$nm_output(value2) != 2} {
30 send_log "value2 == $nm_output(value2)\n"
31 verbose "value2 == $nm_output(value2)"
32 fail $testname
33 } else {
34 pass $testname