[Lldb-commits] [PATCH] D105483: [LLDB] Testsuite: Add helper to check for AArch64 target

Muhammad Omair Javaid via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 12 02:22:37 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG10f5e08a7124: [LLDB] Testsuite: Add helper to check for AArch64 target (authored by omjavaid).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105483/new/

https://reviews.llvm.org/D105483

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
  lldb/test/API/functionalities/return-value/TestReturnValue.py
  lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py


Index: lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
===================================================================
--- lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
+++ lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
@@ -64,7 +64,7 @@
             self.assertEqual(q_info_reg["format"], xml_info_reg.get("format"))
             self.assertEqual(q_info_reg["bitsize"], xml_info_reg.get("bitsize"))
 
-            if not self.getArchitecture() == 'aarch64':
+            if not self.isAArch64():
                 self.assertEqual(q_info_reg["offset"], xml_info_reg.get("offset"))
 
             self.assertEqual(q_info_reg["encoding"], xml_info_reg.get("encoding"))
Index: lldb/test/API/functionalities/return-value/TestReturnValue.py
===================================================================
--- lldb/test/API/functionalities/return-value/TestReturnValue.py
+++ lldb/test/API/functionalities/return-value/TestReturnValue.py
@@ -15,8 +15,8 @@
     mydir = TestBase.compute_mydir(__file__)
 
     def affected_by_pr33042(self):
-        return ("clang" in self.getCompiler() and self.getArchitecture() ==
-            "aarch64" and self.getPlatform() == "linux")
+        return ("clang" in self.getCompiler() and self.isAArch64() and
+            self.getPlatform() == "linux")
 
     def affected_by_pr44132(self):
         return (self.getArchitecture() in ["aarch64", "arm"] and
Index: lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
===================================================================
--- lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
+++ lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
@@ -33,7 +33,7 @@
         # If you're on AArch64 you could have MTE but the remote process
         # must also support it. If you're on any other arhcitecture you
         # won't have any tagging at all. So the error message is different.
-        if self.getArchitecture() == "aarch64":
+        if self.isAArch64():
             expected = "error: Process does not support memory tagging"
         else:
             expected = "error: This architecture does not support memory tagging"
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1291,14 +1291,18 @@
 
         return cpuinfo
 
+    def isAArch64(self):
+        """Returns true if the architecture is AArch64."""
+        return self.getArchitecture().lower() == "aarch64"
+
     def isAArch64SVE(self):
-        return "sve" in self.getCPUInfo()
+        return self.isAArch64() and "sve" in self.getCPUInfo()
 
     def isAArch64MTE(self):
-        return "mte" in self.getCPUInfo()
+        return self.isAArch64() and "mte" in self.getCPUInfo()
 
     def isAArch64PAuth(self):
-        return "paca" in self.getCPUInfo()
+        return self.isAArch64() and "paca" in self.getCPUInfo()
 
     def getArchitecture(self):
         """Returns the architecture in effect the test suite is running with."""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105483.357869.patch
Type: text/x-patch
Size: 3243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210712/58b72a79/attachment-0001.bin>


More information about the lldb-commits mailing list