diff --git a/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py b/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py index 04bc4cc4b6a65c..d2827239caf4af 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 different. + 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)