brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 2a73dc5 Raw
37 lines · python
1"""2Test LLDB type promotion of unscoped enums.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test import lldbutil9 10 11class TestCPPEnumPromotion(TestBase):12    def test(self):13        self.build()14        lldbutil.run_to_source_breakpoint(15            self, "// break here", lldb.SBFileSpec("main.cpp")16        )17        UChar_promoted = self.frame().FindVariable("UChar_promoted")18        UShort_promoted = self.frame().FindVariable("UShort_promoted")19        UInt_promoted = self.frame().FindVariable("UInt_promoted")20        SLong_promoted = self.frame().FindVariable("SLong_promoted")21        ULong_promoted = self.frame().FindVariable("ULong_promoted")22        NChar_promoted = self.frame().FindVariable("NChar_promoted")23        NShort_promoted = self.frame().FindVariable("NShort_promoted")24        NInt_promoted = self.frame().FindVariable("NInt_promoted")25        NLong_promoted = self.frame().FindVariable("NLong_promoted")26 27        # Check that LLDB's promoted type is the same as the compiler's28        self.expect_expr("+EnumUChar::UChar", result_type=UChar_promoted.type.name)29        self.expect_expr("+EnumUShort::UShort", result_type=UShort_promoted.type.name)30        self.expect_expr("+EnumUInt::UInt", result_type=UInt_promoted.type.name)31        self.expect_expr("+EnumSLong::SLong", result_type=SLong_promoted.type.name)32        self.expect_expr("+EnumULong::ULong", result_type=ULong_promoted.type.name)33        self.expect_expr("+EnumNChar::NChar", result_type=NChar_promoted.type.name)34        self.expect_expr("+EnumNShort::NShort", result_type=NShort_promoted.type.name)35        self.expect_expr("+EnumNInt::NInt", result_type=NInt_promoted.type.name)36        self.expect_expr("+EnumNLong::NLong", result_type=NLong_promoted.type.name)37