diff --git a/.gitignore b/.gitignore index ef04589b05..d9a9f18af7 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,6 @@ src/lpython/parser/parser.tab.cc src/lpython/parser/parser.tab.hh *.py[0-9A-Za-z]* + +##Generated files in integration_tests +integration_tests/test_c_interop_01.c diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 8f48b3ce98..aa4fafdc6f 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -143,7 +143,7 @@ RUN(NAME test_builtin_str_02 LABELS cpython llvm) RUN(NAME test_builtin_round LABELS cpython llvm) RUN(NAME test_math1 LABELS cpython llvm) RUN(NAME test_math_02 LABELS cpython llvm) -RUN(NAME test_c_interop_01 LABELS cpython llvm) +RUN(NAME test_c_interop_01 LABELS cpython llvm c) RUN(NAME test_generics_01 LABELS cpython llvm) RUN(NAME test_cmath LABELS cpython llvm) RUN(NAME test_complex LABELS cpython llvm) diff --git a/integration_tests/test_c_interop_01.py b/integration_tests/test_c_interop_01.py index 6582f58a40..94a6652d46 100644 --- a/integration_tests/test_c_interop_01.py +++ b/integration_tests/test_c_interop_01.py @@ -14,15 +14,16 @@ def _lfortran_bgt32(i: i32, j: i32) -> i32: pass @ccall -def _lfortran_bgt64(i: i64, j: i64) -> i64: +def _lfortran_bgt64(i: i64, j: i64) -> i32: pass -@ccall -def _lfortran_random_number(n: i64, v: f64[:]): - pass +#@ccall +#def _lfortran_random_number(n: i64, v: f64[:]): +# pass def test_c_callbacks(): - pi: f64 = 3.141592653589793238462643383279502884197 + pi: f64 + pi = 3.141592653589793238462643383279502884197 assert abs(_lfortran_dsin(pi) - 0) < 1e-12 assert abs(_lfortran_dsin(pi/2) - 1) < 1e-12 #assert abs(_lfortran_ssin(pi) - 0) < 1e-6 diff --git a/src/libasr/asr_utils.h b/src/libasr/asr_utils.h index 0e1dd6bce9..fdba65e715 100644 --- a/src/libasr/asr_utils.h +++ b/src/libasr/asr_utils.h @@ -820,6 +820,31 @@ static inline bool is_logical(ASR::ttype_t &x) { return ASR::is_a(*type_get_past_pointer(&x)); } +static inline int get_body_size(ASR::symbol_t* s) { + int n_body = 0; + switch (s->type) { + case ASR::symbolType::Function: { + ASR::Function_t* f = ASR::down_cast(s); + n_body = f->n_body; + break; + } + case ASR::symbolType::Subroutine: { + ASR::Subroutine_t* sub = ASR::down_cast(s); + n_body = sub->n_body; + break; + } + case ASR::symbolType::Program: { + ASR::Program_t* p = ASR::down_cast(s); + n_body = p->n_body; + break; + } + default: { + n_body = -1; + } + } + return n_body; +} + inline int extract_dimensions_from_ttype(ASR::ttype_t *x, ASR::dimension_t*& m_dims) { int n_dims = 0; diff --git a/src/libasr/codegen/asr_to_c.cpp b/src/libasr/codegen/asr_to_c.cpp index b8c59d1134..481d1f71a3 100644 --- a/src/libasr/codegen/asr_to_c.cpp +++ b/src/libasr/codegen/asr_to_c.cpp @@ -44,13 +44,10 @@ std::string format_type_c(const std::string &dims, const std::string &type, const std::string &name, bool use_ref, bool /*dummy*/) { std::string fmt; - if (dims.size() == 0) { - std::string ref; - if (use_ref) ref = "&"; - fmt = type + " " + ref + name; - } else { - throw CodeGenError("Dimensions is not supported yet."); - } + std::string ref = "", ptr = ""; + if (dims.size() > 0) ptr = "*"; + if (use_ref) ref = "&"; + fmt = type + " " + ptr + ref + name; return fmt; } @@ -200,8 +197,10 @@ R"(#include != x.m_global_scope->get_scope().end()); if (startswith(item, "lfortran_intrinsic")) { ASR::symbol_t *mod = x.m_global_scope->get_symbol(item); - visit_symbol(*mod); - unit_src += src; + if( ASRUtils::get_body_size(mod) != 0 ) { + visit_symbol(*mod); + unit_src += src; + } } } } @@ -210,8 +209,10 @@ R"(#include for (auto &item : x.m_global_scope->get_scope()) { if (ASR::is_a(*item.second) || ASR::is_a(*item.second)) { - visit_symbol(*item.second); - unit_src += src; + if( ASRUtils::get_body_size(item.second) != 0 ) { + visit_symbol(*item.second); + unit_src += src; + } } } diff --git a/src/libasr/codegen/asr_to_c_cpp.h b/src/libasr/codegen/asr_to_c_cpp.h index 9daa31e2b1..bbe4262893 100644 --- a/src/libasr/codegen/asr_to_c_cpp.h +++ b/src/libasr/codegen/asr_to_c_cpp.h @@ -243,9 +243,9 @@ R"(#include if (ASRUtils::is_integer(*return_var->m_type)) { bool is_int = ASR::down_cast(return_var->m_type)->m_kind == 4; if (is_int) { - sub = "int "; + sub = "int32_t "; } else { - sub = "long long "; + sub = "int64_t "; } } else if (ASRUtils::is_real(*return_var->m_type)) { bool is_float = ASR::down_cast(return_var->m_type)->m_kind == 4; diff --git a/src/libasr/containers.h b/src/libasr/containers.h index 241fdeb406..c9509fdce2 100644 --- a/src/libasr/containers.h +++ b/src/libasr/containers.h @@ -190,7 +190,7 @@ std::string string_format(const std::string& format, Args && ...args) } static inline std::string double_to_scientific(double x) { - return string_format("%e", x); + return string_format("%25.17e", x); } } // namespace LFortran diff --git a/tests/reference/asr-assign2-8d1a2ee.json b/tests/reference/asr-assign2-8d1a2ee.json index 5ea5804d99..679668a153 100644 --- a/tests/reference/asr-assign2-8d1a2ee.json +++ b/tests/reference/asr-assign2-8d1a2ee.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-assign2-8d1a2ee.stdout", - "stdout_hash": "8b2bfbe57a9cfaf48dad7d4bc047fcce2987de92e5633834baa01147", + "stdout_hash": "f5a09dae1cc60e65a6a81de3aeaac7e24e4b704c1d28fc5445e10858", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-assign2-8d1a2ee.stdout b/tests/reference/asr-assign2-8d1a2ee.stdout index 465323cdfa..26b408f10c 100644 --- a/tests/reference/asr-assign2-8d1a2ee.stdout +++ b/tests/reference/asr-assign2-8d1a2ee.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Variable 1 f Local () (Cast (RealConstant 1.234568e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.234568e+00 (Real 4 []))) Default (Real 4 []) Source Public Required .false.), f2: (Variable 1 f2 Local () (RealConstant 1.234568e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), i: (Variable 1 i Local () (IntegerConstant 5 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), i2: (Variable 1 i2 Local () (Cast (IntegerConstant 53430903434 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) Default (Integer 8 []) Source Public Required .false.), main_program: (Program (SymbolTable 2 {}) main_program [] [])}) []) +(TranslationUnit (SymbolTable 1 {f: (Variable 1 f Local () (Cast (RealConstant 1.23456788999999989e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.23456788999999989e+00 (Real 4 []))) Default (Real 4 []) Source Public Required .false.), f2: (Variable 1 f2 Local () (RealConstant 1.23456789012340007e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), i: (Variable 1 i Local () (IntegerConstant 5 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), i2: (Variable 1 i2 Local () (Cast (IntegerConstant 53430903434 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) Default (Integer 8 []) Source Public Required .false.), main_program: (Program (SymbolTable 2 {}) main_program [] [])}) []) diff --git a/tests/reference/asr-c_interop1-cf2e9b4.json b/tests/reference/asr-c_interop1-cf2e9b4.json index 4f48b9d69b..79057fc03e 100644 --- a/tests/reference/asr-c_interop1-cf2e9b4.json +++ b/tests/reference/asr-c_interop1-cf2e9b4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-c_interop1-cf2e9b4.stdout", - "stdout_hash": "61f0d41571959b5f0377c18def80a7487b388339bfa78a1ce2b2cbab", + "stdout_hash": "e27cb11d3d55eb71ea1728e7c5e23462b04bd5b51b68fa8ec7879c24", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-c_interop1-cf2e9b4.stdout b/tests/reference/asr-c_interop1-cf2e9b4.stdout index a88e004fae..512b46774d 100644 --- a/tests/reference/asr-c_interop1-cf2e9b4.stdout +++ b/tests/reference/asr-c_interop1-cf2e9b4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Real 8 []) BindC Public Required .false.), x: (Variable 2 x In () () Default (Real 8 []) BindC Public Required .true.)}) f [(Var 2 x)] [] (Var 2 _lpython_return_variable) BindC Public Interface ()), g: (Subroutine (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 []) BindC Public Required .true.), b: (Variable 3 b In () () Default (Real 4 []) BindC Public Required .true.), c: (Variable 3 c In () () Default (Integer 8 []) BindC Public Required .true.), d: (Variable 3 d In () () Default (Integer 4 []) BindC Public Required .true.)}) g [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d)] [] BindC Public Interface () .false. .false.), h: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Real 8 []) BindC Public Required .false.), x: (Variable 4 x In () () Default (Real 8 []) BindC Public Required .true.)}) h [(Var 4 x)] [(= (Var 4 _lpython_return_variable) (BinOp (Var 4 x) Add (RealConstant 1.000000e+00 (Real 8 [])) (Real 8 []) () ()) ()) (Return)] (Var 4 _lpython_return_variable) BindC Public Implementation ()), l: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 8 []) BindC Public Required .true.), b: (Variable 5 b In () () Default (Real 4 []) BindC Public Required .true.), c: (Variable 5 c In () () Default (Integer 8 []) BindC Public Required .true.), d: (Variable 5 d In () () Default (Integer 4 []) BindC Public Required .true.)}) l [(Var 5 a) (Var 5 b) (Var 5 c) (Var 5 d)] [(Print () [(StringConstant "OK" (Character 1 2 () []))])] BindC Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 6 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 6 y Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 6 z Local () () Default (Integer 8 []) Source Public Required .false.), zz: (Variable 6 zz Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(= (Var 6 x) (RealConstant 5.000000e+00 (Real 8 [])) ()) (= (Var 6 i) (FunctionCall 1 f () [((Var 6 x))] (Real 8 []) () ()) ()) (= (Var 6 y) (Cast (RealConstant 5.400000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.400000e+00 (Real 4 []))) ()) (= (Var 6 z) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 6 zz) (IntegerConstant 2 (Integer 4 [])) ()) (SubroutineCall 1 g () [((Var 6 x)) ((Var 6 y)) ((Var 6 z)) ((Var 6 zz))] ()) (= (Var 6 i) (FunctionCall 1 h () [((Var 6 x))] (Real 8 []) () ()) ()) (SubroutineCall 1 l () [((Var 6 x)) ((Var 6 y)) ((Var 6 z)) ((Var 6 zz))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [])}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Real 8 []) BindC Public Required .false.), x: (Variable 2 x In () () Default (Real 8 []) BindC Public Required .true.)}) f [(Var 2 x)] [] (Var 2 _lpython_return_variable) BindC Public Interface ()), g: (Subroutine (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 []) BindC Public Required .true.), b: (Variable 3 b In () () Default (Real 4 []) BindC Public Required .true.), c: (Variable 3 c In () () Default (Integer 8 []) BindC Public Required .true.), d: (Variable 3 d In () () Default (Integer 4 []) BindC Public Required .true.)}) g [(Var 3 a) (Var 3 b) (Var 3 c) (Var 3 d)] [] BindC Public Interface () .false. .false.), h: (Function (SymbolTable 4 {_lpython_return_variable: (Variable 4 _lpython_return_variable ReturnVar () () Default (Real 8 []) BindC Public Required .false.), x: (Variable 4 x In () () Default (Real 8 []) BindC Public Required .true.)}) h [(Var 4 x)] [(= (Var 4 _lpython_return_variable) (BinOp (Var 4 x) Add (RealConstant 1.00000000000000000e+00 (Real 8 [])) (Real 8 []) () ()) ()) (Return)] (Var 4 _lpython_return_variable) BindC Public Implementation ()), l: (Subroutine (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 8 []) BindC Public Required .true.), b: (Variable 5 b In () () Default (Real 4 []) BindC Public Required .true.), c: (Variable 5 c In () () Default (Integer 8 []) BindC Public Required .true.), d: (Variable 5 d In () () Default (Integer 4 []) BindC Public Required .true.)}) l [(Var 5 a) (Var 5 b) (Var 5 c) (Var 5 d)] [(Print () [(StringConstant "OK" (Character 1 2 () []))])] BindC Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 6 {i: (Variable 6 i Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 6 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 6 y Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 6 z Local () () Default (Integer 8 []) Source Public Required .false.), zz: (Variable 6 zz Local () () Default (Integer 4 []) Source Public Required .false.)}) main0 [] [(= (Var 6 x) (RealConstant 5.00000000000000000e+00 (Real 8 [])) ()) (= (Var 6 i) (FunctionCall 1 f () [((Var 6 x))] (Real 8 []) () ()) ()) (= (Var 6 y) (Cast (RealConstant 5.40000000000000036e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.40000000000000036e+00 (Real 4 []))) ()) (= (Var 6 z) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 6 zz) (IntegerConstant 2 (Integer 4 [])) ()) (SubroutineCall 1 g () [((Var 6 x)) ((Var 6 y)) ((Var 6 z)) ((Var 6 zz))] ()) (= (Var 6 i) (FunctionCall 1 h () [((Var 6 x))] (Real 8 []) () ()) ()) (SubroutineCall 1 l () [((Var 6 x)) ((Var 6 y)) ((Var 6 z)) ((Var 6 zz))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 7 {}) main_program [] [])}) []) diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json index 65fadb1804..e4772c07c8 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": "f637b18b301537d199ac5e728b573eef2492f93f2364e19caf280df4", + "stdout_hash": "773103b451c4cc93c9d0f3a8796001b29daa0fcd54642bf79f30134b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-complex1-f26c460.stdout b/tests/reference/asr-complex1-f26c460.stdout index 88ae87c976..60c4055d98 100644 --- a/tests/reference/asr-complex1-f26c460.stdout +++ b/tests/reference/asr-complex1-f26c460.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_0__complex: (ExternalSymbol 1 complex@__lpython_overloaded_0__complex 5 __lpython_overloaded_0__complex lpython_builtin [] __lpython_overloaded_0__complex Public), complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 5 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_1__complex: (ExternalSymbol 1 complex@__lpython_overloaded_1__complex 5 __lpython_overloaded_1__complex lpython_builtin [] __lpython_overloaded_1__complex Public), complex@__lpython_overloaded_2__complex: (ExternalSymbol 1 complex@__lpython_overloaded_2__complex 5 __lpython_overloaded_2__complex lpython_builtin [] __lpython_overloaded_2__complex Public), complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 5 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 5 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 100 {}) main_program [] []), test: (Subroutine (SymbolTable 3 {x: (Variable 3 x Local () () Default (Complex 8 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Complex 8 []) Source Public Required .false.), z: (Variable 3 z Local () () Default (Complex 4 []) Source Public Required .false.)}) test [] [(= (Var 3 x) (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 2.000000e+00 0.000000e+00 (Complex 8 []))) Add (ComplexConstant 0.000000e+00 3.000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 2.000000e+00 3.000000e+00 (Complex 8 [])) ()) ()) (= (Var 3 y) (BinOp (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 5.000000e+00 0.000000e+00 (Complex 8 []))) Add (ComplexConstant 0.000000e+00 5.000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 5.000000e+00 5.000000e+00 (Complex 8 [])) ()) ()) (= (Var 3 z) (Cast (BinOp (Var 3 x) Add (Var 3 y) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ()) (= (Var 3 z) (Cast (BinOp (Var 3 x) Sub (Var 3 y) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ()) (= (Var 3 z) (Cast (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 2.000000e+00 0.000000e+00 (Complex 8 []))) Mul (Var 3 x) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ())] Source Public Implementation () .false. .false.), test_complex: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 4 []) 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.), complex: (ExternalSymbol 2 complex 5 complex lpython_builtin [] complex Private)}) test_complex [] [(= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_0__complex 2 complex [] (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_1__complex 2 complex [((RealConstant 3.400000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.400000e+00 0.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 3.400000e+00 0.000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 5.000000e+00 (Real 8 []))) ((RealConstant 4.300000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 5.000000e+00 4.300000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 5.000000e+00 4.300000e+00 (Complex 4 []))) ()) (= (Var 2 c) (FunctionCall 1 complex@__lpython_overloaded_2__complex 2 complex [((IntegerConstant 1 (Integer 4 [])))] (Complex 4 []) (ComplexConstant 1.000000e+00 0.000000e+00 (Complex 8 [])) ()) ()) (= (Var 2 c1) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 4 []))) ()) (= (Var 2 c2) (Cast (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 2 (Integer 4 []))) ((RealConstant 4.500000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 2.000000e+00 4.500000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 2.000000e+00 4.500000e+00 (Complex 4 []))) ()) (= (Var 2 c3) (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.000000e+00 (Real 8 []))) ((RealConstant 4.000000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) ()) (= (Var 2 b) (Compare (Var 2 c1) NotEq (Var 2 c2) (Logical 4 []) () ()) ()) (= (Var 2 b) (Compare (Cast (Var 2 c1) ComplexToComplex (Complex 8 []) ()) 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) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 1.000000e+00 2.000000e+00 (Complex 8 [])) ()) Pow (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.345340e+00 (Real 8 []))) ((RealConstant 4.867868e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.345340e+00 4.867868e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant 1.555329e-02 6.556118e-02 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 1.555329e-02 6.556118e-02 (Complex 4 []))) ()) (= (Var 2 c) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 1.000000e+00 2.000000e+00 (Complex 8 [])) ()) Mul (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant -5.000000e+00 1.000000e+01 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant -5.000000e+00 1.000000e+01 (Complex 4 []))) ()) (= (Var 2 c) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 4.000000e+00 5.000000e+00 (Complex 8 [])) ()) Sub (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant 1.000000e+00 1.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 1.000000e+00 1.000000e+00 (Complex 4 []))) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_0__complex: (ExternalSymbol 1 complex@__lpython_overloaded_0__complex 5 __lpython_overloaded_0__complex lpython_builtin [] __lpython_overloaded_0__complex Public), complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 5 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_1__complex: (ExternalSymbol 1 complex@__lpython_overloaded_1__complex 5 __lpython_overloaded_1__complex lpython_builtin [] __lpython_overloaded_1__complex Public), complex@__lpython_overloaded_2__complex: (ExternalSymbol 1 complex@__lpython_overloaded_2__complex 5 __lpython_overloaded_2__complex lpython_builtin [] __lpython_overloaded_2__complex Public), complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 5 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 5 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 100 {}) main_program [] []), test: (Subroutine (SymbolTable 3 {x: (Variable 3 x Local () () Default (Complex 8 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Complex 8 []) Source Public Required .false.), z: (Variable 3 z Local () () Default (Complex 4 []) Source Public Required .false.)}) test [] [(= (Var 3 x) (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 2.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 []))) Add (ComplexConstant 0.00000000000000000e+00 3.00000000000000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 2.00000000000000000e+00 3.00000000000000000e+00 (Complex 8 [])) ()) ()) (= (Var 3 y) (BinOp (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 5.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 []))) Add (ComplexConstant 0.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 5.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) ()) ()) (= (Var 3 z) (Cast (BinOp (Var 3 x) Add (Var 3 y) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ()) (= (Var 3 z) (Cast (BinOp (Var 3 x) Sub (Var 3 y) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ()) (= (Var 3 z) (Cast (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 2.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 []))) Mul (Var 3 x) (Complex 8 []) () ()) ComplexToComplex (Complex 4 []) ()) ())] Source Public Implementation () .false. .false.), test_complex: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 4 []) 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.), complex: (ExternalSymbol 2 complex 5 complex lpython_builtin [] complex Private)}) test_complex [] [(= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_0__complex 2 complex [] (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_1__complex 2 complex [((RealConstant 3.39999999999999991e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.39999999999999991e+00 0.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 3.39999999999999991e+00 0.00000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 5.00000000000000000e+00 (Real 8 []))) ((RealConstant 4.29999999999999982e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 5.00000000000000000e+00 4.29999999999999982e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 5.00000000000000000e+00 4.29999999999999982e+00 (Complex 4 []))) ()) (= (Var 2 c) (FunctionCall 1 complex@__lpython_overloaded_2__complex 2 complex [((IntegerConstant 1 (Integer 4 [])))] (Complex 4 []) (ComplexConstant 1.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()) ()) (= (Var 2 c1) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c2) (Cast (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 2 (Integer 4 []))) ((RealConstant 4.50000000000000000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 2.00000000000000000e+00 4.50000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 2.00000000000000000e+00 4.50000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c3) (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.00000000000000000e+00 (Real 8 []))) ((RealConstant 4.00000000000000000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) ()) (= (Var 2 b) (Compare (Var 2 c1) NotEq (Var 2 c2) (Logical 4 []) () ()) ()) (= (Var 2 b) (Compare (Cast (Var 2 c1) ComplexToComplex (Complex 8 []) ()) 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) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 1.00000000000000000e+00 2.00000000000000000e+00 (Complex 8 [])) ()) Pow (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.34534000000000020e+00 (Real 8 []))) ((RealConstant 4.86786779999999997e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.34534000000000020e+00 4.86786779999999997e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant 1.55532894199002149e-02 6.55611790271555805e-02 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 1.55532894199002149e-02 6.55611790271555805e-02 (Complex 4 []))) ()) (= (Var 2 c) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 1.00000000000000000e+00 2.00000000000000000e+00 (Complex 8 [])) ()) Mul (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant -5.00000000000000000e+00 1.00000000000000000e+01 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant -5.00000000000000000e+00 1.00000000000000000e+01 (Complex 4 []))) ()) (= (Var 2 c) (Cast (BinOp (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 4.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) ()) Sub (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant 1.00000000000000000e+00 1.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 1.00000000000000000e+00 1.00000000000000000e+00 (Complex 4 []))) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json index 2b86d54bcb..048aa7fc9d 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": "bb7b04af6fcad948ae6bd56cbc59c9cedb0b93deb35e69826ce79da2", + "stdout_hash": "3fa05ddb17f0a4287a2db3f52d7e82b035e4d87f2499e7e16bea49d7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-constants1-5828e8a.stdout b/tests/reference/asr-constants1-5828e8a.stdout index 43bf850cf3..1f17366ced 100644 --- a/tests/reference/asr-constants1-5828e8a.stdout +++ b/tests/reference/asr-constants1-5828e8a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 13 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), abs@__lpython_overloaded_4__abs: (ExternalSymbol 1 abs@__lpython_overloaded_4__abs 13 __lpython_overloaded_4__abs lpython_builtin [] __lpython_overloaded_4__abs Public), abs@__lpython_overloaded_6__abs: (ExternalSymbol 1 abs@__lpython_overloaded_6__abs 13 __lpython_overloaded_6__abs lpython_builtin [] __lpython_overloaded_6__abs Public), abs@__lpython_overloaded_8__abs: (ExternalSymbol 1 abs@__lpython_overloaded_8__abs 13 __lpython_overloaded_8__abs lpython_builtin [] __lpython_overloaded_8__abs Public), bool@__lpython_overloaded_0__bool: (ExternalSymbol 1 bool@__lpython_overloaded_0__bool 13 __lpython_overloaded_0__bool lpython_builtin [] __lpython_overloaded_0__bool Public), bool@__lpython_overloaded_5__bool: (ExternalSymbol 1 bool@__lpython_overloaded_5__bool 13 __lpython_overloaded_5__bool lpython_builtin [] __lpython_overloaded_5__bool Public), bool@__lpython_overloaded_6__bool: (ExternalSymbol 1 bool@__lpython_overloaded_6__bool 13 __lpython_overloaded_6__bool lpython_builtin [] __lpython_overloaded_6__bool Public), bool@__lpython_overloaded_9__bool: (ExternalSymbol 1 bool@__lpython_overloaded_9__bool 13 __lpython_overloaded_9__bool lpython_builtin [] __lpython_overloaded_9__bool Public), complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 13 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 13 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 108 {}) main_program [] []), str@__lpython_overloaded_0__str: (ExternalSymbol 1 str@__lpython_overloaded_0__str 13 __lpython_overloaded_0__str lpython_builtin [] __lpython_overloaded_0__str Public), str@__lpython_overloaded_1__str: (ExternalSymbol 1 str@__lpython_overloaded_1__str 13 __lpython_overloaded_1__str lpython_builtin [] __lpython_overloaded_1__str Public), str@__lpython_overloaded_2__str: (ExternalSymbol 1 str@__lpython_overloaded_2__str 13 __lpython_overloaded_2__str lpython_builtin [] __lpython_overloaded_2__str Public), str@__lpython_overloaded_3__str: (ExternalSymbol 1 str@__lpython_overloaded_3__str 13 __lpython_overloaded_3__str lpython_builtin [] __lpython_overloaded_3__str Public), test_abs: (Subroutine (SymbolTable 4 {a: (Variable 4 a Local () () Default (Integer 4 []) Source Public Required .false.), abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.), complex: (ExternalSymbol 4 complex 13 complex lpython_builtin [] complex Private)}) test_abs [] [(= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_4__abs 4 abs [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_4__abs 4 abs [((IntegerUnaryMinus (IntegerConstant 500 (Integer 4 [])) (Integer 4 []) (IntegerConstant -500 (Integer 4 []))))] (Integer 4 []) (IntegerConstant 500 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_6__abs 4 abs [((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_6__abs 4 abs [((LogicalConstant .true. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_0__abs 4 abs [((RealConstant 3.450000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 3.450000e+00 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 3.450000e+00 (Real 4 []))) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_0__abs 4 abs [((RealUnaryMinus (RealConstant 5.346340e+03 (Real 8 [])) (Real 8 []) (RealConstant -5.346340e+03 (Real 8 []))))] (Real 8 []) (RealConstant 5.346340e+03 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 5.346340e+03 (Real 4 []))) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_8__abs 4 abs [((FunctionCall 1 complex@__lpython_overloaded_5__complex 4 complex [((RealConstant 3.450000e+00 (Real 8 []))) ((RealConstant 5.600000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.450000e+00 5.600000e+00 (Complex 8 [])) ()))] (Real 8 []) (RealConstant 6.577424e+00 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 6.577424e+00 (Real 4 []))) ())] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 4 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private), complex: (ExternalSymbol 6 complex 13 complex lpython_builtin [] complex Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_0__bool 6 bool [((IntegerConstant 0 (Integer 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_0__bool 6 bool [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_6__bool 6 bool [((StringConstant "" (Character 1 0 () [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_9__bool 6 bool [((FunctionCall 1 complex@__lpython_overloaded_9__complex 6 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_6__bool 6 bool [((StringConstant "t" (Character 1 1 () [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_5__bool 6 bool [((RealConstant 2.300000e+00 (Real 8 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (LogicalConstant .true. (Logical 4 [])) (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 () [((IntegerConstant 5 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0b101" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [((IntegerConstant 64 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0b1000000" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0b1000010110" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerConstant 8 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0o10" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerConstant 56 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0o70" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0o1026" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerConstant 42 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0x2a" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerConstant 12648430 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0xc0ffee" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0x216" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 4 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 8 a) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Tuple [(Integer 4 []) (Integer 4 [])]) Source Public Required .false.), divmod: (ExternalSymbol 11 divmod 13 divmod lpython_builtin [] divmod Private)}) test_divmod [] [(= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 9 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 3 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 9 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant -3 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 0 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 0 (Integer 4 [])) (IntegerConstant 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.)}) test_float [] [(= (Var 10 a) (RealConstant 0.000000e+00 (Real 8 [])) ()) (= (Var 10 a) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 5.000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -1.000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 1.000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 0.000000e+00 (Real 8 []))) ())] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.)}) test_int [] [(= (Var 9 a) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (RealConstant 4.560000e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 4 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (RealUnaryMinus (RealConstant 5.000010e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.000010e+00 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (IntegerConstant 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.), l: (Variable 5 l Local () () Default (List (Integer 4 [])) Source Public Required .false.)}) test_len [] [(= (Var 5 a) (StringLen (StringConstant "" (Character 1 0 () [])) (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) ()) (= (Var 5 a) (StringLen (StringConstant "test" (Character 1 4 () [])) (Integer 4 []) (IntegerConstant 4 (Integer 4 []))) ()) (= (Var 5 a) (StringLen (StringConstant "this is a test" (Character 1 14 () [])) (Integer 4 []) (IntegerConstant 14 (Integer 4 []))) ()) (= (Var 5 a) (TupleLen (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (TupleLen (TupleConstant [(TupleConstant [(StringConstant "c" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (RealConstant 3.400000e+00 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (TupleConstant [(StringConstant "c" (Character 1 1 () [])) (IntegerConstant 3 (Integer 4 [])) (RealConstant 5.600000e+00 (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 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 5 a) (ListLen (ListConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (List (Integer 4 []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (ListLen (ListConstant [(ListConstant [(IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 6 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 [])))] (List (Integer 4 []))) (ListConstant [(IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 [])))] (List (Integer 4 [])))] (List (List (Integer 4 [])))) (Integer 4 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 5 a) (SetLen (SetConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Set (Integer 4 []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (DictLen (DictConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] [(StringConstant "c" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (StringConstant "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 l) (ListConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))] (List (Integer 4 []))) ()) (= (Var 5 a) (ListLen (Var 5 l) (Integer 4 []) ()) ()) (ListAppend 5 l (IntegerConstant 5 (Integer 4 []))) (= (Var 5 a) (ListLen (Var 5 l) (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 () [((StringConstant "5" (Character 1 1 () [])))] (Integer 4 []) (IntegerConstant 53 (Integer 4 [])) ()) ()) (= (Var 3 s) (FunctionCall 3 chr () [((IntegerConstant 43 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "+" (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 1 str@__lpython_overloaded_0__str 7 str [] (Character 1 -2 () []) (StringConstant "" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_3__str 7 str [((IntegerConstant 5 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "5" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_3__str 7 str [((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-4" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_2__str 7 str [((LogicalConstant .true. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "True" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_2__str 7 str [((LogicalConstant .false. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "False" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_1__str 7 str [((StringConstant "5346" (Character 1 4 () [])))] (Character 1 -2 () []) (StringConstant "5346" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 13 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), abs@__lpython_overloaded_4__abs: (ExternalSymbol 1 abs@__lpython_overloaded_4__abs 13 __lpython_overloaded_4__abs lpython_builtin [] __lpython_overloaded_4__abs Public), abs@__lpython_overloaded_6__abs: (ExternalSymbol 1 abs@__lpython_overloaded_6__abs 13 __lpython_overloaded_6__abs lpython_builtin [] __lpython_overloaded_6__abs Public), abs@__lpython_overloaded_8__abs: (ExternalSymbol 1 abs@__lpython_overloaded_8__abs 13 __lpython_overloaded_8__abs lpython_builtin [] __lpython_overloaded_8__abs Public), bool@__lpython_overloaded_0__bool: (ExternalSymbol 1 bool@__lpython_overloaded_0__bool 13 __lpython_overloaded_0__bool lpython_builtin [] __lpython_overloaded_0__bool Public), bool@__lpython_overloaded_5__bool: (ExternalSymbol 1 bool@__lpython_overloaded_5__bool 13 __lpython_overloaded_5__bool lpython_builtin [] __lpython_overloaded_5__bool Public), bool@__lpython_overloaded_6__bool: (ExternalSymbol 1 bool@__lpython_overloaded_6__bool 13 __lpython_overloaded_6__bool lpython_builtin [] __lpython_overloaded_6__bool Public), bool@__lpython_overloaded_9__bool: (ExternalSymbol 1 bool@__lpython_overloaded_9__bool 13 __lpython_overloaded_9__bool lpython_builtin [] __lpython_overloaded_9__bool Public), complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 13 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 13 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 108 {}) main_program [] []), str@__lpython_overloaded_0__str: (ExternalSymbol 1 str@__lpython_overloaded_0__str 13 __lpython_overloaded_0__str lpython_builtin [] __lpython_overloaded_0__str Public), str@__lpython_overloaded_1__str: (ExternalSymbol 1 str@__lpython_overloaded_1__str 13 __lpython_overloaded_1__str lpython_builtin [] __lpython_overloaded_1__str Public), str@__lpython_overloaded_2__str: (ExternalSymbol 1 str@__lpython_overloaded_2__str 13 __lpython_overloaded_2__str lpython_builtin [] __lpython_overloaded_2__str Public), str@__lpython_overloaded_3__str: (ExternalSymbol 1 str@__lpython_overloaded_3__str 13 __lpython_overloaded_3__str lpython_builtin [] __lpython_overloaded_3__str Public), test_abs: (Subroutine (SymbolTable 4 {a: (Variable 4 a Local () () Default (Integer 4 []) Source Public Required .false.), abs: (ExternalSymbol 4 abs 13 abs lpython_builtin [] abs Private), b: (Variable 4 b Local () () Default (Real 4 []) Source Public Required .false.), complex: (ExternalSymbol 4 complex 13 complex lpython_builtin [] complex Private)}) test_abs [] [(= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_4__abs 4 abs [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 5 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_4__abs 4 abs [((IntegerUnaryMinus (IntegerConstant 500 (Integer 4 [])) (Integer 4 []) (IntegerConstant -500 (Integer 4 []))))] (Integer 4 []) (IntegerConstant 500 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_6__abs 4 abs [((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) ()) (= (Var 4 a) (FunctionCall 1 abs@__lpython_overloaded_6__abs 4 abs [((LogicalConstant .true. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_0__abs 4 abs [((RealConstant 3.45000000000000018e+00 (Real 8 [])))] (Real 8 []) (RealConstant 3.45000000000000018e+00 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 3.45000000000000018e+00 (Real 4 []))) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_0__abs 4 abs [((RealUnaryMinus (RealConstant 5.34634000000000015e+03 (Real 8 [])) (Real 8 []) (RealConstant -5.34634000000000015e+03 (Real 8 []))))] (Real 8 []) (RealConstant 5.34634000000000015e+03 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 5.34634000000000015e+03 (Real 4 []))) ()) (= (Var 4 b) (Cast (FunctionCall 1 abs@__lpython_overloaded_8__abs 4 abs [((FunctionCall 1 complex@__lpython_overloaded_5__complex 4 complex [((RealConstant 3.45000000000000018e+00 (Real 8 []))) ((RealConstant 5.59999999999999964e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.45000000000000018e+00 5.59999999999999964e+00 (Complex 8 [])) ()))] (Real 8 []) (RealConstant 6.57742350772701823e+00 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 6.57742350772701823e+00 (Real 4 []))) ())] Source Public Implementation () .false. .false.), test_bool: (Subroutine (SymbolTable 6 {a: (Variable 6 a Local () () Default (Logical 4 []) Source Public Required .false.), bool: (ExternalSymbol 6 bool 13 bool lpython_builtin [] bool Private), complex: (ExternalSymbol 6 complex 13 complex lpython_builtin [] complex Private)}) test_bool [] [(= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_0__bool 6 bool [((IntegerConstant 0 (Integer 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_0__bool 6 bool [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_6__bool 6 bool [((StringConstant "" (Character 1 0 () [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_9__bool 6 bool [((FunctionCall 1 complex@__lpython_overloaded_9__complex 6 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_6__bool 6 bool [((StringConstant "t" (Character 1 1 () [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 6 a) (FunctionCall 1 bool@__lpython_overloaded_5__bool 6 bool [((RealConstant 2.29999999999999982e+00 (Real 8 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Var 6 a) Eq (LogicalConstant .true. (Logical 4 [])) (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 () [((IntegerConstant 5 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0b101" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [((IntegerConstant 64 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0b1000000" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 bin () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0b1000010110" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerConstant 8 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0o10" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerConstant 56 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0o70" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 oct () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0o1026" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerConstant 42 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0x2a" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerConstant 12648430 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "0xc0ffee" (Character 1 1 () [])) ()) ()) (= (Var 2 b) (FunctionCall 2 hex () [((IntegerUnaryMinus (IntegerConstant 534 (Integer 4 [])) (Integer 4 []) (IntegerConstant -534 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-0x216" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.), test_callable: (Subroutine (SymbolTable 8 {a: (Variable 8 a Local () () Default (Logical 4 []) Source Public Required .false.), b: (Variable 8 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_callable [] [(= (Var 8 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 8 a) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ()) (= (Var 8 a) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (Var 8 a) Eq (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_divmod: (Subroutine (SymbolTable 11 {a: (Variable 11 a Local () () Default (Tuple [(Integer 4 []) (Integer 4 [])]) Source Public Required .false.), divmod: (ExternalSymbol 11 divmod 13 divmod lpython_builtin [] divmod Private)}) test_divmod [] [(= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 9 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 3 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 9 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant -3 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 0 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 0 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 [])])) ()) ()) (= (Var 11 a) (FunctionCall 11 divmod () [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 [])]) (TupleConstant [(IntegerConstant 0 (Integer 4 [])) (IntegerConstant 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.)}) test_float [] [(= (Var 10 a) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) (= (Var 10 a) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 5.00000000000000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -1.00000000000000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 1.00000000000000000e+00 (Real 8 []))) ()) (= (Var 10 a) (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 []))) ())] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 9 {a: (Variable 9 a Local () () Default (Integer 8 []) Source Public Required .false.)}) test_int [] [(= (Var 9 a) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (RealConstant 4.55999999999999961e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 4 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (RealUnaryMinus (RealConstant 5.00000999999999962e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.00000999999999962e+00 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 9 a) (Cast (IntegerConstant 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.), l: (Variable 5 l Local () () Default (List (Integer 4 [])) Source Public Required .false.)}) test_len [] [(= (Var 5 a) (StringLen (StringConstant "" (Character 1 0 () [])) (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) ()) (= (Var 5 a) (StringLen (StringConstant "test" (Character 1 4 () [])) (Integer 4 []) (IntegerConstant 4 (Integer 4 []))) ()) (= (Var 5 a) (StringLen (StringConstant "this is a test" (Character 1 14 () [])) (Integer 4 []) (IntegerConstant 14 (Integer 4 []))) ()) (= (Var 5 a) (TupleLen (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (TupleLen (TupleConstant [(TupleConstant [(StringConstant "c" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (RealConstant 3.39999999999999991e+00 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (TupleConstant [(StringConstant "c" (Character 1 1 () [])) (IntegerConstant 3 (Integer 4 [])) (RealConstant 5.59999999999999964e+00 (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 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 5 a) (ListLen (ListConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (List (Integer 4 []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (ListLen (ListConstant [(ListConstant [(IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 6 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 [])))] (List (Integer 4 []))) (ListConstant [(IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 [])))] (List (Integer 4 [])))] (List (List (Integer 4 [])))) (Integer 4 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 5 a) (SetLen (SetConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Set (Integer 4 []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 a) (DictLen (DictConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] [(StringConstant "c" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (StringConstant "c" (Character 1 1 () []))] (Dict (Integer 4 []) (Character 1 1 () []))) (Integer 4 []) (IntegerConstant 3 (Integer 4 []))) ()) (= (Var 5 l) (ListConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])) (IntegerConstant 4 (Integer 4 []))] (List (Integer 4 []))) ()) (= (Var 5 a) (ListLen (Var 5 l) (Integer 4 []) ()) ()) (ListAppend 5 l (IntegerConstant 5 (Integer 4 []))) (= (Var 5 a) (ListLen (Var 5 l) (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 () [((StringConstant "5" (Character 1 1 () [])))] (Integer 4 []) (IntegerConstant 53 (Integer 4 [])) ()) ()) (= (Var 3 s) (FunctionCall 3 chr () [((IntegerConstant 43 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "+" (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 1 str@__lpython_overloaded_0__str 7 str [] (Character 1 -2 () []) (StringConstant "" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_3__str 7 str [((IntegerConstant 5 (Integer 4 [])))] (Character 1 -2 () []) (StringConstant "5" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_3__str 7 str [((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Character 1 -2 () []) (StringConstant "-4" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_2__str 7 str [((LogicalConstant .true. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "True" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_2__str 7 str [((LogicalConstant .false. (Logical 4 [])))] (Character 1 -2 () []) (StringConstant "False" (Character 1 1 () [])) ()) ()) (= (Var 7 s) (FunctionCall 1 str@__lpython_overloaded_1__str 7 str [((StringConstant "5346" (Character 1 4 () [])))] (Character 1 -2 () []) (StringConstant "5346" (Character 1 1 () [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.json b/tests/reference/asr-doconcurrentloop_01-3fdc189.json index 54014109f1..e4a21dd271 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": "c94aa52789d7413c9598fb84bb838848c5de98c9a9246ef19371da7d", + "stdout_hash": "d800e3b5895fa4321a90fd5a3ce26500397213956494046aed6dcb80", "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 6fb4015a34..e9ee06a0d7 100644 --- a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout +++ b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 5 {}) _lpython_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 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) (Cast (RealConstant 1.000000e+01 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.000000e+01 (Real 4 []))) ()) (= (Var 3 nsize) (IntegerConstant 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 3 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (BinOp (Var 3 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) ()) (Cast (RealConstant 5.000000e+00 (Real 8 [])) RealToReal (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) (RealConstant 5.000000e+00 (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]))) ()) (= (ArrayRef 3 b [(() (BinOp (Var 3 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) ()) (Cast (RealConstant 5.000000e+00 (Real 8 [])) RealToReal (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) (RealConstant 5.000000e+00 (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]))) ())]) (SubroutineCall 1 triad () [((Var 3 a)) ((Var 3 b)) ((Var 3 scalar)) ((Var 3 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lpython_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) (IntegerConstant 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) ())])] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 5 {}) _lpython_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 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) (Cast (RealConstant 1.00000000000000000e+01 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.00000000000000000e+01 (Real 4 []))) ()) (= (Var 3 nsize) (IntegerConstant 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 3 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (BinOp (Var 3 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) ()) (Cast (RealConstant 5.00000000000000000e+00 (Real 8 [])) RealToReal (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) (RealConstant 5.00000000000000000e+00 (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]))) ()) (= (ArrayRef 3 b [(() (BinOp (Var 3 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) ()) (Cast (RealConstant 5.00000000000000000e+00 (Real 8 [])) RealToReal (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) (RealConstant 5.00000000000000000e+00 (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]))) ())]) (SubroutineCall 1 triad () [((Var 3 a)) ((Var 3 b)) ((Var 3 scalar)) ((Var 3 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lpython_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) (IntegerConstant 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) ())])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json index cba80521f2..933476a8db 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": "82cf8a955bcbadf8ac3fde84bab3370b79415173e5498c0398c8bcf4", + "stdout_hash": "f4df7a6a8dcdf6a9cd7d66ad095b897bf84c4ba74e323d1a97d9daac", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr10-efcbb1b.stdout b/tests/reference/asr-expr10-efcbb1b.stdout index b1f40edabe..d73b21bd8c 100644 --- a/tests/reference/asr-expr10-efcbb1b.stdout +++ b/tests/reference/asr-expr10-efcbb1b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 4 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 4 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 a) (IntegerUnaryMinus (IntegerConstant 500 (Integer 4 [])) (Integer 4 []) (IntegerConstant -500 (Integer 4 []))) ()) (= (Var 2 a) (IntegerBitNot (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToLogical (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToLogical (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToLogical (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 f) (Cast (RealConstant 1.000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.000000e+00 (Real 4 []))) ()) (= (Var 2 f) (Cast (RealUnaryMinus (RealConstant 1.837455e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.837455e+05 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -1.837455e+05 (Real 4 []))) ()) (= (Var 2 b1) (LogicalConstant .true. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalNot (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 b3) (LogicalNot (Var 2 b2) (Logical 4 []) ()) ()) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 a) (IntegerUnaryMinus (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) ()) (= (Var 2 a) (IntegerBitNot (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) ()) (= (Var 2 c) (Cast (ComplexConstant 1.000000e+00 2.000000e+00 (Complex 8 [])) ComplexToComplex (Complex 4 []) (ComplexConstant 1.000000e+00 2.000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (ComplexUnaryMinus (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((RealConstant 6.500000e+01 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 6.500000e+01 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant -3.000000e+00 -6.500000e+01 (Complex 8 []))) ComplexToComplex (Complex 4 []) (ComplexConstant -3.000000e+00 -6.500000e+01 (Complex 4 []))) ()) (= (Var 2 b1) (LogicalConstant .false. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalConstant .true. (Logical 4 [])) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 4 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_UnaryOp: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () () Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 4 []) Source Public Required .false.), b3: (Variable 2 b3 Local () () Default (Logical 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), f: (Variable 2 f Local () () Default (Real 4 []) Source Public Required .false.)}) test_UnaryOp [] [(= (Var 2 a) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 a) (IntegerUnaryMinus (IntegerConstant 500 (Integer 4 [])) (Integer 4 []) (IntegerConstant -500 (Integer 4 []))) ()) (= (Var 2 a) (IntegerBitNot (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToLogical (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToLogical (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) ()) (= (Var 2 b) (LogicalNot (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToLogical (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 f) (Cast (RealConstant 1.00000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 1.00000000000000000e+00 (Real 4 []))) ()) (= (Var 2 f) (Cast (RealUnaryMinus (RealConstant 1.83745534000000014e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.83745534000000014e+05 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -1.83745534000000014e+05 (Real 4 []))) ()) (= (Var 2 b1) (LogicalConstant .true. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalNot (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 b3) (LogicalNot (Var 2 b2) (Logical 4 []) ()) ()) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 a) (IntegerUnaryMinus (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) ()) (= (Var 2 a) (IntegerBitNot (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) ()) (= (Var 2 c) (Cast (ComplexConstant 1.00000000000000000e+00 2.00000000000000000e+00 (Complex 8 [])) ComplexToComplex (Complex 4 []) (ComplexConstant 1.00000000000000000e+00 2.00000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c) (Cast (ComplexUnaryMinus (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((RealConstant 6.50000000000000000e+01 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 6.50000000000000000e+01 (Complex 8 [])) ()) (Complex 8 []) (ComplexConstant -3.00000000000000000e+00 -6.50000000000000000e+01 (Complex 8 []))) ComplexToComplex (Complex 4 []) (ComplexConstant -3.00000000000000000e+00 -6.50000000000000000e+01 (Complex 4 []))) ()) (= (Var 2 b1) (LogicalConstant .false. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalConstant .true. (Logical 4 [])) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json index 709745cc86..dc05e427ce 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": "64debb576d7f40f9aa85cbba0e029cd8a93881e7be7330a03ba647f1", + "stdout_hash": "4c4f8288354c7b09ebd2b52bce63b218545569c5810a6d3403910da3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr13-81bdb5a.stdout b/tests/reference/asr-expr13-81bdb5a.stdout index a17cda778a..b1eef28d20 100644 --- a/tests/reference/asr-expr13-81bdb5a.stdout +++ b/tests/reference/asr-expr13-81bdb5a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 4 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_Compare: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private)}) test_Compare [] [(= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) Gt (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) LtE (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) Lt (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 5.600000e+00 (Real 8 [])) GtE (RealConstant 5.599990e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 3.300000e+00 (Real 8 [])) Eq (RealConstant 3.300000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 3.300000e+00 (Real 8 [])) NotEq (RealConstant 3.400000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) Eq (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.000000e+00 (Real 8 []))) ((RealConstant 4.000000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.000000e+00 4.000000e+00 (Complex 8 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) Gt (StringConstant "abd" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "" (Character 1 0 () [])) Lt (StringConstant "s" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "-abs" (Character 1 4 () [])) GtE (StringConstant "abs" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abcd" (Character 1 4 () [])) LtE (StringConstant "abcde" (Character 1 5 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) Eq (StringConstant "abc" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) NotEq (StringConstant "abd" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "" (Character 1 0 () [])) Eq (StringConstant "+" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .true. (Logical 4 [])) Gt (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .true. (Logical 4 [])) Eq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .false. (Logical 4 [])) NotEq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .false. (Logical 4 [])) GtE (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {complex@__lpython_overloaded_5__complex: (ExternalSymbol 1 complex@__lpython_overloaded_5__complex 4 __lpython_overloaded_5__complex lpython_builtin [] __lpython_overloaded_5__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_Compare: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Logical 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private)}) test_Compare [] [(= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) Gt (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) LtE (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (IntegerConstant 5 (Integer 4 [])) Lt (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 5.59999999999999964e+00 (Real 8 [])) GtE (RealConstant 5.59999000000000002e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 3.29999999999999982e+00 (Real 8 [])) Eq (RealConstant 3.29999999999999982e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (RealConstant 3.29999999999999982e+00 (Real 8 [])) NotEq (RealConstant 3.39999999999999991e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 4 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) Eq (FunctionCall 1 complex@__lpython_overloaded_5__complex 2 complex [((RealConstant 3.00000000000000000e+00 (Real 8 []))) ((RealConstant 4.00000000000000000e+00 (Real 8 [])))] (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 4.00000000000000000e+00 (Complex 8 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) Gt (StringConstant "abd" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "" (Character 1 0 () [])) Lt (StringConstant "s" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "-abs" (Character 1 4 () [])) GtE (StringConstant "abs" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abcd" (Character 1 4 () [])) LtE (StringConstant "abcde" (Character 1 5 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) Eq (StringConstant "abc" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "abc" (Character 1 3 () [])) NotEq (StringConstant "abd" (Character 1 3 () [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (StringConstant "" (Character 1 0 () [])) Eq (StringConstant "+" (Character 1 1 () [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .true. (Logical 4 [])) Gt (LogicalConstant .false. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .true. (Logical 4 [])) Eq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .false. (Logical 4 [])) NotEq (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 a) (Compare (LogicalConstant .false. (Logical 4 [])) GtE (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr16-a3dc453.json b/tests/reference/asr-expr16-a3dc453.json index 75f6ca6925..606460be05 100644 --- a/tests/reference/asr-expr16-a3dc453.json +++ b/tests/reference/asr-expr16-a3dc453.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-expr16-a3dc453.stdout", - "stdout_hash": "8b82d19903a71469f6bc2536083114d04cd3ed7016144eee0f61c286", + "stdout_hash": "cb31096402633e5973413e2cc28d4eb3aef2f18f3aff36bb216dab65", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr16-a3dc453.stdout b/tests/reference/asr-expr16-a3dc453.stdout index a69bd9ec12..31e2cd6fcf 100644 --- a/tests/reference/asr-expr16-a3dc453.stdout +++ b/tests/reference/asr-expr16-a3dc453.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_issue_455: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Real 8 []) Source Public Required .false.), data: (Variable 2 data In () () Default (List (Integer 4 [])) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 2 sum Local () () Default (Real 8 []) Source Public Required .false.)}) test_issue_455 [(Var 2 data)] [(= (Var 2 sum) (RealConstant 0.000000e+00 (Real 8 [])) ()) (DoLoop ((Var 2 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (ListLen (Var 2 data) (Integer 4 []) ()) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (Var 2 sum) (BinOp (Var 2 sum) Add (Cast (ListItem 2 data (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) ())]) (= (Var 2 _lpython_return_variable) (Var 2 sum) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ())}) []) +(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_issue_455: (Function (SymbolTable 2 {_lpython_return_variable: (Variable 2 _lpython_return_variable ReturnVar () () Default (Real 8 []) Source Public Required .false.), data: (Variable 2 data In () () Default (List (Integer 4 [])) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 2 sum Local () () Default (Real 8 []) Source Public Required .false.)}) test_issue_455 [(Var 2 data)] [(= (Var 2 sum) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) (DoLoop ((Var 2 i) (IntegerConstant 0 (Integer 4 [])) (BinOp (ListLen (Var 2 data) (Integer 4 []) ()) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (IntegerConstant 1 (Integer 4 []))) [(= (Var 2 sum) (BinOp (Var 2 sum) Add (Cast (ListItem 2 data (BinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) ())]) (= (Var 2 _lpython_return_variable) (Var 2 sum) ()) (Return)] (Var 2 _lpython_return_variable) Source Public Implementation ())}) []) diff --git a/tests/reference/asr-expr3-10eb0a4.json b/tests/reference/asr-expr3-10eb0a4.json index 854dc06b88..8ca3cce73c 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": "20e33d43bb6e5a663784b4774909887d23ca4656022c78de5f803151", + "stdout_hash": "69c8b69c92875cd0493b151a401fbf1525b8d864c32c567b6da22627", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr3-10eb0a4.stdout b/tests/reference/asr-expr3-10eb0a4.stdout index 3fe4ce5046..a9b53be51f 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) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (Cast (RealConstant 4.200000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 4.200000e+00 (Real 4 []))) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 4 []) ()) Mul (Var 2 b) (Real 4 []) () ()) ()) (= (Var 2 b) (BinOp (Var 2 b) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) ()) (Real 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 8 []) ()) Sub (RealConstant 3.900000e+00 (Real 8 [])) (Real 8 []) () ()) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 8 []) ()) Div (Var 2 b) (Real 8 []) () ()) ()) (= (Var 2 b) (Cast (BinOp (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (Cast (IntegerConstant 4 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (If (Compare (Cast (Var 2 a) IntegerToReal (Real 4 []) ()) Lt (Var 2 b) (Logical 4 []) () ()) [(Print () [(StringConstant "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) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (Cast (RealConstant 4.20000000000000018e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 4.20000000000000018e+00 (Real 4 []))) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 4 []) ()) Mul (Var 2 b) (Real 4 []) () ()) ()) (= (Var 2 b) (BinOp (Var 2 b) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) ()) (Real 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 8 []) ()) Sub (RealConstant 3.89999999999999991e+00 (Real 8 [])) (Real 8 []) () ()) ()) (= (Var 2 a) (BinOp (Cast (Var 2 a) IntegerToReal (Real 8 []) ()) Div (Var 2 b) (Real 8 []) () ()) ()) (= (Var 2 b) (Cast (BinOp (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (Cast (IntegerConstant 4 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (If (Compare (Cast (Var 2 a) IntegerToReal (Real 4 []) ()) Lt (Var 2 b) (Logical 4 []) () ()) [(Print () [(StringConstant "a < b" (Character 1 5 () []))])] [])] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json index 84c8408b64..8e3b594ca8 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": "8bd31fb7e984935181320276ad51ff269a1197594ba115e6c38c4fcf", + "stdout_hash": "4dcd4ad8d695e9eb23407af0eed602ebab7129a8f5149d6a0948c79a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-expr8-6beda60.stdout b/tests/reference/asr-expr8-6beda60.stdout index dc765ad142..a657b16b86 100644 --- a/tests/reference/asr-expr8-6beda60.stdout +++ b/tests/reference/asr-expr8-6beda60.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lpython_floordiv@__lpython_overloaded_2___lpython_floordiv: (ExternalSymbol 1 _lpython_floordiv@__lpython_overloaded_2___lpython_floordiv 4 __lpython_overloaded_2___lpython_floordiv lpython_builtin [] __lpython_overloaded_2___lpython_floordiv Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_binop: (Subroutine (SymbolTable 2 {_lpython_floordiv: (ExternalSymbol 2 _lpython_floordiv 4 _lpython_floordiv lpython_builtin [] _lpython_floordiv Private), b1: (Variable 2 b1 Local () () Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 4 []) Source Public Required .false.), 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 (IntegerConstant 2 (Integer 4 [])) Pow (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) ()) (= (Var 2 x2) (Cast (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Pow (RealConstant 3.500000e+00 (Real 8 [])) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 x) (BinOp (IntegerConstant 54 (Integer 4 [])) Sub (IntegerConstant 100 (Integer 4 [])) (Integer 4 []) (IntegerConstant -46 (Integer 4 [])) ()) ()) (= (Var 2 x2) (Cast (BinOp (BinOp (RealConstant 3.454000e+00 (Real 8 [])) Sub (RealConstant 7.654300e+02 (Real 8 [])) (Real 8 []) (RealConstant -7.619760e+02 (Real 8 [])) ()) Add (RealConstant 5.346000e+02 (Real 8 [])) (Real 8 []) (RealConstant -2.273760e+02 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant -2.273760e+02 (Real 4 []))) ()) (= (Var 2 x2) (Cast (BinOp (RealConstant 5.346565e+03 (Real 8 [])) Mul (RealConstant 3.450000e+00 (Real 8 [])) (Real 8 []) (RealConstant 1.844565e+04 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 1.844565e+04 (Real 4 []))) ()) (= (Var 2 x2) (Cast (BinOp (RealConstant 5.346565e+03 (Real 8 [])) Pow (RealConstant 3.450000e+00 (Real 8 [])) (Real 8 []) (RealConstant 7.275423e+12 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 7.275423e+12 (Real 4 []))) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Mul (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Pow (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 b1) (LogicalConstant .true. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalConstant .false. (Logical 4 [])) ()) (= (Var 2 x) (FunctionCall 1 _lpython_floordiv@__lpython_overloaded_2___lpython_floordiv 2 _lpython_floordiv [((Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ())) ((Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ()))] (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ()) Pow (Cast (Var 2 b2) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_floordiv@__lpython_overloaded_2___lpython_floordiv: (ExternalSymbol 1 _lpython_floordiv@__lpython_overloaded_2___lpython_floordiv 4 __lpython_overloaded_2___lpython_floordiv lpython_builtin [] __lpython_overloaded_2___lpython_floordiv Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] []), test_binop: (Subroutine (SymbolTable 2 {_lpython_floordiv: (ExternalSymbol 2 _lpython_floordiv 4 _lpython_floordiv lpython_builtin [] _lpython_floordiv Private), b1: (Variable 2 b1 Local () () Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () () Default (Logical 4 []) Source Public Required .false.), 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 (IntegerConstant 2 (Integer 4 [])) Pow (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) ()) (= (Var 2 x2) (Cast (BinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Pow (RealConstant 3.50000000000000000e+00 (Real 8 [])) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 x) (BinOp (IntegerConstant 54 (Integer 4 [])) Sub (IntegerConstant 100 (Integer 4 [])) (Integer 4 []) (IntegerConstant -46 (Integer 4 [])) ()) ()) (= (Var 2 x2) (Cast (BinOp (BinOp (RealConstant 3.45400000000000018e+00 (Real 8 [])) Sub (RealConstant 7.65429999999999950e+02 (Real 8 [])) (Real 8 []) (RealConstant -7.61975999999999999e+02 (Real 8 [])) ()) Add (RealConstant 5.34600000000000023e+02 (Real 8 [])) (Real 8 []) (RealConstant -2.27375999999999976e+02 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant -2.27375999999999976e+02 (Real 4 []))) ()) (= (Var 2 x2) (Cast (BinOp (RealConstant 5.34656499999999960e+03 (Real 8 [])) Mul (RealConstant 3.45000000000000018e+00 (Real 8 [])) (Real 8 []) (RealConstant 1.84456492499999986e+04 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 1.84456492499999986e+04 (Real 4 []))) ()) (= (Var 2 x2) (Cast (BinOp (RealConstant 5.34656499999999960e+03 (Real 8 [])) Pow (RealConstant 3.45000000000000018e+00 (Real 8 [])) (Real 8 []) (RealConstant 7.27542278992521777e+12 (Real 8 [])) ()) RealToReal (Real 4 []) (RealConstant 7.27542278992521777e+12 (Real 4 []))) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Mul (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Pow (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (= (Var 2 b1) (LogicalConstant .true. (Logical 4 [])) ()) (= (Var 2 b2) (LogicalConstant .false. (Logical 4 [])) ()) (= (Var 2 x) (FunctionCall 1 _lpython_floordiv@__lpython_overloaded_2___lpython_floordiv 2 _lpython_floordiv [((Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ())) ((Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ()))] (Integer 4 []) () ()) ()) (= (Var 2 x) (BinOp (Cast (Var 2 b1) LogicalToInteger (Integer 4 []) ()) Pow (Cast (Var 2 b2) LogicalToInteger (Integer 4 []) ()) (Integer 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 622f582024..aba2a8a098 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": "4815b7d41bc983b8b021285d436af121d8b2034e56e5f0aef6056125", + "stdout_hash": "3753065ad285d376135d61b458db004887477ec930b40bde3f066076", "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 0cacffe841..e1bb8cb95d 100644 --- a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout +++ b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_abs () [] ())] Source Public Implementation () .false. .false.), abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 4 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), abs@__lpython_overloaded_1__abs: (ExternalSymbol 1 abs@__lpython_overloaded_1__abs 4 __lpython_overloaded_1__abs lpython_builtin [] __lpython_overloaded_1__abs Public), abs@__lpython_overloaded_2__abs: (ExternalSymbol 1 abs@__lpython_overloaded_2__abs 4 __lpython_overloaded_2__abs lpython_builtin [] __lpython_overloaded_2__abs Public), abs@__lpython_overloaded_3__abs: (ExternalSymbol 1 abs@__lpython_overloaded_3__abs 4 __lpython_overloaded_3__abs lpython_builtin [] __lpython_overloaded_3__abs Public), abs@__lpython_overloaded_4__abs: (ExternalSymbol 1 abs@__lpython_overloaded_4__abs 4 __lpython_overloaded_4__abs lpython_builtin [] __lpython_overloaded_4__abs Public), abs@__lpython_overloaded_5__abs: (ExternalSymbol 1 abs@__lpython_overloaded_5__abs 4 __lpython_overloaded_5__abs lpython_builtin [] __lpython_overloaded_5__abs Public), abs@__lpython_overloaded_6__abs: (ExternalSymbol 1 abs@__lpython_overloaded_6__abs 4 __lpython_overloaded_6__abs lpython_builtin [] __lpython_overloaded_6__abs Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_abs: (Subroutine (SymbolTable 2 {abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 8 []) Source Public Required .false.), i3: (Variable 2 i3 Local () () Default (Integer 1 []) Source Public Required .false.), i4: (Variable 2 i4 Local () () Default (Integer 2 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 2 x) (RealConstant 5.500000e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((Var 2 x))] (Real 8 []) () ()) Eq (RealConstant 5.500000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 x) (RealUnaryMinus (RealConstant 5.500000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.500000e+00 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((Var 2 x))] (Real 8 []) () ()) Eq (RealConstant 5.500000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((RealConstant 5.500000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 5.500000e+00 (Real 8 [])) ()) Eq (RealConstant 5.500000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((RealUnaryMinus (RealConstant 5.500000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.500000e+00 (Real 8 []))))] (Real 8 []) (RealConstant 5.500000e+00 (Real 8 [])) ()) Eq (RealConstant 5.500000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 x2) (Cast (RealUnaryMinus (RealConstant 5.500000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.500000e+00 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -5.500000e+00 (Real 4 []))) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_1__abs 2 abs [((Var 2 x2))] (Real 4 []) () ()) RealToReal (Real 8 []) ()) Eq (RealConstant 5.500000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_4__abs 2 abs [((Var 2 i))] (Integer 4 []) () ()) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_4__abs 2 abs [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 i2) (Cast (IntegerUnaryMinus (IntegerConstant 6 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_5__abs 2 abs [((Var 2 i2))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 i3) (Cast (IntegerUnaryMinus (IntegerConstant 7 (Integer 4 [])) (Integer 4 []) (IntegerConstant -7 (Integer 4 []))) IntegerToInteger (Integer 1 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_2__abs 2 abs [((Var 2 i3))] (Integer 1 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 7 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i4) (Cast (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_3__abs 2 abs [((Var 2 i4))] (Integer 2 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_6__abs 2 abs [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_6__abs 2 abs [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_abs () [] ())] Source Public Implementation () .false. .false.), abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 4 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), abs@__lpython_overloaded_1__abs: (ExternalSymbol 1 abs@__lpython_overloaded_1__abs 4 __lpython_overloaded_1__abs lpython_builtin [] __lpython_overloaded_1__abs Public), abs@__lpython_overloaded_2__abs: (ExternalSymbol 1 abs@__lpython_overloaded_2__abs 4 __lpython_overloaded_2__abs lpython_builtin [] __lpython_overloaded_2__abs Public), abs@__lpython_overloaded_3__abs: (ExternalSymbol 1 abs@__lpython_overloaded_3__abs 4 __lpython_overloaded_3__abs lpython_builtin [] __lpython_overloaded_3__abs Public), abs@__lpython_overloaded_4__abs: (ExternalSymbol 1 abs@__lpython_overloaded_4__abs 4 __lpython_overloaded_4__abs lpython_builtin [] __lpython_overloaded_4__abs Public), abs@__lpython_overloaded_5__abs: (ExternalSymbol 1 abs@__lpython_overloaded_5__abs 4 __lpython_overloaded_5__abs lpython_builtin [] __lpython_overloaded_5__abs Public), abs@__lpython_overloaded_6__abs: (ExternalSymbol 1 abs@__lpython_overloaded_6__abs 4 __lpython_overloaded_6__abs lpython_builtin [] __lpython_overloaded_6__abs Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_abs: (Subroutine (SymbolTable 2 {abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 8 []) Source Public Required .false.), i3: (Variable 2 i3 Local () () Default (Integer 1 []) Source Public Required .false.), i4: (Variable 2 i4 Local () () Default (Integer 2 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), x2: (Variable 2 x2 Local () () Default (Real 4 []) Source Public Required .false.)}) test_abs [] [(= (Var 2 x) (RealConstant 5.50000000000000000e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((Var 2 x))] (Real 8 []) () ()) Eq (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 x) (RealUnaryMinus (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.50000000000000000e+00 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((Var 2 x))] (Real 8 []) () ()) Eq (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((RealConstant 5.50000000000000000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 5.50000000000000000e+00 (Real 8 [])) ()) Eq (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((RealUnaryMinus (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.50000000000000000e+00 (Real 8 []))))] (Real 8 []) (RealConstant 5.50000000000000000e+00 (Real 8 [])) ()) Eq (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 x2) (Cast (RealUnaryMinus (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.50000000000000000e+00 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -5.50000000000000000e+00 (Real 4 []))) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_1__abs 2 abs [((Var 2 x2))] (Real 4 []) () ()) RealToReal (Real 8 []) ()) Eq (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_4__abs 2 abs [((Var 2 i))] (Integer 4 []) () ()) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_4__abs 2 abs [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 i2) (Cast (IntegerUnaryMinus (IntegerConstant 6 (Integer 4 [])) (Integer 4 []) (IntegerConstant -6 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_5__abs 2 abs [((Var 2 i2))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 i3) (Cast (IntegerUnaryMinus (IntegerConstant 7 (Integer 4 [])) (Integer 4 []) (IntegerConstant -7 (Integer 4 []))) IntegerToInteger (Integer 1 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_2__abs 2 abs [((Var 2 i3))] (Integer 1 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 7 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i4) (Cast (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 abs@__lpython_overloaded_3__abs 2 abs [((Var 2 i4))] (Integer 2 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_6__abs 2 abs [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_6__abs 2 abs [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (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 6531bc8fac..97b00725ed 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": "945b4e02f07b1495734c582bd55887351d7745503eb5e7342b7c3822", + "stdout_hash": "6f516ca51d70f6cbec7739f59ead5edc2f9cf5a18bf6c346cb906a75", "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 ee0031bfd4..8bbb2cd670 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_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_bool () [] ())] Source Public Implementation () .false. .false.), bool@__lpython_overloaded_0__bool: (ExternalSymbol 1 bool@__lpython_overloaded_0__bool 4 __lpython_overloaded_0__bool lpython_builtin [] __lpython_overloaded_0__bool Public), bool@__lpython_overloaded_1__bool: (ExternalSymbol 1 bool@__lpython_overloaded_1__bool 4 __lpython_overloaded_1__bool lpython_builtin [] __lpython_overloaded_1__bool Public), bool@__lpython_overloaded_2__bool: (ExternalSymbol 1 bool@__lpython_overloaded_2__bool 4 __lpython_overloaded_2__bool lpython_builtin [] __lpython_overloaded_2__bool Public), bool@__lpython_overloaded_3__bool: (ExternalSymbol 1 bool@__lpython_overloaded_3__bool 4 __lpython_overloaded_3__bool lpython_builtin [] __lpython_overloaded_3__bool Public), bool@__lpython_overloaded_4__bool: (ExternalSymbol 1 bool@__lpython_overloaded_4__bool 4 __lpython_overloaded_4__bool lpython_builtin [] __lpython_overloaded_4__bool Public), bool@__lpython_overloaded_5__bool: (ExternalSymbol 1 bool@__lpython_overloaded_5__bool 4 __lpython_overloaded_5__bool lpython_builtin [] __lpython_overloaded_5__bool Public), bool@__lpython_overloaded_6__bool: (ExternalSymbol 1 bool@__lpython_overloaded_6__bool 4 __lpython_overloaded_6__bool lpython_builtin [] __lpython_overloaded_6__bool Public), bool@__lpython_overloaded_7__bool: (ExternalSymbol 1 bool@__lpython_overloaded_7__bool 4 __lpython_overloaded_7__bool lpython_builtin [] __lpython_overloaded_7__bool Public), bool@__lpython_overloaded_8__bool: (ExternalSymbol 1 bool@__lpython_overloaded_8__bool 4 __lpython_overloaded_8__bool lpython_builtin [] __lpython_overloaded_8__bool Public), bool@__lpython_overloaded_9__bool: (ExternalSymbol 1 bool@__lpython_overloaded_9__bool 4 __lpython_overloaded_9__bool lpython_builtin [] __lpython_overloaded_9__bool Public), complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 4 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_bool: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), a2: (Variable 2 a2 Local () () Default (Integer 8 []) Source Public Required .false.), a3: (Variable 2 a3 Local () () Default (Integer 1 []) Source Public Required .false.), a4: (Variable 2 a4 Local () () Default (Integer 2 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), bool: (ExternalSymbol 2 bool 4 bool lpython_builtin [] bool Private), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 8 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_bool [] [(= (Var 2 a) (IntegerConstant 34 (Integer 4 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((Var 2 a))] (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 0 (Integer 4 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((Var 2 a))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((IntegerConstant 0 (Integer 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 a2) (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_1__bool 2 bool [((Var 2 a2))] (Logical 4 []) () ()) ()) (= (Var 2 a3) (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToInteger (Integer 1 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_2__bool 2 bool [((Var 2 a3))] (Logical 4 []) () ()) ()) (= (Var 2 a4) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_3__bool 2 bool [((Var 2 a4))] (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 0.000000e+00 (Real 8 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((Var 2 f))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (= (Var 2 f) (RealConstant 1.000000e+00 (Real 8 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((Var 2 f))] (Logical 4 []) () ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((RealConstant 5.678687e+01 (Real 8 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((RealConstant 0.000000e+00 (Real 8 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 f2) (Cast (RealUnaryMinus (RealConstant 2.356000e+02 (Real 8 [])) (Real 8 []) (RealConstant -2.356000e+02 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -2.356000e+02 (Real 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_4__bool 2 bool [((Var 2 f2))] (Logical 4 []) () ()) ()) (= (Var 2 s) (StringConstant "" (Character 1 0 () [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((Var 2 s))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (= (Var 2 s) (StringConstant "str" (Character 1 3 () [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((Var 2 s))] (Logical 4 []) () ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((StringConstant "" (Character 1 0 () [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((StringConstant "str" (Character 1 3 () [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((Var 2 b))] (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((Var 2 b))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((LogicalConstant .true. (Logical 4 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((LogicalConstant .false. (Logical 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 2.000000e+00 3.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 2.000000e+00 3.000000e+00 (Complex 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_8__bool 2 bool [((Var 2 c))] (Logical 4 []) () ()) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 4 []))) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_8__bool 2 bool [((Var 2 c))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((BinOp (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 []))) Add (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 c1) (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((RealConstant 1.002020e-01 (Real 8 [])))] (Complex 8 []) (ComplexConstant 0.000000e+00 1.002020e-01 (Complex 8 [])) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((Var 2 c1))] (Logical 4 []) () ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.000000e+00 0.000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((BinOp (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 3.000000e+00 0.000000e+00 (Complex 8 []))) Add (ComplexConstant 0.000000e+00 5.000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 3.000000e+00 5.000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_bool () [] ())] Source Public Implementation () .false. .false.), bool@__lpython_overloaded_0__bool: (ExternalSymbol 1 bool@__lpython_overloaded_0__bool 4 __lpython_overloaded_0__bool lpython_builtin [] __lpython_overloaded_0__bool Public), bool@__lpython_overloaded_1__bool: (ExternalSymbol 1 bool@__lpython_overloaded_1__bool 4 __lpython_overloaded_1__bool lpython_builtin [] __lpython_overloaded_1__bool Public), bool@__lpython_overloaded_2__bool: (ExternalSymbol 1 bool@__lpython_overloaded_2__bool 4 __lpython_overloaded_2__bool lpython_builtin [] __lpython_overloaded_2__bool Public), bool@__lpython_overloaded_3__bool: (ExternalSymbol 1 bool@__lpython_overloaded_3__bool 4 __lpython_overloaded_3__bool lpython_builtin [] __lpython_overloaded_3__bool Public), bool@__lpython_overloaded_4__bool: (ExternalSymbol 1 bool@__lpython_overloaded_4__bool 4 __lpython_overloaded_4__bool lpython_builtin [] __lpython_overloaded_4__bool Public), bool@__lpython_overloaded_5__bool: (ExternalSymbol 1 bool@__lpython_overloaded_5__bool 4 __lpython_overloaded_5__bool lpython_builtin [] __lpython_overloaded_5__bool Public), bool@__lpython_overloaded_6__bool: (ExternalSymbol 1 bool@__lpython_overloaded_6__bool 4 __lpython_overloaded_6__bool lpython_builtin [] __lpython_overloaded_6__bool Public), bool@__lpython_overloaded_7__bool: (ExternalSymbol 1 bool@__lpython_overloaded_7__bool 4 __lpython_overloaded_7__bool lpython_builtin [] __lpython_overloaded_7__bool Public), bool@__lpython_overloaded_8__bool: (ExternalSymbol 1 bool@__lpython_overloaded_8__bool 4 __lpython_overloaded_8__bool lpython_builtin [] __lpython_overloaded_8__bool Public), bool@__lpython_overloaded_9__bool: (ExternalSymbol 1 bool@__lpython_overloaded_9__bool 4 __lpython_overloaded_9__bool lpython_builtin [] __lpython_overloaded_9__bool Public), complex@__lpython_overloaded_13__complex: (ExternalSymbol 1 complex@__lpython_overloaded_13__complex 4 __lpython_overloaded_13__complex lpython_builtin [] __lpython_overloaded_13__complex Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_bool: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), a2: (Variable 2 a2 Local () () Default (Integer 8 []) Source Public Required .false.), a3: (Variable 2 a3 Local () () Default (Integer 1 []) Source Public Required .false.), a4: (Variable 2 a4 Local () () Default (Integer 2 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), bool: (ExternalSymbol 2 bool 4 bool lpython_builtin [] bool Private), c: (Variable 2 c Local () () Default (Complex 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 8 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Character 1 -2 () []) Source Public Required .false.)}) test_bool [] [(= (Var 2 a) (IntegerConstant 34 (Integer 4 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((Var 2 a))] (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 0 (Integer 4 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((Var 2 a))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_0__bool 2 bool [((IntegerConstant 0 (Integer 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 a2) (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_1__bool 2 bool [((Var 2 a2))] (Logical 4 []) () ()) ()) (= (Var 2 a3) (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToInteger (Integer 1 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_2__bool 2 bool [((Var 2 a3))] (Logical 4 []) () ()) ()) (= (Var 2 a4) (Cast (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_3__bool 2 bool [((Var 2 a4))] (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((Var 2 f))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (= (Var 2 f) (RealConstant 1.00000000000000000e+00 (Real 8 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((Var 2 f))] (Logical 4 []) () ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((RealConstant 5.67868658000000011e+01 (Real 8 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_5__bool 2 bool [((RealConstant 0.00000000000000000e+00 (Real 8 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 f2) (Cast (RealUnaryMinus (RealConstant 2.35599999999999994e+02 (Real 8 [])) (Real 8 []) (RealConstant -2.35599999999999994e+02 (Real 8 []))) RealToReal (Real 4 []) (RealConstant -2.35599999999999994e+02 (Real 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_4__bool 2 bool [((Var 2 f2))] (Logical 4 []) () ()) ()) (= (Var 2 s) (StringConstant "" (Character 1 0 () [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((Var 2 s))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (= (Var 2 s) (StringConstant "str" (Character 1 3 () [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((Var 2 s))] (Logical 4 []) () ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((StringConstant "" (Character 1 0 () [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_6__bool 2 bool [((StringConstant "str" (Character 1 3 () [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((Var 2 b))] (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((Var 2 b))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((LogicalConstant .true. (Logical 4 [])))] (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_7__bool 2 bool [((LogicalConstant .false. (Logical 4 [])))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 2.00000000000000000e+00 3.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 2.00000000000000000e+00 3.00000000000000000e+00 (Complex 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_8__bool 2 bool [((Var 2 c))] (Logical 4 []) () ()) ()) (= (Var 2 c) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 4 []))) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_8__bool 2 bool [((Var 2 c))] (Logical 4 []) () ()) (Logical 4 []) ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((BinOp (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 []))) Add (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (= (Var 2 c1) (FunctionCall 1 complex@__lpython_overloaded_13__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((RealConstant 1.00201999999999999e-01 (Real 8 [])))] (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 1.00201999999999999e-01 (Complex 8 [])) ()) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((Var 2 c1))] (Logical 4 []) () ()) ()) (Assert (LogicalNot (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 0 (Integer 4 []))) ((IntegerConstant 0 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 0.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) ()) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) ()) (Assert (FunctionCall 1 bool@__lpython_overloaded_9__bool 2 bool [((BinOp (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToComplex (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 0.00000000000000000e+00 (Complex 8 []))) Add (ComplexConstant 0.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) (Complex 8 []) (ComplexConstant 3.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) ()))] (Logical 4 []) (LogicalConstant .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 a77078a410..4354110bae 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": "4b0b57d1fab815b982273c47e50d1946d42451b3456f06535295f6d5", + "stdout_hash": "a23165ee4a1a693cd41e6155773dc2ae2e2f26298378ead5047b7398", "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 c0fadaf5f0..4538b8abc2 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_main_program: (Subroutine (SymbolTable 4 {}) _lpython_main_program [] [(SubroutineCall 1 test_float () [] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 3 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_float: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_float [] [(= (Var 2 i) (IntegerConstant 34 (Integer 4 [])) ()) (Assert (Compare (RealConstant 0.000000e+00 (Real 8 [])) Eq (RealConstant 0.000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.400000e+01 (Real 8 []))) Eq (RealConstant 3.400000e+01 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 i) IntegerToReal (Real 8 []) ()) Eq (RealConstant 3.400000e+01 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) ()) (Assert (Compare (Cast (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -4.235000e+03 (Real 8 []))) Eq (RealUnaryMinus (RealConstant 4.235000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.235000e+03 (Real 8 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.400000e+01 (Real 8 []))) Eq (RealConstant 3.400000e+01 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -4.235000e+03 (Real 8 []))) Eq (RealUnaryMinus (RealConstant 4.235000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.235000e+03 (Real 8 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 1.000000e+00 (Real 8 []))) Eq (RealConstant 1.000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 0.000000e+00 (Real 8 []))) Eq (RealConstant 0.000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 4 {}) _lpython_main_program [] [(SubroutineCall 1 test_float () [] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 3 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_float: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_float [] [(= (Var 2 i) (IntegerConstant 34 (Integer 4 [])) ()) (Assert (Compare (RealConstant 0.00000000000000000e+00 (Real 8 [])) Eq (RealConstant 0.00000000000000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.40000000000000000e+01 (Real 8 []))) Eq (RealConstant 3.40000000000000000e+01 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 i) IntegerToReal (Real 8 []) ()) Eq (RealConstant 3.40000000000000000e+01 (Real 8 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) ()) (Assert (Compare (Cast (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -4.23500000000000000e+03 (Real 8 []))) Eq (RealUnaryMinus (RealConstant 4.23500000000000000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.23500000000000000e+03 (Real 8 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerConstant 34 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 3.40000000000000000e+01 (Real 8 []))) Eq (RealConstant 3.40000000000000000e+01 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (IntegerUnaryMinus (IntegerConstant 4235 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4235 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant -4.23500000000000000e+03 (Real 8 []))) Eq (RealUnaryMinus (RealConstant 4.23500000000000000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.23500000000000000e+03 (Real 8 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 1.00000000000000000e+00 (Real 8 []))) Eq (RealConstant 1.00000000000000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) IntegerToReal (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 []))) Eq (RealConstant 0.00000000000000000e+00 (Real 8 [])) (Logical 4 []) (LogicalConstant .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 91bc6c1442..57a813dfa1 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": "fe60700aa108402851e81b85d9417e9f6cfdfc5189fd3f45acd44d8d", + "stdout_hash": "e0a6ad03bd21e3a4d570e35228013e7e269b3a7e85f9ddf8c3b5d766", "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 f6c43ec61c..f721b6a6d7 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_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 check_all () [] ())] Source Public Implementation () .false. .false.), check_all: (Subroutine (SymbolTable 4 {}) check_all [] [(SubroutineCall 1 test_int () [] ()) (SubroutineCall 1 test_bool_to_int () [] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_bool_to_int: (Subroutine (SymbolTable 3 {b: (Variable 3 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_bool_to_int [] [(= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (BinOp (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) (Integer 4 []) () ()) Sub (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 2 {f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.)}) test_int [] [(= (Var 2 f) (RealConstant 5.678000e+00 (Real 8 [])) ()) (Assert (Compare (IntegerConstant 0 (Integer 4 [])) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (RealConstant 5.678000e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 5 (Integer 4 []))) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 f) RealToInteger (Integer 4 []) ()) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 1.837452e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.837452e+05 (Real 8 []))) ()) (Assert (Compare (Cast (RealUnaryMinus (RealConstant 1.837452e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.837452e+05 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 f) RealToInteger (Integer 4 []) ()) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (Cast (RealConstant 5.500000e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 5 (Integer 4 []))) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (RealUnaryMinus (RealConstant 5.500000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.500000e+00 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) Eq (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 check_all () [] ())] Source Public Implementation () .false. .false.), check_all: (Subroutine (SymbolTable 4 {}) check_all [] [(SubroutineCall 1 test_int () [] ()) (SubroutineCall 1 test_bool_to_int () [] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), test_bool_to_int: (Subroutine (SymbolTable 3 {b: (Variable 3 b Local () () Default (Integer 4 []) Source Public Required .false.)}) test_bool_to_int [] [(= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (BinOp (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) Sub (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 3 b) (BinOp (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (BinOp (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) (Integer 4 []) () ()) Sub (BinOp (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) Add (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) ()) (Integer 4 []) () ()) (Integer 4 []) () ()) ()) (Assert (Compare (Var 3 b) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ())] Source Public Implementation () .false. .false.), test_int: (Subroutine (SymbolTable 2 {f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.)}) test_int [] [(= (Var 2 f) (RealConstant 5.67799999999999994e+00 (Real 8 [])) ()) (Assert (Compare (IntegerConstant 0 (Integer 4 [])) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (RealConstant 5.67799999999999994e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 5 (Integer 4 []))) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 f) RealToInteger (Integer 4 []) ()) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 1.83745230000000010e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.83745230000000010e+05 (Real 8 []))) ()) (Assert (Compare (Cast (RealUnaryMinus (RealConstant 1.83745230000000010e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.83745230000000010e+05 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (Var 2 f) RealToInteger (Integer 4 []) ()) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (Cast (RealConstant 5.50000000000000000e+00 (Real 8 [])) RealToInteger (Integer 4 []) (IntegerConstant 5 (Integer 4 []))) Eq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (RealUnaryMinus (RealConstant 5.50000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant -5.50000000000000000e+00 (Real 8 []))) RealToInteger (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) Eq (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (LogicalConstant .true. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 1 (Integer 4 []))) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (Cast (LogicalConstant .false. (Logical 4 [])) LogicalToInteger (Integer 4 []) (IntegerConstant 0 (Integer 4 []))) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .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 601b5817bd..98a11d0895 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": "d6d769ef0ade42a501a11328356674d57083a0770f37f7da6882c1c0", + "stdout_hash": "bb5c1fed8528ed061fa8a87444d3d60147ecac0e6e4a8623ebbe71f1", "stderr": "asr-test_builtin_pow-f02fcda.stderr", "stderr_hash": "180e1adfbb0d9c63a2fffa31951bbd629b3f1950cf0d97ca1389efe5", "returncode": 0 diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stdout b/tests/reference/asr-test_builtin_pow-f02fcda.stdout index bb80d3f720..845541e73e 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_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_pow () [] ())] Source Public Implementation () .false. .false.), abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 4 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), pow@__lpython_overloaded_0__pow: (ExternalSymbol 1 pow@__lpython_overloaded_0__pow 4 __lpython_overloaded_0__pow lpython_builtin [] __lpython_overloaded_0__pow Public), pow@__lpython_overloaded_1__pow: (ExternalSymbol 1 pow@__lpython_overloaded_1__pow 4 __lpython_overloaded_1__pow lpython_builtin [] __lpython_overloaded_1__pow Public), pow@__lpython_overloaded_2__pow: (ExternalSymbol 1 pow@__lpython_overloaded_2__pow 4 __lpython_overloaded_2__pow lpython_builtin [] __lpython_overloaded_2__pow Public), pow@__lpython_overloaded_3__pow: (ExternalSymbol 1 pow@__lpython_overloaded_3__pow 4 __lpython_overloaded_3__pow lpython_builtin [] __lpython_overloaded_3__pow Public), pow@__lpython_overloaded_4__pow: (ExternalSymbol 1 pow@__lpython_overloaded_4__pow 4 __lpython_overloaded_4__pow lpython_builtin [] __lpython_overloaded_4__pow Public), pow@__lpython_overloaded_5__pow: (ExternalSymbol 1 pow@__lpython_overloaded_5__pow 4 __lpython_overloaded_5__pow lpython_builtin [] __lpython_overloaded_5__pow Public), pow@__lpython_overloaded_6__pow: (ExternalSymbol 1 pow@__lpython_overloaded_6__pow 4 __lpython_overloaded_6__pow lpython_builtin [] __lpython_overloaded_6__pow Public), pow@__lpython_overloaded_7__pow: (ExternalSymbol 1 pow@__lpython_overloaded_7__pow 4 __lpython_overloaded_7__pow lpython_builtin [] __lpython_overloaded_7__pow Public), pow@__lpython_overloaded_8__pow: (ExternalSymbol 1 pow@__lpython_overloaded_8__pow 4 __lpython_overloaded_8__pow lpython_builtin [] __lpython_overloaded_8__pow Public), pow@__lpython_overloaded_9__pow: (ExternalSymbol 1 pow@__lpython_overloaded_9__pow 4 __lpython_overloaded_9__pow lpython_builtin [] __lpython_overloaded_9__pow Public), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), a1: (Variable 2 a1 Local () (RealConstant 4.500000e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), a2: (Variable 2 a2 Local () (RealConstant 2.300000e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () (LogicalConstant .true. (Logical 4 [])) Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () (LogicalConstant .false. (Logical 4 [])) Default (Logical 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), eps: (Variable 2 eps Local () () Default (Real 8 []) Source Public Required .false.), f1: (Variable 2 f1 Local () () Default (Real 4 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), i1: (Variable 2 i1 Local () () Default (Integer 8 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 8 []) Source Public Required .false.), p: (Variable 2 p Local () () Default (Real 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 4 pow lpython_builtin [] pow Private), x: (Variable 2 x Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () (RealConstant 2.300000e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) test_pow [] [(= (Var 2 eps) (RealConstant 1.000000e-12 (Real 8 [])) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 5 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 32 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 3 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 216 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 0 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) ()) (= (Var 2 a) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 b) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (= (Var 2 i1) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 i2) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_1__pow 2 pow [((Var 2 i1)) ((Var 2 i2))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 32 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 i1) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 i2) (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 f1) (Cast (BinOp (Cast (IntegerConstant 525346 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (Cast (IntegerConstant 66456 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 f2) (Cast (RealConstant 3.000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.000000e+00 (Real 4 []))) ()) (= (Var 2 p) (FunctionCall 1 pow@__lpython_overloaded_2__pow 2 pow [((Var 2 f1)) ((Var 2 f2))] (Real 4 []) () ()) ()) (= (Var 2 f1) (FunctionCall 1 pow@__lpython_overloaded_4__pow 2 pow [((Var 2 a)) ((Var 2 f2))] (Real 4 []) () ()) ()) (= (Var 2 f1) (FunctionCall 1 pow@__lpython_overloaded_5__pow 2 pow [((Var 2 f2)) ((Var 2 a))] (Real 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b1)) ((Var 2 b2))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b2)) ((Var 2 b1))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b1)) ((Var 2 b2))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((LogicalConstant .false. (Logical 4 []))) ((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((Var 2 a1)) ((Var 2 a2))] (Real 8 []) (RealConstant 3.179719e+01 (Real 8 [])) ()) Sub (RealConstant 3.179719e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((Var 2 a2)) ((Var 2 a1))] (Real 8 []) (RealConstant 4.243999e+01 (Real 8 [])) ()) Sub (RealConstant 4.243999e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((Var 2 x)) ((Var 2 y))] (Real 8 []) (RealConstant 1.251350e+01 (Real 8 [])) ()) Sub (RealConstant 1.251350e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((Var 2 y)) ((Var 2 x))] (Real 8 []) (RealConstant 1.216700e+01 (Real 8 [])) ()) Sub (RealConstant 1.216700e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((Var 2 x)) ((RealConstant 5.500000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 4.208883e+02 (Real 8 [])) ()) Sub (RealConstant 4.208883e+02 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Integer 4 []) (RealConstant 5.000000e-01 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 5.000000e-01 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 6 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Integer 4 []) (RealConstant 7.716049e-04 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 7.716049e-04 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 [])))) ((IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))))] (Integer 4 []) (RealConstant -4.115226e-03 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Add (RealConstant 4.115226e-03 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 6 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Integer 4 []) (RealConstant 7.716049e-04 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 7.716049e-04 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 4.500000e+00 (Real 8 []))) ((RealConstant 2.300000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 3.179719e+01 (Real 8 [])) ()) Sub (RealConstant 3.179719e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 2.300000e+00 (Real 8 []))) ((RealConstant 0.000000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 1.000000e+00 (Real 8 [])) ()) Sub (RealConstant 1.000000e+00 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 2.300000e+00 (Real 8 []))) ((RealUnaryMinus (RealConstant 1.500000e+00 (Real 8 [])) (Real 8 []) (RealConstant -1.500000e+00 (Real 8 []))))] (Real 8 []) (RealConstant 2.866872e-01 (Real 8 [])) ()) Sub (RealConstant 2.866872e-01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((RealConstant 3.400000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 1.055606e+01 (Real 8 [])) ()) Sub (RealConstant 1.055606e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((RealUnaryMinus (RealConstant 3.400000e+00 (Real 8 [])) (Real 8 []) (RealConstant -3.400000e+00 (Real 8 []))))] (Real 8 []) (RealConstant 9.473229e-02 (Real 8 [])) ()) Sub (RealConstant 9.473229e-02 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealConstant 3.400000e+00 (Real 8 []))) ((IntegerConstant 9 (Integer 4 [])))] (Real 8 []) (RealConstant 6.071699e+04 (Real 8 [])) ()) Sub (RealConstant 6.071699e+04 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealConstant 0.000000e+00 (Real 8 []))) ((IntegerConstant 53 (Integer 4 [])))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Sub (RealConstant 0.000000e+00 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 16 (Integer 4 [])) ()) Eq (IntegerConstant 16 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealUnaryMinus (RealConstant 4.235000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.235000e+03 (Real 8 [])))) ((IntegerConstant 52 (Integer 4 [])))] (Real 8 []) (RealConstant 3.948004e+188 (Real 8 [])) ()) Sub (RealConstant 3.948004e+188 (Real 8 [])) (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (= (Var 2 c1) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 4.000000e+00 5.000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 4.000000e+00 5.000000e+00 (Complex 4 []))) ()) (= (Var 2 c1) (FunctionCall 1 pow@__lpython_overloaded_9__pow 2 pow [((Var 2 c1)) ((IntegerConstant 4 (Integer 4 [])))] (Complex 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_pow () [] ())] Source Public Implementation () .false. .false.), abs@__lpython_overloaded_0__abs: (ExternalSymbol 1 abs@__lpython_overloaded_0__abs 4 __lpython_overloaded_0__abs lpython_builtin [] __lpython_overloaded_0__abs Public), complex@__lpython_overloaded_9__complex: (ExternalSymbol 1 complex@__lpython_overloaded_9__complex 4 __lpython_overloaded_9__complex lpython_builtin [] __lpython_overloaded_9__complex Public), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), pow@__lpython_overloaded_0__pow: (ExternalSymbol 1 pow@__lpython_overloaded_0__pow 4 __lpython_overloaded_0__pow lpython_builtin [] __lpython_overloaded_0__pow Public), pow@__lpython_overloaded_1__pow: (ExternalSymbol 1 pow@__lpython_overloaded_1__pow 4 __lpython_overloaded_1__pow lpython_builtin [] __lpython_overloaded_1__pow Public), pow@__lpython_overloaded_2__pow: (ExternalSymbol 1 pow@__lpython_overloaded_2__pow 4 __lpython_overloaded_2__pow lpython_builtin [] __lpython_overloaded_2__pow Public), pow@__lpython_overloaded_3__pow: (ExternalSymbol 1 pow@__lpython_overloaded_3__pow 4 __lpython_overloaded_3__pow lpython_builtin [] __lpython_overloaded_3__pow Public), pow@__lpython_overloaded_4__pow: (ExternalSymbol 1 pow@__lpython_overloaded_4__pow 4 __lpython_overloaded_4__pow lpython_builtin [] __lpython_overloaded_4__pow Public), pow@__lpython_overloaded_5__pow: (ExternalSymbol 1 pow@__lpython_overloaded_5__pow 4 __lpython_overloaded_5__pow lpython_builtin [] __lpython_overloaded_5__pow Public), pow@__lpython_overloaded_6__pow: (ExternalSymbol 1 pow@__lpython_overloaded_6__pow 4 __lpython_overloaded_6__pow lpython_builtin [] __lpython_overloaded_6__pow Public), pow@__lpython_overloaded_7__pow: (ExternalSymbol 1 pow@__lpython_overloaded_7__pow 4 __lpython_overloaded_7__pow lpython_builtin [] __lpython_overloaded_7__pow Public), pow@__lpython_overloaded_8__pow: (ExternalSymbol 1 pow@__lpython_overloaded_8__pow 4 __lpython_overloaded_8__pow lpython_builtin [] __lpython_overloaded_8__pow Public), pow@__lpython_overloaded_9__pow: (ExternalSymbol 1 pow@__lpython_overloaded_9__pow 4 __lpython_overloaded_9__pow lpython_builtin [] __lpython_overloaded_9__pow Public), test_pow: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), a1: (Variable 2 a1 Local () (RealConstant 4.50000000000000000e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), a2: (Variable 2 a2 Local () (RealConstant 2.29999999999999982e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), abs: (ExternalSymbol 2 abs 4 abs lpython_builtin [] abs Private), b: (Variable 2 b Local () () Default (Integer 4 []) Source Public Required .false.), b1: (Variable 2 b1 Local () (LogicalConstant .true. (Logical 4 [])) Default (Logical 4 []) Source Public Required .false.), b2: (Variable 2 b2 Local () (LogicalConstant .false. (Logical 4 [])) Default (Logical 4 []) Source Public Required .false.), c1: (Variable 2 c1 Local () () Default (Complex 4 []) Source Public Required .false.), complex: (ExternalSymbol 2 complex 4 complex lpython_builtin [] complex Private), eps: (Variable 2 eps Local () () Default (Real 8 []) Source Public Required .false.), f1: (Variable 2 f1 Local () () Default (Real 4 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), i1: (Variable 2 i1 Local () () Default (Integer 8 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 8 []) Source Public Required .false.), p: (Variable 2 p Local () () Default (Real 4 []) Source Public Required .false.), pow: (ExternalSymbol 2 pow 4 pow lpython_builtin [] pow Private), x: (Variable 2 x Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () (RealConstant 2.29999999999999982e+00 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) test_pow [] [(= (Var 2 eps) (RealConstant 9.99999999999999980e-13 (Real 8 [])) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 5 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 32 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 3 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 216 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 0 (Integer 4 [])) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((Var 2 a)) ((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) ()) (= (Var 2 a) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 b) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (= (Var 2 i1) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 i2) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_1__pow 2 pow [((Var 2 i1)) ((Var 2 i2))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 32 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 i1) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 i2) (Cast (IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))) IntegerToInteger (Integer 8 []) ()) ()) (= (Var 2 f1) (Cast (BinOp (Cast (IntegerConstant 525346 (Integer 4 [])) IntegerToReal (Real 8 []) ()) Div (Cast (IntegerConstant 66456 (Integer 4 [])) IntegerToReal (Real 8 []) ()) (Real 8 []) () ()) RealToReal (Real 4 []) ()) ()) (= (Var 2 f2) (Cast (RealConstant 3.00000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.00000000000000000e+00 (Real 4 []))) ()) (= (Var 2 p) (FunctionCall 1 pow@__lpython_overloaded_2__pow 2 pow [((Var 2 f1)) ((Var 2 f2))] (Real 4 []) () ()) ()) (= (Var 2 f1) (FunctionCall 1 pow@__lpython_overloaded_4__pow 2 pow [((Var 2 a)) ((Var 2 f2))] (Real 4 []) () ()) ()) (= (Var 2 f1) (FunctionCall 1 pow@__lpython_overloaded_5__pow 2 pow [((Var 2 f2)) ((Var 2 a))] (Real 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b1)) ((Var 2 b2))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b2)) ((Var 2 b1))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((Var 2 b1)) ((Var 2 b2))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_8__pow 2 pow [((LogicalConstant .false. (Logical 4 []))) ((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((Var 2 a1)) ((Var 2 a2))] (Real 8 []) (RealConstant 3.17971929089206000e+01 (Real 8 [])) ()) Sub (RealConstant 3.17971929089206000e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((Var 2 a2)) ((Var 2 a1))] (Real 8 []) (RealConstant 4.24399889427765871e+01 (Real 8 [])) ()) Sub (RealConstant 4.24399889427765871e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((Var 2 x)) ((Var 2 y))] (Real 8 []) (RealConstant 1.25135025328431819e+01 (Real 8 [])) ()) Sub (RealConstant 1.25135025328431819e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((Var 2 y)) ((Var 2 x))] (Real 8 []) (RealConstant 1.21669999999999980e+01 (Real 8 [])) ()) Sub (RealConstant 1.21669999999999980e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((Var 2 x)) ((RealConstant 5.50000000000000000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 4.20888346239237194e+02 (Real 8 [])) ()) Sub (RealConstant 4.20888346239237194e+02 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))))] (Integer 4 []) (RealConstant 5.00000000000000000e-01 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 5.00000000000000000e-01 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 6 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Integer 4 []) (RealConstant 7.71604938271604895e-04 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 7.71604938271604895e-04 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 [])))) ((IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))))] (Integer 4 []) (RealConstant -4.11522633744856002e-03 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Add (RealConstant 4.11522633744856002e-03 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (Cast (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 6 (Integer 4 []))) ((IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))))] (Integer 4 []) (RealConstant 7.71604938271604895e-04 (Real 8 [])) ()) IntegerToReal (Real 8 []) ()) Sub (RealConstant 7.71604938271604895e-04 (Real 8 [])) (Real 8 []) () ()))] (Real 8 []) () ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 4.50000000000000000e+00 (Real 8 []))) ((RealConstant 2.29999999999999982e+00 (Real 8 [])))] (Real 8 []) (RealConstant 3.17971929089206000e+01 (Real 8 [])) ()) Sub (RealConstant 3.17971929089206000e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 2.29999999999999982e+00 (Real 8 []))) ((RealConstant 0.00000000000000000e+00 (Real 8 [])))] (Real 8 []) (RealConstant 1.00000000000000000e+00 (Real 8 [])) ()) Sub (RealConstant 1.00000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_3__pow 2 pow [((RealConstant 2.29999999999999982e+00 (Real 8 []))) ((RealUnaryMinus (RealConstant 1.50000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant -1.50000000000000000e+00 (Real 8 []))))] (Real 8 []) (RealConstant 2.86687162345994395e-01 (Real 8 [])) ()) Sub (RealConstant 2.86687162345994395e-01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((RealConstant 3.39999999999999991e+00 (Real 8 [])))] (Real 8 []) (RealConstant 1.05560632861831536e+01 (Real 8 [])) ()) Sub (RealConstant 1.05560632861831536e+01 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_6__pow 2 pow [((IntegerConstant 2 (Integer 4 []))) ((RealUnaryMinus (RealConstant 3.39999999999999991e+00 (Real 8 [])) (Real 8 []) (RealConstant -3.39999999999999991e+00 (Real 8 []))))] (Real 8 []) (RealConstant 9.47322854068998882e-02 (Real 8 [])) ()) Sub (RealConstant 9.47322854068998882e-02 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealConstant 3.39999999999999991e+00 (Real 8 []))) ((IntegerConstant 9 (Integer 4 [])))] (Real 8 []) (RealConstant 6.07169927664639836e+04 (Real 8 [])) ()) Sub (RealConstant 6.07169927664639836e+04 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealConstant 0.00000000000000000e+00 (Real 8 []))) ((IntegerConstant 53 (Integer 4 [])))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Sub (RealConstant 0.00000000000000000e+00 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 pow@__lpython_overloaded_0__pow 2 pow [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 16 (Integer 4 [])) ()) Eq (IntegerConstant 16 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 abs@__lpython_overloaded_0__abs 2 abs [((BinOp (FunctionCall 1 pow@__lpython_overloaded_7__pow 2 pow [((RealUnaryMinus (RealConstant 4.23500000000000000e+03 (Real 8 [])) (Real 8 []) (RealConstant -4.23500000000000000e+03 (Real 8 [])))) ((IntegerConstant 52 (Integer 4 [])))] (Real 8 []) (RealConstant 3.94800380598526379e+188 (Real 8 [])) ()) Sub (RealConstant 3.94800380598526379e+188 (Real 8 [])) (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()))] (Real 8 []) (RealConstant 0.00000000000000000e+00 (Real 8 [])) ()) Lt (Var 2 eps) (Logical 4 []) () ()) ()) (= (Var 2 c1) (Cast (FunctionCall 1 complex@__lpython_overloaded_9__complex 2 complex [((IntegerConstant 4 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Complex 8 []) (ComplexConstant 4.00000000000000000e+00 5.00000000000000000e+00 (Complex 8 [])) ()) ComplexToComplex (Complex 4 []) (ComplexConstant 4.00000000000000000e+00 5.00000000000000000e+00 (Complex 4 []))) ()) (= (Var 2 c1) (FunctionCall 1 pow@__lpython_overloaded_9__pow 2 pow [((Var 2 c1)) ((IntegerConstant 4 (Integer 4 [])))] (Complex 4 []) () ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_builtin_round-7417a21.json b/tests/reference/asr-test_builtin_round-7417a21.json index a59e0f03d7..6429e9a5d9 100644 --- a/tests/reference/asr-test_builtin_round-7417a21.json +++ b/tests/reference/asr-test_builtin_round-7417a21.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_builtin_round-7417a21.stdout", - "stdout_hash": "b12d32d7daab1c4c8a470627e09751161864d49884efb3c52d710236", + "stdout_hash": "c07fa19415756c47a2f61d8884d3db9f50ae8de9f5d8d7a7b94c8ba4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_builtin_round-7417a21.stdout b/tests/reference/asr-test_builtin_round-7417a21.stdout index cbbfeb2751..8f9fe51103 100644 --- a/tests/reference/asr-test_builtin_round-7417a21.stdout +++ b/tests/reference/asr-test_builtin_round-7417a21.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_round () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), round@__lpython_overloaded_0__round: (ExternalSymbol 1 round@__lpython_overloaded_0__round 4 __lpython_overloaded_0__round lpython_builtin [] __lpython_overloaded_0__round Public), round@__lpython_overloaded_1__round: (ExternalSymbol 1 round@__lpython_overloaded_1__round 4 __lpython_overloaded_1__round lpython_builtin [] __lpython_overloaded_1__round Public), round@__lpython_overloaded_2__round: (ExternalSymbol 1 round@__lpython_overloaded_2__round 4 __lpython_overloaded_2__round lpython_builtin [] __lpython_overloaded_2__round Public), round@__lpython_overloaded_3__round: (ExternalSymbol 1 round@__lpython_overloaded_3__round 4 __lpython_overloaded_3__round lpython_builtin [] __lpython_overloaded_3__round Public), round@__lpython_overloaded_4__round: (ExternalSymbol 1 round@__lpython_overloaded_4__round 4 __lpython_overloaded_4__round lpython_builtin [] __lpython_overloaded_4__round Public), round@__lpython_overloaded_5__round: (ExternalSymbol 1 round@__lpython_overloaded_5__round 4 __lpython_overloaded_5__round lpython_builtin [] __lpython_overloaded_5__round Public), round@__lpython_overloaded_6__round: (ExternalSymbol 1 round@__lpython_overloaded_6__round 4 __lpython_overloaded_6__round lpython_builtin [] __lpython_overloaded_6__round Public), test_round: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 1 []) Source Public Required .false.), i3: (Variable 2 i3 Local () () Default (Integer 2 []) Source Public Required .false.), i4: (Variable 2 i4 Local () () Default (Integer 8 []) Source Public Required .false.), round: (ExternalSymbol 2 round 4 round lpython_builtin [] round Private)}) test_round [] [(= (Var 2 f) (RealConstant 5.678000e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 1.837452e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.837452e+05 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 4.434000e+01 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 44 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 5.000000e-01 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 5.050000e+01 (Real 8 [])) (Real 8 []) (RealConstant -5.050000e+01 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 50 (Integer 4 [])) (Integer 4 []) (IntegerConstant -50 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 1.500000e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 1.300100e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 13 (Integer 4 [])) ()) Eq (IntegerConstant 13 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealUnaryMinus (RealConstant 4.049999e+01 (Real 8 [])) (Real 8 []) (RealConstant -4.049999e+01 (Real 8 []))))] (Integer 4 []) (IntegerConstant -40 (Integer 4 [])) ()) Eq (IntegerUnaryMinus (IntegerConstant 40 (Integer 4 [])) (Integer 4 []) (IntegerConstant -40 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.000000e-01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealUnaryMinus (RealConstant 5.000000e-01 (Real 8 [])) (Real 8 []) (RealConstant -5.000000e-01 (Real 8 []))))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 1.500000e+00 (Real 8 [])))] (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ()) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.050000e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 50 (Integer 4 [])) ()) Eq (IntegerConstant 50 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.678000e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 57 (Integer 4 [])) ()) Eq (IntegerConstant 57 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 f2) (Cast (RealConstant 5.678000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.678000e+00 (Real 4 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_1__round 2 round [((Var 2 f2))] (Integer 4 []) () ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_2__round 2 round [((Var 2 i))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_2__round 2 round [((IntegerConstant 4 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 4 (Integer 4 [])) ()) Eq (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 i2) (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToInteger (Integer 1 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 round@__lpython_overloaded_4__round 2 round [((Var 2 i2))] (Integer 1 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 7 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i3) (Cast (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 round@__lpython_overloaded_5__round 2 round [((Var 2 i3))] (Integer 2 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 i4) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_3__round 2 round [((Var 2 i4))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 100 {}) _lpython_main_program [] [(SubroutineCall 1 test_round () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 99 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), round@__lpython_overloaded_0__round: (ExternalSymbol 1 round@__lpython_overloaded_0__round 4 __lpython_overloaded_0__round lpython_builtin [] __lpython_overloaded_0__round Public), round@__lpython_overloaded_1__round: (ExternalSymbol 1 round@__lpython_overloaded_1__round 4 __lpython_overloaded_1__round lpython_builtin [] __lpython_overloaded_1__round Public), round@__lpython_overloaded_2__round: (ExternalSymbol 1 round@__lpython_overloaded_2__round 4 __lpython_overloaded_2__round lpython_builtin [] __lpython_overloaded_2__round Public), round@__lpython_overloaded_3__round: (ExternalSymbol 1 round@__lpython_overloaded_3__round 4 __lpython_overloaded_3__round lpython_builtin [] __lpython_overloaded_3__round Public), round@__lpython_overloaded_4__round: (ExternalSymbol 1 round@__lpython_overloaded_4__round 4 __lpython_overloaded_4__round lpython_builtin [] __lpython_overloaded_4__round Public), round@__lpython_overloaded_5__round: (ExternalSymbol 1 round@__lpython_overloaded_5__round 4 __lpython_overloaded_5__round lpython_builtin [] __lpython_overloaded_5__round Public), round@__lpython_overloaded_6__round: (ExternalSymbol 1 round@__lpython_overloaded_6__round 4 __lpython_overloaded_6__round lpython_builtin [] __lpython_overloaded_6__round Public), test_round: (Subroutine (SymbolTable 2 {b: (Variable 2 b Local () () Default (Logical 4 []) Source Public Required .false.), f: (Variable 2 f Local () () Default (Real 8 []) Source Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), i2: (Variable 2 i2 Local () () Default (Integer 1 []) Source Public Required .false.), i3: (Variable 2 i3 Local () () Default (Integer 2 []) Source Public Required .false.), i4: (Variable 2 i4 Local () () Default (Integer 8 []) Source Public Required .false.), round: (ExternalSymbol 2 round 4 round lpython_builtin [] round Private)}) test_round [] [(= (Var 2 f) (RealConstant 5.67799999999999994e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 1.83745230000000010e+05 (Real 8 [])) (Real 8 []) (RealConstant -1.83745230000000010e+05 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 183745 (Integer 4 [])) (Integer 4 []) (IntegerConstant -183745 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 4.43400000000000034e+01 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 44 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 5.00000000000000000e-01 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealUnaryMinus (RealConstant 5.05000000000000000e+01 (Real 8 [])) (Real 8 []) (RealConstant -5.05000000000000000e+01 (Real 8 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 50 (Integer 4 [])) (Integer 4 []) (IntegerConstant -50 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 f) (RealConstant 1.50000000000000000e+00 (Real 8 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((Var 2 f))] (Integer 4 []) () ()) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 1.30009999999999994e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 13 (Integer 4 [])) ()) Eq (IntegerConstant 13 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealUnaryMinus (RealConstant 4.04999899999999968e+01 (Real 8 [])) (Real 8 []) (RealConstant -4.04999899999999968e+01 (Real 8 []))))] (Integer 4 []) (IntegerConstant -40 (Integer 4 [])) ()) Eq (IntegerUnaryMinus (IntegerConstant 40 (Integer 4 [])) (Integer 4 []) (IntegerConstant -40 (Integer 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.00000000000000000e-01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealUnaryMinus (RealConstant 5.00000000000000000e-01 (Real 8 [])) (Real 8 []) (RealConstant -5.00000000000000000e-01 (Real 8 []))))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 1.50000000000000000e+00 (Real 8 [])))] (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ()) Eq (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.05000000000000000e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 50 (Integer 4 [])) ()) Eq (IntegerConstant 50 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_0__round 2 round [((RealConstant 5.67800000000000011e+01 (Real 8 [])))] (Integer 4 []) (IntegerConstant 57 (Integer 4 [])) ()) Eq (IntegerConstant 57 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 f2) (Cast (RealConstant 5.67799999999999994e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.67799999999999994e+00 (Real 4 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_1__round 2 round [((Var 2 f2))] (Integer 4 []) () ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i) (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_2__round 2 round [((Var 2 i))] (Integer 4 []) () ()) Eq (IntegerUnaryMinus (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) (IntegerConstant -5 (Integer 4 []))) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_2__round 2 round [((IntegerConstant 4 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 4 (Integer 4 [])) ()) Eq (IntegerConstant 4 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (= (Var 2 i2) (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToInteger (Integer 1 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 round@__lpython_overloaded_4__round 2 round [((Var 2 i2))] (Integer 1 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerConstant 7 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 i3) (Cast (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) IntegerToInteger (Integer 2 []) ()) ()) (Assert (Compare (Cast (FunctionCall 1 round@__lpython_overloaded_5__round 2 round [((Var 2 i3))] (Integer 2 []) () ()) IntegerToInteger (Integer 4 []) ()) Eq (IntegerUnaryMinus (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant -8 (Integer 4 []))) (Logical 4 []) () ()) ()) (= (Var 2 i4) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_3__round 2 round [((Var 2 i4))] (Integer 8 []) () ()) Eq (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToInteger (Integer 8 []) ()) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .true. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) () ()) ()) (= (Var 2 b) (LogicalConstant .false. (Logical 4 [])) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((Var 2 b))] (Integer 4 []) () ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (FunctionCall 1 round@__lpython_overloaded_6__round 2 round [((LogicalConstant .false. (Logical 4 [])))] (Integer 4 []) (IntegerConstant 0 (Integer 4 [])) ()) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/asr-test_max_min-3c2fc51.json b/tests/reference/asr-test_max_min-3c2fc51.json index 627e735be7..9c36476ae2 100644 --- a/tests/reference/asr-test_max_min-3c2fc51.json +++ b/tests/reference/asr-test_max_min-3c2fc51.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-test_max_min-3c2fc51.stdout", - "stdout_hash": "52491e0747dbac1711192a3954e80e6fee095f3c8ec317df88a1ac41", + "stdout_hash": "cfe636f53d9f8a3882d284bc53fc2cbc0b8eda75e9ddaf8a372de1e4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-test_max_min-3c2fc51.stdout b/tests/reference/asr-test_max_min-3c2fc51.stdout index 3b282eb35e..49ed735225 100644 --- a/tests/reference/asr-test_max_min-3c2fc51.stdout +++ b/tests/reference/asr-test_max_min-3c2fc51.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 104 {}) _lpython_main_program [] [(SubroutineCall 1 check () [] ())] Source Public Implementation () .false. .false.), check: (Subroutine (SymbolTable 6 {}) check [] [(SubroutineCall 1 test_max_int () [] ()) (SubroutineCall 1 test_max_float () [] ()) (SubroutineCall 1 test_min_int () [] ()) (SubroutineCall 1 test_min_float () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 103 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), max@__lpython_overloaded_0__max: (ExternalSymbol 1 max@__lpython_overloaded_0__max 8 __lpython_overloaded_0__max lpython_builtin [] __lpython_overloaded_0__max Public), max@__lpython_overloaded_1__max: (ExternalSymbol 1 max@__lpython_overloaded_1__max 8 __lpython_overloaded_1__max lpython_builtin [] __lpython_overloaded_1__max Public), max@__lpython_overloaded_2__max: (ExternalSymbol 1 max@__lpython_overloaded_2__max 8 __lpython_overloaded_2__max lpython_builtin [] __lpython_overloaded_2__max Public), max@__lpython_overloaded_3__max: (ExternalSymbol 1 max@__lpython_overloaded_3__max 8 __lpython_overloaded_3__max lpython_builtin [] __lpython_overloaded_3__max Public), min@__lpython_overloaded_0__min: (ExternalSymbol 1 min@__lpython_overloaded_0__min 8 __lpython_overloaded_0__min lpython_builtin [] __lpython_overloaded_0__min Public), min@__lpython_overloaded_1__min: (ExternalSymbol 1 min@__lpython_overloaded_1__min 8 __lpython_overloaded_1__min lpython_builtin [] __lpython_overloaded_1__min Public), min@__lpython_overloaded_2__min: (ExternalSymbol 1 min@__lpython_overloaded_2__min 8 __lpython_overloaded_2__min lpython_builtin [] __lpython_overloaded_2__min Public), min@__lpython_overloaded_3__min: (ExternalSymbol 1 min@__lpython_overloaded_3__min 8 __lpython_overloaded_3__min lpython_builtin [] __lpython_overloaded_3__min Public), test_max_float: (Subroutine (SymbolTable 3 {d: (Variable 3 d Local () (RealConstant 2.323300e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), e: (Variable 3 e Local () (RealConstant 2.322330e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), f: (Variable 3 f Local () (RealConstant 2.123000e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), max: (ExternalSymbol 3 max 8 max lpython_builtin [] max Private)}) test_max_float [] [(Assert (Compare (FunctionCall 1 max@__lpython_overloaded_2__max 3 max [((Var 3 d)) ((Var 3 e)) ((Var 3 f))] (Real 8 []) (RealConstant 2.323300e+01 (Real 8 [])) ()) Eq (Var 3 d) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_3__max 3 max [((Var 3 e)) ((Var 3 f))] (Real 8 []) (RealConstant 2.322330e+01 (Real 8 [])) ()) Eq (Var 3 e) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_max_int: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () (IntegerConstant 1 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () (IntegerConstant 2 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), c: (Variable 2 c Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), max: (ExternalSymbol 2 max 8 max lpython_builtin [] max Private)}) test_max_int [] [(Assert (Compare (FunctionCall 1 max@__lpython_overloaded_0__max 2 max [((Var 2 a)) ((Var 2 b))] (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ()) Eq (Var 2 b) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_1__max 2 max [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) (IntegerConstant 3 (Integer 4 [])) ()) Eq (Var 2 c) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_1__max 2 max [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 3 (Integer 4 [])) ()) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_0__max 2 max [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 6 (Integer 4 [])) ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_min_float: (Subroutine (SymbolTable 5 {d: (Variable 5 d Local () (RealConstant 2.323300e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), e: (Variable 5 e Local () (RealConstant 2.322330e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), f: (Variable 5 f Local () (RealConstant 2.123000e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), min: (ExternalSymbol 5 min 8 min lpython_builtin [] min Private)}) test_min_float [] [(Assert (Compare (FunctionCall 1 min@__lpython_overloaded_2__min 5 min [((Var 5 d)) ((Var 5 e)) ((Var 5 f))] (Real 8 []) (RealConstant 2.123000e+01 (Real 8 [])) ()) Eq (Var 5 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_3__min 5 min [((Var 5 e)) ((Var 5 f))] (Real 8 []) (RealConstant 2.123000e+01 (Real 8 [])) ()) Eq (Var 5 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_min_int: (Subroutine (SymbolTable 4 {a: (Variable 4 a Local () (IntegerConstant 1 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), b: (Variable 4 b Local () (IntegerConstant 2 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), c: (Variable 4 c Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), min: (ExternalSymbol 4 min 8 min lpython_builtin [] min Private)}) test_min_int [] [(Assert (Compare (FunctionCall 1 min@__lpython_overloaded_0__min 4 min [((Var 4 a)) ((Var 4 b))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (Var 4 a) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_1__min 4 min [((Var 4 a)) ((Var 4 b)) ((Var 4 c))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (Var 4 a) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_1__min 4 min [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_0__min 4 min [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {_lpython_main_program: (Subroutine (SymbolTable 104 {}) _lpython_main_program [] [(SubroutineCall 1 check () [] ())] Source Public Implementation () .false. .false.), check: (Subroutine (SymbolTable 6 {}) check [] [(SubroutineCall 1 test_max_int () [] ()) (SubroutineCall 1 test_max_float () [] ()) (SubroutineCall 1 test_min_int () [] ()) (SubroutineCall 1 test_min_float () [] ())] Source Public Implementation () .false. .false.), lpython_builtin: (IntrinsicModule lpython_builtin), main_program: (Program (SymbolTable 103 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), max@__lpython_overloaded_0__max: (ExternalSymbol 1 max@__lpython_overloaded_0__max 8 __lpython_overloaded_0__max lpython_builtin [] __lpython_overloaded_0__max Public), max@__lpython_overloaded_1__max: (ExternalSymbol 1 max@__lpython_overloaded_1__max 8 __lpython_overloaded_1__max lpython_builtin [] __lpython_overloaded_1__max Public), max@__lpython_overloaded_2__max: (ExternalSymbol 1 max@__lpython_overloaded_2__max 8 __lpython_overloaded_2__max lpython_builtin [] __lpython_overloaded_2__max Public), max@__lpython_overloaded_3__max: (ExternalSymbol 1 max@__lpython_overloaded_3__max 8 __lpython_overloaded_3__max lpython_builtin [] __lpython_overloaded_3__max Public), min@__lpython_overloaded_0__min: (ExternalSymbol 1 min@__lpython_overloaded_0__min 8 __lpython_overloaded_0__min lpython_builtin [] __lpython_overloaded_0__min Public), min@__lpython_overloaded_1__min: (ExternalSymbol 1 min@__lpython_overloaded_1__min 8 __lpython_overloaded_1__min lpython_builtin [] __lpython_overloaded_1__min Public), min@__lpython_overloaded_2__min: (ExternalSymbol 1 min@__lpython_overloaded_2__min 8 __lpython_overloaded_2__min lpython_builtin [] __lpython_overloaded_2__min Public), min@__lpython_overloaded_3__min: (ExternalSymbol 1 min@__lpython_overloaded_3__min 8 __lpython_overloaded_3__min lpython_builtin [] __lpython_overloaded_3__min Public), test_max_float: (Subroutine (SymbolTable 3 {d: (Variable 3 d Local () (RealConstant 2.32330000000000005e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), e: (Variable 3 e Local () (RealConstant 2.32232999999999983e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), f: (Variable 3 f Local () (RealConstant 2.12300000000000004e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), max: (ExternalSymbol 3 max 8 max lpython_builtin [] max Private)}) test_max_float [] [(Assert (Compare (FunctionCall 1 max@__lpython_overloaded_2__max 3 max [((Var 3 d)) ((Var 3 e)) ((Var 3 f))] (Real 8 []) (RealConstant 2.32330000000000005e+01 (Real 8 [])) ()) Eq (Var 3 d) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_3__max 3 max [((Var 3 e)) ((Var 3 f))] (Real 8 []) (RealConstant 2.32232999999999983e+01 (Real 8 [])) ()) Eq (Var 3 e) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_max_int: (Subroutine (SymbolTable 2 {a: (Variable 2 a Local () (IntegerConstant 1 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), b: (Variable 2 b Local () (IntegerConstant 2 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), c: (Variable 2 c Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), max: (ExternalSymbol 2 max 8 max lpython_builtin [] max Private)}) test_max_int [] [(Assert (Compare (FunctionCall 1 max@__lpython_overloaded_0__max 2 max [((Var 2 a)) ((Var 2 b))] (Integer 4 []) (IntegerConstant 2 (Integer 4 [])) ()) Eq (Var 2 b) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_1__max 2 max [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) (IntegerConstant 3 (Integer 4 [])) ()) Eq (Var 2 c) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_1__max 2 max [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 3 (Integer 4 [])) ()) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 max@__lpython_overloaded_0__max 2 max [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 6 (Integer 4 [])) ()) Eq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_min_float: (Subroutine (SymbolTable 5 {d: (Variable 5 d Local () (RealConstant 2.32330000000000005e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), e: (Variable 5 e Local () (RealConstant 2.32232999999999983e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), f: (Variable 5 f Local () (RealConstant 2.12300000000000004e+01 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), min: (ExternalSymbol 5 min 8 min lpython_builtin [] min Private)}) test_min_float [] [(Assert (Compare (FunctionCall 1 min@__lpython_overloaded_2__min 5 min [((Var 5 d)) ((Var 5 e)) ((Var 5 f))] (Real 8 []) (RealConstant 2.12300000000000004e+01 (Real 8 [])) ()) Eq (Var 5 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_3__min 5 min [((Var 5 e)) ((Var 5 f))] (Real 8 []) (RealConstant 2.12300000000000004e+01 (Real 8 [])) ()) Eq (Var 5 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ())] Source Public Implementation () .false. .false.), test_min_int: (Subroutine (SymbolTable 4 {a: (Variable 4 a Local () (IntegerConstant 1 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), b: (Variable 4 b Local () (IntegerConstant 2 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), c: (Variable 4 c Local () (IntegerConstant 3 (Integer 4 [])) Default (Integer 4 []) Source Public Required .false.), min: (ExternalSymbol 4 min 8 min lpython_builtin [] min Private)}) test_min_int [] [(Assert (Compare (FunctionCall 1 min@__lpython_overloaded_0__min 4 min [((Var 4 a)) ((Var 4 b))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (Var 4 a) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_1__min 4 min [((Var 4 a)) ((Var 4 b)) ((Var 4 c))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (Var 4 a) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_1__min 4 min [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) ()) ()) (Assert (Compare (FunctionCall 1 min@__lpython_overloaded_0__min 4 min [((IntegerConstant 1 (Integer 4 []))) ((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) (IntegerConstant 1 (Integer 4 [])) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .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 f55e22af27..a30796ed21 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": "9975aba3d9123d4ab7f0ef17821cd4a2bf9452e0b7e4e224fd0f9eb7", + "stdout_hash": "548162b0b137b8772f064dd664233bd6514c03ddfde7c372e1961e62", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-tuple1-09972ab.stdout b/tests/reference/asr-tuple1-09972ab.stdout index 93469d9caa..76fc00d6c7 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) (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a1) (TupleConstant [(IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a2) (TupleConstant [(StringConstant "a" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (StringConstant "c" (Character 1 1 () []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Character 1 1 () [])])) ()) (= (Var 2 a3) (TupleConstant [(IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (RealConstant 4.500000e-01 (Real 8 [])) (StringConstant "d" (Character 1 1 () []))] (Tuple [(Integer 4 []) (Integer 4 []) (Real 8 []) (Character 1 1 () [])])) ()) (= (Var 2 a4) (TupleConstant [(TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (TupleConstant [(IntegerConstant 4 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])) (IntegerConstant 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) (TupleConstant [(TupleConstant [(StringConstant "a" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (RealConstant 3.400000e+00 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (TupleConstant [(StringConstant "c" (Character 1 1 () [])) (IntegerConstant 3 (Integer 4 [])) (RealConstant 5.600000e+00 (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) (TupleItem 2 a1 (BinOp (IntegerConstant 0 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) ()) (= (TupleConstant [(Var 2 b0) (Var 2 b1)] (Tuple [(Integer 4 []) (Integer 4 [])])) (TupleConstant [(TupleItem 2 a1 (BinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) (TupleItem 2 a1 (BinOp (IntegerConstant 1 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ())] (Tuple [(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) (TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a1) (TupleConstant [(IntegerUnaryMinus (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant -3 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 [])))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) ()) (= (Var 2 a2) (TupleConstant [(StringConstant "a" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (StringConstant "c" (Character 1 1 () []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Character 1 1 () [])])) ()) (= (Var 2 a3) (TupleConstant [(IntegerUnaryMinus (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant -2 (Integer 4 []))) (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (RealConstant 4.50000000000000011e-01 (Real 8 [])) (StringConstant "d" (Character 1 1 () []))] (Tuple [(Integer 4 []) (Integer 4 []) (Real 8 []) (Character 1 1 () [])])) ()) (= (Var 2 a4) (TupleConstant [(TupleConstant [(IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))] (Tuple [(Integer 4 []) (Integer 4 []) (Integer 4 [])])) (TupleConstant [(IntegerConstant 4 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])) (IntegerConstant 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) (TupleConstant [(TupleConstant [(StringConstant "a" (Character 1 1 () [])) (StringConstant "b" (Character 1 1 () [])) (RealConstant 3.39999999999999991e+00 (Real 8 []))] (Tuple [(Character 1 1 () []) (Character 1 1 () []) (Real 8 [])])) (TupleConstant [(StringConstant "c" (Character 1 1 () [])) (IntegerConstant 3 (Integer 4 [])) (RealConstant 5.59999999999999964e+00 (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) (TupleItem 2 a1 (BinOp (IntegerConstant 0 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) ()) (= (TupleConstant [(Var 2 b0) (Var 2 b1)] (Tuple [(Integer 4 []) (Integer 4 [])])) (TupleConstant [(TupleItem 2 a1 (BinOp (IntegerConstant 2 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ()) (TupleItem 2 a1 (BinOp (IntegerConstant 1 (Integer 4 [])) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) () ()) (Integer 4 []) ())] (Tuple [(Integer 4 []) (Integer 4 [])])) ())] Source Public Implementation () .false. .false.)}) []) diff --git a/tests/reference/ast-complex1-800b4bb.json b/tests/reference/ast-complex1-800b4bb.json index 0af0a7b63d..cd010beb03 100644 --- a/tests/reference/ast-complex1-800b4bb.json +++ b/tests/reference/ast-complex1-800b4bb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-complex1-800b4bb.stdout", - "stdout_hash": "a50d852f57c75bce50704ea03e6a81580aa1546bc57850385074ac21", + "stdout_hash": "58f00fb2983c857ef011c649d8b43d19d448f073ba94a3ac18c89ea5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-complex1-800b4bb.stdout b/tests/reference/ast-complex1-800b4bb.stdout index 4e6e9e0191..421a08e35d 100644 --- a/tests/reference/ast-complex1-800b4bb.stdout +++ b/tests/reference/ast-complex1-800b4bb.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_complex ([] [] [] [] [] [] []) [(AnnAssign (Name c Store) (Name c32 Load) () 1) (AnnAssign (Name c1 Store) (Name c32 Load) () 1) (AnnAssign (Name c2 Store) (Name c32 Load) () 1) (AnnAssign (Name c3 Store) (Name c64 Load) () 1) (AnnAssign (Name b Store) (Name bool Load) () 1) (Assign [(Name c Store)] (Call (Name complex Load) [] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantFloat 3.400000e+00 ())] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantFloat 5.000000e+00 ()) (ConstantFloat 4.300000e+00 ())] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantInt 1 ())] []) ()) (Assign [(Name c1 Store)] (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] []) ()) (Assign [(Name c2 Store)] (Call (Name complex Load) [(ConstantInt 2 ()) (ConstantFloat 4.500000e+00 ())] []) ()) (Assign [(Name c3 Store)] (Call (Name complex Load) [(ConstantFloat 3.000000e+00 ()) (ConstantFloat 4.000000e+00 ())] []) ()) (Assign [(Name b Store)] (Compare (Name c1 Load) NotEq [(Name c2 Load)]) ()) (Assign [(Name b Store)] (Compare (Name c1 Load) Eq [(Name c3 Load)]) ()) (Assign [(Name c Store)] (BinOp (Name c1 Load) Add (Name c2 Load)) ()) (Assign [(Name c Store)] (BinOp (Name c2 Load) Sub (Name c1 Load)) ()) (Assign [(Name c Store)] (BinOp (Name c1 Load) Mult (Name c2 Load)) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] []) Pow (Call (Name complex Load) [(ConstantFloat 3.345340e+00 ()) (ConstantFloat 4.867868e+00 ())] [])) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] []) Mult (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 4 ()) (ConstantInt 5 ())] []) Sub (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ())] [] () ()) (FunctionDef test ([] [] [] [] [] [] []) [(AnnAssign (Name x Store) (Name c64 Load) () 1) (AnnAssign (Name y Store) (Name c64 Load) () 1) (AnnAssign (Name z Store) (Name c32 Load) () 1) (Assign [(Name x Store)] (BinOp (ConstantInt 2 ()) Add (ConstantComplex 0.000000e+00 3.000000e+00 ())) ()) (Assign [(Name y Store)] (BinOp (ConstantInt 5 ()) Add (ConstantComplex 0.000000e+00 5.000000e+00 ())) ()) (Assign [(Name z Store)] (BinOp (Name x Load) Add (Name y Load)) ()) (Assign [(Name z Store)] (BinOp (Name x Load) Sub (Name y Load)) ()) (Assign [(Name z Store)] (BinOp (ConstantInt 2 ()) Mult (Name x Load)) ())] [] () ())] []) +(Module [(FunctionDef test_complex ([] [] [] [] [] [] []) [(AnnAssign (Name c Store) (Name c32 Load) () 1) (AnnAssign (Name c1 Store) (Name c32 Load) () 1) (AnnAssign (Name c2 Store) (Name c32 Load) () 1) (AnnAssign (Name c3 Store) (Name c64 Load) () 1) (AnnAssign (Name b Store) (Name bool Load) () 1) (Assign [(Name c Store)] (Call (Name complex Load) [] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantFloat 3.39999999999999991e+00 ())] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantFloat 5.00000000000000000e+00 ()) (ConstantFloat 4.29999999999999982e+00 ())] []) ()) (Assign [(Name c Store)] (Call (Name complex Load) [(ConstantInt 1 ())] []) ()) (Assign [(Name c1 Store)] (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] []) ()) (Assign [(Name c2 Store)] (Call (Name complex Load) [(ConstantInt 2 ()) (ConstantFloat 4.50000000000000000e+00 ())] []) ()) (Assign [(Name c3 Store)] (Call (Name complex Load) [(ConstantFloat 3.00000000000000000e+00 ()) (ConstantFloat 4.00000000000000000e+00 ())] []) ()) (Assign [(Name b Store)] (Compare (Name c1 Load) NotEq [(Name c2 Load)]) ()) (Assign [(Name b Store)] (Compare (Name c1 Load) Eq [(Name c3 Load)]) ()) (Assign [(Name c Store)] (BinOp (Name c1 Load) Add (Name c2 Load)) ()) (Assign [(Name c Store)] (BinOp (Name c2 Load) Sub (Name c1 Load)) ()) (Assign [(Name c Store)] (BinOp (Name c1 Load) Mult (Name c2 Load)) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] []) Pow (Call (Name complex Load) [(ConstantFloat 3.34534000000000020e+00 ()) (ConstantFloat 4.86786779999999997e+00 ())] [])) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] []) Mult (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ()) (Assign [(Name c Store)] (BinOp (Call (Name complex Load) [(ConstantInt 4 ()) (ConstantInt 5 ())] []) Sub (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ())] [] () ()) (FunctionDef test ([] [] [] [] [] [] []) [(AnnAssign (Name x Store) (Name c64 Load) () 1) (AnnAssign (Name y Store) (Name c64 Load) () 1) (AnnAssign (Name z Store) (Name c32 Load) () 1) (Assign [(Name x Store)] (BinOp (ConstantInt 2 ()) Add (ConstantComplex 0.00000000000000000e+00 3.00000000000000000e+00 ())) ()) (Assign [(Name y Store)] (BinOp (ConstantInt 5 ()) Add (ConstantComplex 0.00000000000000000e+00 5.00000000000000000e+00 ())) ()) (Assign [(Name z Store)] (BinOp (Name x Load) Add (Name y Load)) ()) (Assign [(Name z Store)] (BinOp (Name x Load) Sub (Name y Load)) ()) (Assign [(Name z Store)] (BinOp (ConstantInt 2 ()) Mult (Name x Load)) ())] [] () ())] []) diff --git a/tests/reference/ast-constants1-91cb6ff.json b/tests/reference/ast-constants1-91cb6ff.json index cf1acf9aac..9a157e0da4 100644 --- a/tests/reference/ast-constants1-91cb6ff.json +++ b/tests/reference/ast-constants1-91cb6ff.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-constants1-91cb6ff.stdout", - "stdout_hash": "75f534945f0c1fc8ce17a37767b99962d1dd60a19d122a6c28a28dc2", + "stdout_hash": "215b4c5d0a30a557d205eb2096b909e9083efa816ec98c5057e4a447", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-constants1-91cb6ff.stdout b/tests/reference/ast-constants1-91cb6ff.stdout index fa40bc81b4..8ab5553155 100644 --- a/tests/reference/ast-constants1-91cb6ff.stdout +++ b/tests/reference/ast-constants1-91cb6ff.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_boz ([] [] [] [] [] [] []) [(AnnAssign (Name b Store) (Name str Load) () 1) (Assign [(Name b Store)] (Call (Name bin Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name b Store)] (Call (Name bin Load) [(ConstantInt 64 ())] []) ()) (Assign [(Name b Store)] (Call (Name bin Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(ConstantInt 8 ())] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(ConstantInt 56 ())] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(ConstantInt 42 ())] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(ConstantInt 12648430 ())] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ())] [] () ()) (FunctionDef test_ord_chr ([] [] [] [] [] [] []) [(AnnAssign (Name s Store) (Name str Load) () 1) (AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name ord Load) [(ConstantStr "5" ())] []) ()) (Assign [(Name s Store)] (Call (Name chr Load) [(ConstantInt 43 ())] []) ())] [] () ()) (FunctionDef test_abs ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(UnaryOp USub (ConstantInt 500 ()))] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantBool .true. ())] []) ()) (AnnAssign (Name b Store) (Name f32 Load) () 1) (Assign [(Name b Store)] (Call (Name abs Load) [(ConstantFloat 3.450000e+00 ())] []) ()) (Assign [(Name b Store)] (Call (Name abs Load) [(UnaryOp USub (ConstantFloat 5.346340e+03 ()))] []) ()) (Assign [(Name b Store)] (Call (Name abs Load) [(Call (Name complex Load) [(ConstantFloat 3.450000e+00 ()) (ConstantFloat 5.600000e+00 ())] [])] []) ())] [] () ()) (FunctionDef test_len ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "test" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "this is a test" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(Tuple [(ConstantStr "c" ()) (ConstantStr "b" ()) (ConstantFloat 3.400000e+00 ())] Load) (Tuple [(ConstantStr "c" ()) (ConstantInt 3 ()) (ConstantFloat 5.600000e+00 ())] Load)] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(List [(List [(UnaryOp USub (ConstantInt 4 ())) (UnaryOp USub (ConstantInt 5 ())) (UnaryOp USub (ConstantInt 6 ()))] Load) (List [(UnaryOp USub (ConstantInt 1 ())) (UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 3 ()))] Load)] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Set [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())])] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Dict [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] [(ConstantStr "c" ()) (ConstantStr "b" ()) (ConstantStr "c" ())])] []) ()) (AnnAssign (Name l Store) (Subscript (Name list Load) (Name i32 Load) Load) () 1) (Assign [(Name l Store)] (List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ()) (ConstantInt 4 ())] Load) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Name l Load)] []) ()) (Expr (Call (Attribute (Name l Load) append Load) [(ConstantInt 5 ())] [])) (Assign [(Name a Store)] (Call (Name len Load) [(Name l Load)] []) ())] [] () ()) (FunctionDef test_bool ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantInt 0 ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(UnaryOp USub (ConstantInt 1 ()))] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantStr "" ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(Call (Name complex Load) [(ConstantInt 0 ()) (ConstantInt 0 ())] [])] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantStr "t" ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantFloat 2.300000e+00 ())] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .true. ())]) ())] [] () ()) (FunctionDef test_str ([] [] [] [] [] [] []) [(AnnAssign (Name s Store) (Name str Load) () 1) (Assign [(Name s Store)] (Call (Name str Load) [] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(UnaryOp USub (ConstantInt 4 ()))] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantStr "5346" ())] []) ())] [] () ()) (FunctionDef test_callable ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (AnnAssign (Name b Store) (Name i32 Load) () 1) (Assign [(Name b Store)] (ConstantInt 2 ()) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(Name test_len Load)] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(Name b Load)] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(ConstantStr "c" ())] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ())] [] () ()) (FunctionDef test_int ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i64 Load) () 1) (Assign [(Name a Store)] (Call (Name int Load) [] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantFloat 4.560000e+00 ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(UnaryOp USub (ConstantFloat 5.000010e+00 ()))] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantStr "5346" ())] []) ())] [] () ()) (FunctionDef test_float ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name f64 Load) () 1) (Assign [(Name a Store)] (Call (Name float Load) [] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantFloat 4.560000e+00 ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(UnaryOp USub (ConstantInt 1 ()))] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantBool .false. ())] []) ())] [] () ()) (FunctionDef test_divmod ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load)] Load) Load) () 1) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 9 ()) (ConstantInt 3 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 9 ()) (UnaryOp USub (ConstantInt 3 ()))] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 3 ()) (ConstantInt 3 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 4 ()) (ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 0 ()) (ConstantInt 5 ())] []) ())] [] () ())] []) +(Module [(FunctionDef test_boz ([] [] [] [] [] [] []) [(AnnAssign (Name b Store) (Name str Load) () 1) (Assign [(Name b Store)] (Call (Name bin Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name b Store)] (Call (Name bin Load) [(ConstantInt 64 ())] []) ()) (Assign [(Name b Store)] (Call (Name bin Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(ConstantInt 8 ())] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(ConstantInt 56 ())] []) ()) (Assign [(Name b Store)] (Call (Name oct Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(ConstantInt 42 ())] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(ConstantInt 12648430 ())] []) ()) (Assign [(Name b Store)] (Call (Name hex Load) [(UnaryOp USub (ConstantInt 534 ()))] []) ())] [] () ()) (FunctionDef test_ord_chr ([] [] [] [] [] [] []) [(AnnAssign (Name s Store) (Name str Load) () 1) (AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name ord Load) [(ConstantStr "5" ())] []) ()) (Assign [(Name s Store)] (Call (Name chr Load) [(ConstantInt 43 ())] []) ())] [] () ()) (FunctionDef test_abs ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(UnaryOp USub (ConstantInt 500 ()))] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name a Store)] (Call (Name abs Load) [(ConstantBool .true. ())] []) ()) (AnnAssign (Name b Store) (Name f32 Load) () 1) (Assign [(Name b Store)] (Call (Name abs Load) [(ConstantFloat 3.45000000000000018e+00 ())] []) ()) (Assign [(Name b Store)] (Call (Name abs Load) [(UnaryOp USub (ConstantFloat 5.34634000000000015e+03 ()))] []) ()) (Assign [(Name b Store)] (Call (Name abs Load) [(Call (Name complex Load) [(ConstantFloat 3.45000000000000018e+00 ()) (ConstantFloat 5.59999999999999964e+00 ())] [])] []) ())] [] () ()) (FunctionDef test_len ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "test" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(ConstantStr "this is a test" ())] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Tuple [(Tuple [(ConstantStr "c" ()) (ConstantStr "b" ()) (ConstantFloat 3.39999999999999991e+00 ())] Load) (Tuple [(ConstantStr "c" ()) (ConstantInt 3 ()) (ConstantFloat 5.59999999999999964e+00 ())] Load)] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(List [(List [(UnaryOp USub (ConstantInt 4 ())) (UnaryOp USub (ConstantInt 5 ())) (UnaryOp USub (ConstantInt 6 ()))] Load) (List [(UnaryOp USub (ConstantInt 1 ())) (UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 3 ()))] Load)] Load)] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Set [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())])] []) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Dict [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] [(ConstantStr "c" ()) (ConstantStr "b" ()) (ConstantStr "c" ())])] []) ()) (AnnAssign (Name l Store) (Subscript (Name list Load) (Name i32 Load) Load) () 1) (Assign [(Name l Store)] (List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ()) (ConstantInt 4 ())] Load) ()) (Assign [(Name a Store)] (Call (Name len Load) [(Name l Load)] []) ()) (Expr (Call (Attribute (Name l Load) append Load) [(ConstantInt 5 ())] [])) (Assign [(Name a Store)] (Call (Name len Load) [(Name l Load)] []) ())] [] () ()) (FunctionDef test_bool ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantInt 0 ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(UnaryOp USub (ConstantInt 1 ()))] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantStr "" ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(Call (Name complex Load) [(ConstantInt 0 ()) (ConstantInt 0 ())] [])] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantStr "t" ())] []) ()) (Assign [(Name a Store)] (Call (Name bool Load) [(ConstantFloat 2.29999999999999982e+00 ())] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .true. ())]) ())] [] () ()) (FunctionDef test_str ([] [] [] [] [] [] []) [(AnnAssign (Name s Store) (Name str Load) () 1) (Assign [(Name s Store)] (Call (Name str Load) [] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(UnaryOp USub (ConstantInt 4 ()))] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name s Store)] (Call (Name str Load) [(ConstantStr "5346" ())] []) ())] [] () ()) (FunctionDef test_callable ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (AnnAssign (Name b Store) (Name i32 Load) () 1) (Assign [(Name b Store)] (ConstantInt 2 ()) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(Name test_len Load)] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(Name b Load)] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Call (Name callable Load) [(ConstantStr "c" ())] []) ()) (Assert (Compare (Name a Load) Eq [(ConstantBool .false. ())]) ())] [] () ()) (FunctionDef test_int ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i64 Load) () 1) (Assign [(Name a Store)] (Call (Name int Load) [] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantFloat 4.55999999999999961e+00 ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(UnaryOp USub (ConstantFloat 5.00000999999999962e+00 ()))] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantBool .false. ())] []) ()) (Assign [(Name a Store)] (Call (Name int Load) [(ConstantStr "5346" ())] []) ())] [] () ()) (FunctionDef test_float ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name f64 Load) () 1) (Assign [(Name a Store)] (Call (Name float Load) [] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantFloat 4.55999999999999961e+00 ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(UnaryOp USub (ConstantInt 1 ()))] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantBool .true. ())] []) ()) (Assign [(Name a Store)] (Call (Name float Load) [(ConstantBool .false. ())] []) ())] [] () ()) (FunctionDef test_divmod ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load)] Load) Load) () 1) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 9 ()) (ConstantInt 3 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 9 ()) (UnaryOp USub (ConstantInt 3 ()))] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 3 ()) (ConstantInt 3 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 4 ()) (ConstantInt 5 ())] []) ()) (Assign [(Name a Store)] (Call (Name divmod Load) [(ConstantInt 0 ()) (ConstantInt 5 ())] []) ())] [] () ())] []) diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.json b/tests/reference/ast-doconcurrentloop_01-ed7017b.json index c41b09e441..98ee970c71 100644 --- a/tests/reference/ast-doconcurrentloop_01-ed7017b.json +++ b/tests/reference/ast-doconcurrentloop_01-ed7017b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-doconcurrentloop_01-ed7017b.stdout", - "stdout_hash": "4f1f23b17cbbf60015bced52526c3b687d6ef6660b4917ff487c0746", + "stdout_hash": "9bb84ccfc923d9d994d354fe887fd916995a7ac27eccf37cab76c2fd", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout b/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout index 4c665e8674..9fe67bd8dd 100644 --- a/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout +++ b/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout @@ -1 +1 @@ -(Module [(FunctionDef triad ([] [(a (Subscript (Name f32 Load) (Slice () () ()) Load) ()) (b (Subscript (Name f32 Load) (Slice () () ()) Load) ()) (scalar (Name f32 Load) ()) (c (Subscript (Name f32 Load) (Slice () () ()) Load) ())] [] [] [] [] []) [(AnnAssign (Name N Store) (Name i32 Load) () 1) (AnnAssign (Name i Store) (Name i32 Load) () 1) (Assign [(Name N Store)] (Call (Name size Load) [(Name a Load)] []) ()) (For (Name i Store) (Call (Name range Load) [(Name N Load)] []) [(Assign [(Subscript (Name c Load) (Name i Load) Store)] (BinOp (Subscript (Name a Load) (Name i Load) Load) Add (BinOp (Name scalar Load) Mult (Subscript (Name b Load) (Name i Load) Load))) ())] [] "parallel")] [] () ()) (FunctionDef main0 ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name b Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name c Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name scalar Store) (Name f32 Load) () 1) (AnnAssign (Name i Store) (Name i32 Load) () 1) (AnnAssign (Name nsize Store) (Name i32 Load) () 1) (Assign [(Name scalar Store)] (ConstantFloat 1.000000e+01 ()) ()) (Assign [(Name nsize Store)] (Call (Name size Load) [(Name a Load)] []) ()) (For (Name i Store) (Call (Name range Load) [(Name nsize Load)] []) [(Assign [(Subscript (Name a Load) (Name i Load) Store)] (ConstantFloat 5.000000e+00 ()) ()) (Assign [(Subscript (Name b Load) (Name i Load) Store)] (ConstantFloat 5.000000e+00 ()) ())] [] "parallel") (Expr (Call (Name triad Load) [(Name a Load) (Name b Load) (Name scalar Load) (Name c Load)] [])) (Expr (Call (Name print Load) [(ConstantStr "End Stream Triad" ())] []))] [] () ()) (Expr (Call (Name main0 Load) [] []))] []) +(Module [(FunctionDef triad ([] [(a (Subscript (Name f32 Load) (Slice () () ()) Load) ()) (b (Subscript (Name f32 Load) (Slice () () ()) Load) ()) (scalar (Name f32 Load) ()) (c (Subscript (Name f32 Load) (Slice () () ()) Load) ())] [] [] [] [] []) [(AnnAssign (Name N Store) (Name i32 Load) () 1) (AnnAssign (Name i Store) (Name i32 Load) () 1) (Assign [(Name N Store)] (Call (Name size Load) [(Name a Load)] []) ()) (For (Name i Store) (Call (Name range Load) [(Name N Load)] []) [(Assign [(Subscript (Name c Load) (Name i Load) Store)] (BinOp (Subscript (Name a Load) (Name i Load) Load) Add (BinOp (Name scalar Load) Mult (Subscript (Name b Load) (Name i Load) Load))) ())] [] "parallel")] [] () ()) (FunctionDef main0 ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name b Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name c Store) (Subscript (Name f32 Load) (ConstantInt 10000 ()) Load) () 1) (AnnAssign (Name scalar Store) (Name f32 Load) () 1) (AnnAssign (Name i Store) (Name i32 Load) () 1) (AnnAssign (Name nsize Store) (Name i32 Load) () 1) (Assign [(Name scalar Store)] (ConstantFloat 1.00000000000000000e+01 ()) ()) (Assign [(Name nsize Store)] (Call (Name size Load) [(Name a Load)] []) ()) (For (Name i Store) (Call (Name range Load) [(Name nsize Load)] []) [(Assign [(Subscript (Name a Load) (Name i Load) Store)] (ConstantFloat 5.00000000000000000e+00 ()) ()) (Assign [(Subscript (Name b Load) (Name i Load) Store)] (ConstantFloat 5.00000000000000000e+00 ()) ())] [] "parallel") (Expr (Call (Name triad Load) [(Name a Load) (Name b Load) (Name scalar Load) (Name c Load)] [])) (Expr (Call (Name print Load) [(ConstantStr "End Stream Triad" ())] []))] [] () ()) (Expr (Call (Name main0 Load) [] []))] []) diff --git a/tests/reference/ast-expr10-a8d646d.json b/tests/reference/ast-expr10-a8d646d.json index 7aa88321a8..1e311ef0d3 100644 --- a/tests/reference/ast-expr10-a8d646d.json +++ b/tests/reference/ast-expr10-a8d646d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-expr10-a8d646d.stdout", - "stdout_hash": "c8ca2326cd755cabcebd5edc78c023bf444b9f04409ca2ab86460ab4", + "stdout_hash": "072ab27812c05ad1771af6427c8bdc60ec708d1350730671e370c90e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-expr10-a8d646d.stdout b/tests/reference/ast-expr10-a8d646d.stdout index 74c3372aba..19f8956155 100644 --- a/tests/reference/ast-expr10-a8d646d.stdout +++ b/tests/reference/ast-expr10-a8d646d.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_UnaryOp ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (UnaryOp UAdd (ConstantInt 4 ())) ()) (Assign [(Name a Store)] (UnaryOp USub (ConstantInt 500 ())) ()) (Assign [(Name a Store)] (UnaryOp Invert (ConstantInt 5 ())) ()) (AnnAssign (Name b Store) (Name bool Load) () 1) (Assign [(Name b Store)] (UnaryOp Not (ConstantInt 5 ())) ()) (Assign [(Name b Store)] (UnaryOp Not (UnaryOp USub (ConstantInt 1 ()))) ()) (Assign [(Name b Store)] (UnaryOp Not (ConstantInt 0 ())) ()) (AnnAssign (Name f Store) (Name f32 Load) () 1) (Assign [(Name f Store)] (UnaryOp UAdd (ConstantFloat 1.000000e+00 ())) ()) (Assign [(Name f Store)] (UnaryOp USub (ConstantFloat 1.837455e+05 ())) ()) (AnnAssign (Name b1 Store) (Name bool Load) () 1) (AnnAssign (Name b2 Store) (Name bool Load) () 1) (AnnAssign (Name b3 Store) (Name bool Load) () 1) (Assign [(Name b1 Store)] (ConstantBool .true. ()) ()) (Assign [(Name b2 Store)] (UnaryOp Not (ConstantBool .false. ())) ()) (Assign [(Name b3 Store)] (UnaryOp Not (Name b2 Load)) ()) (Assign [(Name a Store)] (UnaryOp UAdd (ConstantBool .true. ())) ()) (Assign [(Name a Store)] (UnaryOp USub (ConstantBool .false. ())) ()) (Assign [(Name a Store)] (UnaryOp Invert (ConstantBool .true. ())) ()) (AnnAssign (Name c Store) (Name c32 Load) () 1) (Assign [(Name c Store)] (UnaryOp UAdd (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] [])) ()) (Assign [(Name c Store)] (UnaryOp USub (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantFloat 6.500000e+01 ())] [])) ()) (Assign [(Name b1 Store)] (UnaryOp Not (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ()) (Assign [(Name b2 Store)] (UnaryOp Not (Call (Name complex Load) [(ConstantInt 0 ()) (ConstantInt 0 ())] [])) ())] [] () ())] []) +(Module [(FunctionDef test_UnaryOp ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (Assign [(Name a Store)] (UnaryOp UAdd (ConstantInt 4 ())) ()) (Assign [(Name a Store)] (UnaryOp USub (ConstantInt 500 ())) ()) (Assign [(Name a Store)] (UnaryOp Invert (ConstantInt 5 ())) ()) (AnnAssign (Name b Store) (Name bool Load) () 1) (Assign [(Name b Store)] (UnaryOp Not (ConstantInt 5 ())) ()) (Assign [(Name b Store)] (UnaryOp Not (UnaryOp USub (ConstantInt 1 ()))) ()) (Assign [(Name b Store)] (UnaryOp Not (ConstantInt 0 ())) ()) (AnnAssign (Name f Store) (Name f32 Load) () 1) (Assign [(Name f Store)] (UnaryOp UAdd (ConstantFloat 1.00000000000000000e+00 ())) ()) (Assign [(Name f Store)] (UnaryOp USub (ConstantFloat 1.83745534000000014e+05 ())) ()) (AnnAssign (Name b1 Store) (Name bool Load) () 1) (AnnAssign (Name b2 Store) (Name bool Load) () 1) (AnnAssign (Name b3 Store) (Name bool Load) () 1) (Assign [(Name b1 Store)] (ConstantBool .true. ()) ()) (Assign [(Name b2 Store)] (UnaryOp Not (ConstantBool .false. ())) ()) (Assign [(Name b3 Store)] (UnaryOp Not (Name b2 Load)) ()) (Assign [(Name a Store)] (UnaryOp UAdd (ConstantBool .true. ())) ()) (Assign [(Name a Store)] (UnaryOp USub (ConstantBool .false. ())) ()) (Assign [(Name a Store)] (UnaryOp Invert (ConstantBool .true. ())) ()) (AnnAssign (Name c Store) (Name c32 Load) () 1) (Assign [(Name c Store)] (UnaryOp UAdd (Call (Name complex Load) [(ConstantInt 1 ()) (ConstantInt 2 ())] [])) ()) (Assign [(Name c Store)] (UnaryOp USub (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantFloat 6.50000000000000000e+01 ())] [])) ()) (Assign [(Name b1 Store)] (UnaryOp Not (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] [])) ()) (Assign [(Name b2 Store)] (UnaryOp Not (Call (Name complex Load) [(ConstantInt 0 ()) (ConstantInt 0 ())] [])) ())] [] () ())] []) diff --git a/tests/reference/ast-expr13-c35ace1.json b/tests/reference/ast-expr13-c35ace1.json index 45d0b46286..2a7e650a74 100644 --- a/tests/reference/ast-expr13-c35ace1.json +++ b/tests/reference/ast-expr13-c35ace1.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-expr13-c35ace1.stdout", - "stdout_hash": "0a827e8952bfa8697e2e891c32a24947da370e098c36b480b6468ab0", + "stdout_hash": "35d5a71c6c3e9b4d63eac8d83fcc9f4118fb36e78c219da84f3c3761", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-expr13-c35ace1.stdout b/tests/reference/ast-expr13-c35ace1.stdout index b944d34ff7..372634ae3b 100644 --- a/tests/reference/ast-expr13-c35ace1.stdout +++ b/tests/reference/ast-expr13-c35ace1.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_Compare ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) Gt [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) LtE [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) Lt [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 5.600000e+00 ()) GtE [(ConstantFloat 5.599990e+00 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 3.300000e+00 ()) Eq [(ConstantFloat 3.300000e+00 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 3.300000e+00 ()) NotEq [(ConstantFloat 3.400000e+00 ())]) ()) (Assign [(Name a Store)] (Compare (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] []) Eq [(Call (Name complex Load) [(ConstantFloat 3.000000e+00 ()) (ConstantFloat 4.000000e+00 ())] [])]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) Gt [(ConstantStr "abd" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "" ()) Lt [(ConstantStr "s" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "-abs" ()) GtE [(ConstantStr "abs" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abcd" ()) LtE [(ConstantStr "abcde" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) Eq [(ConstantStr "abc" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) NotEq [(ConstantStr "abd" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "" ()) Eq [(ConstantStr "+" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .true. ()) Gt [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .true. ()) Eq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .false. ()) NotEq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .false. ()) GtE [(ConstantBool .true. ())]) ())] [] () ())] []) +(Module [(FunctionDef test_Compare ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name bool Load) () 1) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) Gt [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) LtE [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantInt 5 ()) Lt [(ConstantInt 4 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 5.59999999999999964e+00 ()) GtE [(ConstantFloat 5.59999000000000002e+00 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 3.29999999999999982e+00 ()) Eq [(ConstantFloat 3.29999999999999982e+00 ())]) ()) (Assign [(Name a Store)] (Compare (ConstantFloat 3.29999999999999982e+00 ()) NotEq [(ConstantFloat 3.39999999999999991e+00 ())]) ()) (Assign [(Name a Store)] (Compare (Call (Name complex Load) [(ConstantInt 3 ()) (ConstantInt 4 ())] []) Eq [(Call (Name complex Load) [(ConstantFloat 3.00000000000000000e+00 ()) (ConstantFloat 4.00000000000000000e+00 ())] [])]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) Gt [(ConstantStr "abd" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "" ()) Lt [(ConstantStr "s" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "-abs" ()) GtE [(ConstantStr "abs" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abcd" ()) LtE [(ConstantStr "abcde" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) Eq [(ConstantStr "abc" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "abc" ()) NotEq [(ConstantStr "abd" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantStr "" ()) Eq [(ConstantStr "+" ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .true. ()) Gt [(ConstantBool .false. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .true. ()) Eq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .false. ()) NotEq [(ConstantBool .true. ())]) ()) (Assign [(Name a Store)] (Compare (ConstantBool .false. ()) GtE [(ConstantBool .true. ())]) ())] [] () ())] []) diff --git a/tests/reference/ast-expr3-c3dcaab.json b/tests/reference/ast-expr3-c3dcaab.json index 4592caa9e6..4b257766a4 100644 --- a/tests/reference/ast-expr3-c3dcaab.json +++ b/tests/reference/ast-expr3-c3dcaab.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-expr3-c3dcaab.stdout", - "stdout_hash": "b50f9f9910ebfed76eca6b13853a0fb250c78107107aaa01f4b45c9b", + "stdout_hash": "f8d5b442736a175dab9573a8f12aa1389146c1672656c7e67be2cb34", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-expr3-c3dcaab.stdout b/tests/reference/ast-expr3-c3dcaab.stdout index 445036fa41..8b166f1336 100644 --- a/tests/reference/ast-expr3-c3dcaab.stdout +++ b/tests/reference/ast-expr3-c3dcaab.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_cast ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (AnnAssign (Name b Store) (Name f32 Load) () 1) (Assign [(Name a Store)] (ConstantInt 2 ()) ()) (Assign [(Name b Store)] (ConstantFloat 4.200000e+00 ()) ()) (AugAssign (Name a Store) Mult (Name b Load)) (AugAssign (Name b Store) Add (ConstantInt 1 ())) (Assign [(Name a Store)] (ConstantInt 5 ()) ()) (AugAssign (Name a Store) Sub (ConstantFloat 3.900000e+00 ())) (AugAssign (Name a Store) Div (Name b Load)) (Assign [(Name b Store)] (BinOp (ConstantInt 3 ()) Div (ConstantInt 4 ())) ()) (If (Compare (Name a Load) Lt [(Name b Load)]) [(Expr (Call (Name print Load) [(ConstantStr "a < b" ())] []))] [])] [] () ())] []) +(Module [(FunctionDef test_cast ([] [] [] [] [] [] []) [(AnnAssign (Name a Store) (Name i32 Load) () 1) (AnnAssign (Name b Store) (Name f32 Load) () 1) (Assign [(Name a Store)] (ConstantInt 2 ()) ()) (Assign [(Name b Store)] (ConstantFloat 4.20000000000000018e+00 ()) ()) (AugAssign (Name a Store) Mult (Name b Load)) (AugAssign (Name b Store) Add (ConstantInt 1 ())) (Assign [(Name a Store)] (ConstantInt 5 ()) ()) (AugAssign (Name a Store) Sub (ConstantFloat 3.89999999999999991e+00 ())) (AugAssign (Name a Store) Div (Name b Load)) (Assign [(Name b Store)] (BinOp (ConstantInt 3 ()) Div (ConstantInt 4 ())) ()) (If (Compare (Name a Load) Lt [(Name b Load)]) [(Expr (Call (Name print Load) [(ConstantStr "a < b" ())] []))] [])] [] () ())] []) diff --git a/tests/reference/ast-expr8-7db6b28.json b/tests/reference/ast-expr8-7db6b28.json index a37faf254e..f812c4b81e 100644 --- a/tests/reference/ast-expr8-7db6b28.json +++ b/tests/reference/ast-expr8-7db6b28.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-expr8-7db6b28.stdout", - "stdout_hash": "a9ca94ae7bee474c1ef21786e7521709987859e106aa855d418a0baa", + "stdout_hash": "2b1d4b9762d703e0ccec933ec70684de16cfd1d59f5aebfb04f91522", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-expr8-7db6b28.stdout b/tests/reference/ast-expr8-7db6b28.stdout index 8244f97c66..d860bb36cd 100644 --- a/tests/reference/ast-expr8-7db6b28.stdout +++ b/tests/reference/ast-expr8-7db6b28.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_binop ([] [] [] [] [] [] []) [(AnnAssign (Name x Store) (Name i32 Load) () 1) (AnnAssign (Name x2 Store) (Name f32 Load) () 1) (Assign [(Name x Store)] (BinOp (ConstantInt 2 ()) Pow (ConstantInt 3 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantInt 2 ()) Pow (ConstantFloat 3.500000e+00 ())) ()) (Assign [(Name x Store)] (BinOp (ConstantInt 54 ()) Sub (ConstantInt 100 ())) ()) (Assign [(Name x2 Store)] (BinOp (BinOp (ConstantFloat 3.454000e+00 ()) Sub (ConstantFloat 7.654300e+02 ())) Add (ConstantFloat 5.346000e+02 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantFloat 5.346565e+03 ()) Mult (ConstantFloat 3.450000e+00 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantFloat 5.346565e+03 ()) Pow (ConstantFloat 3.450000e+00 ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Add (ConstantBool .true. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Sub (ConstantBool .false. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Mult (ConstantBool .false. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Pow (ConstantBool .false. ())) ()) (AnnAssign (Name b1 Store) (Name bool Load) () 1) (AnnAssign (Name b2 Store) (Name bool Load) () 1) (Assign [(Name b1 Store)] (ConstantBool .true. ()) ()) (Assign [(Name b2 Store)] (ConstantBool .false. ()) ()) (Assign [(Name x Store)] (BinOp (Name b1 Load) FloorDiv (Name b1 Load)) ()) (Assign [(Name x Store)] (BinOp (Name b1 Load) Pow (Name b2 Load)) ())] [] () ())] []) +(Module [(FunctionDef test_binop ([] [] [] [] [] [] []) [(AnnAssign (Name x Store) (Name i32 Load) () 1) (AnnAssign (Name x2 Store) (Name f32 Load) () 1) (Assign [(Name x Store)] (BinOp (ConstantInt 2 ()) Pow (ConstantInt 3 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantInt 2 ()) Pow (ConstantFloat 3.50000000000000000e+00 ())) ()) (Assign [(Name x Store)] (BinOp (ConstantInt 54 ()) Sub (ConstantInt 100 ())) ()) (Assign [(Name x2 Store)] (BinOp (BinOp (ConstantFloat 3.45400000000000018e+00 ()) Sub (ConstantFloat 7.65429999999999950e+02 ())) Add (ConstantFloat 5.34600000000000023e+02 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantFloat 5.34656499999999960e+03 ()) Mult (ConstantFloat 3.45000000000000018e+00 ())) ()) (Assign [(Name x2 Store)] (BinOp (ConstantFloat 5.34656499999999960e+03 ()) Pow (ConstantFloat 3.45000000000000018e+00 ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Add (ConstantBool .true. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Sub (ConstantBool .false. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Mult (ConstantBool .false. ())) ()) (Assign [(Name x Store)] (BinOp (ConstantBool .true. ()) Pow (ConstantBool .false. ())) ()) (AnnAssign (Name b1 Store) (Name bool Load) () 1) (AnnAssign (Name b2 Store) (Name bool Load) () 1) (Assign [(Name b1 Store)] (ConstantBool .true. ()) ()) (Assign [(Name b2 Store)] (ConstantBool .false. ()) ()) (Assign [(Name x Store)] (BinOp (Name b1 Load) FloorDiv (Name b1 Load)) ()) (Assign [(Name x Store)] (BinOp (Name b1 Load) Pow (Name b2 Load)) ())] [] () ())] []) diff --git a/tests/reference/ast-tuple1-2fb5396.json b/tests/reference/ast-tuple1-2fb5396.json index 06188c8750..49e73fbf64 100644 --- a/tests/reference/ast-tuple1-2fb5396.json +++ b/tests/reference/ast-tuple1-2fb5396.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast-tuple1-2fb5396.stdout", - "stdout_hash": "d869a76ec719fe4acdd8da7eb10a9d1c85581cb3fb386f7f119be03d", + "stdout_hash": "7f7e0363718a5e885efe98f4f59a61b33e91ea233df64d4fd636f9a4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-tuple1-2fb5396.stdout b/tests/reference/ast-tuple1-2fb5396.stdout index 612d0324c0..bff0b569ca 100644 --- a/tests/reference/ast-tuple1-2fb5396.stdout +++ b/tests/reference/ast-tuple1-2fb5396.stdout @@ -1 +1 @@ -(Module [(FunctionDef test_Tuple ([] [] [] [] [] [] []) [(AnnAssign (Name a1 Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load) () 1) (Assign [(Name a1 Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) ()) (Assign [(Name a1 Store)] (Tuple [(UnaryOp USub (ConstantInt 3 ())) (UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 1 ()))] Load) ()) (AnnAssign (Name a2 Store) (Subscript (Name tuple Load) (Tuple [(Name str Load) (Name str Load) (Name str Load)] Load) Load) () 1) (Assign [(Name a2 Store)] (Tuple [(ConstantStr "a" ()) (ConstantStr "b" ()) (ConstantStr "c" ())] Load) ()) (AnnAssign (Name a3 Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name f32 Load) (Name str Load)] Load) Load) () 1) (Assign [(Name a3 Store)] (Tuple [(UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 1 ())) (ConstantFloat 4.500000e-01 ()) (ConstantStr "d" ())] Load) ()) (AnnAssign (Name a4 Store) (Subscript (Name tuple Load) (Tuple [(Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load)] Load) Load) () 1) (Assign [(Name a4 Store)] (Tuple [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) (Tuple [(ConstantInt 4 ()) (ConstantInt 5 ()) (ConstantInt 6 ())] Load)] Load) ()) (AnnAssign (Name a5 Store) (Subscript (Name tuple Load) (Tuple [(Subscript (Name tuple Load) (Tuple [(Name str Load) (Name str Load) (Name f32 Load)] Load) Load) (Subscript (Name tuple Load) (Tuple [(Name str Load) (Name i32 Load) (Name f32 Load)] Load) Load)] Load) Load) () 1) (Assign [(Name a5 Store)] (Tuple [(Tuple [(ConstantStr "a" ()) (ConstantStr "b" ()) (ConstantFloat 3.400000e+00 ())] Load) (Tuple [(ConstantStr "c" ()) (ConstantInt 3 ()) (ConstantFloat 5.600000e+00 ())] Load)] Load) ()) (AnnAssign (Name b0 Store) (Name i32 Load) () 1) (AnnAssign (Name b1 Store) (Name i32 Load) () 1) (Assign [(Name b0 Store)] (Subscript (Name a1 Load) (ConstantInt 0 ()) Load) ()) (Assign [(Tuple [(Name b0 Store) (Name b1 Store)] Store)] (Tuple [(Subscript (Name a1 Load) (ConstantInt 2 ()) Load) (Subscript (Name a1 Load) (ConstantInt 1 ()) Load)] Load) ())] [] () ())] []) +(Module [(FunctionDef test_Tuple ([] [] [] [] [] [] []) [(AnnAssign (Name a1 Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load) () 1) (Assign [(Name a1 Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) ()) (Assign [(Name a1 Store)] (Tuple [(UnaryOp USub (ConstantInt 3 ())) (UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 1 ()))] Load) ()) (AnnAssign (Name a2 Store) (Subscript (Name tuple Load) (Tuple [(Name str Load) (Name str Load) (Name str Load)] Load) Load) () 1) (Assign [(Name a2 Store)] (Tuple [(ConstantStr "a" ()) (ConstantStr "b" ()) (ConstantStr "c" ())] Load) ()) (AnnAssign (Name a3 Store) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name f32 Load) (Name str Load)] Load) Load) () 1) (Assign [(Name a3 Store)] (Tuple [(UnaryOp USub (ConstantInt 2 ())) (UnaryOp USub (ConstantInt 1 ())) (ConstantFloat 4.50000000000000011e-01 ()) (ConstantStr "d" ())] Load) ()) (AnnAssign (Name a4 Store) (Subscript (Name tuple Load) (Tuple [(Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load) (Subscript (Name tuple Load) (Tuple [(Name i32 Load) (Name i32 Load) (Name i32 Load)] Load) Load)] Load) Load) () 1) (Assign [(Name a4 Store)] (Tuple [(Tuple [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) (Tuple [(ConstantInt 4 ()) (ConstantInt 5 ()) (ConstantInt 6 ())] Load)] Load) ()) (AnnAssign (Name a5 Store) (Subscript (Name tuple Load) (Tuple [(Subscript (Name tuple Load) (Tuple [(Name str Load) (Name str Load) (Name f32 Load)] Load) Load) (Subscript (Name tuple Load) (Tuple [(Name str Load) (Name i32 Load) (Name f32 Load)] Load) Load)] Load) Load) () 1) (Assign [(Name a5 Store)] (Tuple [(Tuple [(ConstantStr "a" ()) (ConstantStr "b" ()) (ConstantFloat 3.39999999999999991e+00 ())] Load) (Tuple [(ConstantStr "c" ()) (ConstantInt 3 ()) (ConstantFloat 5.59999999999999964e+00 ())] Load)] Load) ()) (AnnAssign (Name b0 Store) (Name i32 Load) () 1) (AnnAssign (Name b1 Store) (Name i32 Load) () 1) (Assign [(Name b0 Store)] (Subscript (Name a1 Load) (ConstantInt 0 ()) Load) ()) (Assign [(Tuple [(Name b0 Store) (Name b1 Store)] Store)] (Tuple [(Subscript (Name a1 Load) (ConstantInt 2 ()) Load) (Subscript (Name a1 Load) (ConstantInt 1 ()) Load)] Load) ())] [] () ())] []) diff --git a/tests/reference/ast_new-statements1-e081093.json b/tests/reference/ast_new-statements1-e081093.json index e500e96555..ebeec73890 100644 --- a/tests/reference/ast_new-statements1-e081093.json +++ b/tests/reference/ast_new-statements1-e081093.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "ast_new-statements1-e081093.stdout", - "stdout_hash": "15c7a3741ac8939568fc02d8875151f5db3e8922a5aba6c3cc8fde93", + "stdout_hash": "7a6120be445b84aee8437cf1f4dee9f1af19757f4aefc845927ca4fc", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast_new-statements1-e081093.stdout b/tests/reference/ast_new-statements1-e081093.stdout index fa0cffcec4..5e847cf2e5 100644 --- a/tests/reference/ast_new-statements1-e081093.stdout +++ b/tests/reference/ast_new-statements1-e081093.stdout @@ -1 +1 @@ -(Module [(Pass) (Break) (Continue) (Raise () ()) (Raise (Call (Name NameError Load) [(ConstantStr "String" ())] []) ()) (Raise (Name RuntimeError Load) (Name exc Load)) (Assert (Compare (Call (Name len Load) [(Name marks Load)] []) NotEq [(ConstantInt 0 ())]) (ConstantStr "List is empty." ())) (Assert (Compare (Name x Load) Eq [(ConstantStr "String" ())]) ()) (Assign [(Name x Store)] (ConstantInt 1 ()) ()) (Assign [(Tuple [(Name x Store) (Name y Store)] Store)] (Call (Name x Load) [] []) ()) (Assign [(Name x Store) (Name y Store)] (ConstantInt 1 ()) ()) (Assign [(Tuple [(Name x Store) (Name y Store)] Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) ()) (Assign [(Subscript (Name x Load) (Name i Load) Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) ()) (Assign [(Tuple [(Name x Store) (Name y Store) (Name z Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store) (Name y Store) (Name z Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store)] Store)] (Name t Load) ()) (AugAssign (Name x Store) Add (ConstantInt 1 ())) (AnnAssign (Name x Store) (Name i64 Load) () 1) (AnnAssign (Name y Store) (Name i32 Load) (ConstantInt 1 ()) 1) (Delete [(Name x Del)]) (Delete [(Tuple [] Del)]) (Delete [(Tuple [(Name x Del) (Name y Del)] Del)]) (Delete [(Tuple [(Name x Del) (Name y Del)] Del)]) (Delete [(Name x Del) (Name y Del)]) (Delete [(Name x Del) (Name y Del)]) (Return ()) (Return (BinOp (Name a Load) Add (Name b Load))) (Return (Call (Name x Load) [(Name a Load)] [])) (Return (Tuple [] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Global [a]) (Global [a b]) (Nonlocal [a]) (Nonlocal [a b]) (Expr (ConstantInt 123 ())) (Expr (UnaryOp USub (ConstantInt 123 ()))) (Expr (UnaryOp USub (ConstantInt 291 ()))) (Expr (ConstantInt 6844 ())) (Expr (UnaryOp USub (ConstantInt 83 ()))) (Expr (ConstantInt 87 ())) (Expr (UnaryOp USub (ConstantInt 13 ()))) (Expr (ConstantInt 13 ())) (Expr (ConstantFloat 1.230000e+02 ())) (Expr (ConstantFloat 1.234500e+02 ())) (Expr (ConstantFloat 1.234000e+11 ())) (Expr (BinOp (ConstantInt 12 ()) Add (ConstantComplex 0.000000e+00 3.000000e+00 ()))) (Expr (BinOp (ConstantFloat 1.200000e-01 ()) Add (ConstantComplex 0.000000e+00 1.000000e-03 ()))) (Expr (ConstantStr "String" ())) (Expr (ConstantStr "String String" ())) (Expr (ConstantStr "String String" ())) (Expr (ConstantStr "String String" ())) (Expr (Subscript (ConstantStr "String String" ()) (Slice (ConstantInt 1 ()) () ()) Load)) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (BinOp (ConstantStr "String " ()) Add (ConstantStr "String" ())) ()) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (ConstantStr "String " ()) ()) (Expr (ConstantStr "String" ())) (Expr (ConstantBool .true. ())) (Expr (ConstantBool .false. ())) (Expr (BinOp (BinOp (Name x Load) Add (Name y Load)) Mult (Name z Load))) (Expr (BinOp (Name x Load) Sub (Name y Load))) (Expr (BinOp (Name x Load) Mult (Name y Load))) (Expr (BinOp (Name x Load) Div (Name y Load))) (Expr (BinOp (Name x Load) Mod (Name y Load))) (Expr (UnaryOp USub (Name y Load))) (Expr (UnaryOp UAdd (Name y Load))) (Expr (UnaryOp Invert (Name y Load))) (Expr (BinOp (Name x Load) Pow (Name y Load))) (Expr (BinOp (Name x Load) FloorDiv (Name y Load))) (Expr (BinOp (Name x Load) MatMult (Name y Load))) (Expr (BinOp (Name x Load) BitAnd (Name y Load))) (Expr (BinOp (Name x Load) BitOr (Name y Load))) (Expr (BinOp (Name x Load) BitXor (Name y Load))) (Expr (BinOp (Name x Load) LShift (Name y Load))) (Expr (BinOp (Name x Load) RShift (Name y Load))) (Expr (Compare (Name x Load) Eq [(Name y Load)])) (Expr (Compare (Name x Load) NotEq [(Name y Load)])) (Expr (Compare (Name x Load) Lt [(Name y Load)])) (Expr (Compare (Name x Load) LtE [(Name y Load)])) (Expr (Compare (Name x Load) Gt [(Name y Load)])) (Expr (Compare (Name x Load) GtE [(Name y Load)])) (If (Compare (Call (Name type Load) [(Name x Load)] []) Is [(Name int Load)]) [(Pass)] []) (If (Compare (Compare (BinOp (BinOp (BinOp (ConstantInt 2 ()) Add (ConstantInt 3 ())) Div (ConstantInt 2 ())) Sub (ConstantInt 1 ())) Is [(ConstantInt 5 ())]) Is [(ConstantBool .true. ())]) [(Pass)] []) (If (Compare (Name x Load) IsNot [(Call (Name type Load) [(Name float Load)] [])]) [(Pass)] []) (If (Compare (Name x Load) IsNot [(Call (Name type Load) [(Name int Load)] [])]) [(Pass)] []) (Assign [(Name a Store)] (List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) ()) (If (Compare (Name a Load) NotIn [(List [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)]) [(Pass)] []) (If (Compare (Compare (Name a Load) NotIn [(List [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)]) NotIn [(List [(ConstantBool .true. ()) (ConstantBool .false. ())] Load)]) [(Pass)] []) (AnnAssign (Name i Store) (Name i32 Load) (ConstantInt 4 ()) 1) (If (Compare (ConstantInt 2 ()) Gt [(Name i Load)]) [(Pass)] []) (If (Compare (Name i Load) Gt [(ConstantInt 5 ())]) [(Break)] []) (If (BoolOp And [(Compare (Name i Load) Eq [(ConstantInt 5 ())]) (Compare (Name i Load) Lt [(ConstantInt 10 ())])]) [(Assign [(Name i Store)] (ConstantInt 3 ()) ())] []) (For (Name i Store) (Call (Name range Load) [(Name N Load)] []) [(Assign [(Subscript (Name c Load) (Name i Load) Store)] (BinOp (Subscript (Name a Load) (Name i Load) Load) Add (BinOp (Name scalar Load) Mult (Subscript (Name b Load) (Name i Load) Load))) ())] [] ()) (Assign [(Name x Store)] (NamedExpr (Name y Store) (ConstantInt 0 ())) ()) (If (NamedExpr (Name a Store) (Call (Name ord Load) [(ConstantStr "3" ())] [])) [(Assign [(Name x Store)] (ConstantInt 1 ()) ())] []) (Assign [(Name a Store)] (Set [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())]) ())] []) +(Module [(Pass) (Break) (Continue) (Raise () ()) (Raise (Call (Name NameError Load) [(ConstantStr "String" ())] []) ()) (Raise (Name RuntimeError Load) (Name exc Load)) (Assert (Compare (Call (Name len Load) [(Name marks Load)] []) NotEq [(ConstantInt 0 ())]) (ConstantStr "List is empty." ())) (Assert (Compare (Name x Load) Eq [(ConstantStr "String" ())]) ()) (Assign [(Name x Store)] (ConstantInt 1 ()) ()) (Assign [(Tuple [(Name x Store) (Name y Store)] Store)] (Call (Name x Load) [] []) ()) (Assign [(Name x Store) (Name y Store)] (ConstantInt 1 ()) ()) (Assign [(Tuple [(Name x Store) (Name y Store)] Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) ()) (Assign [(Subscript (Name x Load) (Name i Load) Store)] (Tuple [(ConstantInt 1 ()) (ConstantInt 2 ())] Load) ()) (Assign [(Tuple [(Name x Store) (Name y Store) (Name z Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store) (Name y Store) (Name z Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store)] Store)] (Name t Load) ()) (Assign [(Tuple [(Name x Store)] Store)] (Name t Load) ()) (AugAssign (Name x Store) Add (ConstantInt 1 ())) (AnnAssign (Name x Store) (Name i64 Load) () 1) (AnnAssign (Name y Store) (Name i32 Load) (ConstantInt 1 ()) 1) (Delete [(Name x Del)]) (Delete [(Tuple [] Del)]) (Delete [(Tuple [(Name x Del) (Name y Del)] Del)]) (Delete [(Tuple [(Name x Del) (Name y Del)] Del)]) (Delete [(Name x Del) (Name y Del)]) (Delete [(Name x Del) (Name y Del)]) (Return ()) (Return (BinOp (Name a Load) Add (Name b Load))) (Return (Call (Name x Load) [(Name a Load)] [])) (Return (Tuple [] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Return (Tuple [(Name x Load) (Name y Load)] Load)) (Global [a]) (Global [a b]) (Nonlocal [a]) (Nonlocal [a b]) (Expr (ConstantInt 123 ())) (Expr (UnaryOp USub (ConstantInt 123 ()))) (Expr (UnaryOp USub (ConstantInt 291 ()))) (Expr (ConstantInt 6844 ())) (Expr (UnaryOp USub (ConstantInt 83 ()))) (Expr (ConstantInt 87 ())) (Expr (UnaryOp USub (ConstantInt 13 ()))) (Expr (ConstantInt 13 ())) (Expr (ConstantFloat 1.23000000000000000e+02 ())) (Expr (ConstantFloat 1.23450000000000003e+02 ())) (Expr (ConstantFloat 1.23400000000000000e+11 ())) (Expr (BinOp (ConstantInt 12 ()) Add (ConstantComplex 0.00000000000000000e+00 3.00000000000000000e+00 ()))) (Expr (BinOp (ConstantFloat 1.19999999999999996e-01 ()) Add (ConstantComplex 0.00000000000000000e+00 1.00000000000000002e-03 ()))) (Expr (ConstantStr "String" ())) (Expr (ConstantStr "String String" ())) (Expr (ConstantStr "String String" ())) (Expr (ConstantStr "String String" ())) (Expr (Subscript (ConstantStr "String String" ()) (Slice (ConstantInt 1 ()) () ()) Load)) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (BinOp (ConstantStr "String " ()) Add (ConstantStr "String" ())) ()) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (ConstantStr "String String" ()) ()) (Assign [(Name x Store)] (ConstantStr "String " ()) ()) (Expr (ConstantStr "String" ())) (Expr (ConstantBool .true. ())) (Expr (ConstantBool .false. ())) (Expr (BinOp (BinOp (Name x Load) Add (Name y Load)) Mult (Name z Load))) (Expr (BinOp (Name x Load) Sub (Name y Load))) (Expr (BinOp (Name x Load) Mult (Name y Load))) (Expr (BinOp (Name x Load) Div (Name y Load))) (Expr (BinOp (Name x Load) Mod (Name y Load))) (Expr (UnaryOp USub (Name y Load))) (Expr (UnaryOp UAdd (Name y Load))) (Expr (UnaryOp Invert (Name y Load))) (Expr (BinOp (Name x Load) Pow (Name y Load))) (Expr (BinOp (Name x Load) FloorDiv (Name y Load))) (Expr (BinOp (Name x Load) MatMult (Name y Load))) (Expr (BinOp (Name x Load) BitAnd (Name y Load))) (Expr (BinOp (Name x Load) BitOr (Name y Load))) (Expr (BinOp (Name x Load) BitXor (Name y Load))) (Expr (BinOp (Name x Load) LShift (Name y Load))) (Expr (BinOp (Name x Load) RShift (Name y Load))) (Expr (Compare (Name x Load) Eq [(Name y Load)])) (Expr (Compare (Name x Load) NotEq [(Name y Load)])) (Expr (Compare (Name x Load) Lt [(Name y Load)])) (Expr (Compare (Name x Load) LtE [(Name y Load)])) (Expr (Compare (Name x Load) Gt [(Name y Load)])) (Expr (Compare (Name x Load) GtE [(Name y Load)])) (If (Compare (Call (Name type Load) [(Name x Load)] []) Is [(Name int Load)]) [(Pass)] []) (If (Compare (Compare (BinOp (BinOp (BinOp (ConstantInt 2 ()) Add (ConstantInt 3 ())) Div (ConstantInt 2 ())) Sub (ConstantInt 1 ())) Is [(ConstantInt 5 ())]) Is [(ConstantBool .true. ())]) [(Pass)] []) (If (Compare (Name x Load) IsNot [(Call (Name type Load) [(Name float Load)] [])]) [(Pass)] []) (If (Compare (Name x Load) IsNot [(Call (Name type Load) [(Name int Load)] [])]) [(Pass)] []) (Assign [(Name a Store)] (List [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())] Load) ()) (If (Compare (Name a Load) NotIn [(List [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)]) [(Pass)] []) (If (Compare (Compare (Name a Load) NotIn [(List [(ConstantInt 1 ()) (ConstantInt 2 ())] Load)]) NotIn [(List [(ConstantBool .true. ()) (ConstantBool .false. ())] Load)]) [(Pass)] []) (AnnAssign (Name i Store) (Name i32 Load) (ConstantInt 4 ()) 1) (If (Compare (ConstantInt 2 ()) Gt [(Name i Load)]) [(Pass)] []) (If (Compare (Name i Load) Gt [(ConstantInt 5 ())]) [(Break)] []) (If (BoolOp And [(Compare (Name i Load) Eq [(ConstantInt 5 ())]) (Compare (Name i Load) Lt [(ConstantInt 10 ())])]) [(Assign [(Name i Store)] (ConstantInt 3 ()) ())] []) (For (Name i Store) (Call (Name range Load) [(Name N Load)] []) [(Assign [(Subscript (Name c Load) (Name i Load) Store)] (BinOp (Subscript (Name a Load) (Name i Load) Load) Add (BinOp (Name scalar Load) Mult (Subscript (Name b Load) (Name i Load) Load))) ())] [] ()) (Assign [(Name x Store)] (NamedExpr (Name y Store) (ConstantInt 0 ())) ()) (If (NamedExpr (Name a Store) (Call (Name ord Load) [(ConstantStr "3" ())] [])) [(Assign [(Name x Store)] (ConstantInt 1 ()) ())] []) (Assign [(Name a Store)] (Set [(ConstantInt 1 ()) (ConstantInt 2 ()) (ConstantInt 3 ())]) ())] []) diff --git a/tests/reference/c-c_interop1-e215531.json b/tests/reference/c-c_interop1-e215531.json index 866319b3ab..a83f0c3292 100644 --- a/tests/reference/c-c_interop1-e215531.json +++ b/tests/reference/c-c_interop1-e215531.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-c_interop1-e215531.stdout", - "stdout_hash": "f57cf99159b79f7e3b784cdc14df2177351ac76bbcd0f352f85cf43f", + "stdout_hash": "e3aa55d2d5482ae5ced4c338b62cbb25363975e312f513ce77b4196b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/c-c_interop1-e215531.stdout b/tests/reference/c-c_interop1-e215531.stdout index 4c834869ac..64de0dac27 100644 --- a/tests/reference/c-c_interop1-e215531.stdout +++ b/tests/reference/c-c_interop1-e215531.stdout @@ -39,14 +39,10 @@ void l(double a, float b, int64_t c, int32_t d); void main0(); // Implementations -double f(double x); - -void g(double a, float b, int64_t c, int32_t d); - double h(double x) { double _lpython_return_variable; - _lpython_return_variable = x + 1.000000e+00; + _lpython_return_variable = x + 1.00000000000000000e+00; return _lpython_return_variable; } @@ -62,9 +58,9 @@ void main0() float y; int64_t z; int32_t zz; - x = 5.000000e+00; + x = 5.00000000000000000e+00; i = f(x); - y = 5.400000e+00; + y = 5.40000000000000036e+00; z = 3; zz = 2; g(x, y, z, zz); diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json index 83e5cc558b..6c8a9d9ade 100644 --- a/tests/reference/c-expr7-bb2692a.json +++ b/tests/reference/c-expr7-bb2692a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-expr7-bb2692a.stdout", - "stdout_hash": "fe17849f8c9d0b11e71c0d59f9c37d604731bc9440193f33532b3583", + "stdout_hash": "b85e5ba7a59233bae53065f566d6caaf7d39455607aa4efa30f289de", "stderr": "c-expr7-bb2692a.stderr", "stderr_hash": "28509dd59a386eebd632340a550d14299cd2a921ef6dc3ac7dbe7fe9", "returncode": 0 diff --git a/tests/reference/c-expr7-bb2692a.stdout b/tests/reference/c-expr7-bb2692a.stdout index 0f099f171c..77cc1a772f 100644 --- a/tests/reference/c-expr7-bb2692a.stdout +++ b/tests/reference/c-expr7-bb2692a.stdout @@ -35,8 +35,8 @@ void _lpython_main_program(); void main0(); void test_pow(); -int test_pow_1(int32_t a, int32_t b); -int __lpython_overloaded_0__pow(int32_t x, int32_t y); +int32_t test_pow_1(int32_t a, int32_t b); +int32_t __lpython_overloaded_0__pow(int32_t x, int32_t y); float _lfortran_caimag(float complex x); double _lfortran_zaimag(double complex x); @@ -59,7 +59,7 @@ void test_pow() a = __lpython_overloaded_0__pow(2, 2); } -int test_pow_1(int32_t a, int32_t b) +int32_t test_pow_1(int32_t a, int32_t b) { int32_t _lpython_return_variable; int32_t res; @@ -68,7 +68,7 @@ int test_pow_1(int32_t a, int32_t b) return _lpython_return_variable; } -int __lpython_overloaded_0__pow(int32_t x, int32_t y) +int32_t __lpython_overloaded_0__pow(int32_t x, int32_t y) { int32_t _lpython_return_variable; _lpython_return_variable = pow(x, y); diff --git a/tests/reference/c-loop1-3e341c7.json b/tests/reference/c-loop1-3e341c7.json index d9a0deeca6..85244a754d 100644 --- a/tests/reference/c-loop1-3e341c7.json +++ b/tests/reference/c-loop1-3e341c7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-loop1-3e341c7.stdout", - "stdout_hash": "3231551bed9cd9b0cb0e432feeea9aaf77114c736cddae1da59cc031", + "stdout_hash": "1affe4d89303209b3e5a33acf69e456e4f20d1bbb271aeff92d4e609", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/c-loop1-3e341c7.stdout b/tests/reference/c-loop1-3e341c7.stdout index bcc16c7a18..b35394b2df 100644 --- a/tests/reference/c-loop1-3e341c7.stdout +++ b/tests/reference/c-loop1-3e341c7.stdout @@ -34,9 +34,9 @@ // Forward declarations void _lpython_main_program(); void main0(); -int test_factorial_1(int32_t x); -int test_factorial_2(int32_t x); -long long test_factorial_3(int32_t x); +int32_t test_factorial_1(int32_t x); +int32_t test_factorial_2(int32_t x); +int64_t test_factorial_3(int32_t x); // Implementations void _lpython_main_program() @@ -54,7 +54,7 @@ void main0() printf("%d %lli\n", i, j); } -int test_factorial_1(int32_t x) +int32_t test_factorial_1(int32_t x) { int32_t _lpython_return_variable; int32_t result; @@ -71,7 +71,7 @@ int test_factorial_1(int32_t x) return _lpython_return_variable; } -int test_factorial_2(int32_t x) +int32_t test_factorial_2(int32_t x) { int32_t _lpython_return_variable; int32_t i; @@ -84,7 +84,7 @@ int test_factorial_2(int32_t x) return _lpython_return_variable; } -long long test_factorial_3(int32_t x) +int64_t test_factorial_3(int32_t x) { int64_t _lpython_return_variable; int64_t result; diff --git a/tests/reference/c-test_issue_518-fbbd299.json b/tests/reference/c-test_issue_518-fbbd299.json index 32878d65ae..4390be4dc5 100644 --- a/tests/reference/c-test_issue_518-fbbd299.json +++ b/tests/reference/c-test_issue_518-fbbd299.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-test_issue_518-fbbd299.stdout", - "stdout_hash": "c147d947624f25088725530eab37ec3ee89f1249e8e36797667af52a", + "stdout_hash": "20f6183e2999e6b6c6b62edd7f832a950a206dd3130d21daaead165a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/c-test_issue_518-fbbd299.stdout b/tests/reference/c-test_issue_518-fbbd299.stdout index 02a161de1b..3e7e874b49 100644 --- a/tests/reference/c-test_issue_518-fbbd299.stdout +++ b/tests/reference/c-test_issue_518-fbbd299.stdout @@ -33,7 +33,7 @@ // Forward declarations void _lpython_main_program(); -long long fib(int64_t n); +int64_t fib(int64_t n); void _xx_lcompilers_changed_main_xx(); void main0(); @@ -44,7 +44,7 @@ void _lpython_main_program() main(); } -long long fib(int64_t n) +int64_t fib(int64_t n) { int64_t _lpython_return_variable; if (n < 2) { diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.json b/tests/reference/cpp-doconcurrentloop_01-4e9f274.json index a50d01a6a5..89383da7be 100644 --- a/tests/reference/cpp-doconcurrentloop_01-4e9f274.json +++ b/tests/reference/cpp-doconcurrentloop_01-4e9f274.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-doconcurrentloop_01-4e9f274.stdout", - "stdout_hash": "e2a12b935762ac30438acd6065dad443d58786ed138a7c80f3647821", + "stdout_hash": "d7631cfd821f7356c2e33196b565cff5a035c0e1539db50baf3e1689", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout b/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout index 45bb844611..b9c291dc2c 100644 --- a/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout +++ b/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout @@ -29,11 +29,11 @@ void main0() Kokkos::View c("c"); int nsize; float scalar; - scalar = 1.000000e+01; + scalar = 1.00000000000000000e+01; nsize = 1234; Kokkos::parallel_for(Kokkos::RangePolicy(0, nsize - 1+1), KOKKOS_LAMBDA(const long i) { - a[i + 1-1] = 5.000000e+00; - b[i + 1-1] = 5.000000e+00; + a[i + 1-1] = 5.00000000000000000e+00; + b[i + 1-1] = 5.00000000000000000e+00; }); triad(a, b, scalar, c); std::cout << "End Stream Triad" << std::endl; diff --git a/tests/reference/cpp-expr12-fd2ea87.json b/tests/reference/cpp-expr12-fd2ea87.json index b0abfc8515..6da61ac43b 100644 --- a/tests/reference/cpp-expr12-fd2ea87.json +++ b/tests/reference/cpp-expr12-fd2ea87.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr12-fd2ea87.stdout", - "stdout_hash": "d90122ae415d54567e02c9b5f4fdb4630daec6d87f941be9750987be", + "stdout_hash": "4388c01dad00d8dfd263ff7280f63f1b0d6041a6c4febf0f141db513", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-expr12-fd2ea87.stdout b/tests/reference/cpp-expr12-fd2ea87.stdout index 82b9bc23d7..0cc73e7aae 100644 --- a/tests/reference/cpp-expr12-fd2ea87.stdout +++ b/tests/reference/cpp-expr12-fd2ea87.stdout @@ -22,7 +22,7 @@ void _lpython_main_program() main0(); } -int check() +int32_t check() { int _lpython_return_variable; int a; @@ -37,7 +37,7 @@ void main0() x = check(); } -int test(int a, int b) +int32_t test(int a, int b) { int _lpython_return_variable; _lpython_return_variable = std::pow(a, b); diff --git a/tests/reference/cpp-expr15-1661c0d.json b/tests/reference/cpp-expr15-1661c0d.json index a8e9f69aec..2ff822e0eb 100644 --- a/tests/reference/cpp-expr15-1661c0d.json +++ b/tests/reference/cpp-expr15-1661c0d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr15-1661c0d.stdout", - "stdout_hash": "dd45444ab4ec5b2333ee1fb61130e306fcc0d9f26f71f1210b2c4db5", + "stdout_hash": "aa739007190884b8e5b1d3711b0d0ac283777d05ad980af6ea3d7364", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-expr15-1661c0d.stdout b/tests/reference/cpp-expr15-1661c0d.stdout index 635f154811..b187f83b31 100644 --- a/tests/reference/cpp-expr15-1661c0d.stdout +++ b/tests/reference/cpp-expr15-1661c0d.stdout @@ -28,7 +28,7 @@ double test1() { double _lpython_return_variable; double x; - x = 1.000000e+00; + x = 1.00000000000000000e+00; _lpython_return_variable = x; return _lpython_return_variable; } @@ -42,7 +42,7 @@ std::complex test2() return _lpython_return_variable; } -int test3() +int32_t test3() { int _lpython_return_variable; std::complex x; diff --git a/tests/reference/cpp-expr3-9c516d4.json b/tests/reference/cpp-expr3-9c516d4.json index 9dca284343..76170817fe 100644 --- a/tests/reference/cpp-expr3-9c516d4.json +++ b/tests/reference/cpp-expr3-9c516d4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr3-9c516d4.stdout", - "stdout_hash": "b8ecf8d6b409722113f11d919c089f8f3dbdcbf06a161802d67734a8", + "stdout_hash": "e70b5b12dec6e5a6668e7f2500104f3b2d03cff16b376d01932aa1e5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-expr3-9c516d4.stdout b/tests/reference/cpp-expr3-9c516d4.stdout index f6eeeeb904..f74a71b5cc 100644 --- a/tests/reference/cpp-expr3-9c516d4.stdout +++ b/tests/reference/cpp-expr3-9c516d4.stdout @@ -22,11 +22,11 @@ void test_cast() int a; float b; a = 2; - b = 4.200000e+00; + b = 4.20000000000000018e+00; a = (float)(a)*b; b = b + (float)(1); a = 5; - a = (float)(a) - 3.900000e+00; + a = (float)(a) - 3.89999999999999991e+00; a = (float)(a)/b; b = (float)(3)/(float)(4); if ((float)(a) < b) { diff --git a/tests/reference/cpp-expr7-529bd53.json b/tests/reference/cpp-expr7-529bd53.json index c009fcbf27..62ea4ade12 100644 --- a/tests/reference/cpp-expr7-529bd53.json +++ b/tests/reference/cpp-expr7-529bd53.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr7-529bd53.stdout", - "stdout_hash": "46fafbd4a4248b83b2fbc2358d719bfb076d942aa6222c96ee8a1dd5", + "stdout_hash": "227536c5ef75ca8fd246a81458be780688da5eee1ad4548a9f0236f1", "stderr": "cpp-expr7-529bd53.stderr", "stderr_hash": "28509dd59a386eebd632340a550d14299cd2a921ef6dc3ac7dbe7fe9", "returncode": 0 diff --git a/tests/reference/cpp-expr7-529bd53.stdout b/tests/reference/cpp-expr7-529bd53.stdout index 8de5ed0d8e..b538a59827 100644 --- a/tests/reference/cpp-expr7-529bd53.stdout +++ b/tests/reference/cpp-expr7-529bd53.stdout @@ -35,7 +35,7 @@ void test_pow() a = __lpython_overloaded_0__pow(2, 2); } -int test_pow_1(int a, int b) +int32_t test_pow_1(int a, int b) { int _lpython_return_variable; int res; @@ -44,7 +44,7 @@ int test_pow_1(int a, int b) return _lpython_return_variable; } -int __lpython_overloaded_0__pow(int x, int y) +int32_t __lpython_overloaded_0__pow(int x, int y) { int _lpython_return_variable; _lpython_return_variable = std::pow(x, y); diff --git a/tests/reference/cpp-expr8-704cece.json b/tests/reference/cpp-expr8-704cece.json index ba54e48e3b..776395efae 100644 --- a/tests/reference/cpp-expr8-704cece.json +++ b/tests/reference/cpp-expr8-704cece.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr8-704cece.stdout", - "stdout_hash": "071feda7848c87c63c1e4ca9953618d775a36715fae915568c92e502", + "stdout_hash": "ec8070c7470e9a3b5cf8f32c2d8e5205615607f1d905771ecb2e9554", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-expr8-704cece.stdout b/tests/reference/cpp-expr8-704cece.stdout index 512280e268..6efa75524f 100644 --- a/tests/reference/cpp-expr8-704cece.stdout +++ b/tests/reference/cpp-expr8-704cece.stdout @@ -24,11 +24,11 @@ void test_binop() int x; float x2; x = std::pow(2, 3); - x2 = std::pow((float)(2), 3.500000e+00); + x2 = std::pow((float)(2), 3.50000000000000000e+00); x = 54 - 100; - x2 = 3.454000e+00 - 7.654300e+02 + 5.346000e+02; - x2 = 5.346565e+03*3.450000e+00; - x2 = std::pow(5.346565e+03, 3.450000e+00); + x2 = 3.45400000000000018e+00 - 7.65429999999999950e+02 + 5.34600000000000023e+02; + x2 = 5.34656499999999960e+03* 3.45000000000000018e+00; + x2 = std::pow( 5.34656499999999960e+03, 3.45000000000000018e+00); x = (int)(true) + (int)(true); x = (int)(true) - (int)(false); x = (int)(true)*(int)(false); @@ -39,14 +39,14 @@ void test_binop() x = std::pow((int)(b1), (int)(b2)); } -int __lpython_overloaded_2___lpython_floordiv(int a, int b) +int32_t __lpython_overloaded_2___lpython_floordiv(int a, int b) { int _lpython_return_variable; float r; int result; r = (float)(a)/(float)(b); result = (int)(r); - if (r >= 0.000000e+00 || (float)(result) == r) { + if (r >= 0.00000000000000000e+00 || (float)(result) == r) { _lpython_return_variable = result; return _lpython_return_variable; } diff --git a/tests/reference/cpp-expr9-48868e9.json b/tests/reference/cpp-expr9-48868e9.json index 22cb11674e..a4f4d76bd4 100644 --- a/tests/reference/cpp-expr9-48868e9.json +++ b/tests/reference/cpp-expr9-48868e9.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-expr9-48868e9.stdout", - "stdout_hash": "f0caa3bf4dd3580024fd228c21cff6dfd1c4075a32ebf54d2351b87e", + "stdout_hash": "e4d80059478260fc38f6128ed9b398d529e908e451a2d9df8071cf17", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-expr9-48868e9.stdout b/tests/reference/cpp-expr9-48868e9.stdout index e8d1ef8969..a43cc9280e 100644 --- a/tests/reference/cpp-expr9-48868e9.stdout +++ b/tests/reference/cpp-expr9-48868e9.stdout @@ -32,7 +32,7 @@ void main0() test_return_4(4); } -int test_return_1(int a) +int32_t test_return_1(int a) { int _lpython_return_variable; int x; @@ -50,7 +50,7 @@ std::string test_return_2(int a) return _lpython_return_variable; } -int test_return_3(int a) +int32_t test_return_3(int a) { int _lpython_return_variable; a = 3; diff --git a/tests/reference/cpp-loop1-0a8cf3b.json b/tests/reference/cpp-loop1-0a8cf3b.json index d35925f900..9040167864 100644 --- a/tests/reference/cpp-loop1-0a8cf3b.json +++ b/tests/reference/cpp-loop1-0a8cf3b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-loop1-0a8cf3b.stdout", - "stdout_hash": "fad0c25a88f2f0db7a19892665ff22891dbd482319179f3068c352e9", + "stdout_hash": "ceb7952e4ce0e6842e415d81e64e73275f9e16238a510684d3ce91ad", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-loop1-0a8cf3b.stdout b/tests/reference/cpp-loop1-0a8cf3b.stdout index 026387e41d..64352ea533 100644 --- a/tests/reference/cpp-loop1-0a8cf3b.stdout +++ b/tests/reference/cpp-loop1-0a8cf3b.stdout @@ -32,7 +32,7 @@ void main0() std::cout << i << j << std::endl; } -int test_factorial_1(int x) +int32_t test_factorial_1(int x) { int _lpython_return_variable; int result; @@ -49,7 +49,7 @@ int test_factorial_1(int x) return _lpython_return_variable; } -int test_factorial_2(int x) +int32_t test_factorial_2(int x) { int _lpython_return_variable; int i; @@ -62,7 +62,7 @@ int test_factorial_2(int x) return _lpython_return_variable; } -long long test_factorial_3(int x) +int64_t test_factorial_3(int x) { long long _lpython_return_variable; long long result; diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json index 6a9ec27522..38a76e4a69 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.json +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-test_builtin_pow-56b3f92.stdout", - "stdout_hash": "bf200a19a95d377015f0b1c3064f5facca6787040c3673e41a314902", + "stdout_hash": "bca42a3d6f19c83bdea0631d6382d42b4a29ec1a0cf226019d92f358", "stderr": "cpp-test_builtin_pow-56b3f92.stderr", "stderr_hash": "180e1adfbb0d9c63a2fffa31951bbd629b3f1950cf0d97ca1389efe5", "returncode": 0 diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stdout b/tests/reference/cpp-test_builtin_pow-56b3f92.stdout index cb1096bf09..f13418da43 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.stdout +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.stdout @@ -39,7 +39,7 @@ void test_pow() float p; int x; double y; - eps = 1.000000e-12; + eps = 9.99999999999999980e-13; a = 2; b = 5; assert (__lpython_overloaded_0__pow(a, b) == 32); @@ -59,7 +59,7 @@ void test_pow() i1 = 6; i2 = -3; f1 = (float)(525346)/(float)(66456); - f2 = 3.000000e+00; + f2 = 3.00000000000000000e+00; p = __lpython_overloaded_2__pow(f1, f2); f1 = __lpython_overloaded_4__pow(a, f2); f1 = __lpython_overloaded_5__pow(f2, a); @@ -67,24 +67,24 @@ void test_pow() assert (__lpython_overloaded_8__pow(b2, b1) == 0); assert (__lpython_overloaded_8__pow(b1, b2) == 1); assert (__lpython_overloaded_8__pow(false, false) == 1); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(a1, a2) - 3.179719e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(a2, a1) - 4.243999e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(x, y) - 1.251350e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(y, x) - 1.216700e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(x, 5.500000e+00) - 4.208883e+02) < eps); - assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(2, -1)) - 5.000000e-01) < eps); - assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(6, -4)) - 7.716049e-04) < eps); - assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(-3, -5)) + 4.115226e-03) < eps); - assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(6, -4)) - 7.716049e-04) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(4.500000e+00, 2.300000e+00) - 3.179719e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(2.300000e+00, 0.000000e+00) - 1.000000e+00) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(2.300000e+00, -1.500000e+00) - 2.866872e-01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(2, 3.400000e+00) - 1.055606e+01) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(2, -3.400000e+00) - 9.473229e-02) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(3.400000e+00, 9) - 6.071699e+04) < eps); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(0.000000e+00, 53) - 0.000000e+00) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(a1, a2) - 3.17971929089206000e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow(a2, a1) - 4.24399889427765871e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(x, y) - 1.25135025328431819e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(y, x) - 1.21669999999999980e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(x, 5.50000000000000000e+00) - 4.20888346239237194e+02) < eps); + assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(2, -1)) - 5.00000000000000000e-01) < eps); + assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(6, -4)) - 7.71604938271604895e-04) < eps); + assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(-3, -5)) + 4.11522633744856002e-03) < eps); + assert (__lpython_overloaded_0__abs((float)(__lpython_overloaded_0__pow(6, -4)) - 7.71604938271604895e-04) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow( 4.50000000000000000e+00, 2.29999999999999982e+00) - 3.17971929089206000e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, 0.00000000000000000e+00) - 1.00000000000000000e+00) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, - 1.50000000000000000e+00) - 2.86687162345994395e-01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(2, 3.39999999999999991e+00) - 1.05560632861831536e+01) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_6__pow(2, - 3.39999999999999991e+00) - 9.47322854068998882e-02) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow( 3.39999999999999991e+00, 9) - 6.07169927664639836e+04) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow( 0.00000000000000000e+00, 53) - 0.00000000000000000e+00) < eps); assert (__lpython_overloaded_0__pow(4, 2) == 16); - assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(-4.235000e+03, 52) - 3.948004e+188) < eps); + assert (__lpython_overloaded_0__abs(__lpython_overloaded_7__pow(- 4.23500000000000000e+03, 52) - 3.94800380598526379e+188) < eps); c1 = __lpython_overloaded_9__complex(4, 5); c1 = __lpython_overloaded_9__pow(c1, 4); } @@ -92,7 +92,7 @@ void test_pow() double __lpython_overloaded_0__abs(double x) { double _lpython_return_variable; - if (x >= 0.000000e+00) { + if (x >= 0.00000000000000000e+00) { _lpython_return_variable = x; return _lpython_return_variable; } else { @@ -102,14 +102,14 @@ double __lpython_overloaded_0__abs(double x) return _lpython_return_variable; } -int __lpython_overloaded_0__pow(int x, int y) +int32_t __lpython_overloaded_0__pow(int x, int y) { int _lpython_return_variable; _lpython_return_variable = std::pow(x, y); return _lpython_return_variable; } -long long __lpython_overloaded_1__pow(long long x, long long y) +int64_t __lpython_overloaded_1__pow(long long x, long long y) { long long _lpython_return_variable; _lpython_return_variable = std::pow(x, y); @@ -158,7 +158,7 @@ double __lpython_overloaded_7__pow(double x, int y) return _lpython_return_variable; } -int __lpython_overloaded_8__pow(bool x, bool y) +int32_t __lpython_overloaded_8__pow(bool x, bool y) { int _lpython_return_variable; if (y && !x) {