clearcap.exp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright (C) 2014-2015 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with GCC; see the file COPYING3. If not see
  14. # <http://www.gnu.org/licenses/>.
  15. # Clear hardware capabilities on Solaris.
  16. if [istarget *-*-solaris2*] {
  17. set clearcap_ldflags "-mclear-hwcap"
  18. }
  19. #
  20. # clearcap-init -- called at the start of each subdir of tests
  21. #
  22. proc clearcap-init { args } {
  23. global TEST_ALWAYS_FLAGS
  24. global ALWAYS_CXXFLAGS
  25. global clearcap_saved_TEST_ALWAYS_FLAGS
  26. global clearcap_ldflags
  27. if [info exists TEST_ALWAYS_FLAGS] {
  28. set clearcap_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS
  29. }
  30. if [info exists clearcap_ldflags] {
  31. if [info exists ALWAYS_CXXFLAGS] {
  32. set ALWAYS_CXXFLAGS [concat "{ldflags=$clearcap_ldflags}" $ALWAYS_CXXFLAGS]
  33. } else {
  34. append TEST_ALWAYS_FLAGS " $clearcap_ldflags"
  35. }
  36. }
  37. return 0
  38. }
  39. #
  40. # clearcap-finish -- called at the start of each subdir of tests
  41. #
  42. proc clearcap-finish { args } {
  43. global TEST_ALWAYS_FLAGS
  44. global clearcap_saved_TEST_ALWAYS_FLAGS
  45. if [info exists clearcap_saved_TEST_ALWAYS_FLAGS] {
  46. set TEST_ALWAYS_FLAGS $clearcap_saved_TEST_ALWAYS_FLAGS
  47. } else {
  48. unset TEST_ALWAYS_FLAGS
  49. }
  50. }