[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / pthread_create.c
bloba28d6d31d0c23361bbde514dc22daf03adfc253f
1 // Tests that our thread initialization hooks work properly with random_tags=1.
2 // RUN: %clang_hwasan %s -o %t
3 // RUN: %env_hwasan_opts=random_tags=1 %run %t
4 // REQUIRES: stable-runtime
6 #include <pthread.h>
8 #include <sanitizer/hwasan_interface.h>
10 volatile int state;
12 void *Increment(void *arg) {
13 ++state;
14 return NULL;
17 int main() {
18 __hwasan_enable_allocator_tagging();
19 pthread_t t1;
20 pthread_create(&t1, NULL, Increment, NULL);
21 pthread_join(t1, NULL);