Skip to content

Commit b26d942

Browse files
committed
TEST: Add for const step in loop
1 parent 324bd3b commit b26d942

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ RUN(NAME loop_04 LABELS cpython llvm c)
509509
RUN(NAME loop_05 LABELS cpython llvm c)
510510
RUN(NAME loop_06 LABELS cpython llvm c NOFAST)
511511
RUN(NAME loop_07 LABELS cpython llvm c)
512+
RUN(NAME loop_08 LABELS cpython llvm c)
512513
RUN(NAME if_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
513514
RUN(NAME if_02 LABELS cpython llvm c wasm wasm_x86 wasm_x64)
514515
RUN(NAME if_03 FAIL LABELS cpython llvm c NOFAST)

integration_tests/loop_08.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from lpython import i32, Const
2+
3+
def main0():
4+
i: i32
5+
n: Const[i32] = 10
6+
M2: Const[i32] = 2
7+
y: i32 = 0
8+
for i in range(0, n, M2): # each M2 block in A cols and B rows # !!!!!!!!!!!!!!
9+
y = y + 2
10+
print(y)
11+
assert(y == 10)
12+
13+
main0()

0 commit comments

Comments
 (0)