Commit 158c7c6b authored by Michael Beck's avatar Michael Beck
Browse files

another strange endless loop failure

[r21814]
parent 2825824a
#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;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment