another strange endless loop failure
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 10 Sep 2008 11:05:37 +0000 (11:05 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 10 Sep 2008 11:05:37 +0000 (11:05 +0000)
[r21814]

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

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