[lld] 95bb95e - [LLD][ELF] Fix compressed-debug-level test on SystemZ

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 04:59:54 PDT 2023


Author: Ulrich Weigand
Date: 2023-05-05T13:57:59+02:00
New Revision: 95bb95ebe44882854aeb47f8b3a6a38e775d8232

URL: https://github.com/llvm/llvm-project/commit/95bb95ebe44882854aeb47f8b3a6a38e775d8232
DIFF: https://github.com/llvm/llvm-project/commit/95bb95ebe44882854aeb47f8b3a6a38e775d8232.diff

LOG: [LLD][ELF] Fix compressed-debug-level test on SystemZ

The libz compression library on SystemZ by default makes use of the
platform's hardware-accelerated compression facility. This is much
faster than the regular software implementation, but often results in
slightly different outputs. This causes failures with the
compressed-debug-level test case.

To fix this, set the DFLTCC environment variable to zero while running
tests on SystemZ, which prevents use of hardware compression and falls
back to the software implementation.

Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D149273

Added: 
    

Modified: 
    lld/test/ELF/lit.local.cfg
    lld/test/lit.site.cfg.py.in

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/lit.local.cfg b/lld/test/ELF/lit.local.cfg
index 98c97b66afba5..ad2cf48e40f0a 100644
--- a/lld/test/ELF/lit.local.cfg
+++ b/lld/test/ELF/lit.local.cfg
@@ -1 +1,8 @@
 config.suffixes = ['.test', '.s', '.ll', '.bat']
+
+# The environment variable DFLTCC=0 disables use of the hardware compression
+# facility on SystemZ.  When this facility is enabled, slightly 
diff erent
+# compression results can be seen, which can cause spurious failures in the
+# compressed-debug-level.test test case.
+if 's390x' in config.host_triple:
+    config.environment['DFLTCC'] = '0'

diff  --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index e0998ab87d470..c324b53021a17 100644
--- a/lld/test/lit.site.cfg.py.in
+++ b/lld/test/lit.site.cfg.py.in
@@ -15,6 +15,7 @@ config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
 config.lld_obj_root = "@LLD_BINARY_DIR@"
 config.lld_libs_dir = lit_config.substitute("@CURRENT_LIBS_DIR@")
 config.lld_tools_dir = lit_config.substitute("@CURRENT_TOOLS_DIR@")
+config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.python_executable = "@Python3_EXECUTABLE@"
 config.have_zlib = @LLVM_ENABLE_ZLIB@


        


More information about the llvm-commits mailing list