Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | // 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: |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 4 | // RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 5 | // RUN: echo running with suppressions: |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 6 | // RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} TSAN_OPTIONS="$TSAN_OPTIONS suppressions='%s.supp'" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 7 | |
| 8 | // Tests that interceptors coming from a library specified in called_from_lib |
| 9 | // suppression are ignored. |
| 10 | |
| 11 | #ifndef LIB |
| 12 | |
| 13 | extern "C" void libfunc(); |
| 14 | |
| 15 | int main() { |
| 16 | libfunc(); |
| 17 | } |
| 18 | |
| 19 | #else // #ifdef LIB |
| 20 | |
| 21 | #include "ignore_lib_lib.h" |
| 22 | |
| 23 | #endif // #ifdef LIB |
| 24 | |
| 25 | // CHECK-NOSUPP: WARNING: ThreadSanitizer: data race |
| 26 | // CHECK-NOSUPP: OK |
| 27 | |
| 28 | // CHECK-WITHSUPP-NOT: WARNING: ThreadSanitizer: data race |
| 29 | // CHECK-WITHSUPP: OK |
| 30 | |