-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge latest changes from rework (#498)
* Function passes & Thread creation after unrolling #492 * Thread cf & must edges #494 * Dynamic Pthread join #496 --------- Signed-off-by: Hernan Ponce de Leon <[email protected]> Co-authored-by: Thomas Haas <[email protected]> Co-authored-by: René Pascal Maseli <[email protected]>
- Loading branch information
1 parent
8719fde
commit 027b402
Showing
78 changed files
with
17,537 additions
and
1,202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
#include <stdlib.h> | ||
#include <assert.h> | ||
#include <dat3m.h> | ||
|
||
// This test makes sure that we do not accidentally cut of side-effect-full loops | ||
// This test makes sure that we do not accidentally cut off side-effect-full loops | ||
// whose side-effects were propagated by constant propagation | ||
// Expected result: FAIL with B >= 3, UNKNOWN otherwise | ||
|
||
volatile int bound = 2; // To stop the compiler from optimising away our loop | ||
#ifndef B | ||
#define B 3 | ||
#endif | ||
|
||
volatile int bound = B - 1; // To stop the compiler from optimising away our loop | ||
|
||
int main() | ||
{ | ||
int cnt = 0; | ||
__VERIFIER_loop_bound(B); | ||
while (cnt++ < bound) { } | ||
assert (0); // FAIL, unless we cut of the loop too early | ||
assert (0); // FAIL, unless we cut off the loop too early | ||
|
||
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
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
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,33 @@ | ||
#include <pthread.h> | ||
#include <stdatomic.h> | ||
#include <dat3m.h> | ||
|
||
/* | ||
The test shows thread creation inside loops | ||
Expected result: FAIL | ||
*/ | ||
|
||
#ifndef N | ||
#define N 5 | ||
#endif | ||
|
||
atomic_int data; | ||
|
||
void *worker(void *arg) | ||
{ | ||
atomic_fetch_add(&data, 1); | ||
} | ||
|
||
int main() | ||
{ | ||
pthread_t t[N]; | ||
int bound = __VERIFIER_nondet_int(); | ||
__VERIFIER_assume(0 <= bound && bound < N); | ||
|
||
__VERIFIER_loop_bound(N + 1); | ||
for (int i = 0; i < bound; i++) { | ||
pthread_create(&t[i], NULL, worker, NULL); | ||
} | ||
|
||
assert(data != N - 1); | ||
} |
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
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
Oops, something went wrong.