gcc-test-bogus-warning 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /bin/sh
  2. # Test a "bogus-warning" GCC bug, using environment variables set in
  3. # several reghunt scripts and configuration files.
  4. #
  5. # Copyright (C) 2007 Free Software Foundation.
  6. #
  7. # This file 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. #
  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. #
  17. # For a copy of the GNU General Public License, write the the
  18. # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. # Boston, MA 02111-1301, USA.
  20. ID=$1
  21. LOGID=`printf "%04d" ${ID}`
  22. LOG=${BUGID}.${LOGID}.out
  23. MSGID="bug ${BUGID}, id ${ID}"
  24. $REG_TEST_COMPILER $REG_OPTS $REG_TESTCASE > ${LOG} 2>&1
  25. if [ $? -ne 0 ]; then
  26. echo "`date` unexpected failure: compilation failed for ${MSGID}"
  27. exit $REG_ERROR
  28. fi
  29. grep -q 'warning' ${LOG}
  30. if [ $? -eq 0 ]; then
  31. echo "`date` bogus warning detected for ${MSGID}"
  32. exit $REG_FAIL
  33. fi
  34. echo "`date` no bogus warning for ${MSGID}"
  35. exit $REG_PASS