* tests/test-_Exit.c (MTA, Charlie): New functions, taken from the
old tests/test-stdnoreturn.c. This tests the _Noreturn keyword a bit.
(main): Use them.
2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
+ modules/_Exit-tests: test _Noreturn too
+ * tests/test-_Exit.c (MTA, Charlie): New functions, taken from the
+ old tests/test-stdnoreturn.c. This tests the _Noreturn keyword a bit.
+ (main): Use them.
+
stdnoreturn, stdnoreturn-tests: remove modules
They're not needed here and a bit premature for use elsewhere. See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-07/msg00209.html>.
#include <stdlib.h>
+/* But did he ever return? No he never returned,
+ And his fate is still unlearned ... */
+static _Noreturn void MTA (int);
+
+static _Noreturn void
+Charlie (int n)
+{
+ MTA (n - 1);
+}
+
+static void
+MTA (int n)
+{
+ if (n < 0)
+ _Exit (81);
+ Charlie (n - 1);
+}
+
int
-main ()
+main (int argc, char **argv)
{
- _Exit (81);
+ MTA (argc + !!argv);
}