split_x32.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. # split_x32.sh -- test -fstack-split for x32
  3. # Copyright (C) 2014 Free Software Foundation, Inc.
  4. # Written by Ian Lance Taylor <iant@google.com>.
  5. # Modified by H.J. Lu <hongjiu.lu@intel.com>.
  6. # This file is part of gold.
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  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. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  18. # MA 02110-1301, USA.
  19. match()
  20. {
  21. if ! egrep "$1" "$2" >/dev/null 2>&1; then
  22. echo 1>&2 "could not find '$1' in $2"
  23. exit 1
  24. fi
  25. }
  26. nomatch()
  27. {
  28. if egrep "$1" "$2" >/dev/null 2>&1; then
  29. echo 1>&2 "found unexpected '$1' in $2"
  30. exit 1
  31. fi
  32. }
  33. match 'cmp.*+%fs:[^,]*,%esp' split_x32_1.stdout
  34. match 'callq.*__morestack>?$' split_x32_1.stdout
  35. match 'lea.*-0x200\(%rsp\),' split_x32_1.stdout
  36. match 'stc' split_x32_2.stdout
  37. match 'callq.*__morestack_non_split>?$' split_x32_2.stdout
  38. nomatch 'callq.*__morestack>?$' split_x32_2.stdout
  39. match 'lea.*-0x4200\(%rsp\),' split_x32_2.stdout
  40. match 'failed to match' split_x32_3.stdout
  41. match 'callq.*__morestack>?$' split_x32_4.stdout
  42. match 'cannot mix' split_x32_r.stdout