Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / auto / TestCPPAuto.py
blob915e2197f9f5994a0982bf1d16ab5616da891029
1 """
2 Tests that auto types work
3 """
4 import lldb
5 from lldbsuite.test.decorators import *
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test import lldbutil
10 class CPPAutoTestCase(TestBase):
11 def test_with_run_command(self):
12 """Test that auto types work in the expression parser"""
13 self.build()
14 lldbutil.run_to_source_breakpoint(
15 self, "// break here", lldb.SBFileSpec("main.cpp")
18 self.expect_expr("auto f = 123456; f", result_type="int", result_value="123456")
19 self.expect(
20 "expr struct Test { int x; int y; Test() : x(123), y(456) {} }; auto t = Test(); t",
21 substrs=["Test", "123", "456"],
23 self.expect_expr("auto s = foo; s", result_type="long", result_value="1234")