Commit 10840072 authored by Matthias Braun's avatar Matthias Braun
Browse files

fix testcases, yet another endless loop test

[r21823]
parent d0149fe8
......@@ -2,7 +2,8 @@
#include <stdlib.h>
#include <signal.h>
int x = 2;
volatile int x = 2;
int test(void) {
x = 3;
......
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
volatile int x = 2;
volatile int y;
int test(void) {
x = 3;
y = 4;
for(;;) {
x = y;
}
}
void handler(int sig)
{
printf(x == 4 ? "ok\n" : "fail");
fflush(stdout);
exit(x != 4);
}
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