blob: d6ae72f31638e895f18b5ae1d44596a38af860bd [file] [log] [blame]
Dmitry Vyukov5ba73642013-10-03 13:37:17 +00001// RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib0.so
2// RUN: %clangxx_tsan -O1 %s -L%T -lignore_lib0 -o %t
3// RUN: echo running w/o suppressions:
Alexey Samsonov394f1d42016-02-17 20:40:10 +00004// RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
Dmitry Vyukov5ba73642013-10-03 13:37:17 +00005// RUN: echo running with suppressions:
Alexey Samsonov394f1d42016-02-17 20:40:10 +00006// RUN: env LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
Dmitry Vyukov5ba73642013-10-03 13:37:17 +00007
8// Tests that interceptors coming from a library specified in called_from_lib
9// suppression are ignored.
10
Adhemerval Zanellad7984712015-08-05 15:17:59 +000011// Some aarch64 kernels do not support non executable write pages
Adhemerval Zanella15db6dc2015-08-28 20:40:50 +000012// REQUIRES: stable-runtime
Adhemerval Zanellad7984712015-08-05 15:17:59 +000013
Dmitry Vyukov5ba73642013-10-03 13:37:17 +000014#ifndef LIB
15
16extern "C" void libfunc();
17
18int main() {
19 libfunc();
20}
21
22#else // #ifdef LIB
23
24#include "ignore_lib_lib.h"
25
26#endif // #ifdef LIB
27
28// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
29// CHECK-NOSUPP: OK
30
31// CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race
32// CHECK-WITHSUPP: OK
33