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
ddee95a4
Commit
ddee95a4
authored
5 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
test for conversion issue
parent
c1ca1c91
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/spec/expr_to_term.i
+7
-2
7 additions, 2 deletions
tests/spec/expr_to_term.i
tests/spec/expr_to_term.ml
+5
-2
5 additions, 2 deletions
tests/spec/expr_to_term.ml
with
12 additions
and
4 deletions
tests/spec/expr_to_term.i
+
7
−
2
View file @
ddee95a4
/* run.config
/* run.config
EXECNOW: make -s
@PTEST_DIR@/@PTEST_NAME@.cmxs
MODULE:
@PTEST_DIR@/@PTEST_NAME@.cmxs
OPT:
-no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs
-print
OPT: -print
*/
*/
int
x
[
10
]
;
int
x
[
10
]
;
...
@@ -28,3 +28,8 @@ int main() {
...
@@ -28,3 +28,8 @@ int main() {
s.z = 3;
s.z = 3;
t = 4;
t = 4;
}
}
/*@ ensures int_eq((int)!t,(int)5); */
int
g
()
{
if (!t) return 2; else return 3;
}
This diff is collapsed.
Click to expand it.
tests/spec/expr_to_term.ml
+
5
−
2
View file @
ddee95a4
...
@@ -6,6 +6,7 @@ let check_expr_term check fct s e =
...
@@ -6,6 +6,7 @@ let check_expr_term check fct s e =
let
exp
=
let
exp
=
match
s
.
skind
with
match
s
.
skind
with
|
Instr
(
Set
(
lv
,_,
loc
))
->
Cil
.
new_exp
~
loc
(
Lval
lv
)
|
Instr
(
Set
(
lv
,_,
loc
))
->
Cil
.
new_exp
~
loc
(
Lval
lv
)
|
If
(
c
,_,_,_
)
->
c
|
_
->
Kernel
.
fatal
"Unexpected statement %a"
Printer
.
pp_stmt
s
|
_
->
Kernel
.
fatal
"Unexpected statement %a"
Printer
.
pp_stmt
s
in
in
let
term
=
let
term
=
...
@@ -23,7 +24,6 @@ let check_expr_term check fct s e =
...
@@ -23,7 +24,6 @@ let check_expr_term check fct s e =
let
post
=
Logic_const
.
new_predicate
app
in
let
post
=
Logic_const
.
new_predicate
app
in
Annotations
.
add_ensures
emitter
fct
[
Normal
,
post
]
Annotations
.
add_ensures
emitter
fct
[
Normal
,
post
]
let
treat_fct
check
fct
=
let
treat_fct
check
fct
=
let
stmts
=
(
Kernel_function
.
get_definition
fct
)
.
sbody
.
bstmts
in
let
stmts
=
(
Kernel_function
.
get_definition
fct
)
.
sbody
.
bstmts
in
let
stmts
=
let
stmts
=
...
@@ -31,6 +31,7 @@ let treat_fct check fct =
...
@@ -31,6 +31,7 @@ let treat_fct check fct =
(
function
(
function
{
skind
=
Instr
(
Set
(
lv
,_,_
))
}
->
{
skind
=
Instr
(
Set
(
lv
,_,_
))
}
->
(
match
lv
with
(
Var
v
,_
)
->
v
.
vglob
|
_
->
true
)
(
match
lv
with
(
Var
v
,_
)
->
v
.
vglob
|
_
->
true
)
|
{
skind
=
If
_
}
->
true
|
_
->
false
)
|
_
->
false
)
stmts
stmts
in
in
...
@@ -49,8 +50,10 @@ let treat_fct check fct =
...
@@ -49,8 +50,10 @@ let treat_fct check fct =
let
compute
()
=
let
compute
()
=
let
main
=
Globals
.
Functions
.
find_by_name
"main"
in
let
main
=
Globals
.
Functions
.
find_by_name
"main"
in
let
f
=
Globals
.
Functions
.
find_by_name
"f"
in
let
f
=
Globals
.
Functions
.
find_by_name
"f"
in
let
g
=
Globals
.
Functions
.
find_by_name
"g"
in
treat_fct
true
main
;
treat_fct
true
main
;
treat_fct
false
f
treat_fct
false
f
;
treat_fct
true
g
let
()
=
Db
.
Main
.
extend
compute
let
()
=
Db
.
Main
.
extend
compute
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