From: H.J. Lu Date: Mon, 5 Jun 2017 21:54:12 +0000 (-0700) Subject: Add a testcase for PR ld/21529 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d9409498813c;p=deliverable%2Fbinutils-gdb.git Add a testcase for PR ld/21529 PR ld/21529 * testsuite/ld-unique/pr21529.d: New file. * testsuite/ld-unique/pr21529.s: Likewise. * testsuite/ld-unique/unique.exp: Run *.d. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 8a22862609..0e52c27495 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2017-06-05 H.J. Lu + + PR ld/21529 + * testsuite/ld-unique/pr21529.d: New file. + * testsuite/ld-unique/pr21529.s: Likewise. + * testsuite/ld-unique/unique.exp: Run *.d. + 2017-06-05 Alan Modra * ldmain.c (main): Correct setting of link_indo.new_dtags. diff --git a/ld/testsuite/ld-unique/pr21529.d b/ld/testsuite/ld-unique/pr21529.d new file mode 100644 index 0000000000..9a75a6a8e3 --- /dev/null +++ b/ld/testsuite/ld-unique/pr21529.d @@ -0,0 +1,8 @@ +#ld: --oformat binary -e main +#objdump: -s -b binary + +.*: file format binary + +Contents of section \.data: + 0000 .* +#pass diff --git a/ld/testsuite/ld-unique/pr21529.s b/ld/testsuite/ld-unique/pr21529.s new file mode 100644 index 0000000000..4570635a05 --- /dev/null +++ b/ld/testsuite/ld-unique/pr21529.s @@ -0,0 +1,8 @@ + .type a, %gnu_unique_object +a: .long 0 + .size a, .-a + + .type main,"function" + .global main +main: + .dc.a a diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp index 61c070aa47..49d7925f6d 100644 --- a/ld/testsuite/ld-unique/unique.exp +++ b/ld/testsuite/ld-unique/unique.exp @@ -35,7 +35,12 @@ if { ![supports_gnu_unique] } { return } -run_dump_test "unique" +set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] +foreach t $test_list { + # We need to strip the ".d", but can leave the dirname. + verbose [file rootname $t] + run_dump_test [file rootname $t] +} # We need a working compiler. (Strictly speaking this is # not true, we could use target specific assembler files).