Skip to content
Snippets Groups Projects
Commit 8a03176a authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[tests] add test for generalized check

parent b70a8d35
No related branches found
No related tags found
No related merge requests found
/*@ check lemma tauto: \true ==> \true; */
/*@ check requires \valid(x);
assigns *x;
check ensures *x == 0;
*/
void f(int* x) {
/*@ check \valid(x); */ // can't be proved by WP: we ignore the requires
*x = 0;
}
int main() {
int a = 4;
f(&a);
/*@ check a == 0; */ // can't be proved by WP: we ignore the ensures
}
[kernel] Parsing tests/spec/generalized_check.i (no preprocessing)
/* Generated by Frama-C */
/*@ check lemma tauto: \true;
*/
/*@ check requires \valid(x);
check ensures *\old(x) ≡ 0;
assigns *x; */
void f(int *x)
{
/*@ check \valid(x); */ ;
*x = 0;
return;
}
int main(void)
{
int __retres;
int a = 4;
f(& a);
/*@ check a ≡ 0; */ ;
__retres = 0;
return __retres;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment