Skip to content

Commit fafef63

Browse files
committed
Uncommented tests
1 parent 520a15d commit fafef63

File tree

48 files changed

+803
-2801
lines changed

Some content is hidden

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

48 files changed

+803
-2801
lines changed

integration_tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ RUN(NAME test_list_pop2 LABELS cpython llvm llvm_jit NOFAST) # TODO: Remov
558558
RUN(NAME test_list_pop3 LABELS cpython llvm llvm_jit)
559559
# RUN(NAME test_list_compare LABELS cpython llvm llvm_jit) # post sync
560560
RUN(NAME test_list_compare2 LABELS cpython llvm llvm_jit)
561-
# RUN(NAME test_list_concat LABELS cpython llvm llvm_jit c NOFAST)
561+
RUN(NAME test_list_concat LABELS cpython llvm llvm_jit c NOFAST)
562562
# RUN(NAME test_list_reserve LABELS cpython llvm llvm_jit) # post sync
563563
# RUN(NAME test_const_list LABELS cpython llvm llvm_jit) # post sync
564564
# RUN(NAME test_const_access LABELS cpython llvm llvm_jit) # post sync
@@ -607,7 +607,7 @@ RUN(NAME test_import_05 LABELS cpython llvm llvm_jit c wasm wasm_x86 wasm_x
607607
RUN(NAME test_import_06 LABELS cpython llvm llvm_jit)
608608
RUN(NAME test_import_07 LABELS cpython llvm llvm_jit c)
609609
RUN(NAME test_import_08 LABELS cpython llvm)
610-
# RUN(NAME test_math LABELS cpython llvm llvm_jit NOFAST)
610+
RUN(NAME test_math LABELS cpython llvm llvm_jit NOFAST)
611611
# RUN(NAME test_membership_01 LABELS cpython llvm)
612612
RUN(NAME test_numpy_01 LABELS cpython llvm llvm_jit c)
613613
RUN(NAME test_numpy_02 LABELS cpython llvm llvm_jit c)
@@ -805,7 +805,7 @@ RUN(NAME test_statistics_02 LABELS cpython llvm llvm_jit NOFAST REQ_PY_VER 3.10
805805
# RUN(NAME test_attributes LABELS cpython llvm llvm_jit)
806806
# RUN(NAME test_str_attributes LABELS cpython llvm llvm_jit c)
807807
RUN(NAME kwargs_01 LABELS cpython llvm llvm_jit NOFAST) # renable c # post sync
808-
# RUN(NAME def_func_01 LABELS cpython llvm llvm_jit) # renable c # post sync
808+
RUN(NAME def_func_01 LABELS cpython llvm llvm_jit) # renable c # post sync
809809

810810
RUN(NAME func_inline_01 LABELS llvm llvm_jit c wasm)
811811
RUN(NAME func_inline_02 LABELS cpython llvm llvm_jit c)

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4626,18 +4626,18 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
46264626
size_t default_arg_index = i - default_arg_index_start;
46274627
this->visit_expr(*(x.m_args.m_defaults[default_arg_index]));
46284628
init_expr = ASRUtils::EXPR(tmp);
4629-
4630-
Vec<ASR::alloc_arg_t> alloc_args; alloc_args.reserve(al, 1);
4631-
ASR::alloc_arg_t alloc_arg;
4632-
alloc_arg.loc = loc;
4633-
alloc_arg.m_a = init_expr;
4634-
alloc_arg.m_dims = nullptr;
4635-
alloc_arg.n_dims = 0;
4636-
alloc_arg.m_type = nullptr;
4637-
alloc_arg.m_len_expr = nullptr;
4638-
alloc_arg.m_sym_subclass = nullptr;
4639-
alloc_args.push_back(al, alloc_arg);
4640-
init_expr = ASRUtils::EXPR(ASR::make_Allocate_t(al, loc, alloc_args.p, 1, nullptr, nullptr, nullptr));
4629+
/**/
4630+
/*Vec<ASR::alloc_arg_t> alloc_args; alloc_args.reserve(al, 1);*/
4631+
/*ASR::alloc_arg_t alloc_arg;*/
4632+
/*alloc_arg.loc = loc;*/
4633+
/*alloc_arg.m_a = init_expr;*/
4634+
/*alloc_arg.m_dims = nullptr;*/
4635+
/*alloc_arg.n_dims = 0;*/
4636+
/*alloc_arg.m_type = nullptr;*/
4637+
/*alloc_arg.m_len_expr = nullptr;*/
4638+
/*alloc_arg.m_sym_subclass = nullptr;*/
4639+
/*alloc_args.push_back(al, alloc_arg);*/
4640+
/*init_expr = ASRUtils::STMT(ASR::make_Allocate_t(al, loc, alloc_args.p, 1, nullptr, nullptr, nullptr));*/
46414641

46424642
}
46434643
if (s_intent == ASRUtils::intent_unspecified) {

src/runtime/lpython_builtin.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -608,24 +608,24 @@ def pow(x: i64, y: i64, z: i64) -> i64:
608608
result = _mod(x**y, z)
609609
return result
610610

611-
# @overload
612-
# def _lpython_str_capitalize(x: str) -> str:
613-
# if len(x) == 0:
614-
# return x
615-
# i:str
616-
# res:str = ""
617-
# for i in x:
618-
# if ord(i) >= 65 and ord(i) <= 90: # Check if uppercase
619-
# res += chr(ord(i) + 32) # Convert to lowercase using ASCII values
620-
# else:
621-
# res += i
622-
#
623-
# val: i32
624-
# val = ord(res[0])
625-
# if val >= ord('a') and val <= ord('z'):
626-
# val -= 32
627-
# res = chr(val) + res[1:]
628-
# return res
611+
@overload
612+
def _lpython_str_capitalize(x: str) -> str:
613+
if len(x) == 0:
614+
return x
615+
i:str
616+
res:str = ""
617+
for i in x:
618+
if ord(i) >= 65 and ord(i) <= 90: # Check if uppercase
619+
res += chr(ord(i) + 32) # Convert to lowercase using ASCII values
620+
else:
621+
res += i
622+
623+
val: i32
624+
val = ord(res[0])
625+
if val >= ord('a') and val <= ord('z'):
626+
val -= 32
627+
res = chr(val) + res[1:]
628+
return res
629629

630630

631631
@overload

src/runtime/math.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def frexp(x:f64) -> tuple[f64,i16]:
719719
'''
720720
exponent: i16 = i16(0)
721721
x_: f64 = x
722-
while f64(fabs(x)) > f64(1.0):
722+
while f64(fabs(x_)) > f64(1.0):
723723
exponent += i16(1)
724724
x_ /= 2.0
725725
return x_, exponent
@@ -733,17 +733,17 @@ def frexp(x:f32) -> tuple[f32,i8]:
733733
'''
734734
exponent: i8 = i8(0)
735735
x_: f32 = x
736-
while f32(fabs(x)) > f32(1.0):
736+
while f32(fabs(x_)) > f32(1.0):
737737
exponent += i8(1)
738738
x_ /= f32(2.0)
739739
return x_, exponent
740740

741741

742-
# @overload
743-
# def isclose(a:f64, b:f64, rel_tol:f64 = 1e-09, abs_tol:f64 = 0.0) -> bool:
744-
# '''
745-
# Return True if the values a and b are close to each other and False otherwise.
746-
# '''
747-
# difference:f64 = fabs(a-b)
748-
# greater:f64 = max(fabs(a),fabs(b))
749-
# return difference <= max(rel_tol*greater, abs_tol)
742+
@overload
743+
def isclose(a:f64, b:f64, rel_tol:f64 = 1e-09, abs_tol:f64 = 0.0) -> bool:
744+
'''
745+
Return True if the values a and b are close to each other and False otherwise.
746+
'''
747+
difference:f64 = fabs(a-b)
748+
greater:f64 = max(fabs(a),fabs(b))
749+
return difference <= max(rel_tol*greater, abs_tol)

tests/reference/asr-array_01_decl-39cf894.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-array_01_decl-39cf894.stdout",
9-
"stdout_hash": "17e2924c64cca800d0139da60f519cb8b7e139f9f2f6828fdac3bde5",
9+
"stdout_hash": "8355e703ff669698e75aa05f3a0b0b56c0818989cbd2b110662c8c62",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

0 commit comments

Comments
 (0)