Skip to content

Commit 417083d

Browse files
boomanaiden154luciechoi
authored andcommitted
[TSan] Make Test work with Internal Shell
This test was using subshells to setup LD_LIBRARY_PATH properly. Use a python script and readfile substitutions to preserve the same behavior. Reviewers: vitalybuka, fmayer, thurstond Reviewed By: thurstond Pull Request: llvm#165147
1 parent 7c21b3f commit 417083d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler-rt/test/tsan/ignore_lib0.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
// RUN: %clangxx_tsan -O1 -fno-builtin %s -DLIB -fPIC -fno-sanitize=thread -shared -o %t-dir/libignore_lib0.so
55
// RUN: %clangxx_tsan -O1 %s -L%t-dir -lignore_lib0 %link_libcxx_tsan -o %t
66
// RUN: echo running w/o suppressions:
7-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
7+
// RUN: echo -n %t-dir > %t.ld_library_path
8+
// RUN: python -c "if 'LD_LIBRARY_PATH' in __import__('os').environ: print(':' + __import__('os').environ['LD_LIBRARY_PATH'], end='')" >> %t.ld_library_path
9+
// RUN: env LD_LIBRARY_PATH=%{readfile:%t.ld_library_path} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP
810
// RUN: echo running with suppressions:
9-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
11+
// RUN: env LD_LIBRARY_PATH=%{readfile:%t.ld_library_path} %env_tsan_opts=suppressions='%s.supp' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
1012
// RUN: echo running with generic suppression of noninstrumented code:
11-
// RUN: env LD_LIBRARY_PATH=%t-dir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %env_tsan_opts=ignore_noninstrumented_modules=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
13+
// RUN: env LD_LIBRARY_PATH=%{readfile:%t.ld_library_path} %env_tsan_opts=ignore_noninstrumented_modules=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP
1214

1315
// Tests that interceptors coming from a library specified in called_from_lib
1416
// suppression are ignored.

0 commit comments

Comments
 (0)