-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into affineeq-refine
- Loading branch information
Showing
4 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// PARAM: --set ana.base.privatization mine-W-noinit --enable ana.int.enums | ||
#include <pthread.h> | ||
#include <goblint.h> | ||
|
||
int g; | ||
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; | ||
|
||
void *t_fun(void *arg) { | ||
return NULL; | ||
} | ||
|
||
void *t_fun2(void *arg) { | ||
pthread_mutex_lock(&A); | ||
pthread_mutex_unlock(&A); // used to spuriously publish g = 8 | ||
return NULL; | ||
} | ||
|
||
int main() { | ||
pthread_t id, id2; | ||
pthread_create(&id, NULL, t_fun, NULL); // enter multithreaded | ||
|
||
pthread_mutex_lock(&A); | ||
g = 8; | ||
pthread_create(&id2, NULL, t_fun2, NULL); // used to pass g = 8 and W: A -> {g} to t_fun2 | ||
g = 0; | ||
pthread_mutex_unlock(&A); | ||
|
||
pthread_mutex_lock(&A); | ||
__goblint_check(g == 0); | ||
pthread_mutex_unlock(&A); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//SKIP PARAM: --enable ana.int.interval --set sem.int.signed_overflow assume_none --set ana.activated[+] lin2vareq | ||
|
||
#include <goblint.h> | ||
|
||
int nondet() { | ||
int x; | ||
return x; | ||
} | ||
int SIZE = 1; | ||
int rand; | ||
|
||
int main() { | ||
unsigned int n=2,i=8; | ||
n = i%(SIZE+2); //NOWARN | ||
|
||
rand=nondet(); | ||
|
||
if (rand>5 && rand<10) { | ||
n= i%(rand+2); //NOWARN | ||
} | ||
|
||
return 0; | ||
} | ||
|