From: Ulrich Weigand Date: Fri, 5 May 2023 11:57:59 +0000 (+0200) Subject: [LLD][ELF] Fix compressed-debug-level test on SystemZ X-Git-Tag: upstream/17.0.6~9377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95bb95ebe44882854aeb47f8b3a6a38e775d8232;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/lld/test/ELF/lit.local.cfg b/lld/test/ELF/lit.local.cfg index 98c97b6..ad2cf48 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 different +# 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 e0998ab..c324b53 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@