gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / tests / test-stdnoreturn.c
index fed5e54..7bc0207 100644 (file)
@@ -1,5 +1,5 @@
-/* Test of <stdnoreturn.h> and _Noreturn.
-   Copyright 2011 Free Software Foundation, Inc.
+/* Test of <stdnoreturn.h>.
+   Copyright 2012-2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* written by Paul Eggert */
+/* Written by Paul Eggert.  */
 
 #include <config.h>
 
 #include <stdnoreturn.h>
 
-/* But did he ever return?  No he never returned,
-   And his fate is still unlearned ... */
-static noreturn void MTA (void);
+#include <stdlib.h>
 
-static _Noreturn void
-Charlie (void)
+noreturn void
+does_not_return (void)
 {
-  MTA ();
-}
-
-static void
-MTA (void)
-{
-  Charlie ();
+  exit (0);
 }
 
 int
-main (int argc, char **argv)
+main (void)
 {
-  if (argc <= 0)
-    MTA ();
-  if (!argv[0][0])
-    Charlie ();
-  return 0;
+  does_not_return ();
 }