more tricky endless loop stuff
authorMatthias Braun <matze@braunis.de>
Wed, 10 Sep 2008 15:00:22 +0000 (15:00 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 10 Sep 2008 15:00:22 +0000 (15:00 +0000)
[r21822]

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

diff --git a/ir/be/test/fehler154.c b/ir/be/test/fehler154.c
new file mode 100644 (file)
index 0000000..a5f48e5
--- /dev/null
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int foo(int x)
+{
+       while(x == 0)
+               ;
+
+       return x;
+}
+
+int k;
+
+void handler(int sig)
+{
+       printf("ok\n");
+       _exit(0);
+}
+
+int main(void) {
+       alarm(1);
+       signal(SIGALRM, handler);
+
+       foo(0);
+
+       printf("endless loop returned!\n");
+       return 1;
+}