brintos

brintos / llvm-project-archived public Read only

0
0
Text · 443 B · 2d5fc6e Raw
22 lines · c
1// Tests that our thread initialization hooks work properly with random_tags=1.2// RUN: %clang_hwasan %s -o %t3// RUN: %env_hwasan_opts=random_tags=1 %run %t4 5#include <pthread.h>6 7#include <sanitizer/hwasan_interface.h>8 9volatile int state;10 11void *Increment(void *arg) {12  ++state;13  return NULL;14}15 16int main() {17  __hwasan_enable_allocator_tagging();18  pthread_t t1;19  pthread_create(&t1, NULL, Increment, NULL);20  pthread_join(t1, NULL);21}22