Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
4eab1f50
Commit
4eab1f50
authored
5 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Libc] fix libc spec: utimes; add test
parent
52059c39
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
share/libc/sys/time.h
+3
-2
3 additions, 2 deletions
share/libc/sys/time.h
tests/libc/oracle/sys_time_h.res.oracle
+83
-0
83 additions, 0 deletions
tests/libc/oracle/sys_time_h.res.oracle
tests/libc/sys_time_h.c
+9
-0
9 additions, 0 deletions
tests/libc/sys_time_h.c
with
95 additions
and
2 deletions
share/libc/sys/time.h
+
3
−
2
View file @
4eab1f50
...
@@ -47,8 +47,9 @@ struct timezone {
...
@@ -47,8 +47,9 @@ struct timezone {
/*@
/*@
requires valid_path: valid_read_string(path);
requires valid_path: valid_read_string(path);
requires valid_times: \valid_read(times+(0..1));
requires valid_times_or_null: \valid_read(times+(0..1)) || times == \null;
assigns \result \from indirect:path[0..strlen(path)], indirect:times[0..1];
assigns \result \from indirect:path[0..strlen(path)],
indirect:times, indirect:times[0..1];
*/
*/
extern
int
utimes
(
const
char
*
path
,
const
struct
timeval
times
[
2
]);
extern
int
utimes
(
const
char
*
path
,
const
struct
timeval
times
[
2
]);
...
...
This diff is collapsed.
Click to expand it.
tests/libc/oracle/sys_time.res.oracle
→
tests/libc/oracle/sys_time
_h
.res.oracle
+
83
−
0
View file @
4eab1f50
[kernel] Parsing tests/libc/sys_time.c (with preprocessing)
[kernel] Parsing tests/libc/sys_time
_h
.c (with preprocessing)
[eva] Analyzing a complete application starting at main
[eva] Analyzing a complete application starting at main
[eva] Computing initial state
[eva] Computing initial state
[eva] Initial state computed
[eva] Initial state computed
[eva:initial-state] Values of globals at initialization
[eva:initial-state] Values of globals at initialization
[eva] computing for function setitimer <- main.
[eva] computing for function setitimer <- main.
Called from tests/libc/sys_time.c:6.
Called from tests/libc/sys_time
_h
.c:6.
[eva] using specification for function setitimer
[eva] using specification for function setitimer
[eva] tests/libc/sys_time.c:6:
[eva] tests/libc/sys_time
_h
.c:6:
function setitimer: precondition 'valid_new_value' got status valid.
function setitimer: precondition 'valid_new_value' got status valid.
[eva] tests/libc/sys_time.c:6:
[eva] tests/libc/sys_time
_h
.c:6:
function setitimer: precondition 'old_value_null_or_valid' got status valid.
function setitimer: precondition 'old_value_null_or_valid' got status valid.
[eva:invalid-assigns] tests/libc/sys_time.c:6:
[eva:invalid-assigns] tests/libc/sys_time
_h
.c:6:
Completely invalid destination for assigns clause *old_value. Ignoring.
Completely invalid destination for assigns clause *old_value. Ignoring.
[eva] Done for function setitimer
[eva] Done for function setitimer
[eva] tests/libc/sys_time.c:7: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:7: assertion got status valid.
[eva] computing for function setitimer <- main.
[eva] computing for function setitimer <- main.
Called from tests/libc/sys_time.c:9.
Called from tests/libc/sys_time
_h
.c:9.
[eva] tests/libc/sys_time.c:9:
[eva] tests/libc/sys_time
_h
.c:9:
function setitimer: precondition 'valid_new_value' got status valid.
function setitimer: precondition 'valid_new_value' got status valid.
[eva] tests/libc/sys_time.c:9:
[eva] tests/libc/sys_time
_h
.c:9:
function setitimer: precondition 'old_value_null_or_valid' got status valid.
function setitimer: precondition 'old_value_null_or_valid' got status valid.
[eva] Done for function setitimer
[eva] Done for function setitimer
[eva] tests/libc/sys_time.c:10: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:10: assertion got status valid.
[eva] tests/libc/sys_time.c:11: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:11: assertion got status valid.
[eva] computing for function getitimer <- main.
[eva] computing for function getitimer <- main.
Called from tests/libc/sys_time.c:12.
Called from tests/libc/sys_time
_h
.c:12.
[eva] using specification for function getitimer
[eva] using specification for function getitimer
[eva] tests/libc/sys_time.c:12:
[eva] tests/libc/sys_time
_h
.c:12:
function getitimer: precondition 'valid_curr_value' got status valid.
function getitimer: precondition 'valid_curr_value' got status valid.
[eva] Done for function getitimer
[eva] Done for function getitimer
[eva] tests/libc/sys_time.c:13: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:13: assertion got status valid.
[eva] tests/libc/sys_time.c:14: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:14: assertion got status valid.
[eva] computing for function getitimer <- main.
[eva] computing for function getitimer <- main.
Called from tests/libc/sys_time.c:16.
Called from tests/libc/sys_time
_h
.c:16.
[eva] tests/libc/sys_time.c:16:
[eva] tests/libc/sys_time
_h
.c:16:
function getitimer: precondition 'valid_curr_value' got status valid.
function getitimer: precondition 'valid_curr_value' got status valid.
[eva] Done for function getitimer
[eva] Done for function getitimer
[eva] tests/libc/sys_time.c:17: assertion got status valid.
[eva] tests/libc/sys_time
_h
.c:17: assertion got status valid.
[eva] computing for function setitimer <- main.
[eva] computing for function setitimer <- main.
Called from tests/libc/sys_time.c:19.
Called from tests/libc/sys_time
_h
.c:19.
[eva] tests/libc/sys_time.c:19:
[eva] tests/libc/sys_time
_h
.c:19:
function setitimer: precondition 'valid_new_value' got status valid.
function setitimer: precondition 'valid_new_value' got status valid.
[eva] tests/libc/sys_time.c:19:
[eva] tests/libc/sys_time
_h
.c:19:
function setitimer: precondition 'old_value_null_or_valid' got status valid.
function setitimer: precondition 'old_value_null_or_valid' got status valid.
[eva] Done for function setitimer
[eva] Done for function setitimer
[eva] tests/libc/sys_time.c:20: assertion got status valid.
[eva] tests/libc/sys_time_h.c:20: assertion got status valid.
[eva] computing for function utimes <- main.
Called from tests/libc/sys_time_h.c:22.
[eva] using specification for function utimes
[eva] tests/libc/sys_time_h.c:22:
function utimes: precondition 'valid_path' got status valid.
[eva] tests/libc/sys_time_h.c:22:
function utimes: precondition 'valid_times_or_null' got status valid.
[eva] Done for function utimes
[eva] computing for function utimes <- main.
Called from tests/libc/sys_time_h.c:28.
[eva] tests/libc/sys_time_h.c:28:
function utimes: precondition 'valid_path' got status valid.
[eva] tests/libc/sys_time_h.c:28:
function utimes: precondition 'valid_times_or_null' got status valid.
[eva] Done for function utimes
[eva] Recording results for main
[eva] Recording results for main
[eva] done for function main
[eva] done for function main
[eva] ====== VALUES COMPUTED ======
[eva] ====== VALUES COMPUTED ======
...
@@ -59,4 +74,10 @@
...
@@ -59,4 +74,10 @@
.it_interval.tv_usec ∈ {1000000}
.it_interval.tv_usec ∈ {1000000}
.it_value ∈ [--..--]
.it_value ∈ [--..--]
INVALID_ITIMER ∈ {-1}
INVALID_ITIMER ∈ {-1}
r1 ∈ [--..--]
tv[0].tv_sec ∈ {10000000}
[0].tv_usec ∈ {999999}
[1].tv_sec ∈ {-9000000}
[1].tv_usec ∈ {1}
r2 ∈ [--..--]
__retres ∈ {0}
__retres ∈ {0}
This diff is collapsed.
Click to expand it.
tests/libc/sys_time.c
→
tests/libc/sys_time
_h
.c
+
9
−
0
View file @
4eab1f50
...
@@ -18,5 +18,14 @@ int main() {
...
@@ -18,5 +18,14 @@ int main() {
i2
.
it_interval
.
tv_usec
=
1000000
;
// invalid tv_usec
i2
.
it_interval
.
tv_usec
=
1000000
;
// invalid tv_usec
res
=
setitimer
(
ITIMER_VIRTUAL
,
&
i2
,
&
i1
);
res
=
setitimer
(
ITIMER_VIRTUAL
,
&
i2
,
&
i1
);
//@ assert res == -1;
//@ assert res == -1;
int
r1
=
utimes
(
"/tmp/utimes"
,
0
);
struct
timeval
tv
[
2
]
=
{
{
.
tv_sec
=
10000000
,
.
tv_usec
=
999999
},
{
.
tv_sec
=
-
9000000
,
.
tv_usec
=
1
},
};
int
r2
=
utimes
(
"/tmp/utimes"
,
tv
);
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment