-
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 pull request #1307 from goblint/issue-1260
Suppress thread-unsafe library function calls in single-threaded mode
- Loading branch information
Showing
4 changed files
with
22 additions
and
6 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
16 changes: 16 additions & 0 deletions
16
tests/regression/00-sanity/52-thread-unsafe-libfuns-single-thread.c
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,16 @@ | ||
// PARAM: --enable allglobs --set ana.activated[+] threadJoins | ||
#include <stdlib.h> | ||
#include <pthread.h> | ||
|
||
void *t_benign(void *arg) { | ||
return NULL; | ||
} | ||
|
||
int main() { | ||
rand(); | ||
pthread_t id; | ||
pthread_create(&id, NULL, t_benign, NULL); | ||
pthread_join(id, NULL); | ||
rand(); | ||
return 0; | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/regression/00-sanity/52-thread-unsafe-libfuns-single-thread.t
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,5 @@ | ||
$ goblint --enable allglobs --set ana.activated[+] threadJoins 52-thread-unsafe-libfuns-single-thread.c | ||
[Info][Deadcode] Logical lines of code (LLoC) summary: | ||
live: 8 | ||
dead: 0 | ||
total lines: 8 |
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