Skip to content

Commit 19e2aef

Browse files
committed
TEST: Add test for case UnsignedIntegerToUnsignedInteger
1 parent b2f7999 commit 19e2aef

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ RUN(NAME vec_01 LABELS cpython llvm c NOFAST)
632632
RUN(NAME test_str_comparison LABELS cpython llvm c)
633633
RUN(NAME test_bit_length LABELS cpython llvm c)
634634
RUN(NAME str_to_list_cast LABELS cpython llvm c)
635+
RUN(NAME cast_01 LABELS cpython llvm c)
635636
RUN(NAME test_sys_01 LABELS cpython llvm c NOFAST)
636637
RUN(NAME intent_01 LABELS cpython llvm)
637638

integration_tests/cast_01.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from lpython import i32, u8, u32, dataclass
2+
from numpy import empty, uint8
3+
4+
@dataclass
5+
class LPBHV_small:
6+
dim : i32 = 4
7+
a : u8[4] = empty(4, dtype=uint8)
8+
9+
def main0():
10+
lphv_small : LPBHV_small = LPBHV_small()
11+
i: i32
12+
for i in range(4):
13+
lphv_small.a[i] = u8(10 + i)
14+
elt: u32 = u32(lphv_small.a[i])
15+
print(elt)
16+
assert elt == u32(10 + i)
17+
18+
main0()

0 commit comments

Comments
 (0)