another strange endless loop failure
[libfirm] / ir / be / test / fehler152.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <signal.h>
4
5 int x = 2;
6 int test(void) {
7
8         x = 3;
9
10         for(;;);
11 }
12
13 void handler(int sig)
14 {
15         printf(x == 3 ? "ok\n" : "fail");
16         fflush(stdout);
17         exit(x == 3);
18 }
19
20 int main(int argc, char *argv[]) {
21         alarm(1);
22         signal(SIGALRM, handler);
23         test();
24         printf("FAIL ENDLESS LOOP\n");
25         return 1;
26 }