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
4df1b92c
Commit
4df1b92c
authored
4 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[tests] refine test case for insertion of loop assigns
parent
89037a03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/spec/loop_assigns_generated.ml
+26
-0
26 additions, 0 deletions
tests/spec/loop_assigns_generated.ml
with
26 additions
and
0 deletions
tests/spec/loop_assigns_generated.ml
+
26
−
0
View file @
4df1b92c
...
...
@@ -29,6 +29,16 @@ let add_allocates e kf stmt v =
(
AAllocation
([]
,
FreeAlloc
([]
,
[
id_v
]))));
Filecheck
.
check_ast
(
"after insertion of loop allocates "
^
v
.
vname
)
let
check_only_one
f
=
let
seen
=
ref
false
in
fun
_
a
->
if
f
a
then
begin
assert
(
not
!
seen
);
seen
:=
true
end
let
filter_category
f
_
a
acc
=
if
f
a
then
a
::
acc
else
acc
let
main
()
=
Ast
.
compute
()
;
let
kf
=
Globals
.
Functions
.
find_by_name
"f"
in
...
...
@@ -45,6 +55,22 @@ let main () =
add_assigns
e2
kf
s
k
;
add_allocates
e1
kf
s
p
;
add_allocates
e2
kf
s
q
;
Annotations
.
iter_code_annot
(
check_only_one
Logic_utils
.
is_assigns
)
s
;
Annotations
.
iter_code_annot
(
check_only_one
Logic_utils
.
is_allocation
)
s
;
let
lassigns
=
Annotations
.
fold_code_annot
(
filter_category
Logic_utils
.
is_assigns
)
s
[]
in
assert
(
List
.
length
lassigns
=
1
);
let
lalloc
=
Annotations
.
fold_code_annot
(
filter_category
Logic_utils
.
is_allocation
)
s
[]
in
assert
(
List
.
length
lalloc
=
1
);
ignore
(
Property_status
.
get
(
Property
.
ip_of_code_annot_single
kf
s
(
List
.
hd
lassigns
)));
ignore
(
Property_status
.
get
(
Property
.
ip_of_code_annot_single
kf
s
(
List
.
hd
lalloc
)));
File
.
pretty_ast
()
let
()
=
Db
.
Main
.
extend
main
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