[LLD][ELF] Fix compressed-debug-level test on SystemZ
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 5 May 2023 11:57:59 +0000 (13:57 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 5 May 2023 11:57:59 +0000 (13:57 +0200)
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

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

index 98c97b6..ad2cf48 100644 (file)
@@ -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'
index e0998ab..c324b53 100644 (file)
@@ -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@