[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / libc_thread_freeres.c
blobe6d1731f30e37303756d7f6356a3f4a3ad94cb02
1 // RUN: %clang_hwasan %s -o %t && %env_hwasan_opts=random_tags=1 %run %t
3 #include <pthread.h>
4 #include <sanitizer/hwasan_interface.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
9 void *ThreadFn(void *) {
10 strerror_l(-1, 0);
11 __hwasan_enable_allocator_tagging();
12 // This will trigger memory deallocation in __strerror_thread_freeres,
13 // at a point when HwasanThread is already gone.
16 int main() {
17 pthread_t t;
18 pthread_create(&t, NULL, ThreadFn, NULL);
19 pthread_join(t, NULL);
20 return 0;