Skip to content

Commit

Permalink
Add test for Klever's multiple threads
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 27, 2023
1 parent 717b6a8 commit 670e7cf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/regression/51-threadjoins/07-klever-multiple.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//PARAM: --set ana.activated[+] threadJoins --set lib.activated[+] klever
#include <pthread.h>
#include <goblint.h>

int g = 0;

void *t_fun(void *arg) {
g++; // RACE!
return NULL;
}

int main() {
pthread_t id;
pthread_create_N(&id, NULL, t_fun, NULL); // spawns multiple threads
pthread_join(id, NULL);

g++; // RACE!

pthread_join_N(id, NULL); // TODO: should this join one (do nothing) or all (like assume join)?

g++; // RACE!

return 0;
}

0 comments on commit 670e7cf

Please sign in to comment.