blob: 2a73dc5357fe785096e0b9995f6ba44da9c99e7e (
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
30
31
32
33
34
35
36
|
"""
Test LLDB type promotion of unscoped enums.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCPPEnumPromotion(TestBase):
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "// break here", lldb.SBFileSpec("main.cpp")
)
UChar_promoted = self.frame().FindVariable("UChar_promoted")
UShort_promoted = self.frame().FindVariable("UShort_promoted")
UInt_promoted = self.frame().FindVariable("UInt_promoted")
SLong_promoted = self.frame().FindVariable("SLong_promoted")
ULong_promoted = self.frame().FindVariable("ULong_promoted")
NChar_promoted = self.frame().FindVariable("NChar_promoted")
NShort_promoted = self.frame().FindVariable("NShort_promoted")
NInt_promoted = self.frame().FindVariable("NInt_promoted")
NLong_promoted = self.frame().FindVariable("NLong_promoted")
# Check that LLDB's promoted type is the same as the compiler's
self.expect_expr("+EnumUChar::UChar", result_type=UChar_promoted.type.name)
self.expect_expr("+EnumUShort::UShort", result_type=UShort_promoted.type.name)
self.expect_expr("+EnumUInt::UInt", result_type=UInt_promoted.type.name)
self.expect_expr("+EnumSLong::SLong", result_type=SLong_promoted.type.name)
self.expect_expr("+EnumULong::ULong", result_type=ULong_promoted.type.name)
self.expect_expr("+EnumNChar::NChar", result_type=NChar_promoted.type.name)
self.expect_expr("+EnumNShort::NShort", result_type=NShort_promoted.type.name)
self.expect_expr("+EnumNInt::NInt", result_type=NInt_promoted.type.name)
self.expect_expr("+EnumNLong::NLong", result_type=NLong_promoted.type.name)
|