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
8fba8a9e
Commit
8fba8a9e
authored
5 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] Tests about ghost parameters use the right option
parent
e60084e0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/cil/insert_formal.i
+2
-2
2 additions, 2 deletions
tests/cil/insert_formal.i
tests/cil/insert_formal.ml
+47
-51
47 additions, 51 deletions
tests/cil/insert_formal.ml
tests/spec/assigns_from_kf.i
+2
-2
2 additions, 2 deletions
tests/spec/assigns_from_kf.i
with
51 additions
and
55 deletions
tests/cil/insert_formal.i
+
2
−
2
View file @
8fba8a9e
/* run.config
EXECNOW: make -s
@PTEST_DIR@/@PTEST_NAME@.cmxs
OPT:
-load-module @PTEST_DIR@/@PTEST_NAME@.cmxs
-print
MODULE:
@PTEST_DIR@/@PTEST_NAME@.cmxs
OPT: -print
*/
// v
...
...
This diff is collapsed.
Click to expand it.
tests/cil/insert_formal.ml
+
47
−
51
View file @
8fba8a9e
open
Cil_types
class
visitor
=
object
inherit
Visitor
.
frama_c_inplace
method
!
vfunc
f
=
let
insert_circ
f
=
Cil
.
makeFormalVar
f
~
where
:
"^"
"x"
Cil
.
intType
in
let
insert_dollar
f
=
Cil
.
makeFormalVar
f
~
where
:
"$"
"x"
Cil
.
intType
in
let
insert_circ_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"^"
"x"
Cil
.
intType
in
let
insert_dollar_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"$"
"x"
Cil
.
intType
in
let
insert_a
f
=
Cil
.
makeFormalVar
f
~
where
:
"a"
"x"
Cil
.
intType
in
let
insert_a_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"a"
"x"
Cil
.
intType
in
let
circ_list
=
[
"void_circumflex"
;
"a_circumflex"
;
"ghost_a_circumflex"
]
in
let
dollar_list
=
[
"void_dollar"
;
"a_dollar"
;
"ghost_a_dollar"
]
in
let
circ_g_list
=
[
"void_circumflex_g"
;
"a_circumflex_g"
;
"ghost_a_circumflex_g"
]
in
let
dollar_g_list
=
[
"void_dollar_g"
;
"a_dollar_g"
;
"ghost_a_dollar_g"
]
in
let
a_list
=
[
"a_a"
;
"a_b_c_a"
;
"b_a_c_a"
;
"a_ghost_b_c_a"
;
]
in
let
a_g_list
=
[
"ghost_a_a"
;
"all_ghost_a_b_c_a"
;
"all_ghost_b_a_c_a"
;
"b_ghost_a_c_a"
]
in
if
List
.
mem
f
.
svar
.
vname
circ_list
then
ignore
(
insert_circ
f
)
;
if
List
.
mem
f
.
svar
.
vname
dollar_list
then
ignore
(
insert_dollar
f
)
;
if
List
.
mem
f
.
svar
.
vname
circ_g_list
then
ignore
(
insert_circ_g
f
)
;
if
List
.
mem
f
.
svar
.
vname
dollar_g_list
then
ignore
(
insert_dollar_g
f
)
;
if
List
.
mem
f
.
svar
.
vname
a_list
then
ignore
(
insert_a
f
)
;
if
List
.
mem
f
.
svar
.
vname
a_g_list
then
ignore
(
insert_a_g
f
)
;
Cil
.
DoChildren
end
let
update_func
f
=
let
insert_circ
f
=
Cil
.
makeFormalVar
f
~
where
:
"^"
"x"
Cil
.
intType
in
let
insert_dollar
f
=
Cil
.
makeFormalVar
f
~
where
:
"$"
"x"
Cil
.
intType
in
let
insert_circ_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"^"
"x"
Cil
.
intType
in
let
insert_dollar_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"$"
"x"
Cil
.
intType
in
let
insert_a
f
=
Cil
.
makeFormalVar
f
~
where
:
"a"
"x"
Cil
.
intType
in
let
insert_a_g
f
=
Cil
.
makeFormalVar
f
~
ghost
:
true
~
where
:
"a"
"x"
Cil
.
intType
in
let
circ_list
=
[
"void_circumflex"
;
"a_circumflex"
;
"ghost_a_circumflex"
]
in
let
dollar_list
=
[
"void_dollar"
;
"a_dollar"
;
"ghost_a_dollar"
]
in
let
circ_g_list
=
[
"void_circumflex_g"
;
"a_circumflex_g"
;
"ghost_a_circumflex_g"
]
in
let
dollar_g_list
=
[
"void_dollar_g"
;
"a_dollar_g"
;
"ghost_a_dollar_g"
]
in
let
a_list
=
[
"a_a"
;
"a_b_c_a"
;
"b_a_c_a"
;
"a_ghost_b_c_a"
;
]
in
let
a_g_list
=
[
"ghost_a_a"
;
"all_ghost_a_b_c_a"
;
"all_ghost_b_a_c_a"
;
"b_ghost_a_c_a"
]
in
if
List
.
mem
f
.
svar
.
vname
circ_list
then
ignore
(
insert_circ
f
)
;
if
List
.
mem
f
.
svar
.
vname
dollar_list
then
ignore
(
insert_dollar
f
)
;
if
List
.
mem
f
.
svar
.
vname
circ_g_list
then
ignore
(
insert_circ_g
f
)
;
if
List
.
mem
f
.
svar
.
vname
dollar_g_list
then
ignore
(
insert_dollar_g
f
)
;
if
List
.
mem
f
.
svar
.
vname
a_list
then
ignore
(
insert_a
f
)
;
if
List
.
mem
f
.
svar
.
vname
a_g_list
then
ignore
(
insert_a_g
f
)
;
()
let
run
()
=
Visitor
.
visitFramacFileSameGlobals
(
new
visitor
)
(
Ast
.
get
()
)
Globals
.
Functions
.
iter_on_fundecs
update_func
let
()
=
Db
.
Main
.
extend
run
This diff is collapsed.
Click to expand it.
tests/spec/assigns_from_kf.i
+
2
−
2
View file @
8fba8a9e
/* run.config
EXECNOW: make -s
@PTEST_DIR@/@PTEST_NAME@.cmxs
OPT:
-load-module @PTEST_DIR@/@PTEST_NAME@.cmxs
-print
MODULE:
@PTEST_DIR@/@PTEST_NAME@.cmxs
OPT: -print
*/
void
nothing
(
void
)
;
...
...
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