1"""
2Tests C99's flexible array members.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test import lldbutil
9
10class TestCase(TestBase):
11
12    @no_debug_info_test
13    def test(self):
14        self.build()
15        lldbutil.run_to_source_breakpoint(self, "// break here",
16                lldb.SBFileSpec("main.c"))
17
18        self.expect_var_path("c->flexible", type="char[]", summary='"contents"')
19        # self.expect_var_path("sc->flexible", type="signed char[]", summary='"contents"')
20        self.expect_var_path("uc->flexible", type="unsigned char[]", summary='"contents"')
21        # TODO: Make this work
22        self.expect("expr c->flexible", error=True,
23                substrs=["incomplete", "char[]"])
24        self.expect("expr sc->flexible", error=True,
25                substrs=["incomplete", "signed char[]"])
26        self.expect("expr uc->flexible", error=True,
27                substrs=["incomplete", "unsigned char[]"])
28