Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / linux / aarch64 / mte_memory_region / TestAArch64LinuxMTEMemoryRegion.py
blobefc47349005518f8fd9e04a769faa1a337d53cdc
1 """
2 Test that "memory region" command can show memory tagged regions
3 on AArch64 Linux.
4 """
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class AArch64LinuxMTEMemoryRegionTestCase(TestBase):
14 NO_DEBUG_INFO_TESTCASE = True
16 @skipUnlessArch("aarch64")
17 @skipUnlessPlatform(["linux"])
18 @skipUnlessAArch64MTELinuxCompiler
19 def test_mte_regions(self):
20 if not self.isAArch64MTE():
21 self.skipTest("Target must support MTE.")
23 # This test assumes that we have /proc/<PID>/smaps files
24 # that include "VmFlags:" lines.
25 # AArch64 kernel config defaults to enabling smaps with
26 # PROC_PAGE_MONITOR and "VmFlags" was added in kernel 3.8,
27 # before MTE was supported at all.
29 self.build()
30 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
32 lldbutil.run_break_set_by_file_and_line(
33 self,
34 "main.c",
35 line_number("main.c", "// Set break point at this line."),
36 num_expected_locations=1,
39 self.runCmd("run", RUN_SUCCEEDED)
41 if self.process().GetState() == lldb.eStateExited:
42 self.fail("Test program failed to run.")
44 self.expect(
45 "thread list",
46 STOPPED_DUE_TO_BREAKPOINT,
47 substrs=["stopped", "stop reason = breakpoint"],
50 substrs = ["memory tagging: enabled"]
51 # The new page will be tagged
52 self.expect("memory region the_page", substrs=substrs)
53 # Code page will not be
54 self.expect("memory region main", substrs=substrs, matching=False)