2 Test calling std::String member functions.
5 from __future__ import print_function
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
14 class ExprCommandCallFunctionTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 # Call super's setUp().
21 # Find the line number to break for main.c.
22 self.line = line_number(
24 '// Please test these expressions while stopped at this line:')
28 bugnumber="llvm.org/pr14437, fails with ICC 13.1")
29 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
31 """Test calling std::String member function."""
33 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
35 # Some versions of GCC encode two locations for the 'return' statement
37 lldbutil.run_break_set_by_file_and_line(
38 self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
40 self.runCmd("run", RUN_SUCCEEDED)
42 self.expect("print str",
43 substrs=['Hello world'])
45 # Calling this function now succeeds, but we follow the typedef return type through to
46 # const char *, and thus don't invoke the Summary formatter.
48 # clang's libstdc++ on ios arm64 inlines std::string::c_str() always;
49 # skip this part of the test.
50 triple = self.dbg.GetSelectedPlatform().GetTriple()
52 if triple == "arm64-apple-ios" or triple == "arm64-apple-tvos" or triple == "armv7k-apple-watchos" or triple == "arm64-apple-bridgeos":
55 self.expect("print str.c_str()",
56 substrs=['Hello world'])