Skip to content

Commit

Permalink
Add simpler case_distinction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 20, 2023
1 parent f27b098 commit 4e7312b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/regression/46-apron2/64-case_distinction_with_ghosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void* inc()
__VERIFIER_atomic_end();

__VERIFIER_atomic_begin();
assert(g != 1 || x >= 42);
assert(g != 1 || x >= 42); // TODO
__VERIFIER_atomic_end();
}

Expand All @@ -34,6 +34,6 @@ int main()
g = 1; x = 42;
__VERIFIER_atomic_end();

assert(x >= 42);
assert(x >= 42); // TODO
return 0;
}
30 changes: 30 additions & 0 deletions tests/regression/46-apron2/65-case_distinction_with_ghosts-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// PARAM: --enable ana.sv-comp.functions --set ana.activated[+] apron --set ana.relation.privatization mutex-meet --set sem.int.signed_overflow assume_none
#include <pthread.h>
#include <assert.h>

extern int __VERIFIER_nondet_int();
extern void __VERIFIER_atomic_begin();
extern void __VERIFIER_atomic_end();

int x = 0;
int g = 0;

void* inc()
{
__VERIFIER_atomic_begin();
assert(g != 1 || x >= 42); // TODO
__VERIFIER_atomic_end();
return 0;
}

int main()
{
pthread_t tid;
pthread_create(&tid, 0, inc, 0);
__VERIFIER_atomic_begin();
g = 1; x = 42;
__VERIFIER_atomic_end();

assert(x >= 42); // TODO
return 0;
}
30 changes: 30 additions & 0 deletions tests/regression/46-apron2/66-case_distinction_with_ghosts-3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// PARAM: --enable ana.sv-comp.functions --set ana.activated[+] apron --set ana.relation.privatization mutex-meet --set sem.int.signed_overflow assume_none
#include <pthread.h>
#include <assert.h>

extern int __VERIFIER_nondet_int();
extern void __VERIFIER_atomic_begin();
extern void __VERIFIER_atomic_end();

int x = 0;
int g = 0;

void* inc()
{
// x = 10; // TODO: what is this?

__VERIFIER_atomic_begin();
assert(g != 1 || x >= 42); // TODO
__VERIFIER_atomic_end();
return 0;
}

int main()
{
pthread_t tid;
pthread_create(&tid, 0, inc, 0);
__VERIFIER_atomic_begin();
g = 1; x = 42;
__VERIFIER_atomic_end();
return 0;
}

0 comments on commit 4e7312b

Please sign in to comment.