arm_farcall_thumb_thumb.sh 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/sh
  2. # arm_farcall_thumb_thumb.sh -- a test case for Thumb->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. # Thumb->Thumb default
  33. check arm_farcall_thumb_thumb.stdout "1004: .* bx pc"
  34. check arm_farcall_thumb_thumb.stdout "1006: .* nop"
  35. check arm_farcall_thumb_thumb.stdout "1008: c000"
  36. check arm_farcall_thumb_thumb.stdout "100a: e59f"
  37. check arm_farcall_thumb_thumb.stdout "100c: ff1c e12f"
  38. check arm_farcall_thumb_thumb.stdout "1010: 1015"
  39. check arm_farcall_thumb_thumb.stdout "1012: 0200"
  40. # Thumb->Thumb with v5T interworking
  41. check arm_farcall_thumb_thumb_5t.stdout "1004: f004 e51f"
  42. check arm_farcall_thumb_thumb_5t.stdout "1008: 1015"
  43. check arm_farcall_thumb_thumb_5t.stdout "100a: 0200"
  44. # Thumb->Thumb on v6-M
  45. check arm_farcall_thumb_thumb_6m.stdout "1004: .* push {r0}"
  46. check arm_farcall_thumb_thumb_6m.stdout "1006: .* ldr r0, \\[pc, #8\\]"
  47. check arm_farcall_thumb_thumb_6m.stdout "1008: .* mov ip, r0"
  48. check arm_farcall_thumb_thumb_6m.stdout "100a: .* pop {r0}"
  49. check arm_farcall_thumb_thumb_6m.stdout "100c: .* bx ip"
  50. check arm_farcall_thumb_thumb_6m.stdout "100e: .* nop"
  51. check arm_farcall_thumb_thumb_6m.stdout "1010: 1015"
  52. check arm_farcall_thumb_thumb_6m.stdout "1012: 0200"
  53. # Thumb->Thumb on v7-M
  54. check arm_farcall_thumb_thumb_6m.stdout "1004: .* push {r0}"
  55. check arm_farcall_thumb_thumb_6m.stdout "1006: .* ldr r0, \\[pc, #8\\]"
  56. check arm_farcall_thumb_thumb_6m.stdout "1008: .* mov ip, r0"
  57. check arm_farcall_thumb_thumb_6m.stdout "100a: .* pop {r0}"
  58. check arm_farcall_thumb_thumb_6m.stdout "100c: .* bx ip"
  59. check arm_farcall_thumb_thumb_6m.stdout "100e: .* nop"
  60. check arm_farcall_thumb_thumb_6m.stdout "1010: 1015"
  61. check arm_farcall_thumb_thumb_6m.stdout "1012: 0200"
  62. exit 0