diff options
Diffstat (limited to 'test/functionalities/longjmp/main.c')
-rw-r--r-- | test/functionalities/longjmp/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functionalities/longjmp/main.c b/test/functionalities/longjmp/main.c index 5d3f4364f..3879311eb 100644 --- a/test/functionalities/longjmp/main.c +++ b/test/functionalities/longjmp/main.c @@ -8,12 +8,16 @@ //===----------------------------------------------------------------------===// #include <setjmp.h> #include <stdio.h> +#include <time.h> jmp_buf j; void do_jump(void) { - longjmp(j, 1); // non-local goto + // We can't let the compiler know this will always happen or it might make + // optimizations that break our test. + if (!clock()) + longjmp(j, 1); // non-local goto } int main (void) |