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
86b05b4d
Commit
86b05b4d
authored
4 months ago
by
Valentin Perrelle
Committed by
David Bühler
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] improve Export test coverage
parent
c38e40a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/misc/eva_annot_float.c
+35
-3
35 additions, 3 deletions
tests/misc/eva_annot_float.c
tests/misc/oracle/eva_annot_float.res.oracle
+86
-5
86 additions, 5 deletions
tests/misc/oracle/eva_annot_float.res.oracle
with
121 additions
and
8 deletions
tests/misc/eva_annot_float.c
+
35
−
3
View file @
86b05b4d
/* run.config
/* run.config
PLUGIN: @EVA_PLUGINS@
PLUGIN: @EVA_PLUGINS@
OPT: -eva -eva-precision 2 -eva-annot main -print
OPT: -eva -eva-precision 2
-warn-special-float none
-eva-annot main
1,main2,main3
-print
*/
*/
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* --- Testing EVA
A
nnotations
--- */
/* --- Testing EVA
exported a
nnotations --- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
//@ ghost int world;
//@ ghost int world;
...
@@ -17,7 +17,7 @@ double a[20];
...
@@ -17,7 +17,7 @@ double a[20];
*/
*/
double
value
(
void
);
double
value
(
void
);
double
main
(
void
)
{
double
main
1
(
void
)
{
double
s
=
0
;
double
s
=
0
;
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
double
v
=
value
();
double
v
=
value
();
...
@@ -27,4 +27,36 @@ double main(void) {
...
@@ -27,4 +27,36 @@ double main(void) {
return
s
;
return
s
;
}
}
/*@
ensures (\is_finite(\result) ∧ 0.0 <= \result <= 100.0) ∨ \is_NaN(\result);
assigns \result,world \from world;
*/
double
value_or_nan
(
void
);
void
main2
(
void
)
{
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
double
v
=
value_or_nan
();
a
[
i
]
=
v
;
}
}
/*@
ensures \is_NaN(\result);
assigns \result,world \from world;
*/
double
nan
(
void
);
void
main3
(
void
)
{
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
double
v
=
nan
();
a
[
i
]
=
v
;
}
}
void
main
(
void
)
{
main1
();
main2
();
main3
();
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
This diff is collapsed.
Click to expand it.
tests/misc/oracle/eva_annot_float.res.oracle
+
86
−
5
View file @
86b05b4d
...
@@ -19,15 +19,30 @@
...
@@ -19,15 +19,30 @@
a[0..19] ∈ {0}
a[0..19] ∈ {0}
[eva:loop-unroll:auto] eva_annot_float.c:22: Automatic loop unrolling.
[eva:loop-unroll:auto] eva_annot_float.c:22: Automatic loop unrolling.
[eva] using specification for function value
[eva] using specification for function value
[eva:loop-unroll:auto] eva_annot_float.c:37: Automatic loop unrolling.
[eva] using specification for function value_or_nan
[eva:loop-unroll:auto] eva_annot_float.c:50: Automatic loop unrolling.
[eva] using specification for function nan
[eva] ====== VALUES COMPUTED ======
[eva] ====== VALUES COMPUTED ======
[eva:final-states] Values at end of function main:
[eva:final-states] Values at end of function main3:
world ∈ [--..--]
a[0..19] ∈ NaN
i ∈ {20}
[eva:final-states] Values at end of function main1:
world ∈ [--..--]
world ∈ [--..--]
a[0..19] ∈ [-0. .. 100.]
a[0..19] ∈ [-0. .. 100.]
s ∈ [0. .. 2000.]
s ∈ [0. .. 2000.]
[eva:final-states] Values at end of function main2:
world ∈ [--..--]
a[0..19] ∈ [-0. .. 100.] ∪ {NaN}
i ∈ {20}
[eva:final-states] Values at end of function main:
world ∈ [--..--]
a[0..19] ∈ NaN
[eva:summary] ====== ANALYSIS SUMMARY ======
[eva:summary] ====== ANALYSIS SUMMARY ======
----------------------------------------------------------------------------
----------------------------------------------------------------------------
1
function analyzed (out of
1
): 100% coverage.
4
function
s
analyzed (out of
4
): 100% coverage.
In th
is
function,
12
statements reached (out of
12
): 100% coverage.
In th
ese
function
s
,
34
statements reached (out of
34
): 100% coverage.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
No errors or warnings raised during the analysis.
No errors or warnings raised during the analysis.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
...
@@ -35,7 +50,9 @@
...
@@ -35,7 +50,9 @@
----------------------------------------------------------------------------
----------------------------------------------------------------------------
No logical properties have been reached by the analysis.
No logical properties have been reached by the analysis.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
[eva] Annotate main
[eva] Annotate main1
[eva] Annotate main2
[eva] Annotate main3
/* Generated by Frama-C */
/* Generated by Frama-C */
/*@ ghost int world; */
/*@ ghost int world; */
double a[20];
double a[20];
...
@@ -47,7 +64,7 @@ double a[20];
...
@@ -47,7 +64,7 @@ double a[20];
*/
*/
double value(void);
double value(void);
double main(void)
double main
1
(void)
{
{
double s = (double)0;
double s = (double)0;
{
{
...
@@ -83,4 +100,68 @@ double main(void)
...
@@ -83,4 +100,68 @@ double main(void)
return s;
return s;
}
}
/*@ ensures
(\is_finite(\result) ∧ 0.0 ≤ \result ≤ 100.0) ∨
\is_NaN(\result);
assigns \result, world;
assigns \result \from world;
assigns world \from world;
*/
double value_or_nan(void);
void main2(void)
{
int i = 0;
while (1) {
/*@ assert Eva_export: 0 ≤ i ≤ 20; */
if (! (i < 20)) break;
{
double v = value_or_nan();
/*@ assert Eva_export: 0 ≤ i ≤ 19; */
/*@ assert
Eva_export:
\is_NaN(v) ∨
(-0.0000000000000000e+00d ≤ v ≤ 1.0000000000000000e+02d);
*/
a[i] = v;
}
/*@ assert Eva_export: 0 ≤ i ≤ 19; */
i ++;
}
return;
}
/*@ ensures \is_NaN(\result);
assigns \result, world;
assigns \result \from world;
assigns world \from world;
*/
double nan(void);
void main3(void)
{
int i = 0;
while (1) {
/*@ assert Eva_export: 0 ≤ i ≤ 20; */
if (! (i < 20)) break;
{
double v = nan();
/*@ assert Eva_export: 0 ≤ i ≤ 19; */
/*@ assert Eva_export: \is_NaN(v); */
a[i] = v;
}
/*@ assert Eva_export: 0 ≤ i ≤ 19; */
i ++;
}
return;
}
void main(void)
{
main1();
main2();
main3();
return;
}
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