annotate compiler-rt/test/tsan/Darwin/dyld-library-path.c @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents c4bab56944e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
1 // Test that dyld interposition works in the presence of DYLD_LIBRARY_PATH.
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
3 // RUN: %clang_tsan %s -o %t
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
4 // RUN: env DYLD_LIBRARY_PATH=/usr/lib/system/introspection/ %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
5
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
6 #include <pthread.h>
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
7 #include <stdio.h>
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
8
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
9 void *Thread(void *a) {
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
10 fprintf(stderr, "Hello from pthread\n");
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
11 return NULL;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
12 }
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
13
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
14 int main() {
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
15 pthread_t t;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
16 pthread_create(&t, NULL, Thread, NULL);
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
17 pthread_join(t, NULL);
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
18 fprintf(stderr, "Done.\n");
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
19 }
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
20
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
21 // CHECK: Hello from pthread
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
22 // CHECK: Done.