Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / frame-var-anon-unions / TestFrameVariableAnonymousUnions.py
blob35c4f05d0edb2ac91ae25379f3fbefe5d9e974ab
1 """
2 Tests that frame variable looks into anonymous unions
3 """
4 import lldb
5 from lldbsuite.test.lldbtest import *
6 import lldbsuite.test.lldbutil as lldbutil
9 class FrameVariableAnonymousUnionsTestCase(TestBase):
10 def test_with_run_command(self):
11 """Tests that frame variable looks into anonymous unions"""
12 self.build()
13 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
15 line = line_number("main.cpp", "// break here")
16 lldbutil.run_break_set_by_file_and_line(
17 self, "main.cpp", line, num_expected_locations=-1, loc_exact=False
20 self.runCmd("process launch", RUN_SUCCEEDED)
22 process = self.dbg.GetSelectedTarget().GetProcess()
24 if process.GetByteOrder() == lldb.eByteOrderLittle:
25 self.expect("frame variable -f x i", substrs=["ffffff41"])
26 else:
27 self.expect("frame variable -f x i", substrs=["41ffff00"])
29 self.expect("frame variable c", substrs=["'A"])