This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc/testsuite incorrect checking of compiler's retval in dg-compile


Hi,

I need to check for a non-0 return value in dg-compile testcases in
gcc.

A simple testcase from richi shows the problem i'm facing:
http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gcc.dg/pr29254.c?view=markup&pathrev=117577
In this testcase, he checks for
/* { dg-warning "warnings being treated as errors" "" {target "*-*-*"} 0 } */

which is not really accurate, since it doesn't check that the compiler
did exit with !0 but only if that warn_once string was emitted. In
gfortran, i currently do not emit such a introductory message at all,
and even if i would, checking for the message instead of checking the
actual return-code of the compilation would be incorrect.

A simple testcase that i want to expect to fail to compile would be e.g.:
$ cat c.c
/* { dg-do compile } */
/* { dg-options "-W -Werror" } */
/* { dg-return != 0 } */ // Perhaps also check for ld, as failure
int main(void) {0;} /* { dg-warning "no effect" } */


What do people think about a way to properly check that dg-compile did
indeed return non-0?


PS:
Also see http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00551.html
for the proposed gfortran.dg testcase that comes along a simple fix
that is blocked by this alleged missing feature in dejagnu.

TIA,
Bernhard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]