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
5 
6 #include <pthread.h>
7 
8 #include <sanitizer/hwasan_interface.h>
9 
10 volatile int state;
11 
Increment(void * arg)12 void *Increment(void *arg) {
13   ++state;
14   return NULL;
15 }
16 
main()17 int main() {
18   __hwasan_enable_allocator_tagging();
19   pthread_t t1;
20   pthread_create(&t1, NULL, Increment, NULL);
21   pthread_join(t1, NULL);
22 }
23