Home | History | Annotate | Line # | Download | only in bin
      1  1.1  mrg #! /bin/sh
      2  1.1  mrg 
      3  1.1  mrg # Test a "bogus-warning" GCC bug, using environment variables set in
      4  1.1  mrg # several reghunt scripts and configuration files.
      5  1.1  mrg #
      6  1.1  mrg # Copyright (C) 2007 Free Software Foundation.
      7  1.1  mrg #
      8  1.1  mrg # This file is free software; you can redistribute it and/or modify
      9  1.1  mrg # it under the terms of the GNU General Public License as published by
     10  1.1  mrg # the Free Software Foundation; either version 3 of the License, or
     11  1.1  mrg # (at your option) any later version.
     12  1.1  mrg #
     13  1.1  mrg # This program is distributed in the hope that it will be useful,
     14  1.1  mrg # but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  1.1  mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  1.1  mrg # GNU General Public License for more details.
     17  1.1  mrg #
     18  1.1  mrg # For a copy of the GNU General Public License, write the the
     19  1.1  mrg # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     20  1.1  mrg # Boston, MA 02111-1301, USA.
     21  1.1  mrg 
     22  1.1  mrg ID=$1
     23  1.1  mrg 
     24  1.1  mrg LOGID=`printf "%04d" ${ID}`
     25  1.1  mrg LOG=${BUGID}.${LOGID}.out
     26  1.1  mrg MSGID="bug ${BUGID}, id ${ID}" 
     27  1.1  mrg 
     28  1.1  mrg $REG_TEST_COMPILER $REG_OPTS $REG_TESTCASE > ${LOG} 2>&1
     29  1.1  mrg 
     30  1.1  mrg if [ $? -ne 0 ]; then
     31  1.1  mrg     echo "`date`    unexpected failure: compilation failed for ${MSGID}"
     32  1.1  mrg     exit $REG_ERROR
     33  1.1  mrg fi
     34  1.1  mrg 
     35  1.1  mrg grep -q 'warning' ${LOG}
     36  1.1  mrg if [ $? -eq 0 ]; then
     37  1.1  mrg     echo "`date`  bogus warning detected for ${MSGID}"
     38  1.1  mrg     exit $REG_FAIL
     39  1.1  mrg fi
     40  1.1  mrg 
     41  1.1  mrg echo "`date`  no bogus warning for ${MSGID}"
     42  1.1  mrg exit $REG_PASS
     43