wrong endless loop handling
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 10 Sep 2008 10:58:08 +0000 (10:58 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 10 Sep 2008 10:58:08 +0000 (10:58 +0000)
[r21813]

ir/be/test/fehler151.c [new file with mode: 0644]

diff --git a/ir/be/test/fehler151.c b/ir/be/test/fehler151.c
new file mode 100644 (file)
index 0000000..5da058f
--- /dev/null
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+int test(void) {
+       abort();
+
+       for(;;);
+}
+
+void handler(int sig)
+{
+       printf(sig == SIGABRT ? "ok\n" : "fail");
+       fflush(stdout);
+       exit(sig != SIGABRT);
+}
+
+int main(int argc, char *argv[]) {
+       alarm(1);
+       signal(SIGABRT, handler);
+       signal(SIGALRM, handler);
+       test();
+       return 1;
+}