aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts/defined.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-scripts/defined.exp')
-rw-r--r--ld/testsuite/ld-scripts/defined.exp39
1 files changed, 39 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp
new file mode 100644
index 0000000..6da26bc
--- /dev/null
+++ b/ld/testsuite/ld-scripts/defined.exp
@@ -0,0 +1,39 @@
+# Test DEFINED in a linker script.
+# By Ian Lance Taylor, Cygnus Support.
+
+set testname "DEFINED"
+set prms_id 5699
+
+if ![ld_assemble $as $srcdir/$subdir/defined.s tmpdir/def.o] {
+ unresolved $testname
+ return
+}
+
+if ![ld_simple_link $ld tmpdir/def "-T $srcdir/$subdir/defined.t tmpdir/def.o"] {
+ fail $testname
+} else {
+ if ![ld_nm $nm tmpdir/def] {
+ unresolved $testname
+ } else {
+ if {![info exists nm_output(value1)] \
+ || ![info exists nm_output(value2)]} {
+ send_log "bad output from nm\n"
+ verbose "bad output from nm"
+ fail $testname
+ } else {
+ if {$nm_output(value1) != 1} {
+ send_log "value1 == $nm_output(value1)\n"
+ verbose "value1 == $nm_output(value1)"
+ fail $testname
+ } else {
+ if {$nm_output(value2) != 2} {
+ send_log "value2 == $nm_output(value2)\n"
+ verbose "value2 == $nm_output(value2)"
+ fail $testname
+ } else {
+ pass $testname
+ }
+ }
+ }
+ }
+}