File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ inst/bin/*
8989* _ldd.txt
9090* _lines.dat.txt
9191* __tmp__generated__.c
92+ a.c
93+ a.h
94+ a.py
9295
9396# ## https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore
9497
Original file line number Diff line number Diff line change @@ -534,3 +534,6 @@ RUN(NAME callback_01 LABELS cpython llvm)
534534RUN(NAME intrinsics_01 LABELS cpython llvm) # any
535535
536536COMPILE(NAME import_order_01 LABELS cpython llvm c) # any
537+
538+ # Jit
539+ RUN(NAME test_jit_01 LABELS cpython)
Original file line number Diff line number Diff line change 1+ from numpy import array
2+ from lpython import i32 , f64 , jit
3+
4+ @jit
5+ def fast_sum (n : i32 , x : f64 [:]) -> f64 :
6+ s : f64 = 0.0
7+ i : i32
8+ for i in range (n ):
9+ s += x [i ]
10+ return s
11+
12+ def test ():
13+ x : f64 [3 ] = array ([1.0 , 2.0 , 3.0 ])
14+ assert fast_sum (3 , x ) == 6.0
15+
16+ test ()
You can’t perform that action at this time.
0 commit comments