-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only with high verbosity and leak reports, or thread logging requested.
- Loading branch information
1 parent
f1367a4
commit fa81868
Showing
6 changed files
with
59 additions
and
5 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
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 @@ | ||
// RUN: %clang_lsan %s -o %t && %env_lsan_opts=log_threads=1 %run %t 2>&1 | FileCheck %s | ||
|
||
// XFAIL: hwasan | ||
|
||
#include <assert.h> | ||
#include <pthread.h> | ||
#include <sanitizer/lsan_interface.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
pthread_barrier_t bar; | ||
|
||
void *threadfn(void *arg) { | ||
pthread_barrier_wait(&bar); | ||
sleep(10000); | ||
return 0; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
pthread_t thread_id; | ||
pthread_barrier_init(&bar, 0, 3); | ||
|
||
pthread_create(&thread_id, 0, threadfn, 0); | ||
pthread_create(&thread_id, 0, threadfn, 0); | ||
|
||
pthread_barrier_wait(&bar); | ||
return 0; | ||
} | ||
|
||
// CHECK: Thread T0/{{[0-9]+}} was created by T-1 | ||
// CHECK: Thread T1/{{[0-9]+}} was created by T0/ | ||
// CHECK: Thread T2/{{[0-9]+}} was created by T0/ |