arm_farcall_arm_thumb.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. # arm_farcall_arm_thumb.sh -- a test case for ARM->Thumb farcall veneers.
  3. # Copyright (C) 2010-2022 Free Software Foundation, Inc.
  4. # Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
  5. # Based upon arm_cortex_a8.sh
  6. # Written by Doug Kwan <dougkwan@google.com>.
  7. # This file is part of gold.
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 3 of the License, or
  11. # (at your option) any later version.
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  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. check()
  21. {
  22. if ! grep -q "$2" "$1"
  23. then
  24. echo "Did not find expected instruction in $1:"
  25. echo " $2"
  26. echo ""
  27. echo "Actual instructions below:"
  28. cat "$1"
  29. exit 1
  30. fi
  31. }
  32. # Check for ARM->Thumb default
  33. check arm_farcall_arm_thumb.stdout "1004: .* ldr ip, \[pc\]"
  34. check arm_farcall_arm_thumb.stdout "1008: .* bx ip"
  35. check arm_farcall_arm_thumb.stdout "100c: 02001015"
  36. # Check for ARM->Thumb with v5t interworking
  37. chck arm_farcall_arm_thumb_5t.stdout "1004: f004 e51f"
  38. chck arm_farcall_arm_thumb_5t.stdout "1008: 1015"
  39. chck arm_farcall_arm_thumb_5t.stdout "100a: 0200"
  40. exit 0