Skip to content

Commit b21e95a

Browse files
committed
Add long<longlong test
1 parent ec37b0e commit b21e95a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lldb/test/API/commands/frame/var-dil/expr/Literals/TestFrameVarDILLiterals.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def test_literals(self):
6262
],
6363
)
6464

65-
# These check only apply if `int` and `long` have different sizes
65+
# These check only apply if adjacent types have different sizes
6666
if int_size < long_size:
67-
# 0xFFFFFFFF and 4294967295 will have different types even though
68-
# the numeric value is the same
67+
# For exmaple, 0xFFFFFFFF and 4294967295 will have different types
68+
# even though the numeric value is the same
6969
hex_str = "0x" + "F" * int_size * 2
7070
dec_str = str(int(hex_str, 16))
7171
self.assert_literal_type(frame, hex_str, lldb.eBasicTypeUnsignedInt)
@@ -74,6 +74,17 @@ def test_literals(self):
7474
ulong_str = long_str + "u"
7575
self.assert_literal_type(frame, long_str, lldb.eBasicTypeLong)
7676
self.assert_literal_type(frame, ulong_str, lldb.eBasicTypeUnsignedLong)
77+
if long_size < longlong_size:
78+
hex_str = "0x" + "F" * long_size * 2
79+
dec_str = str(int(hex_str, 16))
80+
self.assert_literal_type(frame, hex_str, lldb.eBasicTypeUnsignedLong)
81+
self.assert_literal_type(frame, dec_str, lldb.eBasicTypeLongLong)
82+
longlong_str = "0x" + "F" * long_size * 2 + "F"
83+
ulonglong_str = longlong_str + "u"
84+
self.assert_literal_type(frame, longlong_str, lldb.eBasicTypeLongLong)
85+
self.assert_literal_type(
86+
frame, ulonglong_str, lldb.eBasicTypeUnsignedLongLong
87+
)
7788

7889
def assert_literal_type(self, frame, literal, expected_type):
7990
value = frame.GetValueForVariablePath(literal)

0 commit comments

Comments
 (0)