vitalybuka created this revision.
vitalybuka added reviewers: eugenis, kda, rnk.
Herald added a reviewer: bollu.
Herald added subscribers: sdasgup3, wenzhicui, wrengr, Chia-hungDuan, dcaballe, 
cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, 
Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, 
rriddle, mehdi_amini, delcypher.
Herald added a project: All.
vitalybuka requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, stephenneuendorffer, 
nicolasvasilache.
Herald added projects: clang, MLIR, LLVM.

Not all options were propageted into tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122869

Files:
  clang/test/Unit/lit.cfg.py
  clang/test/lit.cfg.py
  cross-project-tests/lit.cfg.py
  llvm/test/Unit/lit.cfg.py
  llvm/test/lit.cfg.py
  llvm/utils/lit/lit/llvm/config.py
  mlir/test/Unit/lit.cfg.py
  polly/test/Unit/lit.cfg

Index: polly/test/Unit/lit.cfg
===================================================================
--- polly/test/Unit/lit.cfg
+++ polly/test/Unit/lit.cfg
@@ -32,10 +32,19 @@
 if 'TEMP' in os.environ:
     config.environment['TEMP'] = os.environ['TEMP']
 
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
-    if symbolizer in os.environ:
-        config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+    'ASAN_SYMBOLIZER_PATH',
+    'MSAN_SYMBOLIZER_PATH',
+    'TSAN_SYMBOLIZER_PATH',
+    'UBSAN_SYMBOLIZER_PATH',
+    'ASAN_OPTIONS',
+    'MSAN_OPTIONS',
+    'TSAN_OPTIONS',
+    'UBSAN_OPTIONS',
+]:
+    if var in os.environ:
+        config.environment[var] = os.environ[var]
 
 if platform.system() == 'Darwin':
     shlibpath_var = 'DYLD_LIBRARY_PATH'
Index: mlir/test/Unit/lit.cfg.py
===================================================================
--- mlir/test/Unit/lit.cfg.py
+++ mlir/test/Unit/lit.cfg.py
@@ -33,7 +33,16 @@
 if 'HOME' in os.environ:
     config.environment['HOME'] = os.environ['HOME']
 
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
-    if symbolizer in os.environ:
-        config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+    'ASAN_SYMBOLIZER_PATH',
+    'MSAN_SYMBOLIZER_PATH',
+    'TSAN_SYMBOLIZER_PATH',
+    'UBSAN_SYMBOLIZER_PATH',
+    'ASAN_OPTIONS',
+    'MSAN_OPTIONS',
+    'TSAN_OPTIONS',
+    'UBSAN_OPTIONS',
+]:
+    if var in os.environ:
+        config.environment[var] = os.environ[var]
Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -56,6 +56,17 @@
         if not self.use_lit_shell:
             features.add('shell')
 
+        self.with_system_environment([
+            'ASAN_SYMBOLIZER_PATH',
+            'MSAN_SYMBOLIZER_PATH',
+            'TSAN_SYMBOLIZER_PATH',
+            'UBSAN_SYMBOLIZER_PATH'
+            'ASAN_OPTIONS',
+            'MSAN_OPTIONS',
+            'TSAN_OPTIONS',
+            'UBSAN_OPTIONS',
+        ])
+
         # Running on Darwin OS
         if platform.system() == 'Darwin':
             # FIXME: lld uses the first, other projects use the second.
Index: llvm/test/lit.cfg.py
===================================================================
--- llvm/test/lit.cfg.py
+++ llvm/test/lit.cfg.py
@@ -40,7 +40,7 @@
 
 # Propagate some variables from the host environment.
 llvm_config.with_system_environment(
-    ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
+    ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
 
 
 # Set up OCAMLPATH to include newly built OCaml libraries.
Index: llvm/test/Unit/lit.cfg.py
===================================================================
--- llvm/test/Unit/lit.cfg.py
+++ llvm/test/Unit/lit.cfg.py
@@ -33,10 +33,19 @@
 if 'HOME' in os.environ:
     config.environment['HOME'] = os.environ['HOME']
 
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
-    if symbolizer in os.environ:
-        config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+    'ASAN_SYMBOLIZER_PATH',
+    'MSAN_SYMBOLIZER_PATH',
+    'TSAN_SYMBOLIZER_PATH',
+    'UBSAN_SYMBOLIZER_PATH',
+    'ASAN_OPTIONS',
+    'MSAN_OPTIONS',
+    'TSAN_OPTIONS',
+    'UBSAN_OPTIONS',
+]:
+    if var in os.environ:
+        config.environment[var] = os.environ[var]
 
 # Win32 seeks DLLs along %PATH%.
 if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
Index: cross-project-tests/lit.cfg.py
===================================================================
--- cross-project-tests/lit.cfg.py
+++ cross-project-tests/lit.cfg.py
@@ -83,11 +83,6 @@
 if 'compiler-rt' in config.llvm_enabled_projects:
   config.available_features.add('compiler-rt')
 
-if config.llvm_use_sanitizer:
-    # Propagate path to symbolizer for ASan/MSan.
-    llvm_config.with_system_environment(
-        ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
-
 # Check which debuggers are available:
 lldb_path = llvm_config.use_llvm_tool('lldb', search_env='LLDB')
 
Index: clang/test/lit.cfg.py
===================================================================
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -49,10 +49,6 @@
 config.substitutions.append(
     ('%target_triple', config.target_triple))
 
-# Propagate path to symbolizer for ASan/MSan.
-llvm_config.with_system_environment(
-    ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
-
 config.substitutions.append(('%PATH%', config.environment['PATH']))
 
 
Index: clang/test/Unit/lit.cfg.py
===================================================================
--- clang/test/Unit/lit.cfg.py
+++ clang/test/Unit/lit.cfg.py
@@ -30,10 +30,19 @@
 if 'TEMP' in os.environ:
     config.environment['TEMP'] = os.environ['TEMP']
 
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
-    if symbolizer in os.environ:
-        config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+    'ASAN_SYMBOLIZER_PATH',
+    'MSAN_SYMBOLIZER_PATH',
+    'TSAN_SYMBOLIZER_PATH',
+    'UBSAN_SYMBOLIZER_PATH',
+    'ASAN_OPTIONS',
+    'MSAN_OPTIONS',
+    'TSAN_OPTIONS',
+    'UBSAN_OPTIONS',
+]:
+    if var in os.environ:
+        config.environment[var] = os.environ[var]
 
 def find_shlibpath_var():
     if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to