Daily bump.
[official-gcc.git] / contrib / reghunt / bin / gcc-test-segfault-on-valid-code
blob0a1b1b722b58400315920f60ac5288d2464e52ae
1 #! /bin/sh
3 # Test an "ice-on-valid-code" GCC bug that results in a compiler
4 # segfault, using environment variables set in several reghunt scripts
5 # and configuration files.
7 # Copyright (C) 2007 Free Software Foundation.
9 # This file is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # For a copy of the GNU General Public License, write the the
20 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 # Boston, MA 02111-1301, USA.
23 ID=$1
25 LOGID=`printf "%04d" ${ID}`
26 LOG=${BUGID}.${LOGID}.out
27 MSGID="bug ${BUGID}, id ${ID}"
29 $REG_TEST_COMPILER $REG_OPTS $REG_TESTCASE > ${LOG} 2>&1
31 if [ $? -eq 0 ]; then
32 echo "`date` test compiled successfully for ${MSGID}"
33 exit $REG_PASS
36 grep -q 'No such file or directory' ${LOG}
37 if [ $? -eq 0 ]; then
38 echo "`date` unexpected failure: missing file for ${MSGID}"
39 exit $REG_ERROR
42 grep -q 'egmentation fault' ${LOG}
43 if [ $? -ne 0 ]; then
44 echo "`date` unexpected failure: no segfault message for ${MSGID}"
45 exit $REG_ERROR
48 echo "`date` compilation failed for ${MSGID}"
49 exit $REG_FAIL