Files
clang-p2996/compiler-rt/test/hwasan/TestCases/pthread_create.c
Florian Mayer fdac98a7f3 Remove stable-runtime from many tests
They pass on x86_64 host, arm64 host, and Android.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D156273
2023-07-25 17:29:03 -07:00

22 lines
443 B
C

// Tests that our thread initialization hooks work properly with random_tags=1.
// RUN: %clang_hwasan %s -o %t
// RUN: %env_hwasan_opts=random_tags=1 %run %t
#include <pthread.h>
#include <sanitizer/hwasan_interface.h>
volatile int state;
void *Increment(void *arg) {
++state;
return NULL;
}
int main() {
__hwasan_enable_allocator_tagging();
pthread_t t1;
pthread_create(&t1, NULL, Increment, NULL);
pthread_join(t1, NULL);
}