aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2004-02-20 15:31:11 +0000
committernobody <>2004-02-20 15:31:11 +0000
commita3f5c37a31f87650010fa15f1519924ca18f4335 (patch)
treee88ec874354669e5410b8b45440c2c4aaf69e071
parent4d3a2a6609c43a1f2a74eaba9d7f9118c3f510eb (diff)
downloadgdb-a3f5c37a31f87650010fa15f1519924ca18f4335.zip
gdb-a3f5c37a31f87650010fa15f1519924ca18f4335.tar.gz
gdb-a3f5c37a31f87650010fa15f1519924ca18f4335.tar.bz2
This commit was manufactured by cvs2svn to create branch 'binutils-
2_15-branch'. Cherrypick from master 2004-02-20 15:31:10 UTC Nathan Sidwell <nathan@codesourcery.com> ' * ldgram.y (exp): Add two operand ALIGN.': ld/testsuite/ld-scripts/align.exp ld/testsuite/ld-scripts/align.s ld/testsuite/ld-scripts/align.t
-rw-r--r--ld/testsuite/ld-scripts/align.exp31
-rw-r--r--ld/testsuite/ld-scripts/align.s2
-rw-r--r--ld/testsuite/ld-scripts/align.t8
3 files changed, 41 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/align.exp b/ld/testsuite/ld-scripts/align.exp
new file mode 100644
index 0000000..3959e6d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.exp
@@ -0,0 +1,31 @@
+# Test ALIGN in a linker script.
+# By Nathan Sidwell, CodeSourcery LLC
+# Copyright 2004
+# Free Software Foundation, Inc.
+#
+# This file 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testname "ALIGN"
+
+if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
+ unresolved $testname
+ return
+}
+
+if ![ld_simple_link $ld tmpdir/align "-T $srcdir/$subdir/align.t tmpdir/align.o"] {
+ fail $testname
+} else {
+ pass $testname
+}
diff --git a/ld/testsuite/ld-scripts/align.s b/ld/testsuite/ld-scripts/align.s
new file mode 100644
index 0000000..c9bad23
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.s
@@ -0,0 +1,2 @@
+ .text
+ .long 0
diff --git a/ld/testsuite/ld-scripts/align.t b/ld/testsuite/ld-scripts/align.t
new file mode 100644
index 0000000..49d6053
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.t
@@ -0,0 +1,8 @@
+SECTIONS
+{
+ .text : {*(.text)}
+ .data ALIGN(0x40) : AT (ALIGN (LOADADDR (.text) + SIZEOF (.text), 0x80))
+ {}
+ ASSERT (LOADADDR(.data) == 0x80, "dyadic ALIGN broken")
+ ASSERT (ADDR(.data) == 0x40, "monadic ALIGN broken")
+}