1 // Test forked process does not run lsan.
2 // RUN: %clangxx_lsan %s -o %t && %run %t 2>&1 | FileCheck %s
9 static pthread_barrier_t barrier;
11 // CHECK-NOT: SUMMARY: {{(Leak|Address)}}Sanitizer:
12 static void *thread_func(void *arg) {
13 void *buffer = malloc(1337);
14 pthread_barrier_wait(&barrier);
21 pthread_barrier_init(&barrier, 0, 2);
23 int res = pthread_create(&tid, 0, thread_func, 0);
24 pthread_barrier_wait(&barrier);
25 pthread_barrier_destroy(&barrier);
30 waitpid(pid, &status, 0);
35 // CHECK: WARNING: LeakSanitizer is disabled in forked process