This is the mail archive of the 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


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

A simple testcase from richi shows the problem i'm facing:
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?

Also see
for the proposed gfortran.dg testcase that comes along a simple fix
that is blocked by this alleged missing feature in dejagnu.


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