4 // RUN: %clangxx_tsan -O1 -fno-builtin %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib1.so
5 // RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -o %t-dir/executable
6 // RUN: echo running w/o suppressions:
7 // RUN: %deflake %run %t-dir/executable | FileCheck %s --check-prefix=CHECK-NOSUPP
8 // RUN: echo running with suppressions:
9 // RUN: %env_tsan_opts=suppressions='%s.supp' %run %t-dir/executable 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
11 // Tests that interceptors coming from a dynamically loaded library specified
12 // in called_from_lib suppression are ignored.
14 // REQUIRES: stable-runtime
15 // UNSUPPORTED: target=powerpc64le{{.*}}
16 // FIXME: This test regularly fails on powerpc64 LE possibly starting with
17 // r279664. Re-enable the test once the problem(s) have been fixed.
28 int main(int argc
, char **argv
) {
29 std::string lib
= std::string(dirname(argv
[0])) + "/libignore_lib1.so";
30 void *h
= dlopen(lib
.c_str(), RTLD_GLOBAL
| RTLD_NOW
);
32 exit(printf("failed to load the library (%d)\n", errno
));
33 void (*f
)() = (void(*)())dlsym(h
, "libfunc");
35 exit(printf("failed to find the func (%d)\n", errno
));
41 #include "ignore_lib_lib.h"
45 // CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
48 // CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race