From 75e68ef97a85b6b649b5f7fc574238e6e13d402b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 13 Jan 2011 17:07:52 +0000 Subject: [PATCH] Add a testcase for PR ld/12356. 2011-01-13 H.J. Lu PR ld/12356 * ld-scripts/defined.exp: Run defined5. * ld-scripts/defined5.d: New. * ld-scripts/defined5.s: Likewise. * ld-scripts/defined5.t: Likewise. --- ld/testsuite/ChangeLog | 9 +++++++++ ld/testsuite/ld-scripts/defined.exp | 1 + ld/testsuite/ld-scripts/defined5.d | 9 +++++++++ ld/testsuite/ld-scripts/defined5.s | 6 ++++++ ld/testsuite/ld-scripts/defined5.t | 7 +++++++ 5 files changed, 32 insertions(+) create mode 100644 ld/testsuite/ld-scripts/defined5.d create mode 100644 ld/testsuite/ld-scripts/defined5.s create mode 100644 ld/testsuite/ld-scripts/defined5.t diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 61a6117b329..94c35e38661 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2011-01-13 H.J. Lu + + PR ld/12356 + * ld-scripts/defined.exp: Run defined5. + + * ld-scripts/defined5.d: New. + * ld-scripts/defined5.s: Likewise. + * ld-scripts/defined5.t: Likewise. + 2011-01-13 H.J. Lu * ld-scripts/defined4.d: Xfail rs6000-*-aix*. Skip mips*-*-* diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp index 6d0c9d50edb..10f14daf83d 100644 --- a/ld/testsuite/ld-scripts/defined.exp +++ b/ld/testsuite/ld-scripts/defined.exp @@ -67,4 +67,5 @@ set prms_id 0 run_dump_test "defined2" run_dump_test "defined3" run_dump_test "defined4" +run_dump_test "defined5" set LDFLAGS "$saved_LDFLAGS" diff --git a/ld/testsuite/ld-scripts/defined5.d b/ld/testsuite/ld-scripts/defined5.d new file mode 100644 index 00000000000..3977c93ac25 --- /dev/null +++ b/ld/testsuite/ld-scripts/defined5.d @@ -0,0 +1,9 @@ +#ld: -Tdefined5.t +#nm: -B +#source: defined5.s +#xfail: rs6000-*-aix* + +# Check that arithmetic on DEFINED works. +#... +0+1000 D defined +#pass diff --git a/ld/testsuite/ld-scripts/defined5.s b/ld/testsuite/ld-scripts/defined5.s new file mode 100644 index 00000000000..592e54cea1b --- /dev/null +++ b/ld/testsuite/ld-scripts/defined5.s @@ -0,0 +1,6 @@ + .globl defined + .data + .byte 0 + .section .data.cacheline_aligned +defined: + .byte 0 diff --git a/ld/testsuite/ld-scripts/defined5.t b/ld/testsuite/ld-scripts/defined5.t new file mode 100644 index 00000000000..189da6b6bf5 --- /dev/null +++ b/ld/testsuite/ld-scripts/defined5.t @@ -0,0 +1,7 @@ +defined = addr1; +SECTIONS { + .data.cacheline_aligned : { *(.data.cacheline_aligned) } + . = ALIGN (0x1000); + .data : { *(.data) } + addr1 = ADDR (.data); +} -- 2.30.2