Skip to content

Commit 03f6ca9

Browse files
committed
done
1 parent bf16a3d commit 03f6ca9

File tree

584 files changed

+23140
-8092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

584 files changed

+23140
-8092
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ extsrc/
187187
tmp/
188188
tmpdebug/
189189
gentests/
190+
inst/
190191

191192
## Ninja
192193
build.ninja

build0.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
1313
python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
1414
# Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++)
1515
python src/libasr/wasm_instructions_visitor.py
16+
# Generate the intrinsic_function_registry_util.h (C++)
17+
python src/libasr/intrinsic_func_registry_util_gen.py
1618

1719
# Generate the tokenizer and parser
1820
(cd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp)

integration_tests/symbolics_11.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def test_extraction_of_elements():
1616
print(ele1, ele2, ele3, ele4)
1717
print(l1[0], l1[1], l1[2], l1[3])
1818

19-
test_extraction_of_elements()
19+
test_extraction_of_elements()

integration_tests/test_c_interop_01.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ def _lfortran_dsin(x: f64) -> f64:
99
def _lfortran_ssin(x: f32) -> f32:
1010
pass
1111

12-
@ccall
13-
def _lfortran_bgt32(i: i32, j: i32) -> i32:
14-
pass
15-
16-
@ccall
17-
def _lfortran_bgt64(i: i64, j: i64) -> i32:
18-
pass
19-
2012
#@ccall
2113
#def _lfortran_random_number(n: i64, v: f64[:]):
2214
# pass
@@ -28,9 +20,4 @@ def test_c_callbacks():
2820
assert abs(_lfortran_ssin(f32(pi)) - f32(0.0)) < f32(1e-6)
2921
assert abs(_lfortran_ssin(f32(pi/2.0)) - f32(1.0)) < f32(1e-6)
3022

31-
assert _lfortran_bgt32(3, 4) == 0
32-
assert _lfortran_bgt32(4, 3) == 1
33-
assert _lfortran_bgt64(i64(3), i64(4)) == 0
34-
assert _lfortran_bgt64(i64(4), i64(3)) == 1
35-
3623
test_c_callbacks()

integration_tests/test_list_reserve.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ def test_list_reserve():
66
i: i32
77

88
reserve(l1, 100)
9-
for i in range(50):
10-
l1.append(i)
11-
assert len(l1) == i + 1
9+
# for i in range(50):
10+
# l1.append(i)
11+
# assert len(l1) == i + 1
1212

13-
reserve(l1, 150)
13+
# reserve(l1, 150)
1414

15-
for i in range(50):
16-
l1.pop(0)
17-
assert len(l1) == 49 - i
15+
# for i in range(50):
16+
# l1.pop(0)
17+
# assert len(l1) == 49 - i
1818

19-
reserve(l2, 100)
20-
for i in range(50):
21-
l2.append([(f64(i * i), str(i), (i, f64(i + 1))), (f64(i), str(i), (i, f64(i)))])
22-
assert len(l2) == i + 1
19+
# reserve(l2, 100)
20+
# for i in range(50):
21+
# l2.append([(f64(i * i), str(i), (i, f64(i + 1))), (f64(i), str(i), (i, f64(i)))])
22+
# assert len(l2) == i + 1
2323

24-
reserve(l2, 150)
24+
# reserve(l2, 150)
2525

26-
for i in range(50):
27-
l2.pop(0)
28-
assert len(l2) == 49 - i
26+
# for i in range(50):
27+
# l2.pop(0)
28+
# assert len(l2) == 49 - i
2929

3030
test_list_reserve()

integration_tests/test_list_reverse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ def test_list_reverse():
3636
l3.reverse()
3737
assert l3 == l4
3838
j += 0.1
39-
39+
4040
l5 = ["abcd", "efgh", "ijkl"]
4141
for s in l5:
4242
l6.reverse()
4343
l6.insert(0, s)
4444
l7.append(s)
4545
l6.reverse()
4646
assert l6 == l7
47-
47+
4848
l8 = [[1, 2], [3, 4, 5], [6, 7, 8, 9], [10]]
4949
l8.reverse()
5050
assert l8 == [[10], [6, 7, 8, 9], [3, 4, 5], [1, 2]]
@@ -54,4 +54,4 @@ def test_list_reverse():
5454
assert l9 == [(5, 6.0, "ghi"), (3, 4.0, "def"), (1, 2.0, "abc")]
5555

5656

57-
test_list_reverse()
57+
test_list_reverse()

integration_tests/test_str_attributes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
def capitalize():
22
s: str
33
s = "tom and jerry"
4+
print(s.capitalize())
45
assert s.capitalize() == "Tom and jerry"
56
s = "12wddd"
7+
print(s)
68
assert s.capitalize() == s
79
s = " tom and jerry"
10+
print(s.capitalize())
811
assert s.capitalize() == s
912
assert "empty string" .capitalize() == "Empty string"
1013
assert "".capitalize() == ""
@@ -76,14 +79,17 @@ def count():
7679
sub: str
7780
s = "ABC ABCDAB ABCDABCDABDE"
7881
sub = "ABC"
82+
print(s.count(sub), s.count("ABC"))
7983
assert s.count(sub) == 4
8084
assert s.count("ABC") == 4
81-
85+
8286
sub = "AB"
87+
print(s.count(sub), s.count("AB"))
8388
assert s.count(sub) == 6
8489
assert s.count("AB") == 6
8590

8691
sub = "ABC"
92+
print("ABC ABCDAB ABCDABCDABDE".count(sub), "ABC ABCDAB ABCDABCDABDE".count("ABC"))
8793
assert "ABC ABCDAB ABCDABCDABDE".count(sub) == 4
8894
assert "ABC ABCDAB ABCDABCDABDE".count("ABC") == 4
8995

@@ -342,7 +348,7 @@ def is_title():
342348
res4: bool = d.istitle()
343349
res5: bool = e.istitle()
344350
assert res == True
345-
assert res2 == False
351+
assert res2 == False
346352
assert res3 == False
347353
assert res4 == True
348354
assert res5 == False

run_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def single_test(test, verbose, no_llvm, skip_run_with_dbg, skip_cpptranslate, update_reference,
13-
no_color, specific_backends=None, excluded_backends=None):
13+
verify_hash, no_color, specific_backends=None, excluded_backends=None):
1414
filename = test["filename"]
1515
def is_included(backend):
1616
return test.get(backend, False) \

0 commit comments

Comments
 (0)