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
11
12class TestCase(TestBase):
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(
18            self, "// break here", lldb.SBFileSpec("main.cpp")
19        )
20
21        # Try to use the (u)int128_t data members which are not supported at
22        # the moment. Just verify that LLDB doesn't report an incorrect value
23        # for them and just treats them as normal variables (which will lead
24        # to linker errors as they are not defined anywhere).
25        self.expect(
26            "expr A::int128_max", error=True, substrs=["Couldn't look up symbols:"]
27        )
28        self.expect(
29            "expr A::uint128_max", error=True, substrs=["Couldn't look up symbols:"]
30        )
31        self.expect(
32            "expr A::int128_min", error=True, substrs=["Couldn't look up symbols:"]
33        )
34        self.expect(
35            "expr A::uint128_min", error=True, substrs=["Couldn't look up symbols:"]
36        )
37