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
8c428117
Commit
8c428117
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Adds tests of the reduction by the negation of \initialized.
parent
05573c96
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/value/initialized.c
+36
-0
36 additions, 0 deletions
tests/value/initialized.c
tests/value/oracle/initialized.res.oracle
+49
-7
49 additions, 7 deletions
tests/value/oracle/initialized.res.oracle
with
85 additions
and
7 deletions
tests/value/initialized.c
+
36
−
0
View file @
8c428117
...
...
@@ -154,6 +154,41 @@ void g7() {
//@ assert !\initialized(&key[0..127]);
}
/* Tests the reduction by the negation of the \initialized predicate. */
void
reduce_by_negation
()
{
int
x
,
y
;
int
*
p
=
rand
?
&
x
:
&
y
;
if
(
rand
)
x
=
0
;
if
(
rand
)
y
=
0
;
if
(
rand
)
{
//@ assert !\initialized(&x);
//@ check invalid: \initialized(&x);
}
if
(
rand
)
{
//@ assert !\initialized(p);
//@ check unknown: \initialized(&x) && \initialized(&y);
}
if
(
rand
)
{
//@ assert !\initialized({&x, &y});
//@ check unknown: \initialized(&x) && \initialized(&y);
}
if
(
rand
)
{
y
=
0
;
//@ assert !\initialized(p);
//@ check unknown: \initialized(&x);
}
if
(
rand
)
{
y
=
0
;
//@ assert !\initialized({&x, &y});
//@ check invalid: \initialized(&x);
}
char
t
[
10
];
for
(
int
i
=
0
;
i
<
10
;
i
++
)
t
[
i
]
=
i
;
//@ assert !\initialized(&t[0..9]);
//@ check unknown: \initialized(&t[0..9]);
}
int
main
()
{
g1
();
g2
();
...
...
@@ -162,5 +197,6 @@ int main () {
g5
();
g6
();
g7
();
reduce_by_negation
();
return
0
;
}
This diff is collapsed.
Click to expand it.
tests/value/oracle/initialized.res.oracle
+
49
−
7
View file @
8c428117
...
...
@@ -13,7 +13,7 @@
v1 ∈ {0}
i6 ∈ [--..--]
[eva] computing for function g1 <- main.
Called from tests/value/initialized.c:1
58
.
Called from tests/value/initialized.c:1
93
.
[eva] tests/value/initialized.c:19: starting to merge loop iterations
[eva:alarm] tests/value/initialized.c:21: Warning: assertion got status unknown.
[eva:alarm] tests/value/initialized.c:22: Warning: assertion got status unknown.
...
...
@@ -65,7 +65,7 @@
[eva] Recording results for g1
[eva] Done for function g1
[eva] computing for function g2 <- main.
Called from tests/value/initialized.c:1
5
9.
Called from tests/value/initialized.c:19
4
.
[eva:alarm] tests/value/initialized.c:50: Warning:
signed overflow. assert -2147483648 ≤ (int)(&b4) + (int)(&b4);
[eva:alarm] tests/value/initialized.c:50: Warning:
...
...
@@ -149,7 +149,7 @@
[eva] Recording results for g2
[eva] Done for function g2
[eva] computing for function g3 <- main.
Called from tests/value/initialized.c:1
60
.
Called from tests/value/initialized.c:1
95
.
[eva:alarm] tests/value/initialized.c:89: Warning: assertion got status unknown.
[eva:alarm] tests/value/initialized.c:93: Warning:
accessing uninitialized left-value. assert \initialized(&r2);
...
...
@@ -171,13 +171,13 @@
[eva] Recording results for g3
[eva] Done for function g3
[eva] computing for function g4 <- main.
Called from tests/value/initialized.c:16
1
.
Called from tests/value/initialized.c:1
9
6.
[eva:alarm] tests/value/initialized.c:104: Warning:
accessing uninitialized left-value. assert \initialized(&y);
[eva] Recording results for g4
[eva] Done for function g4
[eva] computing for function g5 <- main.
Called from tests/value/initialized.c:1
62
.
Called from tests/value/initialized.c:1
97
.
[eva] computing for function wrong_assigns <- g5 <- main.
Called from tests/value/initialized.c:127.
[eva] using specification for function wrong_assigns
...
...
@@ -193,7 +193,7 @@
[eva] Recording results for g5
[eva] Done for function g5
[eva] computing for function g6 <- main.
Called from tests/value/initialized.c:1
63
.
Called from tests/value/initialized.c:1
98
.
[eva:alarm] tests/value/initialized.c:143: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:144: Warning:
...
...
@@ -207,7 +207,7 @@
[eva] Recording results for g6
[eva] Done for function g6
[eva] computing for function g7 <- main.
Called from tests/value/initialized.c:1
64
.
Called from tests/value/initialized.c:1
99
.
[eva] computing for function Frama_C_make_unknown <- g7 <- main.
Called from tests/value/initialized.c:153.
[eva] using specification for function Frama_C_make_unknown
...
...
@@ -217,6 +217,35 @@
[eva] tests/value/initialized.c:154: assertion got status valid.
[eva] Recording results for g7
[eva] Done for function g7
[eva] computing for function reduce_by_negation <- main.
Called from tests/value/initialized.c:200.
[eva:alarm] tests/value/initialized.c:164: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:165: Warning:
check 'invalid' got status invalid.
[eva:alarm] tests/value/initialized.c:168: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:169: Warning:
check 'unknown' got status unknown.
[eva:alarm] tests/value/initialized.c:172: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:173: Warning:
check 'unknown' got status unknown.
[eva:alarm] tests/value/initialized.c:177: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:178: Warning:
check 'unknown' got status unknown.
[eva:alarm] tests/value/initialized.c:182: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:183: Warning:
check 'invalid' got status unknown.
[eva] tests/value/initialized.c:186: starting to merge loop iterations
[eva:alarm] tests/value/initialized.c:188: Warning:
assertion got status unknown.
[eva:alarm] tests/value/initialized.c:189: Warning:
check 'unknown' got status unknown.
[eva] Recording results for reduce_by_negation
[eva] Done for function reduce_by_negation
[eva] Recording results for main
[eva] done for function main
[eva] tests/value/initialized.c:93:
...
...
@@ -293,6 +322,11 @@
Frama_C_entropy_source ∈ [--..--]
key[0..63] ∈ [--..--]
[64..127] ∈ UNINITIALIZED
[eva:final-states] Values at end of function reduce_by_negation:
x ∈ {0} or UNINITIALIZED
y ∈ {0} or UNINITIALIZED
p ∈ {{ &x ; &y }}
t[0..9] ∈ [0..9] or UNINITIALIZED
[eva:final-states] Values at end of function g5:
v ∈ UNINITIALIZED
p ∈ {{ &v1 ; &v2 }}
...
...
@@ -319,6 +353,8 @@
[from] Computing for function Frama_C_make_unknown <-g7
[from] Done for function Frama_C_make_unknown
[from] Done for function g7
[from] Computing for function reduce_by_negation
[from] Done for function reduce_by_negation
[from] Computing for function g5
[from] Computing for function wrong_assigns <-g5
[from] Done for function wrong_assigns
...
...
@@ -348,6 +384,8 @@
i6 FROM rand (and SELF)
[from] Function g7:
Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF)
[from] Function reduce_by_negation:
NO EFFECTS
[from] Function wrong_assigns:
v{.a; .b} FROM \nothing
[from] Function g5:
...
...
@@ -386,6 +424,10 @@
Frama_C_entropy_source; key[0..63]
[inout] Inputs for function g7:
Frama_C_entropy_source
[inout] Out (internal) for function reduce_by_negation:
x; y; p; tmp; t[0..9]; i
[inout] Inputs for function reduce_by_negation:
rand
[inout] Out (internal) for function g5:
v{.a; .b}; p; tmp
[inout] Inputs for function g5:
...
...
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