objdump.exp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright (C) 2004-2017 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  15. if {![istarget "m68*-*-*"] || [istarget "m68h*-*-*"] || [istarget "m681*-*-*"]} then {
  16. return
  17. }
  18. if {[which $OBJDUMP] == 0} then {
  19. perror "$OBJDUMP does not exist"
  20. return
  21. }
  22. send_user "Version [binutil_version $OBJDUMP]"
  23. ###########################
  24. # Set up the test of movem.s
  25. ###########################
  26. if {![binutils_assemble $srcdir/$subdir/movem.s tmpdir/movem.o]} then {
  27. return
  28. }
  29. if [is_remote host] {
  30. set objfile [remote_download host tmpdir/movem.o]
  31. } else {
  32. set objfile tmpdir/movem.o
  33. }
  34. # Make sure that the movem is correctly decoded.
  35. set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
  36. set want "moveml %d0-%d3,%sp@-.*moveml %d0-%d3,%sp@\[\r\n\]"
  37. if [regexp $want $got] then {
  38. pass "movem test"
  39. } else {
  40. fail "movem test"
  41. }
  42. ###########################
  43. # Set up the test of fnop.s
  44. ###########################
  45. if {![binutils_assemble $srcdir/$subdir/fnop.s tmpdir/fnop.o]} then {
  46. return
  47. }
  48. if [is_remote host] {
  49. set objfile [remote_download host tmpdir/fnop.o]
  50. } else {
  51. set objfile tmpdir/fnop.o
  52. }
  53. # Make sure that fnop is decoded as fnop, not fbf.
  54. set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
  55. set want "fnop *\[\r\n\]"
  56. if [regexp $want $got] then {
  57. pass "fnop test"
  58. } else {
  59. fail "fnop test"
  60. }