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
c0e0c0af
Commit
c0e0c0af
authored
1 year ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Adds a test of a goto statement skipping a local variable declaration.
parent
666da04c
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/goto.i
+23
-0
23 additions, 0 deletions
tests/value/goto.i
tests/value/oracle/goto.res.oracle
+27
-3
27 additions, 3 deletions
tests/value/oracle/goto.res.oracle
with
50 additions
and
3 deletions
tests/value/goto.i
+
23
−
0
View file @
c0e0c0af
/* run.config*
STDOPT: +""
*/
volatile
int
nondet
;
int
stop
()
{
int
stop
()
{
L: goto L;
L: goto L;
}
void
skip_declaration
(
void
)
{
int y, r;
if (nondet) {
goto l; // This goto skips the declaration of variable x below.
}
int x = 1;
y = 2;
l: // x and y are both uninitialized when coming from the goto
//@ check unknown: \initialized(&x);
//@ check unknown: x > 0;
//@ check unknown: \initialized(&y);
//@ check unknown: y > 0;
r = x + 1; // An initialization alarm must be emitted.
r = y + 1; // An initialization alarm must be emitted.
return;
}
}
int
main
()
{
int
main
()
{
...
@@ -9,4 +31,5 @@ int main() {
...
@@ -9,4 +31,5 @@ int main() {
if (c) stop ();
if (c) stop ();
skip_declaration ();
}
}
This diff is collapsed.
Click to expand it.
tests/value/oracle/goto.res.oracle
+
27
−
3
View file @
c0e0c0af
...
@@ -3,19 +3,37 @@
...
@@ -3,19 +3,37 @@
[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
nondet ∈ [--..--]
[eva] computing for function stop <- main.
[eva] computing for function stop <- main.
Called from goto.i:
10
.
Called from goto.i:
32
.
[eva] Recording results for stop
[eva] Recording results for stop
[eva] Done for function stop
[eva] Done for function stop
[eva] computing for function skip_declaration <- main.
Called from goto.i:34.
[eva:alarm] goto.i:19: Warning: check 'unknown' got status unknown.
[eva:alarm] goto.i:20: Warning: check 'unknown' got status unknown.
[eva:alarm] goto.i:21: Warning: check 'unknown' got status unknown.
[eva:alarm] goto.i:22: Warning: check 'unknown' got status unknown.
[eva:alarm] goto.i:23: Warning:
accessing uninitialized left-value. assert \initialized(&x);
[eva:alarm] goto.i:24: Warning:
accessing uninitialized left-value. assert \initialized(&y);
[eva] Recording results for skip_declaration
[eva] Done for function skip_declaration
[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 ======
[eva:final-states] Values at end of function skip_declaration:
y ∈ {2}
r ∈ {3}
x ∈ {1}
[eva:final-states] Values at end of function stop:
[eva:final-states] Values at end of function stop:
NON TERMINATING FUNCTION
NON TERMINATING FUNCTION
[eva:final-states] Values at end of function main:
[eva:final-states] Values at end of function main:
c ∈ [--..--]
c ∈ [--..--]
__retres ∈ {0}
__retres ∈ {0}
[from] Computing for function skip_declaration
[from] Done for function skip_declaration
[from] Computing for function stop
[from] Computing for function stop
[from] Non-terminating function stop (no dependencies)
[from] Non-terminating function stop (no dependencies)
[from] Done for function stop
[from] Done for function stop
...
@@ -23,11 +41,17 @@
...
@@ -23,11 +41,17 @@
[from] Done for function main
[from] Done for function main
[from] ====== DEPENDENCIES COMPUTED ======
[from] ====== DEPENDENCIES COMPUTED ======
These dependencies hold at termination for the executions that terminate:
These dependencies hold at termination for the executions that terminate:
[from] Function skip_declaration:
NO EFFECTS
[from] Function stop:
[from] Function stop:
NON TERMINATING - NO EFFECTS
NON TERMINATING - NO EFFECTS
[from] Function main:
[from] Function main:
\result FROM \nothing
\result FROM \nothing
[from] ====== END OF DEPENDENCIES ======
[from] ====== END OF DEPENDENCIES ======
[inout] Out (internal) for function skip_declaration:
y; r; x
[inout] Inputs for function skip_declaration:
nondet
[inout] Out (internal) for function stop:
[inout] Out (internal) for function stop:
\nothing
\nothing
[inout] Inputs for function stop:
[inout] Inputs for function stop:
...
@@ -35,4 +59,4 @@
...
@@ -35,4 +59,4 @@
[inout] Out (internal) for function main:
[inout] Out (internal) for function main:
c; __retres
c; __retres
[inout] Inputs for function main:
[inout] Inputs for function main:
\
no
thing
no
ndet
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