pr26936.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # pr26936.sh -- Tests for relocations in debug sections against linkonce
  3. # and comdat sections.
  4. # Copyright (C) 2020-2022 Free Software Foundation, Inc.
  5. # This file is part of gold.
  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. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  17. # MA 02110-1301, USA.
  18. set -e
  19. check()
  20. {
  21. number_of_occurrence=`egrep "$2" ./$1 -o| wc -l`
  22. if [ $number_of_occurrence != $3 ]
  23. then
  24. echo "$1: \"$2\" $3: Failed"
  25. status=1
  26. fi
  27. }
  28. status=0
  29. check pr26936a.stdout "^pr26936a.s +6 +0x10108 +x" 1
  30. check pr26936a.stdout "^pr26936b.s +5 +0x10109 +x" 1
  31. check pr26936a.stdout "^pr26936b.s +11 +0x10108 +x" 1
  32. check pr26936a.stdout "^pr26936c.s +6 +0x10108 +x" 1
  33. check pr26936a.stdout "^ +0+10108 0+1" 3
  34. check pr26936a.stdout "^ +0+10109 0+1" 1
  35. check pr26936a.stdout "^ +0+ 0+10109 0+1010a" 1
  36. check pr26936a.stdout "^ +0+ 0+10108 0+10109" 1
  37. check pr26936b.stdout "^pr26936d.s +6 +0x10108 +x" 1
  38. check pr26936b.stdout "^pr26936b.s +5 +0x10109 +x" 1
  39. check pr26936b.stdout "^pr26936b.s +11 +0x10108 +x" 1
  40. check pr26936b.stdout "^pr26936c.s +6 +0x10108 +x" 1
  41. check pr26936b.stdout "^ +0+10108 0+1" 3
  42. check pr26936b.stdout "^ +0+10109 0+1" 1
  43. check pr26936b.stdout "^ +0+ 0+10109 0+1010a" 1
  44. check pr26936b.stdout "^ +0+ 0+10108 0+10109" 1
  45. exit $status