1"""
2Tests const static data members as specified by C++11 [class.static.data]p3
3with (u)int128_t types.
4"""
5
6import lldb
7from lldbsuite.test.decorators import *
8from lldbsuite.test.lldbtest import *
9from lldbsuite.test import lldbutil
10
11class TestCase(TestBase):
12
13    # int128 is not available on 32-bit ARM.
14    @skipIf(archs=["arm"])
15    def test_int128(self):
16        self.build()
17        lldbutil.run_to_source_breakpoint(self, "// break here",
18                                          lldb.SBFileSpec("main.cpp"))
19
20        # Try to use the (u)int128_t data members which are not supported at
21        # the moment. Just verify that LLDB doesn't report an incorrect value
22        # for them and just treats them as normal variables (which will lead
23        # to linker errors as they are not defined anywhere).
24        self.expect("expr A::int128_max", error=True,
25                    substrs=["Couldn't lookup symbols:"])
26        self.expect("expr A::uint128_max", error=True,
27                    substrs=["Couldn't lookup symbols:"])
28        self.expect("expr A::int128_min", error=True,
29                    substrs=["Couldn't lookup symbols:"])
30        self.expect("expr A::uint128_min", error=True,
31                    substrs=["Couldn't lookup symbols:"])
32