Despite reading the Internals documentation, I cannot determine the
correct way a test should be written for inclusion in testsuite.
Documentation states to use exit(0) or abort() as appropriate for
pass/fail - got that ok!
But when I look at existing test cases in gcc, I find many using
"return 0" from main( ). This includes, so called portable tests in
gcc.c-torture/execute (eg 20050224-1.c)
These tests are not portable, if target has main is "noreturn" function
- common for embedded targets. Of course it may compile - but on
simulator it will most likely crash.
Unlike exit() and abort() there is no obvious means to trap on this for
dejagnu harness. So test will time out - even though the test itself
has passed and is otherwise perfectly valid for the target.
If return 0, is indeed valid, does this mean that all targets must have
main( ) as returnable, by some means for testing?
Could someone clarify this?