rd-sh.exp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Expect script for run_dump_test based ld-sh tests.
  2. # Copyright (C) 2001-2022 Free Software Foundation, Inc.
  3. #
  4. # This file is part of the GNU Binutils.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  19. # MA 02110-1301, USA.
  20. #
  21. # Written by Hans-Peter Nilsson (hp@bitrange.com)
  22. #
  23. # This file is kept separate from sh.exp, because having it separate
  24. # simplifies selective testing, like in "make check-ld
  25. # RUNTESTFLAGS=rd-sh.exp=shared-1". It is assumed that sh.exp is a place
  26. # for constructs where the name of the test is harder to extract and
  27. # select than here.
  28. if ![istarget sh*-*-*] {
  29. return
  30. }
  31. set asflags_save "$ASFLAGS"
  32. set ldflags_save "$LDFLAGS"
  33. set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
  34. foreach shtest $rd_test_list {
  35. # We need to strip the ".d", but can leave the dirname.
  36. verbose [file rootname $shtest]
  37. # vxworks-static.d relies on files created by sh-vxworks.exp.
  38. # We run it there instead of here.
  39. if { [file tail $shtest] != "vxworks1-static.d" } {
  40. run_dump_test [file rootname $shtest]
  41. }
  42. if [string match $srcdir/$subdir/*-dso.d $shtest] {
  43. # Copy the output of the DSO-createing test to .so file.
  44. # Notice that a DSO-creating test must precede the tests
  45. # which need that DSO in sort-order by name.
  46. set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $shtest]].so"
  47. send_log "$cmd\n"
  48. set cmdret [catch "exec $cmd" comp_output]
  49. send_log "$comp_output\n"
  50. # FIXME: What if it fails? Need we do something?
  51. }
  52. }
  53. set ASFLAGS "$asflags_save"
  54. set LDFLAGS "$ldflags_save"