xref: /netbsd-src/external/gpl3/gcc.old/dist/contrib/reghunt/bin/gcc-test-wrong-code (revision 36ac495d2b3ea2b9d96377b2143ebfedac224b92)
1*36ac495dSmrg#! /bin/sh
2*36ac495dSmrg
3*36ac495dSmrg# Test a "wrong-code" GCC bug, using environment variables set in
4*36ac495dSmrg# several reghunt scripts and configuration files.
5*36ac495dSmrg#
6*36ac495dSmrg# Copyright (C) 2007 Free Software Foundation.
7*36ac495dSmrg#
8*36ac495dSmrg# This file is free software; you can redistribute it and/or modify
9*36ac495dSmrg# it under the terms of the GNU General Public License as published by
10*36ac495dSmrg# the Free Software Foundation; either version 3 of the License, or
11*36ac495dSmrg# (at your option) any later version.
12*36ac495dSmrg#
13*36ac495dSmrg# This program is distributed in the hope that it will be useful,
14*36ac495dSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
15*36ac495dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*36ac495dSmrg# GNU General Public License for more details.
17*36ac495dSmrg#
18*36ac495dSmrg# For a copy of the GNU General Public License, write the the
19*36ac495dSmrg# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20*36ac495dSmrg# Boston, MA 02111-1301, USA.
21*36ac495dSmrg
22*36ac495dSmrgID=$1
23*36ac495dSmrg
24*36ac495dSmrgLOGID=`printf "%04d" ${ID}`
25*36ac495dSmrgLOG=${BUGID}.${LOGID}.out
26*36ac495dSmrgMSGID="bug ${BUGID}, id ${ID}"
27*36ac495dSmrg
28*36ac495dSmrg$REG_TEST_COMPILER $REG_OPTS $REG_TESTCASE > ${LOG} 2>&1
29*36ac495dSmrg
30*36ac495dSmrgif [ $? -ne 0 ]; then
31*36ac495dSmrg    echo "`date`  unexpected failure: test compilation failed for ${MSGID}"
32*36ac495dSmrg    exit $REG_ERROR
33*36ac495dSmrgfi
34*36ac495dSmrg
35*36ac495dSmrg./a.out >> ${LOG} 2>&1
36*36ac495dSmrgif [ $? -ne 0 ]; then
37*36ac495dSmrg    echo "`date`  test run aborted for ${MSGID}"
38*36ac495dSmrg    exit $REG_FAIL
39*36ac495dSmrgfi
40*36ac495dSmrg
41*36ac495dSmrgecho "`date`  test ran successfully for ${MSGID}"
42*36ac495dSmrgexit $REG_PASS
43