File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
regression/cbmc-library/sleep-01 Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
#include <assert.h>
2
- #include <unistd.h>
2
+ #ifndef _WIN32
3
+ # include <unistd.h>
4
+ #else
5
+ unsigned sleep (unsigned );
6
+ #endif
3
7
4
8
int main ()
5
9
{
6
- sleep ();
7
- assert (0 );
10
+ assert (sleep (42 ) <= 42 );
8
11
return 0 ;
9
12
}
Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
3
--pointer-check --bounds-check
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ unsigned int sleep(unsigned int seconds)
7
7
__CPROVER_HIDE :;
8
8
// do nothing, but return nondet value
9
9
unsigned remaining_time = __VERIFIER_nondet_unsigned ();
10
-
11
- if (remaining_time > seconds ) remaining_time = seconds ;
10
+ __CPROVER_assume (remaining_time <= seconds );
12
11
13
12
return remaining_time ;
14
13
}
You can’t perform that action at this time.
0 commit comments