File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
regression/cbmc-library/fileno-01 Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
int main ()
5
5
{
6
- fileno ();
7
- assert (0 );
6
+ // requires initialization of stdin/stdout/stderr
7
+ // assert(fileno(stdin) == 0);
8
+ // assert(fileno(stdout) == 1);
9
+ // assert(fileno(stderr) == 2);
10
+
11
+ FILE * some_file ;
12
+ assert (fileno (some_file ) >= -1 );
13
+
8
14
return 0 ;
9
15
}
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 @@ -391,7 +391,6 @@ int __VERIFIER_nondet_int();
391
391
392
392
inline int fileno (FILE * stream )
393
393
{
394
- // just return nondet
395
394
__CPROVER_HIDE :;
396
395
if (stream == stdin )
397
396
return 0 ;
@@ -401,6 +400,7 @@ __CPROVER_HIDE:;
401
400
return 2 ;
402
401
403
402
int return_value = __VERIFIER_nondet_int ();
403
+ __CPROVER_assume (return_value >= -1 );
404
404
405
405
#if !defined(__linux__ ) || defined(__GLIBC__ )
406
406
(void )* stream ;
You can’t perform that action at this time.
0 commit comments