1 // RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
2 // RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t && %run %t 2>&1 | FileCheck %s
5 // https://github.com/google/sanitizers/issues/487
13 fprintf(stderr
, "HELLO FROM SO\n");
30 fprintf(stderr
, "CLOSED SO\n");
35 int main(int argc
, char *argv
[]) {
36 lib
= dlopen((std::string(argv
[0]) + std::string("-so.so")).c_str(),
37 RTLD_NOW
|RTLD_NODELETE
);
39 printf("error in dlopen: %s\n", dlerror());
42 void *f
= dlsym(lib
, "sofunc");
44 printf("error in dlsym: %s\n", dlerror());
53 // CHECK: HELLO FROM SO
54 // CHECK-NOT: Inconsistency detected by ld.so