[Lldb-commits] [lldb] 09ca3f4 - [lldb] Update TestSimulatorPlatform.py to set ARCH_CFLAGS instead of TRIPLE

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 19 15:42:51 PDT 2020


Author: Jonas Devlieghere
Date: 2020-08-19T15:42:44-07:00
New Revision: 09ca3f41bbc5c2c4480accd6404f61bd9e5172a5

URL: https://github.com/llvm/llvm-project/commit/09ca3f41bbc5c2c4480accd6404f61bd9e5172a5
DIFF: https://github.com/llvm/llvm-project/commit/09ca3f41bbc5c2c4480accd6404f61bd9e5172a5.diff

LOG: [lldb] Update TestSimulatorPlatform.py to set ARCH_CFLAGS instead of TRIPLE

I move the triple (de)composition logic into the builder in e5d08fcbac72
but this test is relying on Make to construct the set the ARCH,
ARCH_CFLAGS and SDKROOT based on the given TRIPLE. This patch updates
the test to pass these variables directly.

Differential revision: https://reviews.llvm.org/D86244

Added: 
    

Modified: 
    lldb/test/API/macosx/simulator/TestSimulatorPlatform.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
index 4c3a86531c8f..7be192491251 100644
--- a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
+++ b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
@@ -20,7 +20,7 @@ def check_load_commands(self, expected_load_command):
         found = 0
         for line in load_cmds.split('\n'):
             if expected_load_command in line:
-              found += 1
+                found += 1
         self.assertEquals(
             found, 1, "wrong number of load commands for {}".format(
                 expected_load_command))
@@ -46,7 +46,24 @@ def check_debugserver(self, log, expected_platform, expected_version):
     def run_with(self, arch, os, vers, env, expected_load_command):
         env_list = [env] if env else []
         triple = '-'.join([arch, 'apple', os + vers] + env_list)
-        self.build(dictionary={'TRIPLE': triple})
+
+        version_min = ''
+        if vers:
+            if env == 'simulator':
+                version_min = '-m{}-simulator-version-min={}'.format(os, vers)
+            elif os == 'macosx':
+                version_min = '-m{}-version-min={}'.format(os, vers)
+
+        sdk = lldbutil.get_xcode_sdk(os, env)
+        sdk_root = lldbutil.get_xcode_sdk_root(sdk)
+
+        self.build(
+            dictionary={
+                'ARCH': arch,
+                'ARCH_CFLAGS': '-target {} {}'.format(triple, version_min),
+                'SDKROOT': sdk_root
+            })
+
         self.check_load_commands(expected_load_command)
         log = self.getBuildArtifact('packets.log')
         self.expect("log enable gdb-remote packets -f "+log)


        


More information about the lldb-commits mailing list