1"""
2Tests that auto types work
3"""
4import lldb
5from lldbsuite.test.decorators import *
6from lldbsuite.test.lldbtest import *
7from lldbsuite.test import lldbutil
8
9
10class CPPAutoTestCase(TestBase):
11
12    mydir = TestBase.compute_mydir(__file__)
13
14    @expectedFailureAll(
15        compiler="gcc",
16        bugnumber="GCC generates incomplete debug info")
17    @expectedFailureNetBSD
18    def test_with_run_command(self):
19        """Test that auto types work in the expression parser"""
20        self.build()
21        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp"))
22
23        self.expect_expr('auto f = 123456; f', result_type='int', result_value='123456')
24        self.expect(
25            'expr struct Test { int x; int y; Test() : x(123), y(456) {} }; auto t = Test(); t',
26            substrs=[
27                'Test',
28                '123',
29                '456'])
30        self.expect_expr("auto s = foo; s", result_type="long", result_value="1234")
31