#include <assert.h>
#include <dlfcn.h>
#include <pthread.h>
#include <sanitizer/hwasan_interface.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
constexpr auto kKeys = 100;
int main(int argc, char **argv) {
__hwasan_enable_allocator_tagging();
pthread_key_t keys[kKeys];
for (int i = 0; i < kKeys; ++i) {
assert(pthread_key_create(&keys[i], nullptr) == 0);
}
void *o = dlopen("invalid_file_name.so", 0);
const char *err = dlerror();
for (int i = 0; i < kKeys; ++i) {
assert(pthread_key_delete(keys[i]) == 0);
}
return 0;
}