1"""
2Test that target var can resolve complex DWARF expressions.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10
11class targetCommandTestCase(TestBase):
12
13    @skipUnlessDarwin
14    @skipIfDarwinEmbedded           # needs x86_64
15    @skipIf(debug_info="gmodules")  # not relevant
16    @skipIf(compiler="clang", compiler_version=['<', '7.0'])
17    def testTargetVarExpr(self):
18        self.build()
19        lldbutil.run_to_name_breakpoint(self, 'main')
20        self.expect("target variable i", substrs=['i', '42'])
21        self.expect("target variable var", patterns=['\(incomplete \*\) var = 0[xX](0)*dead'])
22        self.expect("target variable var[0]", error=True, substrs=["can't find global variable 'var[0]'"])
23