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