From 5ee286610e696118493c315725b7950c4cfb9b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 2 Mar 2022 11:41:25 -0700 Subject: [PATCH 1/6] Add `bool realloc_lhs` to Assignment If true, the LHS must be reallocated to the size of the RHS. If False, it is assumed to be allocated and of the right size. --- grammar/ASR.asdl | 2 +- src/libasr/pass/arr_slice.cpp | 8 ++++---- src/libasr/pass/array_op.cpp | 22 ++++++++++----------- src/libasr/pass/class_constructor.cpp | 2 +- src/libasr/pass/do_loops.cpp | 4 ++-- src/libasr/pass/global_stmts.cpp | 2 +- src/libasr/pass/implied_do_loops.cpp | 12 +++++------ src/lpython/semantics/ast_body_visitor.cpp | 2 +- src/lpython/semantics/python_ast_to_asr.cpp | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/grammar/ASR.asdl b/grammar/ASR.asdl index 613df62ded..20f6eb5418 100644 --- a/grammar/ASR.asdl +++ b/grammar/ASR.asdl @@ -154,7 +154,7 @@ abi -- External ABI stmt = Allocate(alloc_arg* args, expr? stat) | Assign(int label, identifier variable) - | Assignment(expr target, expr value, stmt? overloaded) + | Assignment(expr target, expr value, stmt? overloaded, bool realloc_lhs) | Associate(expr target, expr value) | Cycle() -- deallocates if allocated otherwise throws a runtime error diff --git a/src/libasr/pass/arr_slice.cpp b/src/libasr/pass/arr_slice.cpp index 31e5fe58ff..9f0371a827 100644 --- a/src/libasr/pass/arr_slice.cpp +++ b/src/libasr/pass/arr_slice.cpp @@ -241,19 +241,19 @@ class ArrSliceVisitor : public PassUtils::PassVisitor if( doloop == nullptr ) { ASR::expr_t* target_ref = PassUtils::create_array_ref(slice_sym, idx_vars_target, al, x.base.base.loc, x.m_type); ASR::expr_t* value_ref = PassUtils::create_array_ref(x.m_v, idx_vars_value, al, x.base.base.loc, x.m_type); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, target_ref, value_ref, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, target_ref, value_ref, nullptr, false)); doloop_body.push_back(al, assign_stmt); } else { - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[i+1], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[i+1], const_1, nullptr, false)); doloop_body.push_back(al, set_to_one); doloop_body.push_back(al, doloop); } ASR::expr_t* inc_expr = LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, x.base.base.loc, idx_vars_target[i], ASR::binopType::Add, const_1, int32_type, nullptr, nullptr)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[i], inc_expr, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[i], inc_expr, nullptr, false)); doloop_body.push_back(al, assign_stmt); doloop = LFortran::ASRUtils::STMT(ASR::make_DoLoop_t(al, x.base.base.loc, head, doloop_body.p, doloop_body.size())); } - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[0], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_target[0], const_1, nullptr, false)); arr_slice_result.push_back(al, set_to_one); arr_slice_result.push_back(al, doloop); } diff --git a/src/libasr/pass/array_op.cpp b/src/libasr/pass/array_op.cpp index 6a9868cb1a..720642f499 100644 --- a/src/libasr/pass/array_op.cpp +++ b/src/libasr/pass/array_op.cpp @@ -335,7 +335,7 @@ class ArrayOpVisitor : public PassUtils::PassVisitor ASR::expr_t* ref = PassUtils::create_array_ref(tmp_val, idx_vars, al); ASR::expr_t* res = PassUtils::create_array_ref(result_var, idx_vars, al); ASR::expr_t* impl_cast_el_wise = LFortran::ASRUtils::EXPR(ASR::make_ImplicitCast_t(al, x.base.base.loc, ref, x.m_kind, x.m_type, nullptr)); - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, impl_cast_el_wise, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, impl_cast_el_wise, nullptr, false)); doloop_body.push_back(al, assign); } else { doloop_body.push_back(al, doloop); @@ -375,7 +375,7 @@ class ArrayOpVisitor : public PassUtils::PassVisitor ref = tmp_val; } ASR::expr_t* res = PassUtils::create_array_ref(result_var, idx_vars, al); - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, ref, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, ref, nullptr, false)); doloop_body.push_back(al, assign); } else { doloop_body.push_back(al, doloop); @@ -427,7 +427,7 @@ class ArrayOpVisitor : public PassUtils::PassVisitor ASR::expr_t* op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_UnaryOp_t( al, x.base.base.loc, x.m_op, ref, x.m_type, nullptr)); - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr, false)); doloop_body.push_back(al, assign); } else { doloop_body.push_back(al, doloop); @@ -516,21 +516,21 @@ class ArrayOpVisitor : public PassUtils::PassVisitor default: throw LFortranException("The desired operation is not supported yet for arrays."); } - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr, false)); doloop_body.push_back(al, assign); } else { - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i+1], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i+1], const_1, nullptr, false)); doloop_body.push_back(al, set_to_one); doloop_body.push_back(al, doloop); } ASR::expr_t* inc_expr = LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, x.base.base.loc, idx_vars_value[i], ASR::binopType::Add, const_1, int32_type, nullptr, nullptr)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i], inc_expr, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i], inc_expr, nullptr, false)); doloop_body.push_back(al, assign_stmt); doloop = LFortran::ASRUtils::STMT(ASR::make_DoLoop_t(al, x.base.base.loc, head, doloop_body.p, doloop_body.size())); } - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[0], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[0], const_1, nullptr, false)); array_op_result.push_back(al, set_to_one); array_op_result.push_back(al, doloop); } else if( (rank_left == 0 && rank_right > 0) || @@ -599,19 +599,19 @@ class ArrayOpVisitor : public PassUtils::PassVisitor default: throw LFortranException("The desired operation is not supported yet for arrays."); } - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, res, op_el_wise, nullptr, false)); doloop_body.push_back(al, assign); } else { - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i+1], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i+1], const_1, nullptr, false)); doloop_body.push_back(al, set_to_one); doloop_body.push_back(al, doloop); } ASR::expr_t* inc_expr = LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, x.base.base.loc, idx_vars_value[i], ASR::binopType::Add, const_1, int32_type, nullptr, nullptr)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i], inc_expr, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[i], inc_expr, nullptr, false)); doloop_body.push_back(al, assign_stmt); doloop = LFortran::ASRUtils::STMT(ASR::make_DoLoop_t(al, x.base.base.loc, head, doloop_body.p, doloop_body.size())); } - ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[0], const_1, nullptr)); + ASR::stmt_t* set_to_one = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, idx_vars_value[0], const_1, nullptr, false)); array_op_result.push_back(al, set_to_one); array_op_result.push_back(al, doloop); } diff --git a/src/libasr/pass/class_constructor.cpp b/src/libasr/pass/class_constructor.cpp index 7d4de79ef7..0bc2aeab93 100644 --- a/src/libasr/pass/class_constructor.cpp +++ b/src/libasr/pass/class_constructor.cpp @@ -85,7 +85,7 @@ class ClassConstructorVisitor : public PassUtils::PassVisitorn_members; i++ ) { ASR::symbol_t* member = dt_dertype->m_symtab->resolve_symbol(std::string(dt_dertype->m_members[i], strlen(dt_dertype->m_members[i]))); ASR::expr_t* derived_ref = LFortran::ASRUtils::EXPR(ASRUtils::getDerivedRef_t(al, x.base.base.loc, (ASR::asr_t*)result_var, member, current_scope)); - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, derived_ref, x.m_args[i], nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, derived_ref, x.m_args[i], nullptr, false)); class_constructor_result.push_back(al, assign); } } diff --git a/src/libasr/pass/do_loops.cpp b/src/libasr/pass/do_loops.cpp index 0ae6cc8fcb..a137d79ca9 100644 --- a/src/libasr/pass/do_loops.cpp +++ b/src/libasr/pass/do_loops.cpp @@ -65,7 +65,7 @@ Vec replace_doloop(Allocator &al, const ASR::DoLoop_t &loop) { ASR::ttype_t *type = LFortran::ASRUtils::TYPE(ASR::make_Integer_t(al, loc, 4, nullptr, 0)); ASR::stmt_t *stmt1 = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, loc, target, LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, loc, a, ASR::binopType::Sub, c, type, nullptr, nullptr)), - nullptr)); + nullptr, false)); ASR::expr_t *cond = LFortran::ASRUtils::EXPR(ASR::make_Compare_t(al, loc, LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, loc, target, ASR::binopType::Add, c, type, nullptr, nullptr)), @@ -74,7 +74,7 @@ Vec replace_doloop(Allocator &al, const ASR::DoLoop_t &loop) { body.reserve(al, loop.n_body+1); body.push_back(al, LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, loc, target, LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, loc, target, ASR::binopType::Add, c, type, nullptr, nullptr)), - nullptr))); + nullptr, false))); for (size_t i=0; itype == ASR::asrType::stmt) { ASR::stmt_t* asr_stmt = LFortran::ASRUtils::STMT(unit.m_items[i]); diff --git a/src/libasr/pass/implied_do_loops.cpp b/src/libasr/pass/implied_do_loops.cpp index 49973ff3e5..b2d92db089 100644 --- a/src/libasr/pass/implied_do_loops.cpp +++ b/src/libasr/pass/implied_do_loops.cpp @@ -159,11 +159,11 @@ class ImpliedDoLoopVisitor : public PassUtils::PassVisitor if( idoloop->m_values[i]->type == ASR::exprType::ImpliedDoLoop ) { throw LFortranException("Pass for nested ImpliedDoLoop nodes isn't implemented yet."); // idoloop->m_values[i]->base.loc } - ASR::stmt_t* doloop_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, array_ref, idoloop->m_values[i], nullptr)); + ASR::stmt_t* doloop_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, array_ref, idoloop->m_values[i], nullptr, false)); doloop_body.push_back(al, doloop_stmt); if( arr_idx != nullptr ) { ASR::expr_t* increment = LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, arr_var->base.base.loc, arr_idx, ASR::binopType::Add, const_1, LFortran::ASRUtils::expr_type(arr_idx), nullptr, nullptr)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, arr_idx, increment, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, arr_idx, increment, nullptr, false)); doloop_body.push_back(al, assign_stmt); } } @@ -196,7 +196,7 @@ class ImpliedDoLoopVisitor : public PassUtils::PassVisitor } else { ASR::symbol_t* idx_sym = unit.m_global_scope->scope[std::string(idx_var_name)]; idx_var = LFortran::ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, idx_sym)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, idx_var, const_1, nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, idx_var, const_1, nullptr, false)); implied_do_loop_result.push_back(al, assign_stmt); } for( size_t k = 0; k < arr_init->n_args; k++ ) { @@ -216,10 +216,10 @@ class ImpliedDoLoopVisitor : public PassUtils::PassVisitor ASR::expr_t* array_ref = LFortran::ASRUtils::EXPR(ASR::make_ArrayRef_t(al, arr_var->base.base.loc, arr_var->m_v, args.p, args.size(), LFortran::ASRUtils::expr_type(LFortran::ASRUtils::EXPR((ASR::asr_t*)arr_var)), nullptr)); - ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, array_ref, arr_init->m_args[k], nullptr)); + ASR::stmt_t* assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, array_ref, arr_init->m_args[k], nullptr, false)); implied_do_loop_result.push_back(al, assign_stmt); ASR::expr_t* increment = LFortran::ASRUtils::EXPR(ASR::make_BinOp_t(al, arr_var->base.base.loc, idx_var, ASR::binopType::Add, const_1, LFortran::ASRUtils::expr_type(idx_var), nullptr, nullptr)); - assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, idx_var, increment, nullptr)); + assign_stmt = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, arr_var->base.base.loc, idx_var, increment, nullptr, false)); implied_do_loop_result.push_back(al, assign_stmt); } } @@ -248,7 +248,7 @@ class ImpliedDoLoopVisitor : public PassUtils::PassVisitor doloop_body.reserve(al, 1); if( doloop == nullptr ) { ASR::expr_t* ref = PassUtils::create_array_ref(x.m_target, idx_vars, al); - ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, ref, x.m_value, nullptr)); + ASR::stmt_t* assign = LFortran::ASRUtils::STMT(ASR::make_Assignment_t(al, x.base.base.loc, ref, x.m_value, nullptr, false)); doloop_body.push_back(al, assign); } else { doloop_body.push_back(al, doloop); diff --git a/src/lpython/semantics/ast_body_visitor.cpp b/src/lpython/semantics/ast_body_visitor.cpp index 92c3190217..837665ba99 100644 --- a/src/lpython/semantics/ast_body_visitor.cpp +++ b/src/lpython/semantics/ast_body_visitor.cpp @@ -794,7 +794,7 @@ class BodyVisitor : public CommonVisitor { throw SemanticAbort(); } tmp = ASR::make_Assignment_t(al, x.base.base.loc, target, value, - overloaded_stmt); + overloaded_stmt, false); } void visit_SubroutineCall(const AST::SubroutineCall_t &x) { diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 12044c02e2..c9ff2dfcf3 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -953,7 +953,7 @@ class BodyVisitor : public CommonVisitor { value = implicitcast_helper(ASRUtils::expr_type(target), value, true); ASR::stmt_t *overloaded=nullptr; tmp = ASR::make_Assignment_t(al, x.base.base.loc, target, value, - overloaded); + overloaded, false); } void visit_Assert(const AST::Assert_t &x) { @@ -1595,7 +1595,7 @@ class BodyVisitor : public CommonVisitor { make_BinOp_helper(left, right, op, x.base.base.loc, false); ASR::stmt_t* a_overloaded = nullptr; ASR::expr_t *tmp2 = ASR::down_cast(tmp); - tmp = ASR::make_Assignment_t(al, x.base.base.loc, left, tmp2, a_overloaded); + tmp = ASR::make_Assignment_t(al, x.base.base.loc, left, tmp2, a_overloaded, false); } @@ -1927,7 +1927,7 @@ class BodyVisitor : public CommonVisitor { value = implicitcast_helper(ASRUtils::expr_type(target), value, true); ASR::stmt_t *overloaded=nullptr; tmp = ASR::make_Assignment_t(al, x.base.base.loc, target, value, - overloaded); + overloaded, false); // We can only return one statement in `tmp`, so we insert the current // `tmp` into the body of the function directly From 1ca0aa5cf198cb394652b543a981a0abbd2eaf4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 2 Mar 2022 11:42:22 -0700 Subject: [PATCH 2/6] Update tests --- src/lpython/tests/test_llvm.cpp | 4 ++-- tests/reference/asr-assert1-1ce92ea.json | 2 +- tests/reference/asr-assert1-1ce92ea.stdout | 2 +- tests/reference/asr-assign1-886f049.json | 2 +- tests/reference/asr-assign1-886f049.stdout | 2 +- tests/reference/asr-complex1-f26c460.json | 2 +- tests/reference/asr-complex1-f26c460.stdout | 2 +- tests/reference/asr-constants1-5828e8a.json | 2 +- tests/reference/asr-constants1-5828e8a.stdout | 2 +- tests/reference/asr-dictionary1-a105a36.json | 2 +- tests/reference/asr-dictionary1-a105a36.stdout | 2 +- tests/reference/asr-doconcurrentloop_01-3fdc189.json | 2 +- tests/reference/asr-doconcurrentloop_01-3fdc189.stdout | 2 +- tests/reference/asr-expr1-8df2d66.json | 2 +- tests/reference/asr-expr1-8df2d66.stdout | 2 +- tests/reference/asr-expr10-efcbb1b.json | 2 +- tests/reference/asr-expr10-efcbb1b.stdout | 2 +- tests/reference/asr-expr11-9b91d35.json | 2 +- tests/reference/asr-expr11-9b91d35.stdout | 2 +- tests/reference/asr-expr12-5c5b71e.json | 2 +- tests/reference/asr-expr12-5c5b71e.stdout | 2 +- tests/reference/asr-expr13-81bdb5a.json | 2 +- tests/reference/asr-expr13-81bdb5a.stdout | 2 +- tests/reference/asr-expr2-2e78a12.json | 2 +- tests/reference/asr-expr2-2e78a12.stdout | 2 +- tests/reference/asr-expr3-10eb0a4.json | 2 +- tests/reference/asr-expr3-10eb0a4.stdout | 2 +- tests/reference/asr-expr4-cef6743.json | 2 +- tests/reference/asr-expr4-cef6743.stdout | 2 +- tests/reference/asr-expr5-645ffcc.json | 2 +- tests/reference/asr-expr5-645ffcc.stdout | 2 +- tests/reference/asr-expr6-368e5ed.json | 2 +- tests/reference/asr-expr6-368e5ed.stdout | 2 +- tests/reference/asr-expr7-480ba2f.json | 2 +- tests/reference/asr-expr7-480ba2f.stdout | 2 +- tests/reference/asr-expr8-6beda60.json | 2 +- tests/reference/asr-expr8-6beda60.stdout | 2 +- tests/reference/asr-expr9-814e4bc.json | 2 +- tests/reference/asr-expr9-814e4bc.stdout | 2 +- tests/reference/asr-expr_01-211000e.json | 2 +- tests/reference/asr-expr_01-211000e.stdout | 2 +- tests/reference/asr-global_scope1-354e217.json | 2 +- tests/reference/asr-global_scope1-354e217.stdout | 2 +- tests/reference/asr-list1-770ba33.json | 2 +- tests/reference/asr-list1-770ba33.stdout | 2 +- tests/reference/asr-loop1-10d3109.json | 2 +- tests/reference/asr-loop1-10d3109.stdout | 2 +- tests/reference/asr-loop3-a579196.json | 2 +- tests/reference/asr-loop3-a579196.stdout | 2 +- tests/reference/asr-set1-b7b913a.json | 2 +- tests/reference/asr-set1-b7b913a.stdout | 2 +- tests/reference/asr-subscript1-1acfc19.json | 2 +- tests/reference/asr-subscript1-1acfc19.stdout | 2 +- tests/reference/asr-test_builtin-aa64615.json | 2 +- tests/reference/asr-test_builtin-aa64615.stdout | 2 +- tests/reference/asr-test_builtin_abs-c74d2c9.json | 2 +- tests/reference/asr-test_builtin_abs-c74d2c9.stdout | 2 +- tests/reference/asr-test_builtin_bin-52ba9fa.json | 2 +- tests/reference/asr-test_builtin_bin-52ba9fa.stdout | 2 +- tests/reference/asr-test_builtin_bool-330223a.json | 2 +- tests/reference/asr-test_builtin_bool-330223a.stdout | 2 +- tests/reference/asr-test_builtin_float-20601dd.json | 2 +- tests/reference/asr-test_builtin_float-20601dd.stdout | 2 +- tests/reference/asr-test_builtin_hex-64bd268.json | 2 +- tests/reference/asr-test_builtin_hex-64bd268.stdout | 2 +- tests/reference/asr-test_builtin_int-8f88fdc.json | 2 +- tests/reference/asr-test_builtin_int-8f88fdc.stdout | 2 +- tests/reference/asr-test_builtin_len-55b0dec.json | 2 +- tests/reference/asr-test_builtin_len-55b0dec.stdout | 2 +- tests/reference/asr-test_builtin_oct-20b9066.json | 2 +- tests/reference/asr-test_builtin_oct-20b9066.stdout | 2 +- tests/reference/asr-test_builtin_pow-f02fcda.json | 2 +- tests/reference/asr-test_builtin_pow-f02fcda.stdout | 2 +- tests/reference/asr-test_builtin_str-580e920.json | 2 +- tests/reference/asr-test_builtin_str-580e920.stdout | 2 +- tests/reference/asr-tuple1-09972ab.json | 2 +- tests/reference/asr-tuple1-09972ab.stdout | 2 +- 77 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/lpython/tests/test_llvm.cpp b/src/lpython/tests/test_llvm.cpp index c854f2f532..2404e7a69e 100644 --- a/src/lpython/tests/test_llvm.cpp +++ b/src/lpython/tests/test_llvm.cpp @@ -366,7 +366,7 @@ end function)"; LFortran::SymbolTable::reset_global_counter(); LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [(= (Var 2 f) (ConstantInteger 5 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation ())}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [(= (Var 2 f) (ConstantInteger 5 (Integer 4 [])) () .false.)] (Var 2 f) Source Public Implementation ())}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; @@ -400,7 +400,7 @@ end function)"; // AST -> ASR LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [(= (Var 4 f) (ConstantInteger 4 (Integer 4 [])) ())] (Var 4 f) Source Public Implementation ())}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [(= (Var 4 f) (ConstantInteger 4 (Integer 4 [])) () .false.)] (Var 4 f) Source Public Implementation ())}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; LFortran::Result> diff --git a/tests/reference/asr-assert1-1ce92ea.json b/tests/reference/asr-assert1-1ce92ea.json index 357bfbf643..8da9175d7b 100644 --- a/tests/reference/asr-assert1-1ce92ea.json +++ b/tests/reference/asr-assert1-1ce92ea.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-assert1-1ce92ea.stdout", - "stdout_hash": "9f56420368fc84fff47eb098c7ab1ab90f6f7c3a965b24673004dfff", + "stdout_hash": "170f5d14da2c84c57902f680e7a3d85bc0f7a150ad0c04ade48a1345", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-assert1-1ce92ea.stdout b/tests/reference/asr-assert1-1ce92ea.stdout index 9b8576e983..08cb57a9d7 100644 --- a/tests/reference/asr-assert1-1ce92ea.stdout +++ b/tests/reference/asr-assert1-1ce92ea.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_assert: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_assert [] [(= (Var 2 a) (ConstantInteger 5 (Integer 4 [])) ()) (Assert (Compare (Var 2 a) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) (ConstantString "a is not 5" (Character 1 10 () []))) (Assert (Compare (Var 2 a) NotEq (ConstantInteger 10 (Integer 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_assert: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_assert [] [(= (Var 2 a) (ConstantInteger 5 (Integer 4 [])) () .false.) (Assert (Compare (Var 2 a) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) (ConstantString "a is not 5" (Character 1 10 () []))) (Assert (Compare (Var 2 a) NotEq (ConstantInteger 10 (Integer 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-assign1-886f049.json b/tests/reference/asr-assign1-886f049.json index 5a57e62496..78665f151f 100644 --- a/tests/reference/asr-assign1-886f049.json +++ b/tests/reference/asr-assign1-886f049.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-assign1-886f049.stdout", - "stdout_hash": "ded38a240a9ea6e4749c3b601ffc309524be6e1daa55cb81b5ae1c96", + "stdout_hash": "bd3579217e2117de8e9e3bd5b4b989bb6dfbf5ef84c8b66211dbbb88", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-assign1-886f049.stdout b/tests/reference/asr-assign1-886f049.stdout index 6b6190f780..d8170065c6 100644 --- a/tests/reference/asr-assign1-886f049.stdout +++ b/tests/reference/asr-assign1-886f049.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_augassign: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Character 1 -2 () []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.)}) test_augassign [] [(= (Var 2 r) (ConstantInteger 0 (Integer 4 [])) ()) (= (Var 2 r) (BinOp (Var 2 r) Add (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) () ()) ()) (= (Var 2 s) (ConstantInteger 5 (Integer 4 [])) ()) (= (Var 2 r) (BinOp (Var 2 r) Mul (Var 2 s) (Integer 4 []) () ()) ()) (= (Var 2 r) (BinOp (Var 2 r) Sub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) () ()) ()) (= (Var 2 s) (ConstantInteger 10 (Integer 4 [])) ()) (= (Var 2 r) (BinOp (ImplicitCast (Var 2 r) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (Var 2 s) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) ()) (= (Var 2 a) (ConstantString "" (Character 1 0 () [])) ()) (= (Var 2 a) (StrOp (Var 2 a) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 2 () []) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_augassign: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Character 1 -2 () []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.)}) test_augassign [] [(= (Var 2 r) (ConstantInteger 0 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Add (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Mul (Var 2 s) (Integer 4 []) () ()) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Sub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 10 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (ImplicitCast (Var 2 r) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (Var 2 s) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) () .false.) (= (Var 2 a) (ConstantString "" (Character 1 0 () [])) () .false.) (= (Var 2 a) (StrOp (Var 2 a) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 2 () []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json index 32b998bfed..47a9860d56 100644 --- a/tests/reference/asr-complex1-f26c460.json +++ b/tests/reference/asr-complex1-f26c460.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-complex1-f26c460.stdout", - "stdout_hash": "3d30525175033241e93db499e684dd2744b4272da6e49756d4a9aa46", + "stdout_hash": "0e591b2228d2a87047167d5f5a6a4bde8a5a6d68c292744a50fb74eb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-complex1-f26c460.stdout b/tests/reference/asr-complex1-f26c460.stdout index c286e91910..e6fbf9b8ee 100644 --- a/tests/reference/asr-complex1-f26c460.stdout +++ b/tests/reference/asr-complex1-f26c460.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_complex: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 4 []) Source Public Required .false.), c2: (Variable 2 c2 Local () () Default (Complex 4 []) Source Public Required .false.), c3: (Variable 2 c3 Local () () Default (Complex 8 []) Source Public Required .false.)}) test_complex [] [(= (Var 2 c) (ConstantComplex 0.000000 0.000000 (Complex 8 [])) ()) (= (Var 2 c) (ConstantComplex 3.400000 0.000000 (Complex 8 [])) ()) (= (Var 2 c) (ConstantComplex 5.000000 4.300000 (Complex 8 [])) ()) (= (Var 2 c) (ConstantComplex 1.000000 0.000000 (Complex 8 [])) ()) (= (Var 2 c1) (ConstantComplex 3.000000 4.000000 (Complex 8 [])) ()) (= (Var 2 c2) (ConstantComplex 2.000000 4.500000 (Complex 8 [])) ()) (= (Var 2 c3) (ConstantComplex 3.000000 4.000000 (Complex 8 [])) ()) (= (Var 2 b) (Compare (Var 2 c1) NotEq (Var 2 c2) (Logical 4 []) () ()) ()) (= (Var 2 b) (Compare (Var 2 c1) Eq (Var 2 c3) (Logical 4 []) () ()) ()) (= (Var 2 c) (BinOp (Var 2 c1) Add (Var 2 c2) (Complex 4 []) () ()) ()) (= (Var 2 c) (BinOp (Var 2 c2) Sub (Var 2 c1) (Complex 4 []) () ()) ()) (= (Var 2 c) (BinOp (Var 2 c1) Mul (Var 2 c2) (Complex 4 []) () ()) ()) (= (Var 2 c) (BinOp (ConstantComplex 1.000000 2.000000 (Complex 8 [])) Pow (ConstantComplex 3.345340 4.867868 (Complex 8 [])) (Complex 8 []) (ConstantComplex 0.015553 0.065561 (Complex 8 [])) ()) ()) (= (Var 2 c) (BinOp (ConstantComplex 1.000000 2.000000 (Complex 8 [])) Mul (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -5.000000 10.000000 (Complex 8 [])) ()) ()) (= (Var 2 c) (BinOp (ConstantComplex 4.000000 5.000000 (Complex 8 [])) Sub (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 1.000000 (Complex 8 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_complex: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 4 []) Source Public Required .false.), c2: (Variable 2 c2 Local () () Default (Complex 4 []) Source Public Required .false.), c3: (Variable 2 c3 Local () () Default (Complex 8 []) Source Public Required .false.)}) test_complex [] [(= (Var 2 c) (ConstantComplex 0.000000 0.000000 (Complex 8 [])) () .false.) (= (Var 2 c) (ConstantComplex 3.400000 0.000000 (Complex 8 [])) () .false.) (= (Var 2 c) (ConstantComplex 5.000000 4.300000 (Complex 8 [])) () .false.) (= (Var 2 c) (ConstantComplex 1.000000 0.000000 (Complex 8 [])) () .false.) (= (Var 2 c1) (ConstantComplex 3.000000 4.000000 (Complex 8 [])) () .false.) (= (Var 2 c2) (ConstantComplex 2.000000 4.500000 (Complex 8 [])) () .false.) (= (Var 2 c3) (ConstantComplex 3.000000 4.000000 (Complex 8 [])) () .false.) (= (Var 2 b) (Compare (Var 2 c1) NotEq (Var 2 c2) (Logical 4 []) () ()) () .false.) (= (Var 2 b) (Compare (Var 2 c1) Eq (Var 2 c3) (Logical 4 []) () ()) () .false.) (= (Var 2 c) (BinOp (Var 2 c1) Add (Var 2 c2) (Complex 4 []) () ()) () .false.) (= (Var 2 c) (BinOp (Var 2 c2) Sub (Var 2 c1) (Complex 4 []) () ()) () .false.) (= (Var 2 c) (BinOp (Var 2 c1) Mul (Var 2 c2) (Complex 4 []) () ()) () .false.) (= (Var 2 c) (BinOp (ConstantComplex 1.000000 2.000000 (Complex 8 [])) Pow (ConstantComplex 3.345340 4.867868 (Complex 8 [])) (Complex 8 []) (ConstantComplex 0.015553 0.065561 (Complex 8 [])) ()) () .false.) (= (Var 2 c) (BinOp (ConstantComplex 1.000000 2.000000 (Complex 8 [])) Mul (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -5.000000 10.000000 (Complex 8 [])) ()) () .false.) (= (Var 2 c) (BinOp (ConstantComplex 4.000000 5.000000 (Complex 8 [])) Sub (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 1.000000 (Complex 8 [])) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json index f6047d74b4..ebd6da287c 100644 --- a/tests/reference/asr-constants1-5828e8a.json +++ b/tests/reference/asr-constants1-5828e8a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-constants1-5828e8a.stdout", - "stdout_hash": "afdf64c50b62ecb3a51f71b729f21920178f29682559773af511c470", + "stdout_hash": "589e54146bb5e5be11b43c439e8420893b131ebb044c8270e5ea87ae", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-constants1-5828e8a.stdout b/tests/reference/asr-constants1-5828e8a.stdout index bc4b39ba63..d765a35a80 100644 --- a/tests/reference/asr-constants1-5828e8a.stdout +++ b/tests/reference/asr-constants1-5828e8a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 26 {}) main_program [] []), test_abs: (Subroutine (SymbolTable 4 {abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(ConstantReal 3.450000 (Real 8 []))] [] (Real 8 []) (ConstantReal 3.450000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) ()) (= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(UnaryOp USub (ConstantReal 5346.340000 (Real 8 [])) (Real 8 []) (ConstantReal -5346.340000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5346.340000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) ())] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 1 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 6 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "" (Character 1 0 () []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantComplex 0.000000 0.000000 (Complex 8 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "t" (Character 1 1 () []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantReal 2.300000 (Real 8 []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_boz: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), bin: (ExternalSymbol 2 bin 13 bin lpython_builtin [] bin Private), hex: (ExternalSymbol 2 hex 13 hex lpython_builtin [] hex Private), oct: (ExternalSymbol 2 oct 13 oct lpython_builtin [] oct Private)}) test_boz [] [(= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b101" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 8 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o10" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 56 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o70" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o1026" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 42 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x2a" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 12648430 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0xc0ffee" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x216" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 8 a) (ConstantLogical .true. (Logical 1 [])) ()) (Assert (Compare (Var 8 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) ()) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) ()) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_divmod [] [(= (Var 11 a) (ConstantTuple [(ConstantInteger 3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) (= (Var 11 a) (ConstantTuple [(ConstantInteger -3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) (= (Var 11 a) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ())] Source Public Implementation () .false. .false.), test_float: (Subroutine (SymbolTable 10 {a: (Variable 10 a Local () () Default (Real 8 []) Source Public Required .false.), float: (ExternalSymbol 10 float 13 float lpython_builtin [] float Private)}) test_float [] [(= (Var 10 a) (FunctionCall 10 float () [] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantReal 4.560000 (Real 8 []))] [] (Real 8 []) (ConstantReal 4.560000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantInteger 5 (Integer 4 []))] [] (Real 8 []) (ConstantReal 5.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -1.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .true. (Logical 1 []))] [] (Real 8 []) (ConstantReal 1.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .false. (Logical 1 []))] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "5346" (Character 1 4 () []))] [] (Real 8 []) (ConstantReal 5346.000000 (Real 8 [])) ()) ()) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "423.534" (Character 1 7 () []))] [] (Real 8 []) (ConstantReal 423.533997 (Real 8 [])) ()) ())] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.), int: (ExternalSymbol 9 int 13 int lpython_builtin [] int Private)}) test_int [] [(= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantReal 4.560000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(UnaryOp USub (ConstantReal 5.000010 (Real 8 [])) (Real 8 []) (ConstantReal -5.000010 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .true. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .false. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantString "5346" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 5346 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) ())] Source Public Implementation () .false. .false.), test_len: (Subroutine (SymbolTable 5 {a: (Variable 5 a Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 5 len 13 len lpython_builtin [] len Private)}) test_len [] [(= (Var 5 a) (FunctionCall 5 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "test" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "this is a test" (Character 1 14 () []))] [] (Integer 4 []) (ConstantInteger 14 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])]))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantArray [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (UnaryOp USub (ConstantInteger 6 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 [])))] (Integer 4 [])) (ConstantArray [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 [])))] (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) ()) (= (Var 5 a) (FunctionCall 5 len () [(ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_ord_chr: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.), chr: (ExternalSymbol 3 chr 13 chr lpython_builtin [] chr Private), ord: (ExternalSymbol 3 ord 13 ord lpython_builtin [] ord Private), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord_chr [] [(= (Var 3 a) (FunctionCall 3 ord () [(ConstantString "5" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 53 (Integer 4 [])) ()) ()) (= (Var 3 s) (FunctionCall 3 chr () [(ConstantInteger 43 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "+" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.), test_str: (Subroutine (SymbolTable 7 {s: (Variable 7 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 7 str 13 str lpython_builtin [] str Private)}) test_str [] [(= (Var 7 s) (FunctionCall 7 str () [] [] (Character 1 -2 () []) (ConstantString "" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "5" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-4" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(ConstantReal 5.600000 (Real 8 []))] [] (Character 1 -2 () []) (ConstantString "5.600000" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .true. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "True" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .false. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "False" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 7 str () [(ConstantString "5346" (Character 1 4 () []))] [] (Character 1 -2 () []) (ConstantString "5346" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 26 {}) main_program [] []), test_abs: (Subroutine (SymbolTable 4 {abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(ConstantReal 3.450000 (Real 8 []))] [] (Real 8 []) (ConstantReal 3.450000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.) (= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(UnaryOp USub (ConstantReal 5346.340000 (Real 8 [])) (Real 8 []) (ConstantReal -5346.340000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5346.340000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 1 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 6 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "" (Character 1 0 () []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantComplex 0.000000 0.000000 (Complex 8 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "t" (Character 1 1 () []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantReal 2.300000 (Real 8 []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_boz: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), bin: (ExternalSymbol 2 bin 13 bin lpython_builtin [] bin Private), hex: (ExternalSymbol 2 hex 13 hex lpython_builtin [] hex Private), oct: (ExternalSymbol 2 oct 13 oct lpython_builtin [] oct Private)}) test_boz [] [(= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b101" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 8 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o10" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 56 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o70" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o1026" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 42 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x2a" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 12648430 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0xc0ffee" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x216" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 8 a) (ConstantLogical .true. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_divmod [] [(= (Var 11 a) (ConstantTuple [(ConstantInteger 3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger -3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.)] Source Public Implementation () .false. .false.), test_float: (Subroutine (SymbolTable 10 {a: (Variable 10 a Local () () Default (Real 8 []) Source Public Required .false.), float: (ExternalSymbol 10 float 13 float lpython_builtin [] float Private)}) test_float [] [(= (Var 10 a) (FunctionCall 10 float () [] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantReal 4.560000 (Real 8 []))] [] (Real 8 []) (ConstantReal 4.560000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantInteger 5 (Integer 4 []))] [] (Real 8 []) (ConstantReal 5.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .true. (Logical 1 []))] [] (Real 8 []) (ConstantReal 1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .false. (Logical 1 []))] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "5346" (Character 1 4 () []))] [] (Real 8 []) (ConstantReal 5346.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "423.534" (Character 1 7 () []))] [] (Real 8 []) (ConstantReal 423.533997 (Real 8 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.), int: (ExternalSymbol 9 int 13 int lpython_builtin [] int Private)}) test_int [] [(= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantReal 4.560000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(UnaryOp USub (ConstantReal 5.000010 (Real 8 [])) (Real 8 []) (ConstantReal -5.000010 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .true. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .false. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantString "5346" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 5346 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_len: (Subroutine (SymbolTable 5 {a: (Variable 5 a Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 5 len 13 len lpython_builtin [] len Private)}) test_len [] [(= (Var 5 a) (FunctionCall 5 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "test" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "this is a test" (Character 1 14 () []))] [] (Integer 4 []) (ConstantInteger 14 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])]))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantArray [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (UnaryOp USub (ConstantInteger 6 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 [])))] (Integer 4 [])) (ConstantArray [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 [])))] (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_ord_chr: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.), chr: (ExternalSymbol 3 chr 13 chr lpython_builtin [] chr Private), ord: (ExternalSymbol 3 ord 13 ord lpython_builtin [] ord Private), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord_chr [] [(= (Var 3 a) (FunctionCall 3 ord () [(ConstantString "5" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 53 (Integer 4 [])) ()) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(ConstantInteger 43 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "+" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_str: (Subroutine (SymbolTable 7 {s: (Variable 7 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 7 str 13 str lpython_builtin [] str Private)}) test_str [] [(= (Var 7 s) (FunctionCall 7 str () [] [] (Character 1 -2 () []) (ConstantString "" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "5" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-4" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantReal 5.600000 (Real 8 []))] [] (Character 1 -2 () []) (ConstantString "5.600000" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .true. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "True" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .false. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "False" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantString "5346" (Character 1 4 () []))] [] (Character 1 -2 () []) (ConstantString "5346" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-dictionary1-a105a36.json b/tests/reference/asr-dictionary1-a105a36.json index e365076c3b..9169827e1c 100644 --- a/tests/reference/asr-dictionary1-a105a36.json +++ b/tests/reference/asr-dictionary1-a105a36.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dictionary1-a105a36.stdout", - "stdout_hash": "7d1a1cf87681db72f9b9ea3b3e5c7e1b5177bb3179e93b13c1867f45", + "stdout_hash": "18edfc126840375cf74416d9c9a5bce29a0364e9318677bec38b9b30", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dictionary1-a105a36.stdout b/tests/reference/asr-dictionary1-a105a36.stdout index c7064d000f..5acef31f0a 100644 --- a/tests/reference/asr-dictionary1-a105a36.stdout +++ b/tests/reference/asr-dictionary1-a105a36.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) ()) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (Integer 4 []))) ()) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "a" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ()) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "b" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) () .false.) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (Integer 4 []))) () .false.) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "a" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) () .false.) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "b" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.json b/tests/reference/asr-doconcurrentloop_01-3fdc189.json index 8e433c6726..b55cc3ecff 100644 --- a/tests/reference/asr-doconcurrentloop_01-3fdc189.json +++ b/tests/reference/asr-doconcurrentloop_01-3fdc189.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-doconcurrentloop_01-3fdc189.stdout", - "stdout_hash": "183dfafc0b2bc0eb5c1e9c003ac6593e394015616ef63348ed6e2fd5", + "stdout_hash": "6de2c1061fc54b5a6dcaddb09a12f624ad4fa11efd67cb2a170bab48", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout index 2fe168737e..92eedb0eaa 100644 --- a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout +++ b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 5 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 3 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar Local () () Default (Real 4 []) Source Public Required .false.)}) main0 [] [(= (Var 3 scalar) (ImplicitCast (ConstantReal 10.000000 (Real 8 [])) RealToReal (Real 4 []) ()) ()) (= (Var 3 nsize) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 3 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ()) (= (ArrayRef 3 b [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ())]) (SubroutineCall 1 triad () [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] ()) (Print () [(ConstantString "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), triad: (Subroutine (SymbolTable 2 {N: (Variable 2 N Local () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(= (Var 2 N) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 2 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) ())])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 5 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 3 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar Local () () Default (Real 4 []) Source Public Required .false.)}) main0 [] [(= (Var 3 scalar) (ImplicitCast (ConstantReal 10.000000 (Real 8 [])) RealToReal (Real 4 []) ()) () .false.) (= (Var 3 nsize) (ConstantInteger 1234 (Integer 4 [])) () .false.) (DoConcurrentLoop ((Var 3 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) () .false.) (= (ArrayRef 3 b [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) () .false.)]) (SubroutineCall 1 triad () [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] ()) (Print () [(ConstantString "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), triad: (Subroutine (SymbolTable 2 {N: (Variable 2 N Local () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(= (Var 2 N) (ConstantInteger 1234 (Integer 4 [])) () .false.) (DoConcurrentLoop ((Var 2 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) () .false.)])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr1-8df2d66.json b/tests/reference/asr-expr1-8df2d66.json index 2c6b956165..7bb3b0c517 100644 --- a/tests/reference/asr-expr1-8df2d66.json +++ b/tests/reference/asr-expr1-8df2d66.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr1-8df2d66.stdout", - "stdout_hash": "67a3b23f5ed48dc24c0c4561ef8326d5bc37e7f1f24443fe88528d1d", + "stdout_hash": "3676485aa727b7f1c6810bcf622a575daa1014ff522b14d81c8b084b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr1-8df2d66.stdout b/tests/reference/asr-expr1-8df2d66.stdout index c6f0ee8b15..d6a4732a2b 100644 --- a/tests/reference/asr-expr1-8df2d66.stdout +++ b/tests/reference/asr-expr1-8df2d66.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_namedexpr: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 4 ord lpython_builtin [] ord Private), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) test_namedexpr [] [(= (Var 2 x) (NamedExpr (Var 2 y) (ConstantInteger 0 (Integer 4 [])) (Integer 4 [])) ()) (If (NamedExpr (Var 2 a) (FunctionCall 2 ord () [(ConstantString "3" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 51 (Integer 4 [])) ()) (Integer 4 [])) [(= (Var 2 x) (ConstantInteger 1 (Integer 4 [])) ())] []) (WhileLoop (NamedExpr (Var 2 a) (ConstantInteger 1 (Integer 4 [])) (Integer 4 [])) [(= (Var 2 y) (ConstantInteger 1 (Integer 4 [])) ())])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_namedexpr: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 4 ord lpython_builtin [] ord Private), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) test_namedexpr [] [(= (Var 2 x) (NamedExpr (Var 2 y) (ConstantInteger 0 (Integer 4 [])) (Integer 4 [])) () .false.) (If (NamedExpr (Var 2 a) (FunctionCall 2 ord () [(ConstantString "3" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 51 (Integer 4 [])) ()) (Integer 4 [])) [(= (Var 2 x) (ConstantInteger 1 (Integer 4 [])) () .false.)] []) (WhileLoop (NamedExpr (Var 2 a) (ConstantInteger 1 (Integer 4 [])) (Integer 4 [])) [(= (Var 2 y) (ConstantInteger 1 (Integer 4 [])) () .false.)])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json index 6905804896..6966dfd236 100644 --- a/tests/reference/asr-expr10-efcbb1b.json +++ b/tests/reference/asr-expr10-efcbb1b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr10-efcbb1b.stdout", - "stdout_hash": "518a6785039886efd1ec9e0ad5e99c80db038d85f0d377fe74d8e085", + "stdout_hash": "94fb4b99a4459187b357932a96b691b176566456bdc146a2c7d84c76", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr10-efcbb1b.stdout b/tests/reference/asr-expr10-efcbb1b.stdout index 6dd20893b6..35a0e33799 100644 --- a/tests/reference/asr-expr10-efcbb1b.stdout +++ b/tests/reference/asr-expr10-efcbb1b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 1 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 1 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (UnaryOp UAdd (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger 4 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantInteger 500 (Integer 4 [])) (Integer 4 []) (ConstantInteger -500 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Not (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 a) (UnaryOp Not (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 a) (UnaryOp Not (ConstantInteger 0 (Integer 4 [])) (Integer 4 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 f) (ImplicitCast (UnaryOp UAdd (ConstantReal 1.000000 (Real 8 [])) (Real 8 []) (ConstantReal 1.000000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 f) (ImplicitCast (UnaryOp USub (ConstantReal 183745.534000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.534000 (Real 8 []))) RealToReal (Real 4 []) ()) ()) (= (Var 2 b1) (ConstantLogical .true. (Logical 1 [])) ()) (= (Var 2 b2) (UnaryOp Not (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantLogical .true. (Logical 4 []))) ()) (= (Var 2 b3) (UnaryOp Not (Var 2 b2) (Logical 1 []) ()) ()) (= (Var 2 a) (UnaryOp UAdd (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger 1 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp USub (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantInteger 0 (Integer 4 []))) ()) (= (Var 2 a) (UnaryOp Invert (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger -2 (Integer 4 []))) ()) (= (Var 2 c) (UnaryOp UAdd (ConstantComplex 1.000000 2.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 2.000000 (Complex 8 []))) ()) (= (Var 2 c) (UnaryOp USub (ConstantComplex 3.000000 65.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -3.000000 -65.000000 (Complex 8 []))) ()) (= (Var 2 b1) (UnaryOp Not (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .false. (Logical 4 []))) ()) (= (Var 2 b2) (UnaryOp Not (ConstantComplex 0.000000 0.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .true. (Logical 4 []))) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 1 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 1 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 1 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (UnaryOp UAdd (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger 4 (Integer 4 []))) () .false.) (= (Var 2 a) (UnaryOp USub (ConstantInteger 500 (Integer 4 [])) (Integer 4 []) (ConstantInteger -500 (Integer 4 []))) () .false.) (= (Var 2 a) (UnaryOp Invert (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 []))) () .false.) (= (Var 2 a) (UnaryOp Not (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) () .false.) (= (Var 2 a) (UnaryOp Not (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Integer 4 []) (ConstantLogical .false. (Logical 4 []))) () .false.) (= (Var 2 a) (UnaryOp Not (ConstantInteger 0 (Integer 4 [])) (Integer 4 []) (ConstantLogical .true. (Logical 4 []))) () .false.) (= (Var 2 f) (ImplicitCast (UnaryOp UAdd (ConstantReal 1.000000 (Real 8 [])) (Real 8 []) (ConstantReal 1.000000 (Real 8 []))) RealToReal (Real 4 []) ()) () .false.) (= (Var 2 f) (ImplicitCast (UnaryOp USub (ConstantReal 183745.534000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.534000 (Real 8 []))) RealToReal (Real 4 []) ()) () .false.) (= (Var 2 b1) (ConstantLogical .true. (Logical 1 [])) () .false.) (= (Var 2 b2) (UnaryOp Not (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantLogical .true. (Logical 4 []))) () .false.) (= (Var 2 b3) (UnaryOp Not (Var 2 b2) (Logical 1 []) ()) () .false.) (= (Var 2 a) (UnaryOp UAdd (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger 1 (Integer 4 []))) () .false.) (= (Var 2 a) (UnaryOp USub (ConstantLogical .false. (Logical 1 [])) (Logical 1 []) (ConstantInteger 0 (Integer 4 []))) () .false.) (= (Var 2 a) (UnaryOp Invert (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) (ConstantInteger -2 (Integer 4 []))) () .false.) (= (Var 2 c) (UnaryOp UAdd (ConstantComplex 1.000000 2.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex 1.000000 2.000000 (Complex 8 []))) () .false.) (= (Var 2 c) (UnaryOp USub (ConstantComplex 3.000000 65.000000 (Complex 8 [])) (Complex 8 []) (ConstantComplex -3.000000 -65.000000 (Complex 8 []))) () .false.) (= (Var 2 b1) (UnaryOp Not (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .false. (Logical 4 []))) () .false.) (= (Var 2 b2) (UnaryOp Not (ConstantComplex 0.000000 0.000000 (Complex 8 [])) (Complex 8 []) (ConstantLogical .true. (Logical 4 []))) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr11-9b91d35.json b/tests/reference/asr-expr11-9b91d35.json index c8b0128993..97c42f3b9f 100644 --- a/tests/reference/asr-expr11-9b91d35.json +++ b/tests/reference/asr-expr11-9b91d35.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr11-9b91d35.stdout", - "stdout_hash": "fa3e7a04acec45e4e2df9cccacd17bb4cd706125216eed5ccfaa386e", + "stdout_hash": "96d44330f3d93fdb6857d07586156925c37229e3fac8903f108cc454", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr11-9b91d35.stdout b/tests/reference/asr-expr11-9b91d35.stdout index 9e7407cdb8..5033531ec9 100644 --- a/tests/reference/asr-expr11-9b91d35.stdout +++ b/tests/reference/asr-expr11-9b91d35.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_repeat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_repeat [] [(= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (ConstantInteger 2 (Integer 4 [])) (Character 1 2 () []) (ConstantString "aa" (Character 1 2 () []))) ()) (= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) ()) (= (Var 2 s) (StrOp (ConstantString "test" (Character 1 4 () [])) Repeat (ConstantInteger 5 (Integer 4 [])) (Character 1 20 () []) (ConstantString "testtesttesttesttest" (Character 1 20 () []))) ()) (= (Var 2 s) (StrOp (ConstantInteger 4 (Integer 4 [])) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 8 () []) (ConstantString "bbbbbbbb" (Character 1 8 () []))) ()) (= (Var 2 s) (StrOp (UnaryOp USub (ConstantInteger 40 (Integer 4 [])) (Integer 4 []) (ConstantInteger -40 (Integer 4 []))) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) ()) (= (Var 2 s) (StrOp (StrOp (ConstantInteger 3 (Integer 4 [])) Repeat (ConstantString "a" (Character 1 1 () [])) (Character 1 3 () []) (ConstantString "aaa" (Character 1 3 () []))) Repeat (ConstantInteger 3 (Integer 4 [])) (Character 1 9 () []) (ConstantString "aaaaaaaaa" (Character 1 9 () []))) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_repeat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_repeat [] [(= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (ConstantInteger 2 (Integer 4 [])) (Character 1 2 () []) (ConstantString "aa" (Character 1 2 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "test" (Character 1 4 () [])) Repeat (ConstantInteger 5 (Integer 4 [])) (Character 1 20 () []) (ConstantString "testtesttesttesttest" (Character 1 20 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantInteger 4 (Integer 4 [])) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 8 () []) (ConstantString "bbbbbbbb" (Character 1 8 () []))) () .false.) (= (Var 2 s) (StrOp (UnaryOp USub (ConstantInteger 40 (Integer 4 [])) (Integer 4 []) (ConstantInteger -40 (Integer 4 []))) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .false.) (= (Var 2 s) (StrOp (StrOp (ConstantInteger 3 (Integer 4 [])) Repeat (ConstantString "a" (Character 1 1 () [])) (Character 1 3 () []) (ConstantString "aaa" (Character 1 3 () []))) Repeat (ConstantInteger 3 (Integer 4 [])) (Character 1 9 () []) (ConstantString "aaaaaaaaa" (Character 1 9 () []))) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr12-5c5b71e.json b/tests/reference/asr-expr12-5c5b71e.json index df75e5c4dc..c18dc348ba 100644 --- a/tests/reference/asr-expr12-5c5b71e.json +++ b/tests/reference/asr-expr12-5c5b71e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr12-5c5b71e.stdout", - "stdout_hash": "0ced271b644c2c04f7f8b9b92b322e0f478f3618106772fea96f2a33", + "stdout_hash": "64ca23b37620e2376e7bd26721db5fb0a1f0b61a223a521d6ba68949", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr12-5c5b71e.stdout b/tests/reference/asr-expr12-5c5b71e.stdout index 286933b704..c9677d6858 100644 --- a/tests/reference/asr-expr12-5c5b71e.stdout +++ b/tests/reference/asr-expr12-5c5b71e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 6 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), check: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.)}) check [] [(= (Var 3 a) (FunctionCall 1 test () [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) () ()) ()) (= (Var 3 _lpython_return_variable) (Var 3 a) ()) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), main0: (Subroutine (SymbolTable 4 {x: (Variable 4 x Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(= (Var 4 x) (FunctionCall 1 check () [] [] (Integer 4 []) () ()) ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b In () () Default (Integer 4 []) Source Public Required .false.)}) test [(Var 2 a) (Var 2 b)] [(= (Var 2 _lpython_return_variable) (BinOp (Var 2 a) Pow (Var 2 b) (Integer 4 []) () ()) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ())}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 6 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), check: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.)}) check [] [(= (Var 3 a) (FunctionCall 1 test () [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 3 _lpython_return_variable) (Var 3 a) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), main0: (Subroutine (SymbolTable 4 {x: (Variable 4 x Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(= (Var 4 x) (FunctionCall 1 check () [] [] (Integer 4 []) () ()) () .false.)] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b In () () Default (Integer 4 []) Source Public Required .false.)}) test [(Var 2 a) (Var 2 b)] [(= (Var 2 _lpython_return_variable) (BinOp (Var 2 a) Pow (Var 2 b) (Integer 4 []) () ()) () .false.) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ())}) []) diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json index 9e0bb79eef..46a1b96e78 100644 --- a/tests/reference/asr-expr13-81bdb5a.json +++ b/tests/reference/asr-expr13-81bdb5a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr13-81bdb5a.stdout", - "stdout_hash": "25aca9a36f7a40fba1cde5b8211bac48a87664470a93829629b8d2c5", + "stdout_hash": "0f17bb5236579522ed7428635695ca185765f6bd76efd53d5cd7e10b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr13-81bdb5a.stdout b/tests/reference/asr-expr13-81bdb5a.stdout index d538d0cbef..33f2c55ec2 100644 --- a/tests/reference/asr-expr13-81bdb5a.stdout +++ b/tests/reference/asr-expr13-81bdb5a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Compare: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 1 []) Source Public Required .false.)}) test_Compare [] [(= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) Gt (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) LtE (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) Lt (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantReal 5.600000 (Real 8 [])) GtE (ConstantReal 5.599990 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantReal 3.300000 (Real 8 [])) Eq (ConstantReal 3.300000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantReal 3.300000 (Real 8 [])) NotEq (ConstantReal 3.400000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantComplex 3.000000 4.000000 (Complex 8 [])) Eq (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) Gt (ConstantString "abd" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "" (Character 1 0 () [])) Lt (ConstantString "s" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "-abs" (Character 1 4 () [])) GtE (ConstantString "abs" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "abcd" (Character 1 4 () [])) LtE (ConstantString "abcde" (Character 1 5 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) Eq (ConstantString "abc" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) NotEq (ConstantString "abd" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantString "" (Character 1 0 () [])) Eq (ConstantString "+" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantLogical .true. (Logical 1 [])) Gt (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantLogical .true. (Logical 1 [])) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantLogical .false. (Logical 1 [])) NotEq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (ConstantLogical .false. (Logical 1 [])) GtE (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Compare: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 1 []) Source Public Required .false.)}) test_Compare [] [(= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) Gt (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) LtE (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantInteger 5 (Integer 4 [])) Lt (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantReal 5.600000 (Real 8 [])) GtE (ConstantReal 5.599990 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantReal 3.300000 (Real 8 [])) Eq (ConstantReal 3.300000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantReal 3.300000 (Real 8 [])) NotEq (ConstantReal 3.400000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantComplex 3.000000 4.000000 (Complex 8 [])) Eq (ConstantComplex 3.000000 4.000000 (Complex 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) Gt (ConstantString "abd" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "" (Character 1 0 () [])) Lt (ConstantString "s" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "-abs" (Character 1 4 () [])) GtE (ConstantString "abs" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "abcd" (Character 1 4 () [])) LtE (ConstantString "abcde" (Character 1 5 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) Eq (ConstantString "abc" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "abc" (Character 1 3 () [])) NotEq (ConstantString "abd" (Character 1 3 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantString "" (Character 1 0 () [])) Eq (ConstantString "+" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantLogical .true. (Logical 1 [])) Gt (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantLogical .true. (Logical 1 [])) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantLogical .false. (Logical 1 [])) NotEq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) () .false.) (= (Var 2 a) (Compare (ConstantLogical .false. (Logical 1 [])) GtE (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .false. (Logical 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr2-2e78a12.json b/tests/reference/asr-expr2-2e78a12.json index 30174be1d8..1bc72c7191 100644 --- a/tests/reference/asr-expr2-2e78a12.json +++ b/tests/reference/asr-expr2-2e78a12.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr2-2e78a12.stdout", - "stdout_hash": "30936f6b43898b5cad6c23422795ce8f8d0aa20f5a3cea6ff300d5ce", + "stdout_hash": "340573e48fac45a3749c524b1c347f55bac7564fcdbf483835882238", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr2-2e78a12.stdout b/tests/reference/asr-expr2-2e78a12.stdout index f277a35fbe..b530a9ec63 100644 --- a/tests/reference/asr-expr2-2e78a12.stdout +++ b/tests/reference/asr-expr2-2e78a12.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_boolOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 1 []) Source Public Required .false.)}) test_boolOp [] [(= (Var 2 a) (ConstantLogical .false. (Logical 1 [])) ()) (= (Var 2 b) (ConstantLogical .true. (Logical 1 [])) ()) (= (Var 2 a) (BoolOp (Var 2 a) And (Var 2 b) (Logical 1 []) ()) ()) (= (Var 2 b) (BoolOp (Var 2 a) Or (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) ()) ()) (= (Var 2 a) (BoolOp (Var 2 a) Or (Var 2 b) (Logical 1 []) ()) ()) (= (Var 2 a) (BoolOp (Var 2 a) And (Compare (Var 2 b) Eq (Var 2 b) (Logical 4 []) () ()) (Logical 1 []) ()) ()) (= (Var 2 a) (BoolOp (Var 2 a) And (Compare (Var 2 b) NotEq (Var 2 b) (Logical 4 []) () ()) (Logical 1 []) ()) ()) (= (Var 2 a) (BoolOp (Var 2 b) Or (Var 2 b) (Logical 1 []) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_boolOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 1 []) Source Public Required .false.)}) test_boolOp [] [(= (Var 2 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (= (Var 2 b) (ConstantLogical .true. (Logical 1 [])) () .false.) (= (Var 2 a) (BoolOp (Var 2 a) And (Var 2 b) (Logical 1 []) ()) () .false.) (= (Var 2 b) (BoolOp (Var 2 a) Or (ConstantLogical .true. (Logical 1 [])) (Logical 1 []) ()) () .false.) (= (Var 2 a) (BoolOp (Var 2 a) Or (Var 2 b) (Logical 1 []) ()) () .false.) (= (Var 2 a) (BoolOp (Var 2 a) And (Compare (Var 2 b) Eq (Var 2 b) (Logical 4 []) () ()) (Logical 1 []) ()) () .false.) (= (Var 2 a) (BoolOp (Var 2 a) And (Compare (Var 2 b) NotEq (Var 2 b) (Logical 4 []) () ()) (Logical 1 []) ()) () .false.) (= (Var 2 a) (BoolOp (Var 2 b) Or (Var 2 b) (Logical 1 []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr3-10eb0a4.json b/tests/reference/asr-expr3-10eb0a4.json index 94ba314a51..2ecf2aafbf 100644 --- a/tests/reference/asr-expr3-10eb0a4.json +++ b/tests/reference/asr-expr3-10eb0a4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr3-10eb0a4.stdout", - "stdout_hash": "1355bd652786de8629ab9fc2fa7a55c3be0429e973d756ddb30cd6a9", + "stdout_hash": "a26b96e94ab0ec2147b30c31e93492cb7d190b4da2f016283951a37a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr3-10eb0a4.stdout b/tests/reference/asr-expr3-10eb0a4.stdout index 903fa6a772..e2e4577065 100644 --- a/tests/reference/asr-expr3-10eb0a4.stdout +++ b/tests/reference/asr-expr3-10eb0a4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_cast: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_cast [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 2 b) (ImplicitCast (ConstantReal 4.200000 (Real 8 [])) RealToReal (Real 4 []) ()) ()) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 4 []) ()) Mul (Var 2 b) (Real 4 []) () ()) ()) (= (Var 2 b) (BinOp (Var 2 b) Add (ImplicitCast (ConstantInteger 1 (Integer 4 [])) IntegerToReal (Real 4 []) ()) (Real 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 5 (Integer 4 [])) ()) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 8 []) ()) Sub (ConstantReal 3.900000 (Real 8 [])) (Real 8 []) () ()) ()) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 8 []) ()) Div (Var 2 b) (Real 8 []) () ()) ()) (= (Var 2 b) (ImplicitCast (BinOp (ImplicitCast (ConstantInteger 3 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (ConstantInteger 4 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (If (Compare (ImplicitCast (Var 2 a) IntegerToReal (Real 4 []) ()) Lt (Var 2 b) (Logical 4 []) () ()) [(Print () [(ConstantString "a < b" (Character 1 5 () []))])] [])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_cast: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_cast [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 2 b) (ImplicitCast (ConstantReal 4.200000 (Real 8 [])) RealToReal (Real 4 []) ()) () .false.) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 4 []) ()) Mul (Var 2 b) (Real 4 []) () ()) () .false.) (= (Var 2 b) (BinOp (Var 2 b) Add (ImplicitCast (ConstantInteger 1 (Integer 4 [])) IntegerToReal (Real 4 []) ()) (Real 4 []) () ()) () .false.) (= (Var 2 a) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 8 []) ()) Sub (ConstantReal 3.900000 (Real 8 [])) (Real 8 []) () ()) () .false.) (= (Var 2 a) (BinOp (ImplicitCast (Var 2 a) IntegerToReal (Real 8 []) ()) Div (Var 2 b) (Real 8 []) () ()) () .false.) (= (Var 2 b) (ImplicitCast (BinOp (ImplicitCast (ConstantInteger 3 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (ConstantInteger 4 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) () .false.) (If (Compare (ImplicitCast (Var 2 a) IntegerToReal (Real 4 []) ()) Lt (Var 2 b) (Logical 4 []) () ()) [(Print () [(ConstantString "a < b" (Character 1 5 () []))])] [])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr4-cef6743.json b/tests/reference/asr-expr4-cef6743.json index fd0ad3b978..731bce34ec 100644 --- a/tests/reference/asr-expr4-cef6743.json +++ b/tests/reference/asr-expr4-cef6743.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr4-cef6743.stdout", - "stdout_hash": "9d0e28410d0359f023f5871c1a6afe2dafa33922aa6e9aa4d41fe949", + "stdout_hash": "71edcc528e721c4cada5d9baafcaa4d77e212a7e9c240ead00ae7433", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr4-cef6743.stdout b/tests/reference/asr-expr4-cef6743.stdout index d42a0f109b..d337c3dbf9 100644 --- a/tests/reference/asr-expr4-cef6743.stdout +++ b/tests/reference/asr-expr4-cef6743.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_del: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_del [] [(= (Var 2 a) (ConstantInteger 4 (Integer 4 [])) ()) (= (Var 2 b) (ConstantInteger 20 (Integer 4 [])) ()) (ExplicitDeallocate [2 a 2 b])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_del: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_del [] [(= (Var 2 a) (ConstantInteger 4 (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantInteger 20 (Integer 4 [])) () .false.) (ExplicitDeallocate [2 a 2 b])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr5-645ffcc.json b/tests/reference/asr-expr5-645ffcc.json index 0940b9326f..ad0fe1b1d8 100644 --- a/tests/reference/asr-expr5-645ffcc.json +++ b/tests/reference/asr-expr5-645ffcc.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr5-645ffcc.stdout", - "stdout_hash": "4c950262d51cca50f6744b10488746500e692ce0f8f0dd9a285fb4c6", + "stdout_hash": "7bb69a2743c1f275852afa94d2353e403219170007907257f9ff3cee", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr5-645ffcc.stdout b/tests/reference/asr-expr5-645ffcc.stdout index a79fd7b766..bda634478a 100644 --- a/tests/reference/asr-expr5-645ffcc.stdout +++ b/tests/reference/asr-expr5-645ffcc.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_concat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_concat [] [(= (Var 2 s) (StrOp (ConstantString "3" (Character 1 1 () [])) Concat (ConstantString "4" (Character 1 1 () [])) (Character 1 2 () []) (ConstantString "34" (Character 1 2 () []))) ()) (= (Var 2 s) (StrOp (ConstantString "a " (Character 1 2 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 6 () []) (ConstantString "a test" (Character 1 6 () []))) ()) (= (Var 2 s) (StrOp (StrOp (ConstantString "test" (Character 1 4 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 8 () []) (ConstantString "testtest" (Character 1 8 () []))) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 12 () []) (ConstantString "testtesttest" (Character 1 12 () []))) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_concat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_concat [] [(= (Var 2 s) (StrOp (ConstantString "3" (Character 1 1 () [])) Concat (ConstantString "4" (Character 1 1 () [])) (Character 1 2 () []) (ConstantString "34" (Character 1 2 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "a " (Character 1 2 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 6 () []) (ConstantString "a test" (Character 1 6 () []))) () .false.) (= (Var 2 s) (StrOp (StrOp (ConstantString "test" (Character 1 4 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 8 () []) (ConstantString "testtest" (Character 1 8 () []))) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 12 () []) (ConstantString "testtesttest" (Character 1 12 () []))) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr6-368e5ed.json b/tests/reference/asr-expr6-368e5ed.json index 689dd822dc..50f6a21605 100644 --- a/tests/reference/asr-expr6-368e5ed.json +++ b/tests/reference/asr-expr6-368e5ed.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr6-368e5ed.stdout", - "stdout_hash": "19bd88cfd741492c42f9500fd5d647003f42d03784896ef5dc00cd35", + "stdout_hash": "140277c246de0098db012b64729a25c9c5f5aff74154b48eabf2558c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr6-368e5ed.stdout b/tests/reference/asr-expr6-368e5ed.stdout index 85dfc6c708..abc29f5c40 100644 --- a/tests/reference/asr-expr6-368e5ed.stdout +++ b/tests/reference/asr-expr6-368e5ed.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_ifexp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Logical 1 []) Source Public Required .false.)}) test_ifexp [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 2 b) (IfExp (Compare (Var 2 a) Eq (ConstantInteger 2 (Integer 4 [])) (Logical 4 []) () ()) (ConstantInteger 6 (Integer 4 [])) (ConstantInteger 8 (Integer 4 [])) (Integer 4 [])) ()) (= (Var 2 c) (IfExp (Compare (Var 2 b) Gt (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) (ConstantLogical .true. (Logical 1 [])) (ConstantLogical .false. (Logical 1 [])) (Logical 1 [])) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_ifexp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Logical 1 []) Source Public Required .false.)}) test_ifexp [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 2 b) (IfExp (Compare (Var 2 a) Eq (ConstantInteger 2 (Integer 4 [])) (Logical 4 []) () ()) (ConstantInteger 6 (Integer 4 [])) (ConstantInteger 8 (Integer 4 [])) (Integer 4 [])) () .false.) (= (Var 2 c) (IfExp (Compare (Var 2 b) Gt (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) (ConstantLogical .true. (Logical 1 [])) (ConstantLogical .false. (Logical 1 [])) (Logical 1 [])) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json index 85e5c7af66..6b1e8fa767 100644 --- a/tests/reference/asr-expr7-480ba2f.json +++ b/tests/reference/asr-expr7-480ba2f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr7-480ba2f.stdout", - "stdout_hash": "65f0b67e776362bc0264289bf7244daf9bf9e370e9a967d9550397d6", + "stdout_hash": "8c0927e706a7c90b0bb83620889c26e6f30098e2e75724ebfb621e18", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr7-480ba2f.stdout b/tests/reference/asr-expr7-480ba2f.stdout index 19098af78a..aea8100e39 100644 --- a/tests/reference/asr-expr7-480ba2f.stdout +++ b/tests/reference/asr-expr7-480ba2f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 20 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main0: (Subroutine (SymbolTable 4 {c: (Variable 4 c Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(SubroutineCall 1 test_pow () [] ()) (= (Var 4 c) (FunctionCall 1 test_pow_1 () [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) () ()) ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 19 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 6 pow lpython_builtin [] pow Private)}) test_pow [] [(= (Var 2 a) (FunctionCall 2 pow () [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_pow_1: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 3 pow 6 pow lpython_builtin [] pow Private), res: (Variable 3 res Local () () Default (Integer 4 []) Source Public Required .false.)}) test_pow_1 [(Var 3 a) (Var 3 b)] [(= (Var 3 res) (FunctionCall 3 pow () [(Var 3 a) (Var 3 b)] [] (Integer 4 []) () ()) ()) (= (Var 3 _lpython_return_variable) (Var 3 res) ()) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ())}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 20 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main0: (Subroutine (SymbolTable 4 {c: (Variable 4 c Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(SubroutineCall 1 test_pow () [] ()) (= (Var 4 c) (FunctionCall 1 test_pow_1 () [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.)] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 19 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 6 pow lpython_builtin [] pow Private)}) test_pow [] [(= (Var 2 a) (FunctionCall 2 pow () [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_pow_1: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 3 pow 6 pow lpython_builtin [] pow Private), res: (Variable 3 res Local () () Default (Integer 4 []) Source Public Required .false.)}) test_pow_1 [(Var 3 a) (Var 3 b)] [(= (Var 3 res) (FunctionCall 3 pow () [(Var 3 a) (Var 3 b)] [] (Integer 4 []) () ()) () .false.) (= (Var 3 _lpython_return_variable) (Var 3 res) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ())}) []) diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json index cfef81658c..b5f9c7dc0c 100644 --- a/tests/reference/asr-expr8-6beda60.json +++ b/tests/reference/asr-expr8-6beda60.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr8-6beda60.stdout", - "stdout_hash": "8de773c3070286f89f8ef3dc18db71268dfe7e7fc00ab67d5cb63c83", + "stdout_hash": "bd2e50c773dfdedbdd243320f7ad35e41368fd231360c2e250b3da4f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr8-6beda60.stdout b/tests/reference/asr-expr8-6beda60.stdout index 294c6bb095..93427f3880 100644 --- a/tests/reference/asr-expr8-6beda60.stdout +++ b/tests/reference/asr-expr8-6beda60.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_binop: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Real 4 []) Source Public Required .false.)}) test_binop [] [(= (Var 2 x) (BinOp (ConstantInteger 2 (Integer 4 [])) Pow (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger 8 (Integer 4 [])) ()) ()) (= (Var 2 x) (BinOp (ImplicitCast (ConstantInteger 2 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Pow (ConstantReal 3.500000 (Real 8 [])) (Real 8 []) () ()) ()) (= (Var 2 x) (BinOp (ConstantInteger 54 (Integer 4 [])) Sub (ConstantInteger 100 (Integer 4 [])) (Integer 4 []) (ConstantInteger -46 (Integer 4 [])) ()) ()) (= (Var 2 x2) (ImplicitCast (BinOp (BinOp (ConstantReal 3.454000 (Real 8 [])) Sub (ConstantReal 765.430000 (Real 8 [])) (Real 8 []) (ConstantReal -761.976000 (Real 8 [])) ()) Add (ConstantReal 534.600000 (Real 8 [])) (Real 8 []) (ConstantReal -227.376000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 x2) (ImplicitCast (BinOp (ConstantReal 5346.565000 (Real 8 [])) Mul (ConstantReal 3.450000 (Real 8 [])) (Real 8 []) (ConstantReal 18445.649250 (Real 8 [])) ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 x2) (ImplicitCast (BinOp (ConstantReal 5346.565000 (Real 8 [])) Pow (ConstantReal 3.450000 (Real 8 [])) (Real 8 []) (ConstantReal 7275422789925.217773 (Real 8 [])) ()) RealToReal (Real 4 []) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_binop: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Real 4 []) Source Public Required .false.)}) test_binop [] [(= (Var 2 x) (BinOp (ConstantInteger 2 (Integer 4 [])) Pow (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger 8 (Integer 4 [])) ()) () .false.) (= (Var 2 x) (BinOp (ImplicitCast (ConstantInteger 2 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Pow (ConstantReal 3.500000 (Real 8 [])) (Real 8 []) () ()) () .false.) (= (Var 2 x) (BinOp (ConstantInteger 54 (Integer 4 [])) Sub (ConstantInteger 100 (Integer 4 [])) (Integer 4 []) (ConstantInteger -46 (Integer 4 [])) ()) () .false.) (= (Var 2 x2) (ImplicitCast (BinOp (BinOp (ConstantReal 3.454000 (Real 8 [])) Sub (ConstantReal 765.430000 (Real 8 [])) (Real 8 []) (ConstantReal -761.976000 (Real 8 [])) ()) Add (ConstantReal 534.600000 (Real 8 [])) (Real 8 []) (ConstantReal -227.376000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.) (= (Var 2 x2) (ImplicitCast (BinOp (ConstantReal 5346.565000 (Real 8 [])) Mul (ConstantReal 3.450000 (Real 8 [])) (Real 8 []) (ConstantReal 18445.649250 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.) (= (Var 2 x2) (ImplicitCast (BinOp (ConstantReal 5346.565000 (Real 8 [])) Pow (ConstantReal 3.450000 (Real 8 [])) (Real 8 []) (ConstantReal 7275422789925.217773 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr9-814e4bc.json b/tests/reference/asr-expr9-814e4bc.json index 97e3eaf20e..1d87dee826 100644 --- a/tests/reference/asr-expr9-814e4bc.json +++ b/tests/reference/asr-expr9-814e4bc.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr9-814e4bc.stdout", - "stdout_hash": "8c66603ca534cd02f89c60e9db9f581f5106ea4ab379707348a40b00", + "stdout_hash": "ccb7832e8f47078ed6f2bdf2882f32b0adac54f970e3c7843f84fe0f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr9-814e4bc.stdout b/tests/reference/asr-expr9-814e4bc.stdout index eead6ad494..03cb002743 100644 --- a/tests/reference/asr-expr9-814e4bc.stdout +++ b/tests/reference/asr-expr9-814e4bc.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 8 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 6 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) main0 [] [(= (Var 6 i) (FunctionCall 1 test_return_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) ()) (= (Var 6 s) (FunctionCall 1 test_return_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) () ()) ()) (= (Var 6 i) (FunctionCall 1 test_return_3 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) ()) (SubroutineCall 1 test_return_4 () [(ConstantInteger 4 (Integer 4 []))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_return_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) test_return_1 [(Var 2 a)] [(= (Var 2 x) (ConstantInteger 5 (Integer 4 [])) ()) (= (Var 2 _lpython_return_variable) (Var 2 x) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_return_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Character 1 -2 () []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_return_2 [(Var 3 a)] [(= (Var 3 x) (ConstantString "test" (Character 1 4 () [])) ()) (= (Var 3 _lpython_return_variable) (Var 3 x) ()) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_return_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 4 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_3 [(Var 4 a)] [(= (Var 4 a) (ConstantInteger 3 (Integer 4 [])) ()) (= (Var 4 _lpython_return_variable) (Var 4 a) ()) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ()), test_return_4: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_4 [(Var 5 a)] [(= (Var 5 a) (ConstantInteger 1 (Integer 4 [])) ()) (Return)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 8 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 6 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) main0 [] [(= (Var 6 i) (FunctionCall 1 test_return_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 6 s) (FunctionCall 1 test_return_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) () ()) () .false.) (= (Var 6 i) (FunctionCall 1 test_return_3 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (SubroutineCall 1 test_return_4 () [(ConstantInteger 4 (Integer 4 []))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_return_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) test_return_1 [(Var 2 a)] [(= (Var 2 x) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 _lpython_return_variable) (Var 2 x) () .false.) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_return_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Character 1 -2 () []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_return_2 [(Var 3 a)] [(= (Var 3 x) (ConstantString "test" (Character 1 4 () [])) () .false.) (= (Var 3 _lpython_return_variable) (Var 3 x) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_return_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 4 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_3 [(Var 4 a)] [(= (Var 4 a) (ConstantInteger 3 (Integer 4 [])) () .false.) (= (Var 4 _lpython_return_variable) (Var 4 a) () .false.) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ()), test_return_4: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_4 [(Var 5 a)] [(= (Var 5 a) (ConstantInteger 1 (Integer 4 [])) () .false.) (Return)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr_01-211000e.json b/tests/reference/asr-expr_01-211000e.json index 24a879e880..fd11893130 100644 --- a/tests/reference/asr-expr_01-211000e.json +++ b/tests/reference/asr-expr_01-211000e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr_01-211000e.stdout", - "stdout_hash": "8328e1a68c0087d397d97644f791d243ba69b36ecad9b88435acc6d2", + "stdout_hash": "5383891d90758bf98a3acb5c5abf384e855371ff94596fc5024dbb5e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr_01-211000e.stdout b/tests/reference/asr-expr_01-211000e.stdout index 82d2e6cf29..294e79b8e8 100644 --- a/tests/reference/asr-expr_01-211000e.stdout +++ b/tests/reference/asr-expr_01-211000e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 4 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Integer 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.), y2: (Variable 2 y2 Local () () Default (Real 8 []) Source Public Required .false.)}) main0 [] [(= (Var 2 x) (BinOp (BinOp (ConstantInteger 2 (Integer 4 [])) Add (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) Mul (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger 25 (Integer 4 [])) ()) ()) (Print () [(Var 2 x)])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 3 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 4 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Integer 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.), y2: (Variable 2 y2 Local () () Default (Real 8 []) Source Public Required .false.)}) main0 [] [(= (Var 2 x) (BinOp (BinOp (ConstantInteger 2 (Integer 4 [])) Add (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) Mul (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger 25 (Integer 4 [])) ()) () .false.) (Print () [(Var 2 x)])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 3 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())])}) []) diff --git a/tests/reference/asr-global_scope1-354e217.json b/tests/reference/asr-global_scope1-354e217.json index 1fc42c99bb..124a14abc6 100644 --- a/tests/reference/asr-global_scope1-354e217.json +++ b/tests/reference/asr-global_scope1-354e217.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-global_scope1-354e217.stdout", - "stdout_hash": "c619febb9c231a876749f33ced3991b86e33bb80c82b55573531cd1c", + "stdout_hash": "2eeb552a9abe950ba3f38caf0acc448154d75cc0efd7471d7c7461e4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-global_scope1-354e217.stdout b/tests/reference/asr-global_scope1-354e217.stdout index 40ba5c386f..b8d3da226d 100644 --- a/tests/reference/asr-global_scope1-354e217.stdout +++ b/tests/reference/asr-global_scope1-354e217.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 3 {}) _lfortran_main_program [] [(= (Var 1 i) (ConstantInteger 5 (Integer 4 [])) ())] Source Public Implementation () .false. .false.), i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false.), main_program: (Program (SymbolTable 2 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 3 {}) _lfortran_main_program [] [(= (Var 1 i) (ConstantInteger 5 (Integer 4 [])) () .false.)] Source Public Implementation () .false. .false.), i: (Variable 1 i Local () () Default (Integer 4 []) Source Public Required .false.), main_program: (Program (SymbolTable 2 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())])}) []) diff --git a/tests/reference/asr-list1-770ba33.json b/tests/reference/asr-list1-770ba33.json index 043d395ed4..de0e5b9db8 100644 --- a/tests/reference/asr-list1-770ba33.json +++ b/tests/reference/asr-list1-770ba33.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-list1-770ba33.stdout", - "stdout_hash": "8d8b6e7775ff0eeba1cf05bb19d8d76a6d66617217d948c5f2e6c604", + "stdout_hash": "ec54ddb46bf28165d1af48cc4124189ee3040dbe575ff9925e762837", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-list1-770ba33.stdout b/tests/reference/asr-list1-770ba33.stdout index 2ed95fc7e9..4746d09008 100644 --- a/tests/reference/asr-list1-770ba33.stdout +++ b/tests/reference/asr-list1-770ba33.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_List: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Integer 4 []) Source Public Required .false.), d: (Variable 2 d Local () () Default (Integer 4 []) Source Public Required .false.)}) test_List [] [(= (Var 2 a) (ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) ()) (= (Var 2 a) (ConstantArray [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Integer 4 [])) ()) (= (Var 2 b) (ConstantArray [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Character 1 1 () [])) ()) (= (Var 2 c) (ConstantArray [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) (ConstantArray [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Integer 4 []))] (Integer 4 [])) ()) (= (Var 2 d) (ArrayRef 2 a [(() (ConstantInteger 2 (Integer 4 [])) ())] (Integer 4 []) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_List: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Integer 4 []) Source Public Required .false.), d: (Variable 2 d Local () () Default (Integer 4 []) Source Public Required .false.)}) test_List [] [(= (Var 2 a) (ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 a) (ConstantArray [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantArray [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Character 1 1 () [])) () .false.) (= (Var 2 c) (ConstantArray [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) (ConstantArray [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 d) (ArrayRef 2 a [(() (ConstantInteger 2 (Integer 4 [])) ())] (Integer 4 []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-loop1-10d3109.json b/tests/reference/asr-loop1-10d3109.json index 54dd4f0495..04811a09d4 100644 --- a/tests/reference/asr-loop1-10d3109.json +++ b/tests/reference/asr-loop1-10d3109.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-loop1-10d3109.stdout", - "stdout_hash": "0d76828da8d01bcd78c1bb6b59606bf5ac59e03c2cd39ed10840da7d", + "stdout_hash": "d17b85c17e447e87260a368e2436f5e3a0b0432012f7a24d3b6ddee1", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-loop1-10d3109.stdout b/tests/reference/asr-loop1-10d3109.stdout index 7068b88f00..f75631c1be 100644 --- a/tests/reference/asr-loop1-10d3109.stdout +++ b/tests/reference/asr-loop1-10d3109.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 7 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 8 []) Source Public Required .false.)}) main0 [] [(= (Var 5 i) (FunctionCall 1 test_factorial_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) ()) (= (Var 5 i) (FunctionCall 1 test_factorial_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) ()) (= (Var 5 j) (FunctionCall 1 test_factorial_3 () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 8 []) () ()) ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 6 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_factorial_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 2 result Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_1 [(Var 2 x)] [(If (Compare (Var 2 x) Lt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 2 _lpython_return_variable) (ConstantInteger 0 (Integer 4 [])) ()) (Return)] []) (= (Var 2 result) (ConstantInteger 1 (Integer 4 [])) ()) (WhileLoop (Compare (Var 2 x) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 2 result) (BinOp (Var 2 result) Mul (Var 2 x) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Var 2 x) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())]) (= (Var 2 _lpython_return_variable) (Var 2 result) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_factorial_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_2 [(Var 3 x)] [(= (Var 3 result) (ConstantInteger 1 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (ConstantInteger 1 (Integer 4 [])) (BinOp (BinOp (Var 3 x) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (Var 3 result) (BinOp (Var 3 result) Mul (Var 3 i) (Integer 4 []) () ()) ())]) (= (Var 3 _lpython_return_variable) (Var 3 result) ()) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_factorial_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 8 []) Source Public Required .false.), result: (Variable 4 result Local () () Default (Integer 8 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_3 [(Var 4 x)] [(If (Compare (Var 4 x) Lt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 4 _lpython_return_variable) (ImplicitCast (ConstantInteger 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Return)] []) (= (Var 4 result) (ImplicitCast (ConstantInteger 1 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (WhileLoop (Compare (Var 4 x) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 4 result) (ImplicitCast (BinOp (ImplicitCast (Var 4 result) IntegerToInteger (Integer 4 []) ()) Mul (Var 4 x) (Integer 4 []) () ()) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 4 x) (BinOp (Var 4 x) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())]) (= (Var 4 _lpython_return_variable) (Var 4 result) ()) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ())}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 7 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 8 []) Source Public Required .false.)}) main0 [] [(= (Var 5 i) (FunctionCall 1 test_factorial_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 5 i) (FunctionCall 1 test_factorial_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 5 j) (FunctionCall 1 test_factorial_3 () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 8 []) () ()) () .false.)] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 6 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_factorial_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 2 result Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_1 [(Var 2 x)] [(If (Compare (Var 2 x) Lt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 2 _lpython_return_variable) (ConstantInteger 0 (Integer 4 [])) () .false.) (Return)] []) (= (Var 2 result) (ConstantInteger 1 (Integer 4 [])) () .false.) (WhileLoop (Compare (Var 2 x) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 2 result) (BinOp (Var 2 result) Mul (Var 2 x) (Integer 4 []) () ()) () .false.) (= (Var 2 x) (BinOp (Var 2 x) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) () .false.)]) (= (Var 2 _lpython_return_variable) (Var 2 result) () .false.) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_factorial_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_2 [(Var 3 x)] [(= (Var 3 result) (ConstantInteger 1 (Integer 4 [])) () .false.) (DoLoop ((Var 3 i) (ConstantInteger 1 (Integer 4 [])) (BinOp (BinOp (Var 3 x) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (Var 3 result) (BinOp (Var 3 result) Mul (Var 3 i) (Integer 4 []) () ()) () .false.)]) (= (Var 3 _lpython_return_variable) (Var 3 result) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_factorial_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 8 []) Source Public Required .false.), result: (Variable 4 result Local () () Default (Integer 8 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.)}) test_factorial_3 [(Var 4 x)] [(If (Compare (Var 4 x) Lt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 4 _lpython_return_variable) (ImplicitCast (ConstantInteger 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) () .false.) (Return)] []) (= (Var 4 result) (ImplicitCast (ConstantInteger 1 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) () .false.) (WhileLoop (Compare (Var 4 x) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(= (Var 4 result) (ImplicitCast (BinOp (ImplicitCast (Var 4 result) IntegerToInteger (Integer 4 []) ()) Mul (Var 4 x) (Integer 4 []) () ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 4 x) (BinOp (Var 4 x) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) () .false.)]) (= (Var 4 _lpython_return_variable) (Var 4 result) () .false.) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ())}) []) diff --git a/tests/reference/asr-loop3-a579196.json b/tests/reference/asr-loop3-a579196.json index 22ed66cd3e..5b41dea359 100644 --- a/tests/reference/asr-loop3-a579196.json +++ b/tests/reference/asr-loop3-a579196.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-loop3-a579196.stdout", - "stdout_hash": "c2c4f9112ca70d8a2d87b4e71a5aa2cd8eaba8c72e9399690ee5bce1", + "stdout_hash": "b396366f73cc710a04ba9ea9fe6c47e57b06c84cd543ca986bdbde7d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-loop3-a579196.stdout b/tests/reference/asr-loop3-a579196.stdout index 76353e1b53..5038da51ab 100644 --- a/tests/reference/asr-loop3-a579196.stdout +++ b/tests/reference/asr-loop3-a579196.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_pass: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_pass [] [(= (Var 2 a) (ConstantInteger 1 (Integer 4 [])) ()) (WhileLoop (Compare (Var 2 a) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_pass: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_pass [] [(= (Var 2 a) (ConstantInteger 1 (Integer 4 [])) () .false.) (WhileLoop (Compare (Var 2 a) Gt (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-set1-b7b913a.json b/tests/reference/asr-set1-b7b913a.json index 68ce276ced..54fb01568a 100644 --- a/tests/reference/asr-set1-b7b913a.json +++ b/tests/reference/asr-set1-b7b913a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-set1-b7b913a.stdout", - "stdout_hash": "5433f9fb4d9340e21b495cf9bc901d8138d67dee4d0378302cba25c4", + "stdout_hash": "11972a7a22d05ccf4956478b630f45c241d82456d42c917a37615b13", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-set1-b7b913a.stdout b/tests/reference/asr-set1-b7b913a.stdout index 89b640bbe6..946be4d9f2 100644 --- a/tests/reference/asr-set1-b7b913a.stdout +++ b/tests/reference/asr-set1-b7b913a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Set: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Set (Integer 4 [])) Source Public Required .false.), b: (Variable 2 b Local () () Default (Set (Character 1 -2 () [])) Source Public Required .false.)}) test_Set [] [(= (Var 2 a) (ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 []))) ()) (= (Var 2 a) (ConstantSet [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) (ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 5 (Integer 4 []))] (Set (Integer 4 []))) ()) (= (Var 2 b) (ConstantSet [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Set (Character 1 1 () []))) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Set: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Set (Integer 4 [])) Source Public Required .false.), b: (Variable 2 b Local () () Default (Set (Character 1 -2 () [])) Source Public Required .false.)}) test_Set [] [(= (Var 2 a) (ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 []))) () .false.) (= (Var 2 a) (ConstantSet [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) (ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 5 (Integer 4 []))] (Set (Integer 4 []))) () .false.) (= (Var 2 b) (ConstantSet [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Set (Character 1 1 () []))) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-subscript1-1acfc19.json b/tests/reference/asr-subscript1-1acfc19.json index 8ca9474572..2095e4ba84 100644 --- a/tests/reference/asr-subscript1-1acfc19.json +++ b/tests/reference/asr-subscript1-1acfc19.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-subscript1-1acfc19.stdout", - "stdout_hash": "bb7b8b7478d50742985082735dfa0d2cf059f67e66a730c1c14915e2", + "stdout_hash": "840aebe44fa6e87ce67d2d8d16393e0db5cebb5774d068cf6b3537f3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-subscript1-1acfc19.stdout b/tests/reference/asr-subscript1-1acfc19.stdout index 48711b551f..b078eee8c7 100644 --- a/tests/reference/asr-subscript1-1acfc19.stdout +++ b/tests/reference/asr-subscript1-1acfc19.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_subscript: (Subroutine (SymbolTable 2 {A: (Variable 2 A Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) Source Public Required .false.), B: (Variable 2 B Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_subscript [] [(= (Var 2 s) (ConstantString "abc" (Character 1 3 () [])) ()) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 0 (Integer 4 [])) ())] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) ())] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [(() () ())] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [(() () (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [(() () (ConstantInteger 2 (Integer 4 [])))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 88 (Integer 4 [])) (ConstantInteger 1 (Integer 4 [])))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 1 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 89 (Integer 4 [])) (Integer 4 []) (ConstantInteger -89 (Integer 4 []))) () (ConstantInteger 4 (Integer 4 [])))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))))] (Character 1 -2 () []) ()) ()) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Character 1 -2 () []) ()) ()) (= (Var 2 i) (ArrayRef 2 A [(() (ConstantInteger 0 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) ()) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) ()) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])))] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_subscript: (Subroutine (SymbolTable 2 {A: (Variable 2 A Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) Source Public Required .false.), B: (Variable 2 B Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_subscript [] [(= (Var 2 s) (ConstantString "abc" (Character 1 3 () [])) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 0 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () (ConstantInteger 2 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 88 (Integer 4 [])) (ConstantInteger 1 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 1 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 89 (Integer 4 [])) (Integer 4 []) (ConstantInteger -89 (Integer 4 []))) () (ConstantInteger 4 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 i) (ArrayRef 2 A [(() (ConstantInteger 0 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])))] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin-aa64615.json b/tests/reference/asr-test_builtin-aa64615.json index 6e5d551796..13ebd52fac 100644 --- a/tests/reference/asr-test_builtin-aa64615.json +++ b/tests/reference/asr-test_builtin-aa64615.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin-aa64615.stdout", - "stdout_hash": "06c7d960ecb9e0562475a7f831b964da93826fc507f6b0872cd3a9f6", + "stdout_hash": "bf82d32c56577821b4de74b4f7a3e704a9d498dce354472da8b9b707", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin-aa64615.stdout b/tests/reference/asr-test_builtin-aa64615.stdout index 0c84aa15d3..1b2619527a 100644 --- a/tests/reference/asr-test_builtin-aa64615.stdout +++ b/tests/reference/asr-test_builtin-aa64615.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 19 {}) _lfortran_main_program [] [(SubroutineCall 1 test_ord () [] ()) (SubroutineCall 1 test_chr () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 18 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_chr: (Subroutine (SymbolTable 3 {chr: (ExternalSymbol 3 chr 5 chr lpython_builtin [] chr Private), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_chr [] [(= (Var 3 i) (ConstantInteger 48 (Integer 4 [])) ()) (= (Var 3 s) (FunctionCall 3 chr () [(Var 3 i)] [] (Character 1 -2 () []) () ()) ()) (Assert (Compare (Var 3 s) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 3 chr () [(ConstantInteger 48 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0" (Character 1 1 () [])) ()) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_ord: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 5 ord lpython_builtin [] ord Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord [] [(= (Var 2 s) (ConstantString "1" (Character 1 1 () [])) ()) (= (Var 2 i) (FunctionCall 2 ord () [(Var 2 s)] [] (Integer 4 []) () ()) ()) (Assert (Compare (Var 2 i) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 ord () [(ConstantString "1" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 49 (Integer 4 [])) ()) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 19 {}) _lfortran_main_program [] [(SubroutineCall 1 test_ord () [] ()) (SubroutineCall 1 test_chr () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 18 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_chr: (Subroutine (SymbolTable 3 {chr: (ExternalSymbol 3 chr 5 chr lpython_builtin [] chr Private), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_chr [] [(= (Var 3 i) (ConstantInteger 48 (Integer 4 [])) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(Var 3 i)] [] (Character 1 -2 () []) () ()) () .false.) (Assert (Compare (Var 3 s) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 3 chr () [(ConstantInteger 48 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0" (Character 1 1 () [])) ()) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_ord: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 5 ord lpython_builtin [] ord Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord [] [(= (Var 2 s) (ConstantString "1" (Character 1 1 () [])) () .false.) (= (Var 2 i) (FunctionCall 2 ord () [(Var 2 s)] [] (Integer 4 []) () ()) () .false.) (Assert (Compare (Var 2 i) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 ord () [(ConstantString "1" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 49 (Integer 4 [])) ()) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.json b/tests/reference/asr-test_builtin_abs-c74d2c9.json index ea2a4fce2a..adabe3315c 100644 --- a/tests/reference/asr-test_builtin_abs-c74d2c9.json +++ b/tests/reference/asr-test_builtin_abs-c74d2c9.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_abs-c74d2c9.stdout", - "stdout_hash": "f3c851e843ddae1aa7179f4a99914aa04f0267c8505c7d3857774bc2", + "stdout_hash": "7a5645324ff458a5b10ba6ee017c55e555d40d6c6566e41df25aac89", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout index f30478bad9..0b01854d08 100644 --- a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout +++ b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_abs () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_abs: (Subroutine (SymbolTable 2 {abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.)}) test_abs [] [(= (Var 2 x) (ConstantReal 5.500000 (Real 8 [])) ()) (Assert (Compare (FunctionCall 2 abs () [(Var 2 x)] [] (Real 8 []) () ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 x) (UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 []))) ()) (Assert (Compare (FunctionCall 2 abs () [(Var 2 x)] [] (Real 8 []) () ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 abs () [(ConstantReal 5.500000 (Real 8 []))] [] (Real 8 []) (ConstantReal 5.500000 (Real 8 [])) ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 abs () [(UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5.500000 (Real 8 [])) ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_abs () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_abs: (Subroutine (SymbolTable 2 {abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.)}) test_abs [] [(= (Var 2 x) (ConstantReal 5.500000 (Real 8 [])) () .false.) (Assert (Compare (FunctionCall 2 abs () [(Var 2 x)] [] (Real 8 []) () ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 x) (UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 []))) () .false.) (Assert (Compare (FunctionCall 2 abs () [(Var 2 x)] [] (Real 8 []) () ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 abs () [(ConstantReal 5.500000 (Real 8 []))] [] (Real 8 []) (ConstantReal 5.500000 (Real 8 [])) ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 abs () [(UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5.500000 (Real 8 [])) ()) Eq (ConstantReal 5.500000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.json b/tests/reference/asr-test_builtin_bin-52ba9fa.json index 00f5cd9d8e..52f904a2fd 100644 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.json +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_bin-52ba9fa.stdout", - "stdout_hash": "18792724f44a999b523dfa1cda6886e0cf00e78c0fc64159a37f175b", + "stdout_hash": "30f27920fa9944266c866c1c7a05a7802dc04650139c503e0805e5ac", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stdout b/tests/reference/asr-test_builtin_bin-52ba9fa.stdout index e375ea7fa6..1e268d4a36 100644 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.stdout +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_bin: (Subroutine (SymbolTable 2 {bin: (ExternalSymbol 2 bin 4 bin lpython_builtin [] bin Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_bin [] [(= (Var 2 i) (ConstantInteger 5 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0b101" (Character 1 5 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (ConstantInteger 64 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0b1000000" (Character 1 9 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0b1000010110" (Character 1 13 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) Eq (ConstantString "0b1000000" (Character 1 9 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) Eq (ConstantString "-0b1000010110" (Character 1 13 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_bin: (Subroutine (SymbolTable 2 {bin: (ExternalSymbol 2 bin 4 bin lpython_builtin [] bin Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_bin [] [(= (Var 2 i) (ConstantInteger 5 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0b101" (Character 1 5 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (ConstantInteger 64 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0b1000000" (Character 1 9 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 []))) () .false.) (Assert (Compare (FunctionCall 2 bin () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0b1000010110" (Character 1 13 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) Eq (ConstantString "0b1000000" (Character 1 9 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) Eq (ConstantString "-0b1000010110" (Character 1 13 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_bool-330223a.json b/tests/reference/asr-test_builtin_bool-330223a.json index a23a86420f..934c07560c 100644 --- a/tests/reference/asr-test_builtin_bool-330223a.json +++ b/tests/reference/asr-test_builtin_bool-330223a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_bool-330223a.stdout", - "stdout_hash": "151a12279912d589ebbb83f4a3995ba5af4b0c71ba1c039b1093fef7", + "stdout_hash": "601e3b95681ab509b6666904c9a963f12377d369a801a39458a2c433", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_bool-330223a.stdout b/tests/reference/asr-test_builtin_bool-330223a.stdout index 5902cc2828..44ebc7b558 100644 --- a/tests/reference/asr-test_builtin_bool-330223a.stdout +++ b/tests/reference/asr-test_builtin_bool-330223a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_bool: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), bool: (ExternalSymbol 2 bool 4 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 2 a) (ConstantInteger 34 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 bool () [(Var 2 a)] [] (Logical 1 []) () ()) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 0 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 bool () [(Var 2 a)] [] (Logical 1 []) () ()) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_bool: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), bool: (ExternalSymbol 2 bool 4 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 2 a) (ConstantInteger 34 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 bool () [(Var 2 a)] [] (Logical 1 []) () ()) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 0 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 bool () [(Var 2 a)] [] (Logical 1 []) () ()) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_float-20601dd.json b/tests/reference/asr-test_builtin_float-20601dd.json index a0443bf7eb..18df310711 100644 --- a/tests/reference/asr-test_builtin_float-20601dd.json +++ b/tests/reference/asr-test_builtin_float-20601dd.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_float-20601dd.stdout", - "stdout_hash": "f968158f287e9459cb14cfe2396a9739a3a55531ebd18272ff4c22c1", + "stdout_hash": "5f17026eded2a50b6ca92af1d492817e38eb032967fdf29bfc4936b4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_float-20601dd.stdout b/tests/reference/asr-test_builtin_float-20601dd.stdout index 41c3cbdca6..a4074a25bf 100644 --- a/tests/reference/asr-test_builtin_float-20601dd.stdout +++ b/tests/reference/asr-test_builtin_float-20601dd.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_float: (Subroutine (SymbolTable 2 {float: (ExternalSymbol 2 float 4 float lpython_builtin [] float Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_float [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 float () [(Var 2 i)] [] (Real 8 []) () ()) Eq (ConstantReal 34.000000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 2 float () [(Var 2 i)] [] (Real 8 []) () ()) Eq (UnaryOp USub (ConstantReal 4235.000000 (Real 8 [])) (Real 8 []) (ConstantReal -4235.000000 (Real 8 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 float () [(ConstantInteger 34 (Integer 4 []))] [] (Real 8 []) (ConstantReal 34.000000 (Real 8 [])) ()) Eq (ConstantReal 34.000000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 float () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -4235.000000 (Real 8 [])) ()) Eq (UnaryOp USub (ConstantReal 4235.000000 (Real 8 [])) (Real 8 []) (ConstantReal -4235.000000 (Real 8 []))) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_float: (Subroutine (SymbolTable 2 {float: (ExternalSymbol 2 float 4 float lpython_builtin [] float Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_float [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 float () [(Var 2 i)] [] (Real 8 []) () ()) Eq (ConstantReal 34.000000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) () .false.) (Assert (Compare (FunctionCall 2 float () [(Var 2 i)] [] (Real 8 []) () ()) Eq (UnaryOp USub (ConstantReal 4235.000000 (Real 8 [])) (Real 8 []) (ConstantReal -4235.000000 (Real 8 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 float () [(ConstantInteger 34 (Integer 4 []))] [] (Real 8 []) (ConstantReal 34.000000 (Real 8 [])) ()) Eq (ConstantReal 34.000000 (Real 8 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 float () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -4235.000000 (Real 8 [])) ()) Eq (UnaryOp USub (ConstantReal 4235.000000 (Real 8 [])) (Real 8 []) (ConstantReal -4235.000000 (Real 8 []))) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_hex-64bd268.json b/tests/reference/asr-test_builtin_hex-64bd268.json index e4dc720e11..b6daa51535 100644 --- a/tests/reference/asr-test_builtin_hex-64bd268.json +++ b/tests/reference/asr-test_builtin_hex-64bd268.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_hex-64bd268.stdout", - "stdout_hash": "222bf7134ed8ff229ef1dcddf67774de7abdfa8aadc83fac5fdab247", + "stdout_hash": "916cc6edf803195df4a85e8d665bd78bca1c8ee0104a523812334b18", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stdout b/tests/reference/asr-test_builtin_hex-64bd268.stdout index 7e134e566b..00e034004b 100644 --- a/tests/reference/asr-test_builtin_hex-64bd268.stdout +++ b/tests/reference/asr-test_builtin_hex-64bd268.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_hex () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_hex: (Subroutine (SymbolTable 2 {hex: (ExternalSymbol 2 hex 4 hex lpython_builtin [] hex Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_hex [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 hex () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0x22" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 2 hex () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0x108b" (Character 1 7 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 hex () [(ConstantInteger 34 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x22" (Character 1 1 () [])) ()) Eq (ConstantString "0x22" (Character 1 4 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x108b" (Character 1 1 () [])) ()) Eq (ConstantString "-0x108b" (Character 1 7 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_hex () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_hex: (Subroutine (SymbolTable 2 {hex: (ExternalSymbol 2 hex 4 hex lpython_builtin [] hex Private), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_hex [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 hex () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0x22" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) () .false.) (Assert (Compare (FunctionCall 2 hex () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0x108b" (Character 1 7 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 hex () [(ConstantInteger 34 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x22" (Character 1 1 () [])) ()) Eq (ConstantString "0x22" (Character 1 4 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x108b" (Character 1 1 () [])) ()) Eq (ConstantString "-0x108b" (Character 1 7 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.json b/tests/reference/asr-test_builtin_int-8f88fdc.json index 45a35f2999..37a2866b15 100644 --- a/tests/reference/asr-test_builtin_int-8f88fdc.json +++ b/tests/reference/asr-test_builtin_int-8f88fdc.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_int-8f88fdc.stdout", - "stdout_hash": "87f3b4b2932cc45371ade598965cc571322c8681c138cd61b4a06657", + "stdout_hash": "c7acc3ba8fd263b41a906ec3d353e7a62d6155476dba02a19b1d4b1a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.stdout b/tests/reference/asr-test_builtin_int-8f88fdc.stdout index 6460f4d376..291d5ae610 100644 --- a/tests/reference/asr-test_builtin_int-8f88fdc.stdout +++ b/tests/reference/asr-test_builtin_int-8f88fdc.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_int: (Subroutine (SymbolTable 2 {f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), int: (ExternalSymbol 2 int 4 int lpython_builtin [] int Private)}) test_int [] [(= (Var 2 f) (ConstantReal 5.678000 (Real 8 [])) ()) (Assert (Compare (FunctionCall 2 int () [(Var 2 f)] [] (Integer 4 []) () ()) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (UnaryOp USub (ConstantReal 183745.230000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.230000 (Real 8 []))) ()) (Assert (Compare (FunctionCall 2 int () [(Var 2 f)] [] (Integer 4 []) () ()) Eq (UnaryOp USub (ConstantInteger 183745 (Integer 4 [])) (Integer 4 []) (ConstantInteger -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 int () [(ConstantReal 5.500000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 int () [(UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) Eq (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_int: (Subroutine (SymbolTable 2 {f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), int: (ExternalSymbol 2 int 4 int lpython_builtin [] int Private)}) test_int [] [(= (Var 2 f) (ConstantReal 5.678000 (Real 8 [])) () .false.) (Assert (Compare (FunctionCall 2 int () [(Var 2 f)] [] (Integer 4 []) () ()) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (UnaryOp USub (ConstantReal 183745.230000 (Real 8 [])) (Real 8 []) (ConstantReal -183745.230000 (Real 8 []))) () .false.) (Assert (Compare (FunctionCall 2 int () [(Var 2 f)] [] (Integer 4 []) () ()) Eq (UnaryOp USub (ConstantInteger 183745 (Integer 4 [])) (Integer 4 []) (ConstantInteger -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 int () [(ConstantReal 5.500000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) Eq (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 int () [(UnaryOp USub (ConstantReal 5.500000 (Real 8 [])) (Real 8 []) (ConstantReal -5.500000 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) Eq (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_len-55b0dec.json b/tests/reference/asr-test_builtin_len-55b0dec.json index 84172128f4..0290f5ea57 100644 --- a/tests/reference/asr-test_builtin_len-55b0dec.json +++ b/tests/reference/asr-test_builtin_len-55b0dec.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_len-55b0dec.stdout", - "stdout_hash": "8546e54dce5e0cab77d8ff789ab25d78292c6dccf53538e07161aedb", + "stdout_hash": "ba2cd9f2fc520fe526dc6a262b34b20816fcd70149cce63fd06bb49d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_len-55b0dec.stdout b/tests/reference/asr-test_builtin_len-55b0dec.stdout index f7a9383f64..af3862ad24 100644 --- a/tests/reference/asr-test_builtin_len-55b0dec.stdout +++ b/tests/reference/asr-test_builtin_len-55b0dec.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_len: (Subroutine (SymbolTable 2 {len: (ExternalSymbol 2 len 4 len lpython_builtin [] len Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_len [] [(= (Var 2 s) (ConstantString "abcd" (Character 1 4 () [])) ()) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (ConstantString "" (Character 1 0 () [])) ()) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "abcd" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_len: (Subroutine (SymbolTable 2 {len: (ExternalSymbol 2 len 4 len lpython_builtin [] len Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_len [] [(= (Var 2 s) (ConstantString "abcd" (Character 1 4 () [])) () .false.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (ConstantString "" (Character 1 0 () [])) () .false.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "abcd" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_oct-20b9066.json b/tests/reference/asr-test_builtin_oct-20b9066.json index 44d2046f67..28f203dbf1 100644 --- a/tests/reference/asr-test_builtin_oct-20b9066.json +++ b/tests/reference/asr-test_builtin_oct-20b9066.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_oct-20b9066.stdout", - "stdout_hash": "de259ca941f17ca84e1a6dd031353162e1ce081ef110c2a689813073", + "stdout_hash": "72da2095fafc5dea45c28ee06ea24ef0bf46e112b56f30ac6683aed3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stdout b/tests/reference/asr-test_builtin_oct-20b9066.stdout index ef0e57bbdb..bf9ffeac24 100644 --- a/tests/reference/asr-test_builtin_oct-20b9066.stdout +++ b/tests/reference/asr-test_builtin_oct-20b9066.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_oct () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_oct: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), oct: (ExternalSymbol 2 oct 4 oct lpython_builtin [] oct Private)}) test_oct [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 oct () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0o42" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 2 oct () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0o10213" (Character 1 8 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 oct () [(ConstantInteger 34 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o42" (Character 1 1 () [])) ()) Eq (ConstantString "0o42" (Character 1 4 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o10213" (Character 1 1 () [])) ()) Eq (ConstantString "-0o10213" (Character 1 8 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 18 {}) _lfortran_main_program [] [(SubroutineCall 1 test_oct () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_oct: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), oct: (ExternalSymbol 2 oct 4 oct lpython_builtin [] oct Private)}) test_oct [] [(= (Var 2 i) (ConstantInteger 34 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 oct () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "0o42" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 []))) () .false.) (Assert (Compare (FunctionCall 2 oct () [(Var 2 i)] [] (Character 1 -2 () []) () ()) Eq (ConstantString "-0o10213" (Character 1 8 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 oct () [(ConstantInteger 34 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o42" (Character 1 1 () [])) ()) Eq (ConstantString "0o42" (Character 1 4 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 4235 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4235 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o10213" (Character 1 1 () [])) ()) Eq (ConstantString "-0o10213" (Character 1 8 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json index 2e6b6565da..96f7af7ab6 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.json +++ b/tests/reference/asr-test_builtin_pow-f02fcda.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_pow-f02fcda.stdout", - "stdout_hash": "ec9c857cfabd443659b1478fee3ceef271af12e3b0250f187f18f67a", + "stdout_hash": "72289b960242c8a84f8ceb9a8faef2bdf8477aca65c80cd4980233e5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stdout b/tests/reference/asr-test_builtin_pow-f02fcda.stdout index 93de4f875c..938cb5f826 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stdout +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 4 pow lpython_builtin [] pow Private)}) test_pow [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 2 b) (ConstantInteger 5 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 32 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 6 (Integer 4 [])) ()) (= (Var 2 b) (ConstantInteger 3 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 216 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 2 b) (ConstantInteger 0 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) ()) (= (Var 2 b) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) ()) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 6 (Integer 4 [])) ()) (= (Var 2 b) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) ()) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.000772 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) ()) (= (Var 2 b) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) ()) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (UnaryOp USub (ConstantReal 0.004115 (Real 8 [])) (Real 8 []) (ConstantReal -0.004115 (Real 8 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 pow () [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) Eq (ConstantInteger 1 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(ConstantInteger 6 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Integer 4 []) (ConstantReal 0.000772 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.000772 (Real 8 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 4 pow lpython_builtin [] pow Private)}) test_pow [] [(= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantInteger 5 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 32 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 6 (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantInteger 3 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 216 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantInteger 0 (Integer 4 [])) () .false.) (Assert (Compare (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) Eq (ConstantInteger 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 2 b) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) () .false.) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.500000 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (ConstantInteger 6 (Integer 4 [])) () .false.) (= (Var 2 b) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) () .false.) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.000772 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) () .false.) (= (Var 2 b) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) () .false.) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(Var 2 a) (Var 2 b)] [] (Integer 4 []) () ()) IntegerToReal (Real 8 []) ()) Eq (UnaryOp USub (ConstantReal 0.004115 (Real 8 [])) (Real 8 []) (ConstantReal -0.004115 (Real 8 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 pow () [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) Eq (ConstantInteger 1 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (ImplicitCast (FunctionCall 2 pow () [(ConstantInteger 6 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Integer 4 []) (ConstantReal 0.000772 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Eq (ConstantReal 0.000772 (Real 8 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_str-580e920.json b/tests/reference/asr-test_builtin_str-580e920.json index b9d19d8663..d36100ed55 100644 --- a/tests/reference/asr-test_builtin_str-580e920.json +++ b/tests/reference/asr-test_builtin_str-580e920.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_str-580e920.stdout", - "stdout_hash": "5566c7bb611858c26f835e7408c1c9b47b291080abbb05152ab7b1ea", + "stdout_hash": "2f931a907c8894527ff966f808428ade81d0295990736d299b242d6d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_str-580e920.stdout b/tests/reference/asr-test_builtin_str-580e920.stdout index 06db47b80c..f6ff876302 100644 --- a/tests/reference/asr-test_builtin_str-580e920.stdout +++ b/tests/reference/asr-test_builtin_str-580e920.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 4 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 2 str () [(ConstantInteger 356 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "356" (Character 1 1 () [])) ()) ()) (Assert (Compare (Var 2 s) Eq (ConstantString "356" (Character 1 3 () [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 567 (Integer 4 [])) (Integer 4 []) (ConstantInteger -567 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-567" (Character 1 1 () [])) ()) ()) (Assert (Compare (Var 2 s) Eq (ConstantString "-567" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 str () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "4" (Character 1 1 () [])) ()) Eq (ConstantString "4" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-5" (Character 1 1 () [])) ()) Eq (ConstantString "-5" (Character 1 2 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 4 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 2 str () [(ConstantInteger 356 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "356" (Character 1 1 () [])) ()) () .false.) (Assert (Compare (Var 2 s) Eq (ConstantString "356" (Character 1 3 () [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 567 (Integer 4 [])) (Integer 4 []) (ConstantInteger -567 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-567" (Character 1 1 () [])) ()) () .false.) (Assert (Compare (Var 2 s) Eq (ConstantString "-567" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 str () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "4" (Character 1 1 () [])) ()) Eq (ConstantString "4" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-5" (Character 1 1 () [])) ()) Eq (ConstantString "-5" (Character 1 2 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-tuple1-09972ab.json b/tests/reference/asr-tuple1-09972ab.json index 5ca1d2fd76..a6e9d579a9 100644 --- a/tests/reference/asr-tuple1-09972ab.json +++ b/tests/reference/asr-tuple1-09972ab.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-tuple1-09972ab.stdout", - "stdout_hash": "7e1ad2f8d9edbff9a4f63b2b456e51707de2217b4b375e10ccb26fa9", + "stdout_hash": "218a17f083db0a5fc4854a3f4471e6c9122bdaa3596f59f415cf6e09", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-tuple1-09972ab.stdout b/tests/reference/asr-tuple1-09972ab.stdout index 43b3744157..7cf957eeb2 100644 --- a/tests/reference/asr-tuple1-09972ab.stdout +++ b/tests/reference/asr-tuple1-09972ab.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Tuple: (Subroutine (SymbolTable 2 {a1: (Variable 2 a1 Local () () Default (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) Source Public Required .false.), a2: (Variable 2 a2 Local () () Default (Tuple [(Character 1 -2 () []) (Character 1 -2 () []) (Character 1 -2 () [])]) Source Public Required .false.), a3: (Variable 2 a3 Local () () Default (Tuple [(Integer 4 []) (Integer 4 []) (Real 4 []) (Character 1 -2 () [])]) Source Public Required .false.), a4: (Variable 2 a4 Local () () Default (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])]) Source Public Required .false.), a5: (Variable 2 a5 Local () () Default (Tuple [(Tuple [(Character 1 -2 () []) (Character 1 -2 () []) (Real 4 [])]) (Tuple [(Character 1 -2 () []) (Integer 4 []) (Real 4 [])])]) Source Public Required .false.), b0: (Variable 2 b0 Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Tuple [] [(= (Var 2 a1) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a1) (ConstantTuple [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a2) (ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Character 1 1 () [])])) ()) (= (Var 2 a3) (ConstantTuple [(UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (ConstantReal 0.450000 (Real 8 [])) (ConstantString "d" (Character 1 1 () []))] (Tuple [(Integer 4 []) (Integer 4 []) (Real 8 []) (Character 1 1 () [])])) ()) (= (Var 2 a4) (ConstantTuple [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (ConstantTuple [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])])) ()) (= (Var 2 a5) (ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])])) ()) (= (Var 2 b0) (ArrayRef 2 a1 [(() (ConstantInteger 0 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ()) ()) (= (ConstantTuple [(Var 2 b0) (Var 2 b1)] (Tuple [(Integer 4 []) (Integer 4 [])])) (ConstantTuple [(ArrayRef 2 a1 [(() (ConstantInteger 2 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ()) (ArrayRef 2 a1 [(() (ConstantInteger 1 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ())] (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])])) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Tuple: (Subroutine (SymbolTable 2 {a1: (Variable 2 a1 Local () () Default (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) Source Public Required .false.), a2: (Variable 2 a2 Local () () Default (Tuple [(Character 1 -2 () []) (Character 1 -2 () []) (Character 1 -2 () [])]) Source Public Required .false.), a3: (Variable 2 a3 Local () () Default (Tuple [(Integer 4 []) (Integer 4 []) (Real 4 []) (Character 1 -2 () [])]) Source Public Required .false.), a4: (Variable 2 a4 Local () () Default (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])]) Source Public Required .false.), a5: (Variable 2 a5 Local () () Default (Tuple [(Tuple [(Character 1 -2 () []) (Character 1 -2 () []) (Real 4 [])]) (Tuple [(Character 1 -2 () []) (Integer 4 []) (Real 4 [])])]) Source Public Required .false.), b0: (Variable 2 b0 Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Tuple [] [(= (Var 2 a1) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 2 a1) (ConstantTuple [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 2 a2) (ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Character 1 1 () [])])) () .false.) (= (Var 2 a3) (ConstantTuple [(UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (ConstantReal 0.450000 (Real 8 [])) (ConstantString "d" (Character 1 1 () []))] (Tuple [(Integer 4 []) (Integer 4 []) (Real 8 []) (Character 1 1 () [])])) () .false.) (= (Var 2 a4) (ConstantTuple [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (ConstantTuple [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])])) () .false.) (= (Var 2 a5) (ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])])) () .false.) (= (Var 2 b0) (ArrayRef 2 a1 [(() (ConstantInteger 0 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ()) () .false.) (= (ConstantTuple [(Var 2 b0) (Var 2 b1)] (Tuple [(Integer 4 []) (Integer 4 [])])) (ConstantTuple [(ArrayRef 2 a1 [(() (ConstantInteger 2 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ()) (ArrayRef 2 a1 [(() (ConstantInteger 1 (Integer 4 [])) ())] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) ())] (Tuple [(Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]) (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])])) () .false.)] Source Public Implementation () .false. .false.)}) []) From 3ba20f105b5fab7196ae95937b9d7736e449cd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 2 Mar 2022 11:48:46 -0700 Subject: [PATCH 3/6] Set Reallocate LHS for allocatable strings --- src/lpython/semantics/python_ast_to_asr.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index c9ff2dfcf3..b459787baa 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -950,10 +950,19 @@ class BodyVisitor : public CommonVisitor { } this->visit_expr(*x.m_value); ASR::expr_t *value = ASRUtils::EXPR(tmp); - value = implicitcast_helper(ASRUtils::expr_type(target), value, true); + ASR::ttype_t *target_type = ASRUtils::expr_type(target); + value = implicitcast_helper(target_type, value, true); ASR::stmt_t *overloaded=nullptr; + bool realloc_lhs = false; + if (ASR::is_a(*target_type)) { + ASR::Character_t *t = ASR::down_cast(target_type); + if (t->m_len == -2) { + // Reallocate LHS for allocatable strings + realloc_lhs = true; + } + } tmp = ASR::make_Assignment_t(al, x.base.base.loc, target, value, - overloaded, false); + overloaded, realloc_lhs); } void visit_Assert(const AST::Assert_t &x) { From f8a8ea93e5f89d0c1efd0015dd209a11554519ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 2 Mar 2022 11:49:53 -0700 Subject: [PATCH 4/6] Update tests --- tests/reference/asr-assign1-886f049.json | 2 +- tests/reference/asr-assign1-886f049.stdout | 2 +- tests/reference/asr-constants1-5828e8a.json | 2 +- tests/reference/asr-constants1-5828e8a.stdout | 2 +- tests/reference/asr-expr11-9b91d35.json | 2 +- tests/reference/asr-expr11-9b91d35.stdout | 2 +- tests/reference/asr-expr5-645ffcc.json | 2 +- tests/reference/asr-expr5-645ffcc.stdout | 2 +- tests/reference/asr-expr9-814e4bc.json | 2 +- tests/reference/asr-expr9-814e4bc.stdout | 2 +- tests/reference/asr-list1-770ba33.json | 2 +- tests/reference/asr-list1-770ba33.stdout | 2 +- tests/reference/asr-subscript1-1acfc19.json | 2 +- tests/reference/asr-subscript1-1acfc19.stdout | 2 +- tests/reference/asr-test_builtin-aa64615.json | 2 +- tests/reference/asr-test_builtin-aa64615.stdout | 2 +- tests/reference/asr-test_builtin_len-55b0dec.json | 2 +- tests/reference/asr-test_builtin_len-55b0dec.stdout | 2 +- tests/reference/asr-test_builtin_str-580e920.json | 2 +- tests/reference/asr-test_builtin_str-580e920.stdout | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/reference/asr-assign1-886f049.json b/tests/reference/asr-assign1-886f049.json index 78665f151f..f201baf81f 100644 --- a/tests/reference/asr-assign1-886f049.json +++ b/tests/reference/asr-assign1-886f049.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-assign1-886f049.stdout", - "stdout_hash": "bd3579217e2117de8e9e3bd5b4b989bb6dfbf5ef84c8b66211dbbb88", + "stdout_hash": "992edf2514ae1860c07375d60eb9cd038c46f6a1f5227294a92db8e9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-assign1-886f049.stdout b/tests/reference/asr-assign1-886f049.stdout index d8170065c6..57d43f423a 100644 --- a/tests/reference/asr-assign1-886f049.stdout +++ b/tests/reference/asr-assign1-886f049.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_augassign: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Character 1 -2 () []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.)}) test_augassign [] [(= (Var 2 r) (ConstantInteger 0 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Add (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Mul (Var 2 s) (Integer 4 []) () ()) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Sub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 10 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (ImplicitCast (Var 2 r) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (Var 2 s) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) () .false.) (= (Var 2 a) (ConstantString "" (Character 1 0 () [])) () .false.) (= (Var 2 a) (StrOp (Var 2 a) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 2 () []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_augassign: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Character 1 -2 () []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.)}) test_augassign [] [(= (Var 2 r) (ConstantInteger 0 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Add (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Mul (Var 2 s) (Integer 4 []) () ()) () .false.) (= (Var 2 r) (BinOp (Var 2 r) Sub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) () ()) () .false.) (= (Var 2 s) (ConstantInteger 10 (Integer 4 [])) () .false.) (= (Var 2 r) (BinOp (ImplicitCast (Var 2 r) IntegerToReal (Real 8 []) ()) Div (ImplicitCast (Var 2 s) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) () .false.) (= (Var 2 a) (ConstantString "" (Character 1 0 () [])) () .true.) (= (Var 2 a) (StrOp (Var 2 a) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 2 () []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json index ebd6da287c..32c32f4d3f 100644 --- a/tests/reference/asr-constants1-5828e8a.json +++ b/tests/reference/asr-constants1-5828e8a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-constants1-5828e8a.stdout", - "stdout_hash": "589e54146bb5e5be11b43c439e8420893b131ebb044c8270e5ea87ae", + "stdout_hash": "01f4a582be65a9508de47942aff79e7b0d56f27c2c45cf553cdadf18", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-constants1-5828e8a.stdout b/tests/reference/asr-constants1-5828e8a.stdout index d765a35a80..e80bcb5d92 100644 --- a/tests/reference/asr-constants1-5828e8a.stdout +++ b/tests/reference/asr-constants1-5828e8a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 26 {}) main_program [] []), test_abs: (Subroutine (SymbolTable 4 {abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(ConstantReal 3.450000 (Real 8 []))] [] (Real 8 []) (ConstantReal 3.450000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.) (= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(UnaryOp USub (ConstantReal 5346.340000 (Real 8 [])) (Real 8 []) (ConstantReal -5346.340000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5346.340000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 1 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 6 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "" (Character 1 0 () []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantComplex 0.000000 0.000000 (Complex 8 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "t" (Character 1 1 () []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantReal 2.300000 (Real 8 []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_boz: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), bin: (ExternalSymbol 2 bin 13 bin lpython_builtin [] bin Private), hex: (ExternalSymbol 2 hex 13 hex lpython_builtin [] hex Private), oct: (ExternalSymbol 2 oct 13 oct lpython_builtin [] oct Private)}) test_boz [] [(= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b101" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 8 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o10" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 56 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o70" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o1026" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 42 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x2a" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 12648430 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0xc0ffee" (Character 1 1 () [])) ()) () .false.) (= (Var 2 b) (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x216" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 8 a) (ConstantLogical .true. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_divmod [] [(= (Var 11 a) (ConstantTuple [(ConstantInteger 3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger -3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.)] Source Public Implementation () .false. .false.), test_float: (Subroutine (SymbolTable 10 {a: (Variable 10 a Local () () Default (Real 8 []) Source Public Required .false.), float: (ExternalSymbol 10 float 13 float lpython_builtin [] float Private)}) test_float [] [(= (Var 10 a) (FunctionCall 10 float () [] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantReal 4.560000 (Real 8 []))] [] (Real 8 []) (ConstantReal 4.560000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantInteger 5 (Integer 4 []))] [] (Real 8 []) (ConstantReal 5.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .true. (Logical 1 []))] [] (Real 8 []) (ConstantReal 1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .false. (Logical 1 []))] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "5346" (Character 1 4 () []))] [] (Real 8 []) (ConstantReal 5346.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "423.534" (Character 1 7 () []))] [] (Real 8 []) (ConstantReal 423.533997 (Real 8 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.), int: (ExternalSymbol 9 int 13 int lpython_builtin [] int Private)}) test_int [] [(= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantReal 4.560000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(UnaryOp USub (ConstantReal 5.000010 (Real 8 [])) (Real 8 []) (ConstantReal -5.000010 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .true. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .false. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantString "5346" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 5346 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_len: (Subroutine (SymbolTable 5 {a: (Variable 5 a Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 5 len 13 len lpython_builtin [] len Private)}) test_len [] [(= (Var 5 a) (FunctionCall 5 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "test" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "this is a test" (Character 1 14 () []))] [] (Integer 4 []) (ConstantInteger 14 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])]))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantArray [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (UnaryOp USub (ConstantInteger 6 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 [])))] (Integer 4 [])) (ConstantArray [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 [])))] (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_ord_chr: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.), chr: (ExternalSymbol 3 chr 13 chr lpython_builtin [] chr Private), ord: (ExternalSymbol 3 ord 13 ord lpython_builtin [] ord Private), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord_chr [] [(= (Var 3 a) (FunctionCall 3 ord () [(ConstantString "5" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 53 (Integer 4 [])) ()) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(ConstantInteger 43 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "+" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_str: (Subroutine (SymbolTable 7 {s: (Variable 7 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 7 str 13 str lpython_builtin [] str Private)}) test_str [] [(= (Var 7 s) (FunctionCall 7 str () [] [] (Character 1 -2 () []) (ConstantString "" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "5" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-4" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantReal 5.600000 (Real 8 []))] [] (Character 1 -2 () []) (ConstantString "5.600000" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .true. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "True" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .false. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "False" (Character 1 1 () [])) ()) () .false.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantString "5346" (Character 1 4 () []))] [] (Character 1 -2 () []) (ConstantString "5346" (Character 1 1 () [])) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 26 {}) main_program [] []), test_abs: (Subroutine (SymbolTable 4 {abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(ConstantReal 3.450000 (Real 8 []))] [] (Real 8 []) (ConstantReal 3.450000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.) (= (Var 4 b) (ImplicitCast (FunctionCall 4 abs () [(UnaryOp USub (ConstantReal 5346.340000 (Real 8 [])) (Real 8 []) (ConstantReal -5346.340000 (Real 8 [])))] [] (Real 8 []) (ConstantReal 5346.340000 (Real 8 [])) ()) RealToReal (Real 4 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 1 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 6 bool () [(ConstantInteger 0 (Integer 4 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "" (Character 1 0 () []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantComplex 0.000000 0.000000 (Complex 8 []))] [] (Logical 1 []) (ConstantLogical .false. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantString "t" (Character 1 1 () []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (= (Var 6 a) (FunctionCall 6 bool () [(ConstantReal 2.300000 (Real 8 []))] [] (Logical 1 []) (ConstantLogical .true. (Logical 1 [])) ()) () .false.) (Assert (Compare (Var 6 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_boz: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), bin: (ExternalSymbol 2 bin 13 bin lpython_builtin [] bin Private), hex: (ExternalSymbol 2 hex 13 hex lpython_builtin [] hex Private), oct: (ExternalSymbol 2 oct 13 oct lpython_builtin [] oct Private)}) test_boz [] [(= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b101" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 bin () [(ConstantInteger 64 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0b1000000" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 bin () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0b1000010110" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 8 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o10" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 oct () [(ConstantInteger 56 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0o70" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 oct () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0o1026" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 42 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0x2a" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 hex () [(ConstantInteger 12648430 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0xc0ffee" (Character 1 1 () [])) ()) () .true.) (= (Var 2 b) (FunctionCall 2 hex () [(UnaryOp USub (ConstantInteger 534 (Integer 4 [])) (Integer 4 []) (ConstantInteger -534 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-0x216" (Character 1 1 () [])) ()) () .true.)] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 1 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (ConstantInteger 2 (Integer 4 [])) () .false.) (= (Var 8 a) (ConstantLogical .true. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .true. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (ConstantLogical .false. (Logical 1 [])) () .false.) (Assert (Compare (Var 8 a) Eq (ConstantLogical .false. (Logical 1 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Integer 4 []) Source Public Required .false.)}) test_divmod [] [(= (Var 11 a) (ConstantTuple [(ConstantInteger 3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger -3 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.) (= (Var 11 a) (ConstantTuple [(ConstantInteger 0 (Integer 4 [])) (ConstantInteger 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) () .false.)] Source Public Implementation () .false. .false.), test_float: (Subroutine (SymbolTable 10 {a: (Variable 10 a Local () () Default (Real 8 []) Source Public Required .false.), float: (ExternalSymbol 10 float 13 float lpython_builtin [] float Private)}) test_float [] [(= (Var 10 a) (FunctionCall 10 float () [] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantReal 4.560000 (Real 8 []))] [] (Real 8 []) (ConstantReal 4.560000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantInteger 5 (Integer 4 []))] [] (Real 8 []) (ConstantReal 5.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] [] (Real 8 []) (ConstantReal -1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .true. (Logical 1 []))] [] (Real 8 []) (ConstantReal 1.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantLogical .false. (Logical 1 []))] [] (Real 8 []) (ConstantReal 0.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "5346" (Character 1 4 () []))] [] (Real 8 []) (ConstantReal 5346.000000 (Real 8 [])) ()) () .false.) (= (Var 10 a) (FunctionCall 10 float () [(ConstantString "423.534" (Character 1 7 () []))] [] (Real 8 []) (ConstantReal 423.533997 (Real 8 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.), int: (ExternalSymbol 9 int 13 int lpython_builtin [] int Private)}) test_int [] [(= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantReal 4.560000 (Real 8 []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantInteger 5 (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(UnaryOp USub (ConstantReal 5.000010 (Real 8 [])) (Real 8 []) (ConstantReal -5.000010 (Real 8 [])))] [] (Integer 4 []) (ConstantInteger -5 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .true. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 1 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantLogical .false. (Logical 1 []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.) (= (Var 9 a) (ImplicitCast (FunctionCall 9 int () [(ConstantString "5346" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 5346 (Integer 4 [])) ()) IntegerToInteger (Integer 8 []) ()) () .false.)] Source Public Implementation () .false. .false.), test_len: (Subroutine (SymbolTable 5 {a: (Variable 5 a Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 5 len 13 len lpython_builtin [] len Private)}) test_len [] [(= (Var 5 a) (FunctionCall 5 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "test" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantString "this is a test" (Character 1 14 () []))] [] (Integer 4 []) (ConstantInteger 14 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])]))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantTuple [(ConstantTuple [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantReal 3.400000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (ConstantTuple [(ConstantString "c" (Character 1 1 () [])) (ConstantInteger 3 (Integer 4 [])) (ConstantReal 5.600000 (Real 8 []))] (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])]))] (Tuple [(Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])]) (Tuple [(Character 1 1 () []) (Integer 4 []) (Real 8 [])])]))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantArray [(ConstantArray [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))) (UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 []))) (UnaryOp USub (ConstantInteger 6 (Integer 4 [])) (Integer 4 []) (ConstantInteger -6 (Integer 4 [])))] (Integer 4 [])) (ConstantArray [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 [])))] (Integer 4 []))] (Integer 4 []))] [] (Integer 4 []) (ConstantInteger 2 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantSet [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Set (Integer 4 [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.) (= (Var 5 a) (FunctionCall 5 len () [(ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () [])))] [] (Integer 4 []) (ConstantInteger 3 (Integer 4 [])) ()) () .false.)] Source Public Implementation () .false. .false.), test_ord_chr: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 []) Source Public Required .false.), chr: (ExternalSymbol 3 chr 13 chr lpython_builtin [] chr Private), ord: (ExternalSymbol 3 ord 13 ord lpython_builtin [] ord Private), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord_chr [] [(= (Var 3 a) (FunctionCall 3 ord () [(ConstantString "5" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 53 (Integer 4 [])) ()) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(ConstantInteger 43 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "+" (Character 1 1 () [])) ()) () .true.)] Source Public Implementation () .false. .false.), test_str: (Subroutine (SymbolTable 7 {s: (Variable 7 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 7 str 13 str lpython_builtin [] str Private)}) test_str [] [(= (Var 7 s) (FunctionCall 7 str () [] [] (Character 1 -2 () []) (ConstantString "" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantInteger 5 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "5" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-4" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantReal 5.600000 (Real 8 []))] [] (Character 1 -2 () []) (ConstantString "5.600000" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .true. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "True" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantLogical .false. (Logical 1 []))] [] (Character 1 -2 () []) (ConstantString "False" (Character 1 1 () [])) ()) () .true.) (= (Var 7 s) (FunctionCall 7 str () [(ConstantString "5346" (Character 1 4 () []))] [] (Character 1 -2 () []) (ConstantString "5346" (Character 1 1 () [])) ()) () .true.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr11-9b91d35.json b/tests/reference/asr-expr11-9b91d35.json index 97c42f3b9f..54d4a72e10 100644 --- a/tests/reference/asr-expr11-9b91d35.json +++ b/tests/reference/asr-expr11-9b91d35.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr11-9b91d35.stdout", - "stdout_hash": "96d44330f3d93fdb6857d07586156925c37229e3fac8903f108cc454", + "stdout_hash": "5fd489c91bb99a7698d751dea153388c41ad8d58393b356be08bf628", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr11-9b91d35.stdout b/tests/reference/asr-expr11-9b91d35.stdout index 5033531ec9..468243dc02 100644 --- a/tests/reference/asr-expr11-9b91d35.stdout +++ b/tests/reference/asr-expr11-9b91d35.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_repeat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_repeat [] [(= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (ConstantInteger 2 (Integer 4 [])) (Character 1 2 () []) (ConstantString "aa" (Character 1 2 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "test" (Character 1 4 () [])) Repeat (ConstantInteger 5 (Integer 4 [])) (Character 1 20 () []) (ConstantString "testtesttesttesttest" (Character 1 20 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantInteger 4 (Integer 4 [])) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 8 () []) (ConstantString "bbbbbbbb" (Character 1 8 () []))) () .false.) (= (Var 2 s) (StrOp (UnaryOp USub (ConstantInteger 40 (Integer 4 [])) (Integer 4 []) (ConstantInteger -40 (Integer 4 []))) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .false.) (= (Var 2 s) (StrOp (StrOp (ConstantInteger 3 (Integer 4 [])) Repeat (ConstantString "a" (Character 1 1 () [])) (Character 1 3 () []) (ConstantString "aaa" (Character 1 3 () []))) Repeat (ConstantInteger 3 (Integer 4 [])) (Character 1 9 () []) (ConstantString "aaaaaaaaa" (Character 1 9 () []))) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_repeat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_repeat [] [(= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (ConstantInteger 2 (Integer 4 [])) (Character 1 2 () []) (ConstantString "aa" (Character 1 2 () []))) () .true.) (= (Var 2 s) (StrOp (ConstantString "a" (Character 1 1 () [])) Repeat (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .true.) (= (Var 2 s) (StrOp (ConstantString "test" (Character 1 4 () [])) Repeat (ConstantInteger 5 (Integer 4 [])) (Character 1 20 () []) (ConstantString "testtesttesttesttest" (Character 1 20 () []))) () .true.) (= (Var 2 s) (StrOp (ConstantInteger 4 (Integer 4 [])) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 8 () []) (ConstantString "bbbbbbbb" (Character 1 8 () []))) () .true.) (= (Var 2 s) (StrOp (UnaryOp USub (ConstantInteger 40 (Integer 4 [])) (Integer 4 []) (ConstantInteger -40 (Integer 4 []))) Repeat (ConstantString "bb" (Character 1 2 () [])) (Character 1 0 () []) (ConstantString "" (Character 1 0 () []))) () .true.) (= (Var 2 s) (StrOp (StrOp (ConstantInteger 3 (Integer 4 [])) Repeat (ConstantString "a" (Character 1 1 () [])) (Character 1 3 () []) (ConstantString "aaa" (Character 1 3 () []))) Repeat (ConstantInteger 3 (Integer 4 [])) (Character 1 9 () []) (ConstantString "aaaaaaaaa" (Character 1 9 () []))) () .true.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr5-645ffcc.json b/tests/reference/asr-expr5-645ffcc.json index ad0fe1b1d8..a1a441da41 100644 --- a/tests/reference/asr-expr5-645ffcc.json +++ b/tests/reference/asr-expr5-645ffcc.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr5-645ffcc.stdout", - "stdout_hash": "7bb69a2743c1f275852afa94d2353e403219170007907257f9ff3cee", + "stdout_hash": "fedf0e917b31a711f8e908dcf30dace4ab6097dae6098717d7372129", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr5-645ffcc.stdout b/tests/reference/asr-expr5-645ffcc.stdout index bda634478a..e6d8237fb4 100644 --- a/tests/reference/asr-expr5-645ffcc.stdout +++ b/tests/reference/asr-expr5-645ffcc.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_concat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_concat [] [(= (Var 2 s) (StrOp (ConstantString "3" (Character 1 1 () [])) Concat (ConstantString "4" (Character 1 1 () [])) (Character 1 2 () []) (ConstantString "34" (Character 1 2 () []))) () .false.) (= (Var 2 s) (StrOp (ConstantString "a " (Character 1 2 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 6 () []) (ConstantString "a test" (Character 1 6 () []))) () .false.) (= (Var 2 s) (StrOp (StrOp (ConstantString "test" (Character 1 4 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 8 () []) (ConstantString "testtest" (Character 1 8 () []))) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 12 () []) (ConstantString "testtesttest" (Character 1 12 () []))) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_StrOp_concat: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_StrOp_concat [] [(= (Var 2 s) (StrOp (ConstantString "3" (Character 1 1 () [])) Concat (ConstantString "4" (Character 1 1 () [])) (Character 1 2 () []) (ConstantString "34" (Character 1 2 () []))) () .true.) (= (Var 2 s) (StrOp (ConstantString "a " (Character 1 2 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 6 () []) (ConstantString "a test" (Character 1 6 () []))) () .true.) (= (Var 2 s) (StrOp (StrOp (ConstantString "test" (Character 1 4 () [])) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 8 () []) (ConstantString "testtest" (Character 1 8 () []))) Concat (ConstantString "test" (Character 1 4 () [])) (Character 1 12 () []) (ConstantString "testtesttest" (Character 1 12 () []))) () .true.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr9-814e4bc.json b/tests/reference/asr-expr9-814e4bc.json index 1d87dee826..57c85c08ff 100644 --- a/tests/reference/asr-expr9-814e4bc.json +++ b/tests/reference/asr-expr9-814e4bc.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr9-814e4bc.stdout", - "stdout_hash": "ccb7832e8f47078ed6f2bdf2882f32b0adac54f970e3c7843f84fe0f", + "stdout_hash": "010541d84be7e89ee69bc9b04e2f4f820ad27186b2dbd61e2777f362", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr9-814e4bc.stdout b/tests/reference/asr-expr9-814e4bc.stdout index 03cb002743..c39ec19098 100644 --- a/tests/reference/asr-expr9-814e4bc.stdout +++ b/tests/reference/asr-expr9-814e4bc.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 8 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 6 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) main0 [] [(= (Var 6 i) (FunctionCall 1 test_return_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 6 s) (FunctionCall 1 test_return_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) () ()) () .false.) (= (Var 6 i) (FunctionCall 1 test_return_3 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (SubroutineCall 1 test_return_4 () [(ConstantInteger 4 (Integer 4 []))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_return_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) test_return_1 [(Var 2 a)] [(= (Var 2 x) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 _lpython_return_variable) (Var 2 x) () .false.) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_return_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Character 1 -2 () []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_return_2 [(Var 3 a)] [(= (Var 3 x) (ConstantString "test" (Character 1 4 () [])) () .false.) (= (Var 3 _lpython_return_variable) (Var 3 x) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_return_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 4 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_3 [(Var 4 a)] [(= (Var 4 a) (ConstantInteger 3 (Integer 4 [])) () .false.) (= (Var 4 _lpython_return_variable) (Var 4 a) () .false.) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ()), test_return_4: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_4 [(Var 5 a)] [(= (Var 5 a) (ConstantInteger 1 (Integer 4 [])) () .false.) (Return)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 8 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 6 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) main0 [] [(= (Var 6 i) (FunctionCall 1 test_return_1 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (= (Var 6 s) (FunctionCall 1 test_return_2 () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) () ()) () .true.) (= (Var 6 i) (FunctionCall 1 test_return_3 () [(ConstantInteger 4 (Integer 4 []))] [] (Integer 4 []) () ()) () .false.) (SubroutineCall 1 test_return_4 () [(ConstantInteger 4 (Integer 4 []))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_return_1: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) test_return_1 [(Var 2 a)] [(= (Var 2 x) (ConstantInteger 5 (Integer 4 [])) () .false.) (= (Var 2 _lpython_return_variable) (Var 2 x) () .false.) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ()), test_return_2: (Function (SymbolTable 3 {_lpython_return_variable: (Variable 3 _lpython_return_variable ReturnVar () () Default (Character 1 -2 () []) Source Public Required .false.), a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_return_2 [(Var 3 a)] [(= (Var 3 x) (ConstantString "test" (Character 1 4 () [])) () .true.) (= (Var 3 _lpython_return_variable) (Var 3 x) () .false.) (Return)] (Var 3 _lpython_return_variable) Source Public Implementation ()), test_return_3: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 4 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_3 [(Var 4 a)] [(= (Var 4 a) (ConstantInteger 3 (Integer 4 [])) () .false.) (= (Var 4 _lpython_return_variable) (Var 4 a) () .false.) (Return)] (Var 4 _lpython_return_variable) Source Public Implementation ()), test_return_4: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Integer 4 []) Source Public Required .false.)}) test_return_4 [(Var 5 a)] [(= (Var 5 a) (ConstantInteger 1 (Integer 4 [])) () .false.) (Return)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-list1-770ba33.json b/tests/reference/asr-list1-770ba33.json index de0e5b9db8..c3ed86bdcf 100644 --- a/tests/reference/asr-list1-770ba33.json +++ b/tests/reference/asr-list1-770ba33.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-list1-770ba33.stdout", - "stdout_hash": "ec54ddb46bf28165d1af48cc4124189ee3040dbe575ff9925e762837", + "stdout_hash": "762e770c2af9ed4f4586564ef59c5f73c9252ff43cc61c1d57ca5f13", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-list1-770ba33.stdout b/tests/reference/asr-list1-770ba33.stdout index 4746d09008..f869666482 100644 --- a/tests/reference/asr-list1-770ba33.stdout +++ b/tests/reference/asr-list1-770ba33.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_List: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Integer 4 []) Source Public Required .false.), d: (Variable 2 d Local () () Default (Integer 4 []) Source Public Required .false.)}) test_List [] [(= (Var 2 a) (ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 a) (ConstantArray [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantArray [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Character 1 1 () [])) () .false.) (= (Var 2 c) (ConstantArray [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) (ConstantArray [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 d) (ArrayRef 2 a [(() (ConstantInteger 2 (Integer 4 [])) ())] (Integer 4 []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_List: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Character 1 -2 () []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Integer 4 []) Source Public Required .false.), d: (Variable 2 d Local () () Default (Integer 4 []) Source Public Required .false.)}) test_List [] [(= (Var 2 a) (ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 a) (ConstantArray [(UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 []))) (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 [])))] (Integer 4 [])) () .false.) (= (Var 2 b) (ConstantArray [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () [])) (ConstantString "c" (Character 1 1 () []))] (Character 1 1 () [])) () .true.) (= (Var 2 c) (ConstantArray [(ConstantArray [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] (Integer 4 [])) (ConstantArray [(ConstantInteger 4 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])) (ConstantInteger 6 (Integer 4 []))] (Integer 4 []))] (Integer 4 [])) () .false.) (= (Var 2 d) (ArrayRef 2 a [(() (ConstantInteger 2 (Integer 4 [])) ())] (Integer 4 []) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-subscript1-1acfc19.json b/tests/reference/asr-subscript1-1acfc19.json index 2095e4ba84..e40566e71c 100644 --- a/tests/reference/asr-subscript1-1acfc19.json +++ b/tests/reference/asr-subscript1-1acfc19.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-subscript1-1acfc19.stdout", - "stdout_hash": "840aebe44fa6e87ce67d2d8d16393e0db5cebb5774d068cf6b3537f3", + "stdout_hash": "1e58d0f30eccbefb60c24ea9d513ec0bfe1c7071d61e122c5559b5df", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-subscript1-1acfc19.stdout b/tests/reference/asr-subscript1-1acfc19.stdout index b078eee8c7..1d962ef366 100644 --- a/tests/reference/asr-subscript1-1acfc19.stdout +++ b/tests/reference/asr-subscript1-1acfc19.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_subscript: (Subroutine (SymbolTable 2 {A: (Variable 2 A Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) Source Public Required .false.), B: (Variable 2 B Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_subscript [] [(= (Var 2 s) (ConstantString "abc" (Character 1 3 () [])) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 0 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() () (ConstantInteger 2 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 88 (Integer 4 [])) (ConstantInteger 1 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 1 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 89 (Integer 4 [])) (Integer 4 []) (ConstantInteger -89 (Integer 4 []))) () (ConstantInteger 4 (Integer 4 [])))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))))] (Character 1 -2 () []) ()) () .false.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .false.) (= (Var 2 i) (ArrayRef 2 A [(() (ConstantInteger 0 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])))] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_subscript: (Subroutine (SymbolTable 2 {A: (Variable 2 A Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) Source Public Required .false.), B: (Variable 2 B Local () () Default (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_subscript [] [(= (Var 2 s) (ConstantString "abc" (Character 1 3 () [])) () .true.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 0 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [(() () ())] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [(() () (UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [(() () (ConstantInteger 2 (Integer 4 [])))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 88 (Integer 4 [])) (ConstantInteger 1 (Integer 4 [])))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [(() (ConstantInteger 1 (Integer 4 [])) (UnaryOp USub (ConstantInteger 4 (Integer 4 [])) (Integer 4 []) (ConstantInteger -4 (Integer 4 []))))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 89 (Integer 4 [])) (Integer 4 []) (ConstantInteger -89 (Integer 4 []))) () (ConstantInteger 4 (Integer 4 [])))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [((UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))) (UnaryOp USub (ConstantInteger 3 (Integer 4 [])) (Integer 4 []) (ConstantInteger -3 (Integer 4 []))))] (Character 1 -2 () []) ()) () .true.) (= (Var 2 s) (ArrayRef 2 s [((ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Character 1 -2 () []) ()) () .true.) (= (Var 2 i) (ArrayRef 2 A [(() (ConstantInteger 0 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])) ())] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.) (= (Var 2 B) (ArrayRef 2 A [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 2 (Integer 4 [])) (ConstantInteger 3 (Integer 4 [])))] (Integer 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 5 (Integer 4 [])))]) ()) () .false.)] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin-aa64615.json b/tests/reference/asr-test_builtin-aa64615.json index 13ebd52fac..20d00d7915 100644 --- a/tests/reference/asr-test_builtin-aa64615.json +++ b/tests/reference/asr-test_builtin-aa64615.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin-aa64615.stdout", - "stdout_hash": "bf82d32c56577821b4de74b4f7a3e704a9d498dce354472da8b9b707", + "stdout_hash": "31115cbb0180f5d592845da1d4b432f334c1666b7f4c959e85a6e0e8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin-aa64615.stdout b/tests/reference/asr-test_builtin-aa64615.stdout index 1b2619527a..31e7049703 100644 --- a/tests/reference/asr-test_builtin-aa64615.stdout +++ b/tests/reference/asr-test_builtin-aa64615.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 19 {}) _lfortran_main_program [] [(SubroutineCall 1 test_ord () [] ()) (SubroutineCall 1 test_chr () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 18 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_chr: (Subroutine (SymbolTable 3 {chr: (ExternalSymbol 3 chr 5 chr lpython_builtin [] chr Private), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_chr [] [(= (Var 3 i) (ConstantInteger 48 (Integer 4 [])) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(Var 3 i)] [] (Character 1 -2 () []) () ()) () .false.) (Assert (Compare (Var 3 s) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 3 chr () [(ConstantInteger 48 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0" (Character 1 1 () [])) ()) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_ord: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 5 ord lpython_builtin [] ord Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord [] [(= (Var 2 s) (ConstantString "1" (Character 1 1 () [])) () .false.) (= (Var 2 i) (FunctionCall 2 ord () [(Var 2 s)] [] (Integer 4 []) () ()) () .false.) (Assert (Compare (Var 2 i) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 ord () [(ConstantString "1" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 49 (Integer 4 [])) ()) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 19 {}) _lfortran_main_program [] [(SubroutineCall 1 test_ord () [] ()) (SubroutineCall 1 test_chr () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 18 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), test_chr: (Subroutine (SymbolTable 3 {chr: (ExternalSymbol 3 chr 5 chr lpython_builtin [] chr Private), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 3 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_chr [] [(= (Var 3 i) (ConstantInteger 48 (Integer 4 [])) () .false.) (= (Var 3 s) (FunctionCall 3 chr () [(Var 3 i)] [] (Character 1 -2 () []) () ()) () .true.) (Assert (Compare (Var 3 s) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 3 chr () [(ConstantInteger 48 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "0" (Character 1 1 () [])) ()) Eq (ConstantString "0" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_ord: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ord: (ExternalSymbol 2 ord 5 ord lpython_builtin [] ord Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_ord [] [(= (Var 2 s) (ConstantString "1" (Character 1 1 () [])) () .true.) (= (Var 2 i) (FunctionCall 2 ord () [(Var 2 s)] [] (Integer 4 []) () ()) () .false.) (Assert (Compare (Var 2 i) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 ord () [(ConstantString "1" (Character 1 1 () []))] [] (Integer 4 []) (ConstantInteger 49 (Integer 4 [])) ()) Eq (ConstantInteger 49 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_len-55b0dec.json b/tests/reference/asr-test_builtin_len-55b0dec.json index 0290f5ea57..79e34ea5a5 100644 --- a/tests/reference/asr-test_builtin_len-55b0dec.json +++ b/tests/reference/asr-test_builtin_len-55b0dec.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_len-55b0dec.stdout", - "stdout_hash": "ba2cd9f2fc520fe526dc6a262b34b20816fcd70149cce63fd06bb49d", + "stdout_hash": "d632d856834200cea0fccb87c47e3d72c2695718e6c0c3690b105c4d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_len-55b0dec.stdout b/tests/reference/asr-test_builtin_len-55b0dec.stdout index af3862ad24..1692aacfa2 100644 --- a/tests/reference/asr-test_builtin_len-55b0dec.stdout +++ b/tests/reference/asr-test_builtin_len-55b0dec.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_len: (Subroutine (SymbolTable 2 {len: (ExternalSymbol 2 len 4 len lpython_builtin [] len Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_len [] [(= (Var 2 s) (ConstantString "abcd" (Character 1 4 () [])) () .false.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (ConstantString "" (Character 1 0 () [])) () .false.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "abcd" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_len: (Subroutine (SymbolTable 2 {len: (ExternalSymbol 2 len 4 len lpython_builtin [] len Private), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_len [] [(= (Var 2 s) (ConstantString "abcd" (Character 1 4 () [])) () .true.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (ConstantString "" (Character 1 0 () [])) () .true.) (Assert (Compare (FunctionCall 2 len () [(Var 2 s)] [] (Integer 4 []) () ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "abcd" (Character 1 4 () []))] [] (Integer 4 []) (ConstantInteger 4 (Integer 4 [])) ()) Eq (ConstantInteger 4 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 len () [(ConstantString "" (Character 1 0 () []))] [] (Integer 4 []) (ConstantInteger 0 (Integer 4 [])) ()) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_str-580e920.json b/tests/reference/asr-test_builtin_str-580e920.json index d36100ed55..b45c145561 100644 --- a/tests/reference/asr-test_builtin_str-580e920.json +++ b/tests/reference/asr-test_builtin_str-580e920.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_str-580e920.stdout", - "stdout_hash": "2f931a907c8894527ff966f808428ade81d0295990736d299b242d6d", + "stdout_hash": "50154404cdcdaa5eb8fdc49a7214a32f6973bf43c233725de24d2953", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_str-580e920.stdout b/tests/reference/asr-test_builtin_str-580e920.stdout index f6ff876302..b27eaa29a6 100644 --- a/tests/reference/asr-test_builtin_str-580e920.stdout +++ b/tests/reference/asr-test_builtin_str-580e920.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 4 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 2 str () [(ConstantInteger 356 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "356" (Character 1 1 () [])) ()) () .false.) (Assert (Compare (Var 2 s) Eq (ConstantString "356" (Character 1 3 () [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 567 (Integer 4 [])) (Integer 4 []) (ConstantInteger -567 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-567" (Character 1 1 () [])) ()) () .false.) (Assert (Compare (Var 2 s) Eq (ConstantString "-567" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 str () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "4" (Character 1 1 () [])) ()) Eq (ConstantString "4" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-5" (Character 1 1 () [])) ()) Eq (ConstantString "-5" (Character 1 2 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 17 {}) main_program [] []), test_str_int: (Subroutine (SymbolTable 2 {s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.), str: (ExternalSymbol 2 str 4 str lpython_builtin [] str Private)}) test_str_int [] [(= (Var 2 s) (FunctionCall 2 str () [(ConstantInteger 356 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "356" (Character 1 1 () [])) ()) () .true.) (Assert (Compare (Var 2 s) Eq (ConstantString "356" (Character 1 3 () [])) (Logical 4 []) () ()) ()) (= (Var 2 s) (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 567 (Integer 4 [])) (Integer 4 []) (ConstantInteger -567 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-567" (Character 1 1 () [])) ()) () .true.) (Assert (Compare (Var 2 s) Eq (ConstantString "-567" (Character 1 4 () [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 2 str () [(ConstantInteger 4 (Integer 4 []))] [] (Character 1 -2 () []) (ConstantString "4" (Character 1 1 () [])) ()) Eq (ConstantString "4" (Character 1 1 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 2 str () [(UnaryOp USub (ConstantInteger 5 (Integer 4 [])) (Integer 4 []) (ConstantInteger -5 (Integer 4 [])))] [] (Character 1 -2 () []) (ConstantString "-5" (Character 1 1 () [])) ()) Eq (ConstantString "-5" (Character 1 2 () [])) (Logical 4 []) (ConstantLogical .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) From 8950ad43813d32be3b38bcd4fd6e0998e5952a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 2 Mar 2022 11:56:37 -0700 Subject: [PATCH 5/6] Add TODO comments in the LLVM backend --- src/libasr/codegen/asr_to_llvm.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index 51f77bc516..ef66da9ad5 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -2440,12 +2440,18 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor target = builder->CreateLoad(llvm_utils->create_gep(ptr, idx)); } if( arr_descr->is_array(target) ) { - if( asr_target->m_type->type == - ASR::ttypeType::Character ) { + if( asr_target->m_type->type == ASR::ttypeType::Character ) { + if (x.m_realloc_lhs) { + // TODO: it seems here we have to reallocate + // target to the size of the string + } target = arr_descr->get_pointer_to_data(target); } } } + // TODO: possibly this needs to be done first, so that + // we can check the length of the actual string in `value`, and + // then reallocate the `target` accordingly this->visit_expr_wrapper(x.m_value, true); value = tmp; if ( is_a(*expr_type(x.m_value)) ) { From a75454bbcebcee86322ce5a88ebbd91380775851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Thu, 3 Mar 2022 11:51:08 -0700 Subject: [PATCH 6/6] Work on the string assignment --- src/libasr/codegen/asr_to_llvm.cpp | 40 ++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index ef66da9ad5..9aacab0a62 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -2441,17 +2441,12 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } if( arr_descr->is_array(target) ) { if( asr_target->m_type->type == ASR::ttypeType::Character ) { - if (x.m_realloc_lhs) { - // TODO: it seems here we have to reallocate - // target to the size of the string - } target = arr_descr->get_pointer_to_data(target); } } } - // TODO: possibly this needs to be done first, so that - // we can check the length of the actual string in `value`, and - // then reallocate the `target` accordingly + + // Evaluate the RHS and save into `value` this->visit_expr_wrapper(x.m_value, true); value = tmp; if ( is_a(*expr_type(x.m_value)) ) { @@ -2462,7 +2457,36 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } } } - builder->CreateStore(value, target); + + bool allocatable_string = false; + if( x.m_target->type == ASR::exprType::ArrayRef || + x.m_target->type == ASR::exprType::DerivedRef ) { + // pass + } else { + ASR::Variable_t *asr_target = EXPR2VAR(x.m_target); + if (!arr_descr->is_array(target)) { + if (ASR::is_a(*asr_target->m_type)) { + if (x.m_realloc_lhs) { + // This is an allocatable string + LFORTRAN_ASSERT(ASR::down_cast(asr_target->m_type)->m_len == -2) + allocatable_string = true; + } + } + } + } + if (allocatable_string) { + // RHS is an allocatable string + + // TODO: We need to free the previously allocated memory (if not null) + + // If the RHS contains a temporarily created string, we simply + // copy the pointer to it (now LHS owns it): + builder->CreateStore(value, target); + // TODO: otherwise we allocate the LHS to the right size + // and copy the string + } else { + builder->CreateStore(value, target); + } auto finder = std::find(nested_globals.begin(), nested_globals.end(), h); if (finder != nested_globals.end()) {