[Flang][OpenMP]Add parsing support for DISPATCH construct (#121982)
[llvm-project.git] / compiler-rt / test / lsan / TestCases / print_threads.c
bloba9389412af1ccfaa59b993cb64417929eaa47cc1
1 // RUN: %clang_lsan %s -o %t && %env_lsan_opts=log_threads=1 %run %t 2>&1 | FileCheck %s
3 // XFAIL: hwasan
5 // No pthread barriers on Darwin.
6 // UNSUPPORTED: darwin
8 #include <assert.h>
9 #include <pthread.h>
10 #include <sanitizer/lsan_interface.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <unistd.h>
15 pthread_barrier_t bar;
17 void *threadfn(void *arg) {
18 pthread_barrier_wait(&bar);
19 sleep(10000);
20 return 0;
23 int main(int argc, char *argv[]) {
24 pthread_t thread_id;
25 pthread_barrier_init(&bar, 0, 3);
27 pthread_create(&thread_id, 0, threadfn, 0);
28 pthread_create(&thread_id, 0, threadfn, 0);
30 pthread_barrier_wait(&bar);
31 return 0;
34 // CHECK: Thread T0/{{[0-9]+}} was created by T-1
35 // CHECK: Thread T1/{{[0-9]+}} was created by T0/
36 // CHECK: Thread T2/{{[0-9]+}} was created by T0/