dyn_weak_ref.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # dyn_weak_ref.sh -- test weak reference remains weak in output even if
  3. # gold sees a dynamic weak reference before a static one.
  4. # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  5. # Written by Doug Kwan <dougkwan@google.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. # This checks that the reference to 'weak_ref' have WEAK binding.
  20. check()
  21. {
  22. file=$1
  23. pattern=$2
  24. found=`grep "$pattern" $file`
  25. if test -z "$found"; then
  26. echo "pattern \"$pattern\" not found in file $file."
  27. echo $found
  28. exit 1
  29. fi
  30. }
  31. check dyn_weak_ref.stdout ".* WEAK .* UND.* weak_ref"
  32. exit 0