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