Skip to content

Commit a9c5ee0

Browse files
Register a test
1 parent fbbe016 commit a9c5ee0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,5 +619,6 @@ RUN(NAME intrinsics_01 LABELS cpython llvm NOFAST) # any
619619

620620
# lpython decorator
621621
RUN(NAME lpython_decorator_01 LABELS cpython)
622+
RUN(NAME lpython_decorator_02 LABELS cpython)
622623

623624
COMPILE(NAME import_order_01 LABELS cpython llvm c) # any
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
from numpy import array
2-
from lpython import i32, f64, lpython
2+
from lpython import i32, f64, lpython, TypeVar
3+
4+
n = TypeVar("n")
35

46
@lpython
5-
def multiply(n: i32, x: f64[:]) -> f64[:]:
7+
def multiply(n: i32, x: f64[:]) -> f64[n]:
68
i: i32
79
for i in range(n):
810
x[i] *= 5.0
911
return x
1012

1113
def test():
12-
x: f64[3] = array([11.0, 12.0, 13.0, 14., 15.])
13-
print(multiply(5, x))
14+
size: i32 = 5
15+
x: f64[5] = array([11.0, 12.0, 13.0, 14.0, 15.0])
16+
y: f64[5] = (multiply(size, x))
17+
assert y[2] == 65.
1418

1519
test()

0 commit comments

Comments
 (0)