summaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/cpp/struct_with_keyword_name/TestStructWithKeywordName.py
blob: dcb0618711ba20f7e9bafd8d472fb52c26e13960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestCase(TestBase):
    @no_debug_info_test
    def test(self):
        self.build()
        lldbutil.run_to_source_breakpoint(
            self, "// break here", lldb.SBFileSpec("main.c")
        )

        # First run this in C which should work.
        self.expect_expr("constexpr.class", result_type="int", result_value="3")

        # Now try running this in a language that explicitly enables C++.
        # This isn't expected to work, but at least it shouldn't crash LLDB.
        self.expect(
            "expr -l c++ -- constexpr.class",
            error=True,
            substrs=["expected unqualified-id"],
        )
        self.expect(
            "expr -l objective-c++ -- constexpr.class",
            error=True,
            substrs=["expected unqualified-id"],
        )