We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aea2a6f commit d7b4db0Copy full SHA for d7b4db0
integration_tests/CMakeLists.txt
@@ -423,6 +423,7 @@ RUN(NAME expr_16 LABELS cpython c)
423
RUN(NAME expr_17 LABELS cpython llvm c)
424
RUN(NAME expr_18 FAIL LABELS cpython llvm c)
425
RUN(NAME expr_19 LABELS cpython llvm c)
426
+RUN(NAME expr_20 LABELS cpython llvm c)
427
428
RUN(NAME expr_01u LABELS cpython llvm c NOFAST)
429
RUN(NAME expr_02u LABELS cpython llvm c NOFAST)
integration_tests/expr_20.py
@@ -0,0 +1,16 @@
1
+from lpython import i16, i32
2
+
3
+def f():
4
+ i: i32 = 5
5
+ print(i16(i % 1023))
6
7
+def u16(x: i16) -> i32:
8
+ if x >= i16(0):
9
+ return i32(x)
10
+ else:
11
+ return i32(x) + 65536
12
13
+f()
14
+print(u16(i16(10)), u16(i16(-10)))
15
+assert(u16(i16(10)) == 10)
16
+assert(u16(i16(-10)) == 65526)
0 commit comments