[Lldb-commits] [lldb] 64f98aa - [lldb] Fix memory tag unsupported test

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 25 01:57:29 PDT 2021


Author: David Spickett
Date: 2021-06-25T08:57:05Z
New Revision: 64f98aae40894cb0b281723c7f91e73705f551ce

URL: https://github.com/llvm/llvm-project/commit/64f98aae40894cb0b281723c7f91e73705f551ce
DIFF: https://github.com/llvm/llvm-project/commit/64f98aae40894cb0b281723c7f91e73705f551ce.diff

LOG: [lldb] Fix memory tag unsupported test

This corrects the test added in
31f9960c38529ce805edf9764535eb0ce188cadf
and temporarily patched in
3b4aad1186e8e8e6f6c7887cb5e8d9bfd7d3ce2f.

This test checks that the memory tag read
command errors when you use it on a platform
without memory tagging.
(which is why we skip the test if you actually
have MTE)

The problem with this test is that there's
two levels of unsupported each with it's own
specific error.

On anything that isn't AArch64, there's no
tagging extension we support. So you're told
that that is the case. As in "this won't ever work".

When you're on AArch64 we know that MTE could
be present on the remote and when we find that it
isn't, we tell you that instead.

Expect a different error message on AArch64 to fix
the test.

Added: 
    

Modified: 
    lldb/test/API/functionalities/memory/tag/TestMemoryTag.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py b/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
index 04bc4cc4b6a65..d2827239caf4a 100644
--- a/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
+++ b/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
@@ -18,7 +18,7 @@ class MemoryTagTestCase(TestBase):
 
     def test_memory_tag_read_unsupported(self):
         """Test that "memory tag read" errors on unsupported platforms"""
-        if not self.isAArch64MTE():
+        if self.isAArch64MTE():
             self.skipTest("Requires a target without AArch64 MTE.")
 
         self.build()
@@ -30,6 +30,12 @@ def test_memory_tag_read_unsupported(self):
                                         num_expected_locations=1)
         self.runCmd("run", RUN_SUCCEEDED)
 
-        self.expect("memory tag read 0 1",
-                    substrs=["error: This architecture does not support memory tagging"],
-                    error=True)
+        # 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 
diff erent.
+        if self.getArchitecture() == "aarch64":
+            expected = "error: Process does not support memory tagging"
+        else:
+            expected = "error: This architecture does not support memory tagging"
+
+        self.expect("memory tag read 0 1", substrs=[expected], error=True)


        


More information about the lldb-commits mailing list