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
5559ba38
Commit
5559ba38
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Adds a much needed test for arithmetic backward propagators.
parent
f5329039
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/backward_arith.i
+33
-0
33 additions, 0 deletions
tests/value/backward_arith.i
tests/value/oracle/backward_arith.res.oracle
+44
-0
44 additions, 0 deletions
tests/value/oracle/backward_arith.res.oracle
with
77 additions
and
0 deletions
tests/value/backward_arith.i
0 → 100644
+
33
−
0
View file @
5559ba38
/* run.config*
*/
/* Test the soundness of arithmetic backward propagators. */
volatile
int
nondet
;
void
unsigned_neg
()
{
unsigned int x = nondet;
unsigned int minus_ten = -10; /* minus_ten = 4294967286. */
if (-x == minus_ten)
Frama_C_show_each_ten(x);
else
Frama_C_show_each_not_ten(x);
if (-x < minus_ten)
Frama_C_show_each_greater_than_ten_or_zero(x);
else
Frama_C_show_each_smaller_than_ten_but_zero(x);
if (-x == 10)
Frama_C_show_each_minus_ten(x); /* 4294967286 */
else
Frama_C_show_each_not_minus_ten(x); /* not 4294967286 */
if (-x < 10)
Frama_C_show_each_greater_than_minus_ten_or_zero(x); /* > 4294967286 or 0 */
else
Frama_C_show_each_smaller_than_minus_ten_but_zero(x); /* <= 4294967286 but 0 */
}
int
main
()
{
unsigned_neg ();
return 0;
}
This diff is collapsed.
Click to expand it.
tests/value/oracle/backward_arith.res.oracle
0 → 100644
+
44
−
0
View file @
5559ba38
[kernel] Parsing tests/value/backward_arith.i (no preprocessing)
[eva] Analyzing a complete application starting at main
[eva] Computing initial state
[eva] Initial state computed
[eva:initial-state] Values of globals at initialization
nondet ∈ [--..--]
[eva] computing for function unsigned_neg <- main.
Called from tests/value/backward_arith.i:31.
[eva] tests/value/backward_arith.i:14:
Frama_C_show_each_not_ten: [0..4294967295]
[eva] tests/value/backward_arith.i:16:
Frama_C_show_each_greater_than_ten_or_zero: {0}
[eva] tests/value/backward_arith.i:22: Frama_C_show_each_not_minus_ten: {0}
[eva] tests/value/backward_arith.i:24:
Frama_C_show_each_greater_than_minus_ten_or_zero: {0}
[eva] Recording results for unsigned_neg
[eva] Done for function unsigned_neg
[eva] Recording results for main
[eva] done for function main
[eva] ====== VALUES COMPUTED ======
[eva:final-states] Values at end of function unsigned_neg:
x ∈ {0}
minus_ten ∈ {4294967286}
[eva:final-states] Values at end of function main:
__retres ∈ {0}
[from] Computing for function unsigned_neg
[from] Done for function unsigned_neg
[from] Computing for function main
[from] Done for function main
[from] ====== DEPENDENCIES COMPUTED ======
These dependencies hold at termination for the executions that terminate:
[from] Function unsigned_neg:
NO EFFECTS
[from] Function main:
\result FROM \nothing
[from] ====== END OF DEPENDENCIES ======
[inout] Out (internal) for function unsigned_neg:
x; minus_ten
[inout] Inputs for function unsigned_neg:
nondet
[inout] Out (internal) for function main:
__retres
[inout] Inputs for function main:
nondet
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