[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / linux / builtin_trap / TestBuiltinTrap.py
blob22de873e29faded07ace710a4f162ed24e350f68
1 """
2 Test lldb ability to unwind a stack with a function containing a call to the
3 '__builtin_trap' intrinsic, which GCC (4.6) encodes to an illegal opcode.
4 """
8 import lldb
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
14 class BuiltinTrapTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
18 def setUp(self):
19 # Call super's setUp().
20 TestBase.setUp(self)
21 # Find the line number to break at.
22 self.line = line_number('main.cpp', '// Set break point at this line.')
24 # gcc generates incorrect linetable
25 @expectedFailureAll(archs="arm", compiler="gcc", triple=".*-android")
26 @expectedFailureAll(oslist=['linux'], archs=['arm', 'aarch64'])
27 @skipIfWindows
28 def test_with_run_command(self):
29 """Test that LLDB handles a function with __builtin_trap correctly."""
30 self.build()
31 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
33 lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line,
34 num_expected_locations=1,
35 loc_exact=True)
37 self.runCmd("run", RUN_SUCCEEDED)
39 # The stop reason of the thread should be breakpoint.
40 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
41 substrs=['stopped',
42 'stop reason = breakpoint'])
44 # print backtrace, expect both 'bar' and 'main' functions to be listed
45 self.expect('bt', substrs=['bar', 'main'])
47 # go up one frame
48 self.runCmd("up", RUN_SUCCEEDED)
50 # evaluate a local
51 self.expect('p foo', substrs=['= 5'])