[X86] Use NSW/NUW flags on ISD::TRUNCATE nodes to improve X86 PACKSS/PACKUS lowering...
[llvm-project.git] / lldb / test / API / lang / objc / real-definition / TestRealDefinition.py
blob6cbb9ddec264d9b5523a2c7aadff1e1ba3130ed7
1 """Test that types defined in shared libraries work correctly."""
4 import lldb
5 from lldbsuite.test.decorators import *
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test import lldbutil
10 class TestRealDefinition(TestBase):
11 def test_frame_var_after_stop_at_interface(self):
12 """Test that we can find the implementation for an objective C type"""
13 if self.getArchitecture() == "i386":
14 self.skipTest("requires modern objc runtime")
15 self.build()
17 lldbutil.run_to_source_breakpoint(
18 self,
19 "// Set breakpoint where Bar is an interface",
20 lldb.SBFileSpec("Foo.m", False),
23 # Break inside the foo function which takes a bar_ptr argument.
24 self.expect('breakpoint set -p "// Set breakpoint in main"')
25 self.runCmd("continue", RUN_SUCCEEDED)
27 # Run at stop at main
28 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
30 self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
32 # This should display correctly.
33 self.expect(
34 "frame variable foo->_bar->_hidden_ivar",
35 VARIABLES_DISPLAYED_CORRECTLY,
36 substrs=["(NSString *)", "foo->_bar->_hidden_ivar = 0x"],
39 def test_frame_var_after_stop_at_implementation(self):
40 """Test that we can find the implementation for an objective C type"""
41 if self.getArchitecture() == "i386":
42 self.skipTest("requires modern objc runtime")
43 self.build()
45 lldbutil.run_to_source_breakpoint(
46 self,
47 "// Set breakpoint where Bar is an implementation",
48 lldb.SBFileSpec("Bar.m", False),
51 self.expect('breakpoint set -p "// Set breakpoint in main"')
52 self.runCmd("continue", RUN_SUCCEEDED)
54 # Run at stop at main
55 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
57 self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
59 # This should display correctly.
60 self.expect(
61 "frame variable foo->_bar->_hidden_ivar",
62 VARIABLES_DISPLAYED_CORRECTLY,
63 substrs=["(NSString *)", "foo->_bar->_hidden_ivar = 0x"],