[PATCH] D113165: [LIT] Add win32 PLATFORM env var to test config

Muhammad Omair Javaid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 20:13:23 PDT 2021


omjavaid created this revision.
omjavaid added reviewers: zturner, mstorsjo.
Herald added subscribers: pengfei, delcypher, kristof.beyls.
omjavaid requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

LIT skips various system environment variables while building test
config. It turns out that we require PLATFORM environment variable for
detection of x86 vs Arm windows platform.

      

This patch adds system environment variable PLATFORM into LIT test 
config for detection of win32 Arm platform.


https://reviews.llvm.org/D113165

Files:
  lldb/test/Shell/helper/build.py
  llvm/utils/lit/lit/llvm/config.py


Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -38,7 +38,7 @@
             # Many tools behave strangely if these environment variables aren't
             # set.
             self.with_system_environment(
-                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP'])
+                ['SystemDrive', 'SystemRoot', 'TEMP', 'TMP', 'PLATFORM'])
             self.use_lit_shell = True
 
             global lit_path_displayed
Index: lldb/test/Shell/helper/build.py
===================================================================
--- lldb/test/Shell/helper/build.py
+++ lldb/test/Shell/helper/build.py
@@ -277,7 +277,10 @@
     def __init__(self, toolchain_type, args):
         Builder.__init__(self, toolchain_type, args, '.obj')
 
-        self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
+        if os.getenv('PLATFORM') == 'arm64':
+            self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64'
+        else:
+            self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'
 
         if toolchain_type == 'msvc':
             # Make sure we're using the appropriate toolchain for the desired


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113165.384643.patch
Type: text/x-patch
Size: 1270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/08baa164/attachment.bin>


More information about the llvm-commits mailing list