From f40f524c26a045b14fac6d6d8f76bef63412f2df Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:04:15 +0530 Subject: [PATCH 01/18] Fix merge conflicts --- integration_tests/test_str_attributes.py | 12 +++++++ src/lpython/semantics/python_ast_to_asr.cpp | 20 +++++++++-- src/lpython/semantics/python_comptime_eval.h | 3 +- src/runtime/lpython_builtin.py | 9 +++++ .../reference/asr-array_01_decl-39cf894.json | 8 +++++ .../asr-array_01_decl-39cf894.stderr | 17 +++++++++ .../asr-array_02_decl-e8f6874.stderr | 17 +++++++++ tests/reference/asr-arrays_01-a617b64.json | 2 +- tests/reference/asr-arrays_01-a617b64.stderr | 25 ++++++++----- tests/reference/asr-arrays_02-da94458.json | 2 +- tests/reference/asr-arrays_02-da94458.stderr | 22 +++++++++--- tests/reference/asr-arrays_03-de2e952.json | 2 +- tests/reference/asr-arrays_03-de2e952.stderr | 20 ++++++++--- tests/reference/asr-arrays_04-880407c.json | 2 +- tests/reference/asr-arrays_04-880407c.stderr | 20 ++++++++--- tests/reference/asr-arrays_05-ec8fbd5.json | 2 +- tests/reference/asr-arrays_05-ec8fbd5.stderr | 20 ++++++++--- tests/reference/asr-arrays_06-fbb09a3.json | 2 +- tests/reference/asr-arrays_06-fbb09a3.stderr | 20 ++++++++--- tests/reference/asr-arrays_07-de430fd.json | 2 +- tests/reference/asr-arrays_07-de430fd.stderr | 20 ++++++++--- tests/reference/asr-arrays_08-ba317a3.json | 2 +- tests/reference/asr-arrays_08-ba317a3.stderr | 20 ++++++++--- tests/reference/asr-arrays_09-50ee586.json | 2 +- tests/reference/asr-arrays_09-50ee586.stderr | 20 ++++++++--- tests/reference/asr-arrays_10-bc82d75.json | 2 +- tests/reference/asr-arrays_10-bc82d75.stderr | 20 ++++++++--- tests/reference/asr-arrays_11-fc505b4.json | 2 +- tests/reference/asr-arrays_11-fc505b4.stderr | 20 ++++++++--- tests/reference/asr-arrays_12-63d6f25.json | 2 +- tests/reference/asr-arrays_12-63d6f25.stderr | 20 ++++++++--- tests/reference/asr-arrays_13-b5fcc7e.json | 2 +- tests/reference/asr-arrays_13-b5fcc7e.stderr | 20 ++++++++--- tests/reference/asr-arrays_14-78be00e.json | 2 +- tests/reference/asr-arrays_14-78be00e.stderr | 20 ++++++++--- tests/reference/asr-bindc_02-bc1a7ea.stderr | 17 +++++++++ tests/reference/asr-bindc_03-95dbba7.json | 2 +- tests/reference/asr-bindc_03-95dbba7.stderr | 20 ++++++++--- tests/reference/asr-bindc_04-06bd800.json | 2 +- tests/reference/asr-bindc_04-06bd800.stderr | 22 +++++++++--- tests/reference/asr-cast-435c233.stderr | 11 ++++++ tests/reference/asr-complex1-f26c460.stderr | 11 ++++++ tests/reference/asr-constants1-5828e8a.stderr | 11 ++++++ .../reference/asr-elemental_01-b58df26.stderr | 17 +++++++++ tests/reference/asr-expr10-efcbb1b.stderr | 11 ++++++ tests/reference/asr-expr13-81bdb5a.stderr | 11 ++++++ tests/reference/asr-expr7-480ba2f.json | 4 +-- tests/reference/asr-expr7-480ba2f.stderr | 14 ++++---- tests/reference/asr-expr8-6beda60.stderr | 11 ++++++ tests/reference/asr-expr_05-3a37324.stderr | 11 ++++++ .../asr-generics_array_01-682b1b2.stderr | 17 +++++++++ .../asr-generics_array_02-22c8dc1.stderr | 17 +++++++++ .../asr-generics_array_02-22c8dc1.stdout | 4 +++ .../asr-generics_array_03-fb3706c.stderr | 17 +++++++++ .../asr-kwargs_02_error-7c91f8f.json | 2 +- .../asr-kwargs_02_error-7c91f8f.stderr | 16 ++++++--- tests/reference/asr-structs_05-fa98307.json | 8 +++++ tests/reference/asr-structs_05-fa98307.stderr | 17 +++++++++ tests/reference/asr-test_assign8-4b26e63.json | 2 +- .../reference/asr-test_assign8-4b26e63.stderr | 14 +++++--- tests/reference/asr-test_binop3-a67201d.json | 2 +- .../reference/asr-test_binop3-a67201d.stderr | 10 ++++-- .../asr-test_bool_binop-f856ef0.json | 8 +++++ .../asr-test_bool_binop-f856ef0.stderr | 11 ++++++ .../asr-test_builtin_bin-52ba9fa.stderr | 11 ++++++ .../asr-test_builtin_bool-330223a.stderr | 11 ++++++ .../asr-test_builtin_hex-64bd268.stderr | 11 ++++++ .../asr-test_builtin_oct-20b9066.stderr | 11 ++++++ .../asr-test_builtin_oct-20b9066.stdout | 36 +++++++++++++++++++ .../asr-test_builtin_pow-f02fcda.json | 4 +-- .../asr-test_builtin_pow-f02fcda.stderr | 10 ++++-- .../asr-test_builtin_pow-f02fcda.stdout | 36 +++++++++++++++++++ .../asr-test_builtin_round-7417a21.stderr | 11 ++++++ .../asr-test_complex_01-a6def58.stderr | 11 ++++++ .../asr-test_complex_01-a6def58.stdout | 36 +++++++++++++++++++ .../asr-test_complex_02-782ba2d.stderr | 11 ++++++ .../asr-test_complex_02-782ba2d.stdout | 36 +++++++++++++++++++ tests/reference/asr-test_dict13-683b290.json | 2 +- .../reference/asr-test_dict13-683b290.stderr | 12 +++++-- .../reference/asr-test_max_min-3c2fc51.stderr | 11 ++++++ .../reference/asr-test_max_min-3c2fc51.stdout | 12 +++++++ .../asr-test_numpy_03-e600a49.stderr | 17 +++++++++ .../asr-test_numpy_03-e600a49.stdout | 24 +++++++++++++ .../asr-test_numpy_04-ecbb614.stderr | 17 +++++++++ tests/reference/asr-test_pow-3f5d550.json | 4 +-- tests/reference/asr-test_pow-3f5d550.stderr | 10 ++++-- tests/reference/asr-test_pow1-581ef42.json | 2 +- tests/reference/asr-test_pow1-581ef42.stderr | 14 ++++---- tests/reference/asr-test_pow2-0dcbd7d.json | 2 +- tests/reference/asr-test_pow2-0dcbd7d.stderr | 14 ++++---- tests/reference/asr-test_pow3-79749ed.json | 2 +- tests/reference/asr-test_pow3-79749ed.stderr | 14 ++++---- tests/reference/asr-test_pow4-ef60978.json | 2 +- tests/reference/asr-test_pow4-ef60978.stderr | 14 ++++---- tests/reference/asr-vec_01-66ac423.stderr | 17 +++++++++ tests/reference/c-expr7-bb2692a.json | 4 +-- tests/reference/c-expr7-bb2692a.stderr | 14 ++++---- tests/reference/cpp-expr15-1661c0d.json | 10 +++--- tests/reference/cpp-expr15-1661c0d.stderr | 11 ++++++ tests/reference/cpp-expr7-529bd53.json | 8 ++--- tests/reference/cpp-expr7-529bd53.stderr | 14 ++++---- tests/reference/cpp-expr8-704cece.stderr | 11 ++++++ .../cpp-test_builtin_pow-56b3f92.json | 4 +-- .../cpp-test_builtin_pow-56b3f92.stderr | 10 ++++-- .../pass_loop_vectorise-vec_01-be9985e.stderr | 17 +++++++++ 105 files changed, 1064 insertions(+), 185 deletions(-) create mode 100644 tests/reference/asr-array_01_decl-39cf894.stderr create mode 100644 tests/reference/asr-array_02_decl-e8f6874.stderr create mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stderr create mode 100644 tests/reference/asr-cast-435c233.stderr create mode 100644 tests/reference/asr-complex1-f26c460.stderr create mode 100644 tests/reference/asr-constants1-5828e8a.stderr create mode 100644 tests/reference/asr-elemental_01-b58df26.stderr create mode 100644 tests/reference/asr-expr10-efcbb1b.stderr create mode 100644 tests/reference/asr-expr13-81bdb5a.stderr create mode 100644 tests/reference/asr-expr8-6beda60.stderr create mode 100644 tests/reference/asr-expr_05-3a37324.stderr create mode 100644 tests/reference/asr-generics_array_01-682b1b2.stderr create mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stderr create mode 100644 tests/reference/asr-generics_array_03-fb3706c.stderr create mode 100644 tests/reference/asr-structs_05-fa98307.stderr create mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stderr create mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stderr create mode 100644 tests/reference/asr-test_builtin_bool-330223a.stderr create mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stderr create mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stderr create mode 100644 tests/reference/asr-test_builtin_round-7417a21.stderr create mode 100644 tests/reference/asr-test_complex_01-a6def58.stderr create mode 100644 tests/reference/asr-test_complex_02-782ba2d.stderr create mode 100644 tests/reference/asr-test_max_min-3c2fc51.stderr create mode 100644 tests/reference/asr-test_numpy_03-e600a49.stderr create mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stderr create mode 100644 tests/reference/asr-vec_01-66ac423.stderr create mode 100644 tests/reference/cpp-expr15-1661c0d.stderr create mode 100644 tests/reference/cpp-expr8-704cece.stderr create mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr diff --git a/integration_tests/test_str_attributes.py b/integration_tests/test_str_attributes.py index 8e6f650c92..24e1886dba 100755 --- a/integration_tests/test_str_attributes.py +++ b/integration_tests/test_str_attributes.py @@ -276,6 +276,17 @@ def is_ascii(): s = "123 45 6" assert s.isascii() == True + +def isspace(): + assert "\n".isspace() == True + assert " ".isspace() == True + assert "\r".isspace() == True + + s:str = " " + assert s.isspace() == True + s: str = "a" + assert s.isspace() == False + def check(): capitalize() lower() @@ -290,5 +301,6 @@ def check(): is_upper() is_decimal() is_ascii() + isspace() check() diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 272d5a1c2c..e33f31682d 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -6651,7 +6651,7 @@ class BodyVisitor : public CommonVisitor { /* String Validation Methods i.e all "is" based functions are handled here */ - std::vector validation_methods{"lower", "upper", "decimal", "ascii"}; // Database of validation methods supported + std::vector validation_methods{"lower", "upper", "decimal", "ascii","space"}; // Database of validation methods supported std::string method_name = attr_name.substr(2); if(std::find(validation_methods.begin(),validation_methods.end(), method_name) == validation_methods.end()) { @@ -6919,7 +6919,7 @@ class BodyVisitor : public CommonVisitor { * islower() method is limited to English Alphabets currently * TODO: We can support other characters from Unicode Library */ - std::vector validation_methods{"lower", "upper", "decimal", "ascii"}; // Database of validation methods supported + std::vector validation_methods{"lower", "upper", "decimal", "ascii","space"}; // Database of validation methods supported std::string method_name = attr_name.substr(2); if(std::find(validation_methods.begin(),validation_methods.end(), method_name) == validation_methods.end()) { throw SemanticError("String method not implemented: " + attr_name, loc); @@ -6999,6 +6999,22 @@ class BodyVisitor : public CommonVisitor { tmp = ASR::make_LogicalConstant_t(al, loc, is_ascii, ASRUtils::TYPE(ASR::make_Logical_t(al, loc, 4))); return; + } else if(attr_name == "isspace") { + /* + * Specification: + Return true if all characters in the input string are considered whitespace characters, + as defined by the std::isspace function. Return false otherwise. + */ + bool is_space = true; + for (char i : s_var) { + if (!std::isspace(static_cast(i))) { + is_space = false; + break; + } + } + tmp = ASR::make_LogicalConstant_t(al, loc, is_space, + ASRUtils::TYPE(ASR::make_Logical_t(al, loc, 4))); + return; } else { throw SemanticError("'str' object has no attribute '" + attr_name + "'", loc); } diff --git a/src/lpython/semantics/python_comptime_eval.h b/src/lpython/semantics/python_comptime_eval.h index ecdc9c7b52..db52c8523e 100644 --- a/src/lpython/semantics/python_comptime_eval.h +++ b/src/lpython/semantics/python_comptime_eval.h @@ -92,7 +92,8 @@ struct PythonIntrinsicProcedures { {"_lpython_str_islower", {m_builtin, ¬_implemented}}, {"_lpython_str_isupper", {m_builtin, ¬_implemented}}, {"_lpython_str_isdecimal", {m_builtin, ¬_implemented}}, - {"_lpython_str_isascii", {m_builtin, ¬_implemented}} + {"_lpython_str_isascii", {m_builtin, ¬_implemented}}, + {"_lpython_str_isspace", {m_builtin, ¬_implemented}} }; } diff --git a/src/runtime/lpython_builtin.py b/src/runtime/lpython_builtin.py index a2faeb8ef1..4d3101cd28 100644 --- a/src/runtime/lpython_builtin.py +++ b/src/runtime/lpython_builtin.py @@ -858,6 +858,15 @@ def _lpython_str_isascii(s: str) -> bool: return False return True +@overload +def _lpython_str_isspace(s:str) -> bool: + ch:str + for ch in s: + if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\v': + return False + return True + + def list(s: str) -> list[str]: l: list[str] = [] i: i32 diff --git a/tests/reference/asr-array_01_decl-39cf894.json b/tests/reference/asr-array_01_decl-39cf894.json index ad322439fa..fe70e8917e 100644 --- a/tests/reference/asr-array_01_decl-39cf894.json +++ b/tests/reference/asr-array_01_decl-39cf894.json @@ -5,9 +5,17 @@ "infile_hash": "3dff59bab7475d254ce0470065c11e797e52a5b2a3d7546acc0e6705", "outfile": null, "outfile_hash": null, +<<<<<<< HEAD + "stdout": null, + "stdout_hash": null, + "stderr": "asr-array_01_decl-39cf894.stderr", + "stderr_hash": "5155e10cd4958bdda66178e2ed1b6faed6f415ff1cf3ff78e45f9cbb", + "returncode": 2 +======= "stdout": "asr-array_01_decl-39cf894.stdout", "stdout_hash": "24b1d1f4774489a87a82c51c4f4a797ca363f7efdb011e42936fc6b9", "stderr": null, "stderr_hash": null, "returncode": 0 +>>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-array_01_decl-39cf894.stderr b/tests/reference/asr-array_01_decl-39cf894.stderr new file mode 100644 index 0000000000..2ef3142ddf --- /dev/null +++ b/tests/reference/asr-array_01_decl-39cf894.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/array_01_decl.py:2:1 + | +2 | from numpy import empty, int16, int32, int64, float32, float64, complex64, complex128 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-array_02_decl-e8f6874.stderr b/tests/reference/asr-array_02_decl-e8f6874.stderr new file mode 100644 index 0000000000..143230f959 --- /dev/null +++ b/tests/reference/asr-array_02_decl-e8f6874.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/array_02_decl.py:2:1 + | +2 | from numpy import empty, int32, int64, float32, float64, complex64, complex128 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_01-a617b64.json b/tests/reference/asr-arrays_01-a617b64.json index 45a1b7310d..ca8f874250 100644 --- a/tests/reference/asr-arrays_01-a617b64.json +++ b/tests/reference/asr-arrays_01-a617b64.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_01-a617b64.stderr", - "stderr_hash": "b8317c7306f747ceefa8557c06f2a0b4a8a4bd7ae805bb494fca6ef2", + "stderr_hash": "ddb2640e06012a8ab9efe1bc1dbe130321fb96721ce3fd749813c988", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_01-a617b64.stderr b/tests/reference/asr-arrays_01-a617b64.stderr index 4fa39a8c3c..e712ee9cf1 100644 --- a/tests/reference/asr-arrays_01-a617b64.stderr +++ b/tests/reference/asr-arrays_01-a617b64.stderr @@ -1,8 +1,17 @@ -semantic error: Type mismatch in procedure call; the types must be compatible - --> tests/errors/arrays_01.py:15:9 - | -15 | [i8(214), i8(157), i8(3), i8(146)]) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch (passed argument type is list[i8] but required type is i8[4]) - | - 9 | a : i8[4] = empty(4, dtype=int8) - | ^^^^^ type mismatch (passed argument type is list[i8] but required type is i8[4]) +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_01.py:2:1 + | +2 | from numpy import empty, int8 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_02-da94458.json b/tests/reference/asr-arrays_02-da94458.json index 37de52ba40..2dfc6c7f7c 100644 --- a/tests/reference/asr-arrays_02-da94458.json +++ b/tests/reference/asr-arrays_02-da94458.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_02-da94458.stderr", - "stderr_hash": "dc0e5be7cd6de7395421aedf1ce11977206f3e35bb7cba271aed8992", + "stderr_hash": "b7b907310495016dfb487fccb13739865174dda44541ade08931bae9", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_02-da94458.stderr b/tests/reference/asr-arrays_02-da94458.stderr index 295e0c9b28..5229403208 100644 --- a/tests/reference/asr-arrays_02-da94458.stderr +++ b/tests/reference/asr-arrays_02-da94458.stderr @@ -1,5 +1,17 @@ -semantic error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() - --> tests/errors/arrays_02.py:28:8 - | -28 | assert r1.a == t1.a - | ^^^^^^^^^^^^ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_02.py:2:1 + | +2 | from numpy import (empty, int8) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_03-de2e952.json b/tests/reference/asr-arrays_03-de2e952.json index 1583b11b63..77b002c31e 100644 --- a/tests/reference/asr-arrays_03-de2e952.json +++ b/tests/reference/asr-arrays_03-de2e952.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_03-de2e952.stderr", - "stderr_hash": "4c932f31bbb10c9ba8d8d75be226ba9c33553be3bcb367c8112e31af", + "stderr_hash": "ddfa8ceea3cb39c9b59069d2a67d13c8752ec2511fc62c162e77b206", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_03-de2e952.stderr b/tests/reference/asr-arrays_03-de2e952.stderr index 1fb5635502..00df208054 100644 --- a/tests/reference/asr-arrays_03-de2e952.stderr +++ b/tests/reference/asr-arrays_03-de2e952.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_03.py:6:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_03.py:2:1 | -6 | x: i16[4] = empty([5], dtype=int16) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_04-880407c.json b/tests/reference/asr-arrays_04-880407c.json index 1c5077a22c..69bda74cc5 100644 --- a/tests/reference/asr-arrays_04-880407c.json +++ b/tests/reference/asr-arrays_04-880407c.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_04-880407c.stderr", - "stderr_hash": "10ef155b0236096d5de8157e38b3989d99343b016a8153b68a36aa54", + "stderr_hash": "ee2a3d13e91567e2924e0154d6c09db79923debe4c2733b246964808", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_04-880407c.stderr b/tests/reference/asr-arrays_04-880407c.stderr index 5cb27a1cb7..692cb026bf 100644 --- a/tests/reference/asr-arrays_04-880407c.stderr +++ b/tests/reference/asr-arrays_04-880407c.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_04.py:6:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_04.py:2:1 | -6 | x: i16[5] = empty([5], dtype=int32) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5]' and 'i32[5]') +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_05-ec8fbd5.json b/tests/reference/asr-arrays_05-ec8fbd5.json index a4302b38e0..8ff8c5a20d 100644 --- a/tests/reference/asr-arrays_05-ec8fbd5.json +++ b/tests/reference/asr-arrays_05-ec8fbd5.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_05-ec8fbd5.stderr", - "stderr_hash": "4e5d42a186b8d82b484ec66ccc5a3b90da7e4be8a32bac26ea906198", + "stderr_hash": "066b86f582348bb519b6a39a7e7421ac5a666b29d9ef96d753be0207", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_05-ec8fbd5.stderr b/tests/reference/asr-arrays_05-ec8fbd5.stderr index 165aee29a8..ee5cc62302 100644 --- a/tests/reference/asr-arrays_05-ec8fbd5.stderr +++ b/tests/reference/asr-arrays_05-ec8fbd5.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_05.py:6:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_05.py:2:1 | -6 | x: i16[5, 4] = empty([5, 3], dtype=int16) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5,4]' and 'i16[5,3]') +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_06-fbb09a3.json b/tests/reference/asr-arrays_06-fbb09a3.json index 863eeebf1e..8c473166fc 100644 --- a/tests/reference/asr-arrays_06-fbb09a3.json +++ b/tests/reference/asr-arrays_06-fbb09a3.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_06-fbb09a3.stderr", - "stderr_hash": "1fa3f5061a72f03c0678806c0460b9ec5caf01cbbd2f07a606f1057e", + "stderr_hash": "529c8dc2333a83b0b67feb5db104ea294258fdcac341dad9e314cfee", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_06-fbb09a3.stderr b/tests/reference/asr-arrays_06-fbb09a3.stderr index 9bbcde8ee8..8d8b27a690 100644 --- a/tests/reference/asr-arrays_06-fbb09a3.stderr +++ b/tests/reference/asr-arrays_06-fbb09a3.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_06.py:6:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_06.py:2:1 | -6 | x: i16[5, 4] = empty([5, 4], dtype=int32) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5,4]' and 'i32[5,4]') +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_07-de430fd.json b/tests/reference/asr-arrays_07-de430fd.json index 19a44750cc..a3c5bfc680 100644 --- a/tests/reference/asr-arrays_07-de430fd.json +++ b/tests/reference/asr-arrays_07-de430fd.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_07-de430fd.stderr", - "stderr_hash": "7fadea44b4ad8f383e0cadbd27a53eb3ab75f0edef98d27639527723", + "stderr_hash": "78a96ca7fbcae19b8cdaa9f9a2d18de003d7569070edb855bd07bff6", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_07-de430fd.stderr b/tests/reference/asr-arrays_07-de430fd.stderr index 7624d1fe92..f5f3ff9143 100644 --- a/tests/reference/asr-arrays_07-de430fd.stderr +++ b/tests/reference/asr-arrays_07-de430fd.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_07.py:6:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_07.py:2:1 | -6 | x: f32[5, 4] = empty([5, 4], dtype=complex64) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('f32[5,4]' and 'c32[5,4]') +2 | from numpy import empty, complex64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_08-ba317a3.json b/tests/reference/asr-arrays_08-ba317a3.json index 56982fe195..068d21e7d1 100644 --- a/tests/reference/asr-arrays_08-ba317a3.json +++ b/tests/reference/asr-arrays_08-ba317a3.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_08-ba317a3.stderr", - "stderr_hash": "bedb87b219b7c49a18cced170e4ffcac780d242f70c3ae8bbfb27a26", + "stderr_hash": "2c0dffd29d0f996f1403e49241e6fe1cfbf7df0ce479e4434c3a7c6a", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_08-ba317a3.stderr b/tests/reference/asr-arrays_08-ba317a3.stderr index e8f8eb441e..d5aad26c5b 100644 --- a/tests/reference/asr-arrays_08-ba317a3.stderr +++ b/tests/reference/asr-arrays_08-ba317a3.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_08.py:9:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_08.py:2:1 | -9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i64[100,120,200]' and 'i64[120,100,200]') +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_09-50ee586.json b/tests/reference/asr-arrays_09-50ee586.json index fa9b9de0df..1180b9b694 100644 --- a/tests/reference/asr-arrays_09-50ee586.json +++ b/tests/reference/asr-arrays_09-50ee586.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_09-50ee586.stderr", - "stderr_hash": "30bfc87e70c4b4688cf7162eec34dce8e52c959539d20ad8b79cf845", + "stderr_hash": "31ae490ebcebebc570a4846a32f1723dd3e9861f47c6805e9cc5e9b4", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_09-50ee586.stderr b/tests/reference/asr-arrays_09-50ee586.stderr index 58147a840d..efb877322b 100644 --- a/tests/reference/asr-arrays_09-50ee586.stderr +++ b/tests/reference/asr-arrays_09-50ee586.stderr @@ -1,5 +1,17 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. - --> tests/errors/arrays_09.py:9:12 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_09.py:2:1 | -9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64) - | ^ +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_10-bc82d75.json b/tests/reference/asr-arrays_10-bc82d75.json index 4599fd95cf..8125d1c0f8 100644 --- a/tests/reference/asr-arrays_10-bc82d75.json +++ b/tests/reference/asr-arrays_10-bc82d75.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_10-bc82d75.stderr", - "stderr_hash": "59e8cc91d7dae61bf60ec4d9cd23d62cdcb162e553bd64a3995fad19", + "stderr_hash": "12434839db5b4ef953cdf8002472348be5b31f95ed106f68c6646523", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_10-bc82d75.stderr b/tests/reference/asr-arrays_10-bc82d75.stderr index 7935120aa7..af28c4fcb3 100644 --- a/tests/reference/asr-arrays_10-bc82d75.stderr +++ b/tests/reference/asr-arrays_10-bc82d75.stderr @@ -1,5 +1,17 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. - --> tests/errors/arrays_10.py:9:36 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_10.py:2:1 | -9 | x: i64[100, 120, 200] = empty([q, p, r], dtype=int64) - | ^ +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_11-fc505b4.json b/tests/reference/asr-arrays_11-fc505b4.json index 22700cace0..31cf31d842 100644 --- a/tests/reference/asr-arrays_11-fc505b4.json +++ b/tests/reference/asr-arrays_11-fc505b4.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_11-fc505b4.stderr", - "stderr_hash": "ef5e89392b20ad345ba9bcf862ab71b19e56c85d9838db742be117a1", + "stderr_hash": "f5a3fde8bbd2fd083b1f1d2148c92c3ae71ef4aaaed74e725061cb94", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_11-fc505b4.stderr b/tests/reference/asr-arrays_11-fc505b4.stderr index 09cb02b625..1fd700c7b4 100644 --- a/tests/reference/asr-arrays_11-fc505b4.stderr +++ b/tests/reference/asr-arrays_11-fc505b4.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_11.py:5:1 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_11.py:2:1 | -5 | x: i16[4] = empty([5], dtype=int16) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_12-63d6f25.json b/tests/reference/asr-arrays_12-63d6f25.json index a032a5fad1..4f456715f5 100644 --- a/tests/reference/asr-arrays_12-63d6f25.json +++ b/tests/reference/asr-arrays_12-63d6f25.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_12-63d6f25.stderr", - "stderr_hash": "b6fa626301868bd5cbbef6d914f5b4f38b1d896b951753122969e74a", + "stderr_hash": "28d115256d1f8e36fdce5f2192e17e06c4b6daaa2166ece7bed3947c", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_12-63d6f25.stderr b/tests/reference/asr-arrays_12-63d6f25.stderr index 8000ae521d..4dc8ec210c 100644 --- a/tests/reference/asr-arrays_12-63d6f25.stderr +++ b/tests/reference/asr-arrays_12-63d6f25.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_12.py:5:1 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_12.py:2:1 | -5 | x: i16[5] = empty([5], dtype=int32) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5]' and 'i32[5]') +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_13-b5fcc7e.json b/tests/reference/asr-arrays_13-b5fcc7e.json index 3a17697702..d2c834ff6a 100644 --- a/tests/reference/asr-arrays_13-b5fcc7e.json +++ b/tests/reference/asr-arrays_13-b5fcc7e.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_13-b5fcc7e.stderr", - "stderr_hash": "6bde2f7fc14d5a461a58d694e44e19dd79ef5bee47c88b4022daf5d6", + "stderr_hash": "684ced8828de6debbd6d46dd706f9bbb993e8c85b22b656583c3a077", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_13-b5fcc7e.stderr b/tests/reference/asr-arrays_13-b5fcc7e.stderr index 14f0dbe414..1533a34f7a 100644 --- a/tests/reference/asr-arrays_13-b5fcc7e.stderr +++ b/tests/reference/asr-arrays_13-b5fcc7e.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_13.py:7:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_13.py:2:1 | -7 | x: i16[4] = empty(5, dtype=int16) - | ^ ^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_14-78be00e.json b/tests/reference/asr-arrays_14-78be00e.json index b41704e4d0..9a235f1984 100644 --- a/tests/reference/asr-arrays_14-78be00e.json +++ b/tests/reference/asr-arrays_14-78be00e.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_14-78be00e.stderr", - "stderr_hash": "267aea8e48708230a9b2bc61c37c849a0b75cb45294ca25ee11fe632", + "stderr_hash": "3539282cce2d83675ca57e47d093800765d28c5b74a04eb46457f715", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_14-78be00e.stderr b/tests/reference/asr-arrays_14-78be00e.stderr index ed7f661811..14bdfe6421 100644 --- a/tests/reference/asr-arrays_14-78be00e.stderr +++ b/tests/reference/asr-arrays_14-78be00e.stderr @@ -1,5 +1,17 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/arrays_14.py:7:5 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_14.py:2:1 | -7 | x: i16[4] = empty((5), dtype=int16) - | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stderr b/tests/reference/asr-bindc_02-bc1a7ea.stderr new file mode 100644 index 0000000000..0366febb6a --- /dev/null +++ b/tests/reference/asr-bindc_02-bc1a7ea.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/bindc_02.py:2:1 + | +2 | from numpy import empty, int16, array + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_03-95dbba7.json b/tests/reference/asr-bindc_03-95dbba7.json index 7ea004cc34..fa55114a3e 100644 --- a/tests/reference/asr-bindc_03-95dbba7.json +++ b/tests/reference/asr-bindc_03-95dbba7.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-bindc_03-95dbba7.stderr", - "stderr_hash": "371c3fc384c0e72448648d5a3734a373fe96ba258b261f0695ccb518", + "stderr_hash": "9225af71c044978cc3832abb4a60a5d13f6d143a8c4dc219e930eab9", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_03-95dbba7.stderr b/tests/reference/asr-bindc_03-95dbba7.stderr index ae2b810b6c..98e9a26f07 100644 --- a/tests/reference/asr-bindc_03-95dbba7.stderr +++ b/tests/reference/asr-bindc_03-95dbba7.stderr @@ -1,5 +1,17 @@ -semantic error: Target type specified in c_p_pointer must have deferred shape. - --> tests/errors/bindc_03.py:6:26 +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/bindc_03.py:3:1 | -6 | A: Pointer[i16[:]] = c_p_pointer(b, i16[n * k], array([k * n])) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | from numpy import array + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_04-06bd800.json b/tests/reference/asr-bindc_04-06bd800.json index 4772e98aa9..a19d71962d 100644 --- a/tests/reference/asr-bindc_04-06bd800.json +++ b/tests/reference/asr-bindc_04-06bd800.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-bindc_04-06bd800.stderr", - "stderr_hash": "20c105d0189cd06a197a6b1dda073a58f5c8ee0104230cf187960c46", + "stderr_hash": "6aa8aa05ae2628d04b771044165e1c9078ba3c5ae211906def3ff0be", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_04-06bd800.stderr b/tests/reference/asr-bindc_04-06bd800.stderr index 1a05ab5e55..704b35ab47 100644 --- a/tests/reference/asr-bindc_04-06bd800.stderr +++ b/tests/reference/asr-bindc_04-06bd800.stderr @@ -1,5 +1,17 @@ -semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. - --> tests/errors/bindc_04.py:20:12 - | -20 | C: i16[nk] = empty(nk, dtype=int16) - | ^^ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/bindc_04.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-cast-435c233.stderr b/tests/reference/asr-cast-435c233.stderr new file mode 100644 index 0000000000..74531e3791 --- /dev/null +++ b/tests/reference/asr-cast-435c233.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/cast.py:5:9 + | +5 | x = list(s) + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-complex1-f26c460.stderr b/tests/reference/asr-complex1-f26c460.stderr new file mode 100644 index 0000000000..b6f4d1d8f0 --- /dev/null +++ b/tests/reference/asr-complex1-f26c460.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/complex1.py:11:13 + | +11 | c = c32(complex()) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-constants1-5828e8a.stderr b/tests/reference/asr-constants1-5828e8a.stderr new file mode 100644 index 0000000000..d831d31282 --- /dev/null +++ b/tests/reference/asr-constants1-5828e8a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/constants1.py:5:9 + | +5 | b = bin(5) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-elemental_01-b58df26.stderr b/tests/reference/asr-elemental_01-b58df26.stderr new file mode 100644 index 0000000000..464e01fed8 --- /dev/null +++ b/tests/reference/asr-elemental_01-b58df26.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/elemental_01.py:2:1 + | +2 | from numpy import empty, sin, cos, reshape, int32, float32, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr10-efcbb1b.stderr b/tests/reference/asr-expr10-efcbb1b.stderr new file mode 100644 index 0000000000..e35c34b037 --- /dev/null +++ b/tests/reference/asr-expr10-efcbb1b.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr10.py:28:14 + | +28 | c = +c32(complex(1, 2)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr13-81bdb5a.stderr b/tests/reference/asr-expr13-81bdb5a.stderr new file mode 100644 index 0000000000..d05293f0a0 --- /dev/null +++ b/tests/reference/asr-expr13-81bdb5a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr13.py:9:9 + | +9 | a = complex(3, 4) == complex(3., 4.) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json index 0662b945e4..b6cc6873be 100644 --- a/tests/reference/asr-expr7-480ba2f.json +++ b/tests/reference/asr-expr7-480ba2f.json @@ -8,6 +8,6 @@ "stdout": "asr-expr7-480ba2f.stdout", "stdout_hash": "f2a3f371604ed6cb8460758126475e5d6bd7c6d1bee5c36b8df66162", "stderr": "asr-expr7-480ba2f.stderr", - "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", - "returncode": 0 + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-expr7-480ba2f.stderr b/tests/reference/asr-expr7-480ba2f.stderr index a4fad29beb..d1b84ec030 100644 --- a/tests/reference/asr-expr7-480ba2f.stderr +++ b/tests/reference/asr-expr7-480ba2f.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here -style suggestion: Could have used '**' instead of 'pow' - --> tests/expr7.py:8:15 - | -8 | res = i32(pow(a, b)) - | ^^^^^^^^^ '**' could be used instead +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr8-6beda60.stderr b/tests/reference/asr-expr8-6beda60.stderr new file mode 100644 index 0000000000..6e9d8d0f32 --- /dev/null +++ b/tests/reference/asr-expr8-6beda60.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr8.py:22:13 + | +22 | x = i32(b1//b1) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr_05-3a37324.stderr b/tests/reference/asr-expr_05-3a37324.stderr new file mode 100644 index 0000000000..a8b017fcee --- /dev/null +++ b/tests/reference/asr-expr_05-3a37324.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/expr_05.py:7:12 + | +7 | return a%b + | ^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_01-682b1b2.stderr b/tests/reference/asr-generics_array_01-682b1b2.stderr new file mode 100644 index 0000000000..91024d158c --- /dev/null +++ b/tests/reference/asr-generics_array_01-682b1b2.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_01.py:2:1 + | +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stderr b/tests/reference/asr-generics_array_02-22c8dc1.stderr new file mode 100644 index 0000000000..252a42ae21 --- /dev/null +++ b/tests/reference/asr-generics_array_02-22c8dc1.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_02.py:2:1 + | +2 | from numpy import empty, int32, float32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stdout b/tests/reference/asr-generics_array_02-22c8dc1.stdout index 4bbd63c4a5..22b8883224 100644 --- a/tests/reference/asr-generics_array_02-22c8dc1.stdout +++ b/tests/reference/asr-generics_array_02-22c8dc1.stdout @@ -28,7 +28,11 @@ __asr_generic_g_0: (Function (SymbolTable +<<<<<<< HEAD + 220 +======= 207 +>>>>>>> main { a: (Variable diff --git a/tests/reference/asr-generics_array_03-fb3706c.stderr b/tests/reference/asr-generics_array_03-fb3706c.stderr new file mode 100644 index 0000000000..873e342ad1 --- /dev/null +++ b/tests/reference/asr-generics_array_03-fb3706c.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_03.py:2:1 + | +2 | from numpy import empty, int32, float32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.json b/tests/reference/asr-kwargs_02_error-7c91f8f.json index 228d941171..bac9cf8743 100644 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.json +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-kwargs_02_error-7c91f8f.stderr", - "stderr_hash": "120e6e6838e464af15ff96aa99dcdda21923a3bb5f0c3d6d7cc8348b", + "stderr_hash": "d7988f2217bab99a6e782c6cb63f3d2f505b5d59c8976e4e4fab5042", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr index 9e13b4f43d..738691275d 100644 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr @@ -1,5 +1,11 @@ -semantic error: func02() got multiple values for argument 'b' - --> tests/errors/kwargs_02_error.py:13:5 - | -13 | func02(arg3, arg4, c=arg5, b=arg4) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/kwargs_02_error.py:4:12 + | +4 | return complex(float(a), b) + c + | ^^^^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-structs_05-fa98307.json b/tests/reference/asr-structs_05-fa98307.json index a0f7b5bf70..749a2183a7 100644 --- a/tests/reference/asr-structs_05-fa98307.json +++ b/tests/reference/asr-structs_05-fa98307.json @@ -5,9 +5,17 @@ "infile_hash": "ef1037b0936a63be679efd366920a94463900e80630a070ba440aa78", "outfile": null, "outfile_hash": null, +<<<<<<< HEAD + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_05-fa98307.stderr", + "stderr_hash": "9425960bac284eae21adb4274aa833960c505abd6bd546f896da0216", + "returncode": 2 +======= "stdout": "asr-structs_05-fa98307.stdout", "stdout_hash": "3f7e68ccebad6bea7e857ff10c72bf579bd9620b47635d9eeff31a46", "stderr": null, "stderr_hash": null, "returncode": 0 +>>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-structs_05-fa98307.stderr b/tests/reference/asr-structs_05-fa98307.stderr new file mode 100644 index 0000000000..ffff18de12 --- /dev/null +++ b/tests/reference/asr-structs_05-fa98307.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/structs_05.py:2:1 + | +2 | from numpy import empty + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_assign8-4b26e63.json b/tests/reference/asr-test_assign8-4b26e63.json index fb449632d9..3b0ecbbcd1 100644 --- a/tests/reference/asr-test_assign8-4b26e63.json +++ b/tests/reference/asr-test_assign8-4b26e63.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_assign8-4b26e63.stderr", - "stderr_hash": "c8ad8a6c89a23c0e2bd0cbaf7c9568625f093e526ff8ff26ae300e07", + "stderr_hash": "900fcd6359806b1e7ab41b6c5c4eb252bdbab6e96404912b710a8682", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_assign8-4b26e63.stderr b/tests/reference/asr-test_assign8-4b26e63.stderr index dcb47d9356..e320bd3600 100644 --- a/tests/reference/asr-test_assign8-4b26e63.stderr +++ b/tests/reference/asr-test_assign8-4b26e63.stderr @@ -1,5 +1,11 @@ -semantic error: readonly attribute - --> tests/errors/test_assign8.py:6:5 +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_assign8.py:5:13 | -6 | c.real = 5.0 - | ^^^^^^^^^^^^ +5 | c = c32(complex(3, 4)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_binop3-a67201d.json b/tests/reference/asr-test_binop3-a67201d.json index dc238a62cb..b93163a529 100644 --- a/tests/reference/asr-test_binop3-a67201d.json +++ b/tests/reference/asr-test_binop3-a67201d.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_binop3-a67201d.stderr", - "stderr_hash": "ff683b1bc0695903f2d2ea7bbd1963346fcb5f84bbfd10a4da0e27d7", + "stderr_hash": "00ec81e32ad3b0d4145714c7224146e9af7fd913aa87aa633667f4f2", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_binop3-a67201d.stderr b/tests/reference/asr-test_binop3-a67201d.stderr index 84e374e2f5..ea6ee12b1c 100644 --- a/tests/reference/asr-test_binop3-a67201d.stderr +++ b/tests/reference/asr-test_binop3-a67201d.stderr @@ -1,5 +1,11 @@ -semantic error: Type mismatch in binary operator; the types must be compatible +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_binop3.py:5:9 | 5 | y = complex(5)+100 - | ^^^^^^^^^^ ^^^ type mismatch (c32 and i32) + | ^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_bool_binop-f856ef0.json b/tests/reference/asr-test_bool_binop-f856ef0.json index b74825e8d7..ccc4cf7e29 100644 --- a/tests/reference/asr-test_bool_binop-f856ef0.json +++ b/tests/reference/asr-test_bool_binop-f856ef0.json @@ -5,9 +5,17 @@ "infile_hash": "7c44fe2915b3871b3b85edf3ab129d87a75fa4b9acbb597ae801daf9", "outfile": null, "outfile_hash": null, +<<<<<<< HEAD + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_bool_binop-f856ef0.stderr", + "stderr_hash": "7e1f44ed79212fae132aca28b495a511f27ee327b9bf88b797502eff", + "returncode": 2 +======= "stdout": "asr-test_bool_binop-f856ef0.stdout", "stdout_hash": "b2d6b1205576cabc7c44ae611eec55ba5af026dbd918972e05e8f7da", "stderr": null, "stderr_hash": null, "returncode": 0 +>>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stderr b/tests/reference/asr-test_bool_binop-f856ef0.stderr new file mode 100644 index 0000000000..725d3bd642 --- /dev/null +++ b/tests/reference/asr-test_bool_binop-f856ef0.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_bool_binop.py:14:13 + | +14 | i = i32(True // True) + | ^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr new file mode 100644 index 0000000000..06b339838a --- /dev/null +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_bin.py:6:12 + | +6 | assert bin(i) == "0b101" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bool-330223a.stderr b/tests/reference/asr-test_builtin_bool-330223a.stderr new file mode 100644 index 0000000000..6061f4823c --- /dev/null +++ b/tests/reference/asr-test_builtin_bool-330223a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_bool.py:56:13 + | +56 | c = c32(complex(2, 3)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stderr b/tests/reference/asr-test_builtin_hex-64bd268.stderr new file mode 100644 index 0000000000..40dc59a4e9 --- /dev/null +++ b/tests/reference/asr-test_builtin_hex-64bd268.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_hex.py:6:12 + | +6 | assert hex(i) == "0x22" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stderr b/tests/reference/asr-test_builtin_oct-20b9066.stderr new file mode 100644 index 0000000000..8bde6da6dc --- /dev/null +++ b/tests/reference/asr-test_builtin_oct-20b9066.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_oct.py:6:12 + | +6 | assert oct(i) == "0o42" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stdout b/tests/reference/asr-test_builtin_oct-20b9066.stdout index 0aa9d61529..06973cfab3 100644 --- a/tests/reference/asr-test_builtin_oct-20b9066.stdout +++ b/tests/reference/asr-test_builtin_oct-20b9066.stdout @@ -219,11 +219,35 @@ main_program: (Program (SymbolTable +<<<<<<< HEAD +<<<<<<< HEAD + 131 + { + __main__global_stmts: + (ExternalSymbol + 131 +======= +<<<<<<< HEAD + 120 + { + __main__global_stmts: + (ExternalSymbol + 120 +======= + 133 + { + __main__global_stmts: + (ExternalSymbol + 133 +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 120 { __main__global_stmts: (ExternalSymbol 120 +>>>>>>> main __main__global_stmts 2 __main__global_stmts __main__ @@ -235,7 +259,19 @@ main_program [__main__] [(SubroutineCall +<<<<<<< HEAD +<<<<<<< HEAD + 131 __main__global_stmts +======= +<<<<<<< HEAD + 120 __main__global_stmts +======= + 133 __main__global_stmts +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 120 __main__global_stmts +>>>>>>> main 2 __main__global_stmts [] () diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json index 7db2c1efd0..4aec745fd8 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.json +++ b/tests/reference/asr-test_builtin_pow-f02fcda.json @@ -8,6 +8,6 @@ "stdout": "asr-test_builtin_pow-f02fcda.stdout", "stdout_hash": "a7d94321eaec571a74e7b6c52bd9f200e814ae6511e4425f7363908e", "stderr": "asr-test_builtin_pow-f02fcda.stderr", - "stderr_hash": "859ce76c74748f2d32c7eab92cfbba789a78d4cbf5818646b99806ea", - "returncode": 0 + "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stderr b/tests/reference/asr-test_builtin_pow-f02fcda.stderr index 5dbb75ad24..e2d434b6f1 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stderr +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stderr @@ -1,5 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/../integration_tests/test_builtin_pow.py:11:16 | 11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stdout b/tests/reference/asr-test_builtin_pow-f02fcda.stdout index fb4a5219d8..03e652d428 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stdout +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stdout @@ -1892,11 +1892,35 @@ main_program: (Program (SymbolTable +<<<<<<< HEAD +<<<<<<< HEAD + 131 + { + __main__global_stmts: + (ExternalSymbol + 131 +======= +<<<<<<< HEAD + 120 + { + __main__global_stmts: + (ExternalSymbol + 120 +======= + 133 + { + __main__global_stmts: + (ExternalSymbol + 133 +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 120 { __main__global_stmts: (ExternalSymbol 120 +>>>>>>> main __main__global_stmts 2 __main__global_stmts __main__ @@ -1908,7 +1932,19 @@ main_program [__main__] [(SubroutineCall +<<<<<<< HEAD +<<<<<<< HEAD + 131 __main__global_stmts +======= +<<<<<<< HEAD + 120 __main__global_stmts +======= + 133 __main__global_stmts +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 120 __main__global_stmts +>>>>>>> main 2 __main__global_stmts [] () diff --git a/tests/reference/asr-test_builtin_round-7417a21.stderr b/tests/reference/asr-test_builtin_round-7417a21.stderr new file mode 100644 index 0000000000..570365512c --- /dev/null +++ b/tests/reference/asr-test_builtin_round-7417a21.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_round.py:6:12 + | +6 | assert round(f) == 6 + | ^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_01-a6def58.stderr b/tests/reference/asr-test_complex_01-a6def58.stderr new file mode 100644 index 0000000000..f87f59ca76 --- /dev/null +++ b/tests/reference/asr-test_complex_01-a6def58.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_complex_01.py:17:9 + | +17 | x = complex(4.5, 6.7) + | ^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_01-a6def58.stdout b/tests/reference/asr-test_complex_01-a6def58.stdout index 7255e4941a..9afdf1c930 100644 --- a/tests/reference/asr-test_complex_01-a6def58.stdout +++ b/tests/reference/asr-test_complex_01-a6def58.stdout @@ -1986,11 +1986,35 @@ main_program: (Program (SymbolTable +<<<<<<< HEAD +<<<<<<< HEAD + 135 + { + __main__global_stmts: + (ExternalSymbol + 135 +======= +<<<<<<< HEAD + 124 + { + __main__global_stmts: + (ExternalSymbol + 124 +======= + 137 + { + __main__global_stmts: + (ExternalSymbol + 137 +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 124 { __main__global_stmts: (ExternalSymbol 124 +>>>>>>> main __main__global_stmts 2 __main__global_stmts __main__ @@ -2002,7 +2026,19 @@ main_program [__main__] [(SubroutineCall +<<<<<<< HEAD +<<<<<<< HEAD + 135 __main__global_stmts +======= +<<<<<<< HEAD + 124 __main__global_stmts +======= + 137 __main__global_stmts +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 124 __main__global_stmts +>>>>>>> main 2 __main__global_stmts [] () diff --git a/tests/reference/asr-test_complex_02-782ba2d.stderr b/tests/reference/asr-test_complex_02-782ba2d.stderr new file mode 100644 index 0000000000..b61ce381bd --- /dev/null +++ b/tests/reference/asr-test_complex_02-782ba2d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_complex_02.py:5:13 + | +5 | x = c32(complex(3, 4)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_02-782ba2d.stdout b/tests/reference/asr-test_complex_02-782ba2d.stdout index 9935836c29..bb09e7e578 100644 --- a/tests/reference/asr-test_complex_02-782ba2d.stdout +++ b/tests/reference/asr-test_complex_02-782ba2d.stdout @@ -691,11 +691,35 @@ main_program: (Program (SymbolTable +<<<<<<< HEAD +<<<<<<< HEAD + 134 + { + __main__global_stmts: + (ExternalSymbol + 134 +======= +<<<<<<< HEAD + 123 + { + __main__global_stmts: + (ExternalSymbol + 123 +======= + 136 + { + __main__global_stmts: + (ExternalSymbol + 136 +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 123 { __main__global_stmts: (ExternalSymbol 123 +>>>>>>> main __main__global_stmts 2 __main__global_stmts __main__ @@ -707,7 +731,19 @@ main_program [__main__] [(SubroutineCall +<<<<<<< HEAD +<<<<<<< HEAD + 134 __main__global_stmts +======= +<<<<<<< HEAD + 123 __main__global_stmts +======= + 136 __main__global_stmts +>>>>>>> 1095cb6ff (Add isspace API in str) +>>>>>>> c359259eb (Add isspace API in str) +======= 123 __main__global_stmts +>>>>>>> main 2 __main__global_stmts [] () diff --git a/tests/reference/asr-test_dict13-683b290.json b/tests/reference/asr-test_dict13-683b290.json index 982bd80540..3f08b12f0a 100644 --- a/tests/reference/asr-test_dict13-683b290.json +++ b/tests/reference/asr-test_dict13-683b290.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_dict13-683b290.stderr", - "stderr_hash": "60bc3be332a1b638ade1cf40068ee4381ba4a79942a76c104c9cdebd", + "stderr_hash": "26039da2a42594ace7df2672a7bec3e88607caa7b45e35024b33df62", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_dict13-683b290.stderr b/tests/reference/asr-test_dict13-683b290.stderr index 9dc7b6ef9c..b22b070fa2 100644 --- a/tests/reference/asr-test_dict13-683b290.stderr +++ b/tests/reference/asr-test_dict13-683b290.stderr @@ -1,5 +1,11 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict13.py:2:11 +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_dict13.py:2:12 | 2 | print({complex(0.0, 1.0): 1.1}) # constant dict with complex value as key - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.stderr b/tests/reference/asr-test_max_min-3c2fc51.stderr new file mode 100644 index 0000000000..15c4a4ff5a --- /dev/null +++ b/tests/reference/asr-test_max_min-3c2fc51.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_max_min.py:7:12 + | +7 | assert max(a, b) == b + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.stdout b/tests/reference/asr-test_max_min-3c2fc51.stdout index 21fafa7072..6ebc1dd036 100644 --- a/tests/reference/asr-test_max_min-3c2fc51.stdout +++ b/tests/reference/asr-test_max_min-3c2fc51.stdout @@ -10,7 +10,11 @@ __main__global_stmts: (Function (SymbolTable +<<<<<<< HEAD + 136 +======= 123 +>>>>>>> main { }) @@ -787,11 +791,19 @@ main_program: (Program (SymbolTable +<<<<<<< HEAD + 137 + { + __main__global_stmts: + (ExternalSymbol + 137 +======= 124 { __main__global_stmts: (ExternalSymbol 124 +>>>>>>> main __main__global_stmts 2 __main__global_stmts __main__ diff --git a/tests/reference/asr-test_numpy_03-e600a49.stderr b/tests/reference/asr-test_numpy_03-e600a49.stderr new file mode 100644 index 0000000000..74f788b4cf --- /dev/null +++ b/tests/reference/asr-test_numpy_03-e600a49.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/test_numpy_03.py:2:1 + | +2 | from numpy import reshape, empty, int32, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_03-e600a49.stdout b/tests/reference/asr-test_numpy_03-e600a49.stdout index f145e74e8e..6d062b182d 100644 --- a/tests/reference/asr-test_numpy_03-e600a49.stdout +++ b/tests/reference/asr-test_numpy_03-e600a49.stdout @@ -985,6 +985,9 @@ [] .false. ) +<<<<<<< HEAD +<<<<<<< HEAD +======= [] [(Var 201 a)] [(= @@ -1627,6 +1630,7 @@ [] .false. ) +>>>>>>> main [test_nd_to_1d test_1d_to_nd] [] @@ -1639,6 +1643,26 @@ [((IntegerConstant 0 (Integer 4)) (IntegerConstant 16 (Integer 4))) ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 214 c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) (IntegerConstant 16 (Integer 4)))] FixedSizeArray ) diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stderr b/tests/reference/asr-test_numpy_04-ecbb614.stderr new file mode 100644 index 0000000000..7bc395d1fc --- /dev/null +++ b/tests/reference/asr-test_numpy_04-ecbb614.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/test_numpy_04.py:2:1 + | +2 | from numpy import array + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow-3f5d550.json b/tests/reference/asr-test_pow-3f5d550.json index b65280a0df..ecb315f814 100644 --- a/tests/reference/asr-test_pow-3f5d550.json +++ b/tests/reference/asr-test_pow-3f5d550.json @@ -8,6 +8,6 @@ "stdout": "asr-test_pow-3f5d550.stdout", "stdout_hash": "726fae2bb158304b087ba542674db17a8bc39ba174d234f8dcbe99f3", "stderr": "asr-test_pow-3f5d550.stderr", - "stderr_hash": "3d950301563cce75654f28bf41f6f53428ed1f5ae997774345f374a3", - "returncode": 0 + "stderr_hash": "13a950a0d1f29b9a7cf4484858b22246b086a24919ca22f6b1d410b3", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow-3f5d550.stderr b/tests/reference/asr-test_pow-3f5d550.stderr index 712d80384b..c955d6b4bc 100644 --- a/tests/reference/asr-test_pow-3f5d550.stderr +++ b/tests/reference/asr-test_pow-3f5d550.stderr @@ -1,5 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_pow.py:2:11 | 2 | print(pow(2, 2)) - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow1-581ef42.json b/tests/reference/asr-test_pow1-581ef42.json index a5584b1bc7..2ef657f3ac 100644 --- a/tests/reference/asr-test_pow1-581ef42.json +++ b/tests/reference/asr-test_pow1-581ef42.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow1-581ef42.stderr", - "stderr_hash": "7f7cc07cf6f08f2d953d6e6c1f4892e6379faaf8aa668117234293d0", + "stderr_hash": "32fe0eecb3687de0e976228815c25c96f3dc3e8f6491adb21c105ee6", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow1-581ef42.stderr b/tests/reference/asr-test_pow1-581ef42.stderr index fa7160f584..f1693701de 100644 --- a/tests/reference/asr-test_pow1-581ef42.stderr +++ b/tests/reference/asr-test_pow1-581ef42.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_pow1.py:4:11 | 4 | print(pow(x,3)) - | ^^^^^^^^ '**' could be used instead + | ^^^^^^^^ imported here -semantic error: Arguments do not match for any generic procedure, pow - --> tests/errors/test_pow1.py:4:11 - | -4 | print(pow(x,3)) - | ^^^^^^^^ +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow2-0dcbd7d.json b/tests/reference/asr-test_pow2-0dcbd7d.json index 083bc76b8d..129acc3859 100644 --- a/tests/reference/asr-test_pow2-0dcbd7d.json +++ b/tests/reference/asr-test_pow2-0dcbd7d.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow2-0dcbd7d.stderr", - "stderr_hash": "1d1d3a4a308e068439ac40685fcad6f29750560722b910be3341ce3c", + "stderr_hash": "54113068b55d3eab93cd04927b2fbf6a384a4a0ed64f02aa6ea18f9b", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow2-0dcbd7d.stderr b/tests/reference/asr-test_pow2-0dcbd7d.stderr index 896faa98e5..edc4007245 100644 --- a/tests/reference/asr-test_pow2-0dcbd7d.stderr +++ b/tests/reference/asr-test_pow2-0dcbd7d.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_pow2.py:12:11 | 12 | print(pow(a, b, c, d)) - | ^^^^^^^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^^^^^^^ imported here -semantic error: Arguments do not match for any generic procedure, pow - --> tests/errors/test_pow2.py:12:11 - | -12 | print(pow(a, b, c, d)) - | ^^^^^^^^^^^^^^^ +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow3-79749ed.json b/tests/reference/asr-test_pow3-79749ed.json index cd0f9f0d33..7c5d30d4da 100644 --- a/tests/reference/asr-test_pow3-79749ed.json +++ b/tests/reference/asr-test_pow3-79749ed.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow3-79749ed.stderr", - "stderr_hash": "4a6600740ad466d250f39b76130ab5ab796312b1ee89c2d72847500f", + "stderr_hash": "199c8dc10f23e2053ec5498131683383bb4b20bf06b05bf1c5f7d747", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow3-79749ed.stderr b/tests/reference/asr-test_pow3-79749ed.stderr index 6456498803..3a157a0866 100644 --- a/tests/reference/asr-test_pow3-79749ed.stderr +++ b/tests/reference/asr-test_pow3-79749ed.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_pow3.py:8:11 | 8 | print(pow(x, a)) - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here -semantic error: Arguments do not match for any generic procedure, pow - --> tests/errors/test_pow3.py:8:11 - | -8 | print(pow(x, a)) - | ^^^^^^^^^ +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow4-ef60978.json b/tests/reference/asr-test_pow4-ef60978.json index 2e98c401ce..8cfd3c1460 100644 --- a/tests/reference/asr-test_pow4-ef60978.json +++ b/tests/reference/asr-test_pow4-ef60978.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow4-ef60978.stderr", - "stderr_hash": "ddc8a81609479bf82d256c9cb8d4d54526bd6656632a0d1e2f1ada2c", + "stderr_hash": "e4796a76ca15b125485b820d259be4ce20ed67f403953372685b98d5", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow4-ef60978.stderr b/tests/reference/asr-test_pow4-ef60978.stderr index 0663475b44..2dc752cd36 100644 --- a/tests/reference/asr-test_pow4-ef60978.stderr +++ b/tests/reference/asr-test_pow4-ef60978.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/test_pow4.py:10:11 | 10 | print(pow(x, a, b)) - | ^^^^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^^^^ imported here -semantic error: Arguments do not match for any generic procedure, pow - --> tests/errors/test_pow4.py:10:11 - | -10 | print(pow(x, a, b)) - | ^^^^^^^^^^^^ +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-vec_01-66ac423.stderr b/tests/reference/asr-vec_01-66ac423.stderr new file mode 100644 index 0000000000..0371022cc6 --- /dev/null +++ b/tests/reference/asr-vec_01-66ac423.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/vec_01.py:2:1 + | +2 | from numpy import empty, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json index 84ee9e5ed5..ec97c6b237 100644 --- a/tests/reference/c-expr7-bb2692a.json +++ b/tests/reference/c-expr7-bb2692a.json @@ -8,6 +8,6 @@ "stdout": "c-expr7-bb2692a.stdout", "stdout_hash": "1d75b4cf61dcee73adafec2a5448c953bae5476aab2502115df2eecb", "stderr": "c-expr7-bb2692a.stderr", - "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", - "returncode": 0 + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/c-expr7-bb2692a.stderr b/tests/reference/c-expr7-bb2692a.stderr index a4fad29beb..d1b84ec030 100644 --- a/tests/reference/c-expr7-bb2692a.stderr +++ b/tests/reference/c-expr7-bb2692a.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here -style suggestion: Could have used '**' instead of 'pow' - --> tests/expr7.py:8:15 - | -8 | res = i32(pow(a, b)) - | ^^^^^^^^^ '**' could be used instead +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr15-1661c0d.json b/tests/reference/cpp-expr15-1661c0d.json index a75de781fb..812a9c4978 100644 --- a/tests/reference/cpp-expr15-1661c0d.json +++ b/tests/reference/cpp-expr15-1661c0d.json @@ -5,9 +5,9 @@ "infile_hash": "f3fa7c8efa999392edc0a94ff9c7820ed0c3f1e849c77655151b8d72", "outfile": null, "outfile_hash": null, - "stdout": "cpp-expr15-1661c0d.stdout", - "stdout_hash": "c6660bd5efa0a0602ea96a86d5c44220cb4390dea4eebf4cb16211bc", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-expr15-1661c0d.stderr", + "stderr_hash": "abb193cadddd4745a52610eabc746e5facafefb220f85ba3310a7498", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/cpp-expr15-1661c0d.stderr b/tests/reference/cpp-expr15-1661c0d.stderr new file mode 100644 index 0000000000..9b4deb20d2 --- /dev/null +++ b/tests/reference/cpp-expr15-1661c0d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr15.py:11:9 + | +11 | x = complex(2, 2) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr7-529bd53.json b/tests/reference/cpp-expr7-529bd53.json index 9697eaa92d..be1428115b 100644 --- a/tests/reference/cpp-expr7-529bd53.json +++ b/tests/reference/cpp-expr7-529bd53.json @@ -5,9 +5,9 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": "cpp-expr7-529bd53.stdout", - "stdout_hash": "8f72ce4b2d8f170884e171b1bdfa4a4ea07344825b6787d814a446cf", + "stdout": null, + "stdout_hash": null, "stderr": "cpp-expr7-529bd53.stderr", - "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", - "returncode": 0 + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/cpp-expr7-529bd53.stderr b/tests/reference/cpp-expr7-529bd53.stderr index a4fad29beb..d1b84ec030 100644 --- a/tests/reference/cpp-expr7-529bd53.stderr +++ b/tests/reference/cpp-expr7-529bd53.stderr @@ -1,11 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here -style suggestion: Could have used '**' instead of 'pow' - --> tests/expr7.py:8:15 - | -8 | res = i32(pow(a, b)) - | ^^^^^^^^^ '**' could be used instead +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr8-704cece.stderr b/tests/reference/cpp-expr8-704cece.stderr new file mode 100644 index 0000000000..6e9d8d0f32 --- /dev/null +++ b/tests/reference/cpp-expr8-704cece.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr8.py:22:13 + | +22 | x = i32(b1//b1) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json index a18ad0aab9..05ca48608a 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.json +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.json @@ -8,6 +8,6 @@ "stdout": "cpp-test_builtin_pow-56b3f92.stdout", "stdout_hash": "dec0af96e013cd38032672f4812f876e586bf697757278addd17b591", "stderr": "cpp-test_builtin_pow-56b3f92.stderr", - "stderr_hash": "859ce76c74748f2d32c7eab92cfbba789a78d4cbf5818646b99806ea", - "returncode": 0 + "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr index 5dbb75ad24..e2d434b6f1 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr @@ -1,5 +1,11 @@ -style suggestion: Could have used '**' instead of 'pow' +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/../integration_tests/test_builtin_pow.py:11:16 | 11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ '**' could be used instead + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr new file mode 100644 index 0000000000..0371022cc6 --- /dev/null +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/vec_01.py:2:1 + | +2 | from numpy import empty, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ From a4682276302587419b4dd5f43e6bd1815df9541d Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:10:17 +0530 Subject: [PATCH 02/18] Update reference tests --- tests/reference/asr-array_01_decl-39cf894.json | 8 -------- tests/reference/asr-array_02_decl-e8f6874.json | 10 +++++----- tests/reference/asr-bindc_02-bc1a7ea.json | 10 +++++----- tests/reference/asr-cast-435c233.json | 10 +++++----- tests/reference/asr-complex1-f26c460.json | 10 +++++----- tests/reference/asr-constants1-5828e8a.json | 10 +++++----- tests/reference/asr-elemental_01-b58df26.json | 10 +++++----- tests/reference/asr-expr10-efcbb1b.json | 10 +++++----- tests/reference/asr-expr13-81bdb5a.json | 10 +++++----- tests/reference/asr-expr7-480ba2f.json | 4 ++-- tests/reference/asr-expr8-6beda60.json | 10 +++++----- tests/reference/asr-expr_05-3a37324.json | 10 +++++----- tests/reference/asr-generics_array_01-682b1b2.json | 10 +++++----- tests/reference/asr-generics_array_02-22c8dc1.json | 10 +++++----- tests/reference/asr-generics_array_03-fb3706c.json | 10 +++++----- tests/reference/asr-string_02-499c9ff.json | 2 +- tests/reference/asr-string_02-499c9ff.stderr | 10 ++++++++-- tests/reference/asr-structs_05-fa98307.json | 8 -------- tests/reference/asr-test_bool_binop-f856ef0.json | 8 -------- tests/reference/asr-test_builtin_bin-52ba9fa.json | 10 +++++----- tests/reference/asr-test_builtin_bool-330223a.json | 10 +++++----- tests/reference/asr-test_builtin_hex-64bd268.json | 10 +++++----- tests/reference/asr-test_builtin_oct-20b9066.json | 10 +++++----- tests/reference/asr-test_builtin_pow-f02fcda.json | 4 ++-- tests/reference/asr-test_builtin_round-7417a21.json | 10 +++++----- tests/reference/asr-test_complex_01-a6def58.json | 10 +++++----- tests/reference/asr-test_complex_02-782ba2d.json | 10 +++++----- tests/reference/asr-test_max_min-3c2fc51.json | 10 +++++----- tests/reference/asr-test_numpy_03-e600a49.json | 10 +++++----- tests/reference/asr-test_numpy_04-ecbb614.json | 10 +++++----- tests/reference/asr-test_pow-3f5d550.json | 4 ++-- tests/reference/asr-test_zero_division-3dd84e8.json | 2 +- tests/reference/asr-test_zero_division-3dd84e8.stderr | 4 ++-- tests/reference/asr-test_zero_division2-d84989f.json | 2 +- tests/reference/asr-test_zero_division2-d84989f.stderr | 4 ++-- tests/reference/asr-vec_01-66ac423.json | 10 +++++----- tests/reference/c-expr7-bb2692a.json | 4 ++-- tests/reference/cpp-expr8-704cece.json | 10 +++++----- tests/reference/cpp-test_builtin_pow-56b3f92.json | 4 ++-- .../reference/pass_loop_vectorise-vec_01-be9985e.json | 10 +++++----- 40 files changed, 155 insertions(+), 173 deletions(-) diff --git a/tests/reference/asr-array_01_decl-39cf894.json b/tests/reference/asr-array_01_decl-39cf894.json index fe70e8917e..b23bdaa272 100644 --- a/tests/reference/asr-array_01_decl-39cf894.json +++ b/tests/reference/asr-array_01_decl-39cf894.json @@ -5,17 +5,9 @@ "infile_hash": "3dff59bab7475d254ce0470065c11e797e52a5b2a3d7546acc0e6705", "outfile": null, "outfile_hash": null, -<<<<<<< HEAD "stdout": null, "stdout_hash": null, "stderr": "asr-array_01_decl-39cf894.stderr", "stderr_hash": "5155e10cd4958bdda66178e2ed1b6faed6f415ff1cf3ff78e45f9cbb", "returncode": 2 -======= - "stdout": "asr-array_01_decl-39cf894.stdout", - "stdout_hash": "24b1d1f4774489a87a82c51c4f4a797ca363f7efdb011e42936fc6b9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 ->>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-array_02_decl-e8f6874.json b/tests/reference/asr-array_02_decl-e8f6874.json index 68dff93169..f59af233fa 100644 --- a/tests/reference/asr-array_02_decl-e8f6874.json +++ b/tests/reference/asr-array_02_decl-e8f6874.json @@ -5,9 +5,9 @@ "infile_hash": "9a398864499c7a3b4e2a480faf3a5dccaa65f9771a8de27f55f11ca4", "outfile": null, "outfile_hash": null, - "stdout": "asr-array_02_decl-e8f6874.stdout", - "stdout_hash": "a442d1685188ae1ac93a98e1c9d15aa8c9eb53cf7ef9d926911d941c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-array_02_decl-e8f6874.stderr", + "stderr_hash": "b9fd331511456947bef74d5df2f292244e7fa1861ab43918a6e02acd", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-bc1a7ea.json b/tests/reference/asr-bindc_02-bc1a7ea.json index c15e13d718..b8abd26275 100644 --- a/tests/reference/asr-bindc_02-bc1a7ea.json +++ b/tests/reference/asr-bindc_02-bc1a7ea.json @@ -5,9 +5,9 @@ "infile_hash": "a29f0f269c494419077ca8725e7c2d2dc7a5b4964d5c909347f1caa4", "outfile": null, "outfile_hash": null, - "stdout": "asr-bindc_02-bc1a7ea.stdout", - "stdout_hash": "01a64e5f6cf42ede674e82e44dae47760b77e108155c498d63ad4638", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_02-bc1a7ea.stderr", + "stderr_hash": "f35a1e2233396c7620436bb77c9e617e33e60fb9c92da2552280ed2c", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-cast-435c233.json b/tests/reference/asr-cast-435c233.json index 0e702578d8..8614194075 100644 --- a/tests/reference/asr-cast-435c233.json +++ b/tests/reference/asr-cast-435c233.json @@ -5,9 +5,9 @@ "infile_hash": "6e4219b25f4aa2035b57c9658dbb133f2dff55db0d9c128b19214f62", "outfile": null, "outfile_hash": null, - "stdout": "asr-cast-435c233.stdout", - "stdout_hash": "1d616232829e2d73cf1f82681176b8f5e82ae5159e9bc3b39794a33f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-cast-435c233.stderr", + "stderr_hash": "94b3ddb64aab37aa358cd260252df21698826606401d00e07c873603", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json index 4540a057eb..2eb40d0cd8 100644 --- a/tests/reference/asr-complex1-f26c460.json +++ b/tests/reference/asr-complex1-f26c460.json @@ -5,9 +5,9 @@ "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", "outfile": null, "outfile_hash": null, - "stdout": "asr-complex1-f26c460.stdout", - "stdout_hash": "8c3db4b88ed74a020b6a0ed76f47a65c3da89b2e0756dd260de0a9fb", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-complex1-f26c460.stderr", + "stderr_hash": "850f4cbe87b0a7ae8138fbfb71f94b82843abf09e50752159f900292", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json index efbf8f9bc1..5abb75edfe 100644 --- a/tests/reference/asr-constants1-5828e8a.json +++ b/tests/reference/asr-constants1-5828e8a.json @@ -5,9 +5,9 @@ "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", "outfile": null, "outfile_hash": null, - "stdout": "asr-constants1-5828e8a.stdout", - "stdout_hash": "8ad517b1fb9537e903479b813ed839f72c36608a890401e78187eaa1", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-constants1-5828e8a.stderr", + "stderr_hash": "ebf1574a4c5a5194ffa967d7e3a768aad6fe823a3eae7b48b0ea46f2", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-elemental_01-b58df26.json b/tests/reference/asr-elemental_01-b58df26.json index b4d36966d1..91ad0f8c5d 100644 --- a/tests/reference/asr-elemental_01-b58df26.json +++ b/tests/reference/asr-elemental_01-b58df26.json @@ -5,9 +5,9 @@ "infile_hash": "1d1eb8ce26df5817c1e474e4f69b0b96e53df362a31f1b722efaadf0", "outfile": null, "outfile_hash": null, - "stdout": "asr-elemental_01-b58df26.stdout", - "stdout_hash": "71cc6bc6a596fd628bad7572f8636622ef932ac2098ed3776f77099e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-elemental_01-b58df26.stderr", + "stderr_hash": "cd10f41e485a55b944782ec55b168ba07907570bc9c92869d02f705e", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json index 486fbbae27..62a4828972 100644 --- a/tests/reference/asr-expr10-efcbb1b.json +++ b/tests/reference/asr-expr10-efcbb1b.json @@ -5,9 +5,9 @@ "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", "outfile": null, "outfile_hash": null, - "stdout": "asr-expr10-efcbb1b.stdout", - "stdout_hash": "888daca8b770c13848943f1e1da7d63d29ce81e4beeaf050a042f7d4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr10-efcbb1b.stderr", + "stderr_hash": "32b0a64a7d73278b8d793b2991e8550827128c4df7fd48bc82d20311", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json index 9f0b756203..739e799cd5 100644 --- a/tests/reference/asr-expr13-81bdb5a.json +++ b/tests/reference/asr-expr13-81bdb5a.json @@ -5,9 +5,9 @@ "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", "outfile": null, "outfile_hash": null, - "stdout": "asr-expr13-81bdb5a.stdout", - "stdout_hash": "c07ed7eef3224ca374248cf1a964efd0159266de0351db244cc65639", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr13-81bdb5a.stderr", + "stderr_hash": "0699d234dbdd85c470cbdb001dd7447b9419e96ce3aafa7642a9edc3", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json index b6cc6873be..7d13377709 100644 --- a/tests/reference/asr-expr7-480ba2f.json +++ b/tests/reference/asr-expr7-480ba2f.json @@ -5,8 +5,8 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": "asr-expr7-480ba2f.stdout", - "stdout_hash": "f2a3f371604ed6cb8460758126475e5d6bd7c6d1bee5c36b8df66162", + "stdout": null, + "stdout_hash": null, "stderr": "asr-expr7-480ba2f.stderr", "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", "returncode": 2 diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json index 9fb8c510ab..7801dbd06d 100644 --- a/tests/reference/asr-expr8-6beda60.json +++ b/tests/reference/asr-expr8-6beda60.json @@ -5,9 +5,9 @@ "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", "outfile": null, "outfile_hash": null, - "stdout": "asr-expr8-6beda60.stdout", - "stdout_hash": "b79ac7dd790182c720f71316cdcedbd0a6b3b1bd56ef5cb800fab8dd", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr8-6beda60.stderr", + "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-expr_05-3a37324.json b/tests/reference/asr-expr_05-3a37324.json index 71dbc8d3d5..e366badac0 100644 --- a/tests/reference/asr-expr_05-3a37324.json +++ b/tests/reference/asr-expr_05-3a37324.json @@ -5,9 +5,9 @@ "infile_hash": "cc922bec30fac0a8eb10efd99f72234aa5638b3c9cd92c68044c69ea", "outfile": null, "outfile_hash": null, - "stdout": "asr-expr_05-3a37324.stdout", - "stdout_hash": "88a4e64ce40edc1bb143c2540b877787c0e123da28609e0e129c3b84", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr_05-3a37324.stderr", + "stderr_hash": "ec167ccde0bcc3539244c081abc86809b00655e649722a96f082d86b", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_01-682b1b2.json b/tests/reference/asr-generics_array_01-682b1b2.json index bce600e7c0..2da3a03bc0 100644 --- a/tests/reference/asr-generics_array_01-682b1b2.json +++ b/tests/reference/asr-generics_array_01-682b1b2.json @@ -5,9 +5,9 @@ "infile_hash": "6e943dd0e26ab4d1ffb6ed6909a365b4135b6f5295957b2478cfb479", "outfile": null, "outfile_hash": null, - "stdout": "asr-generics_array_01-682b1b2.stdout", - "stdout_hash": "03c8c6575d2998c550eb112986451ceea6f8f94324e9fe33a8999fc5", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_01-682b1b2.stderr", + "stderr_hash": "07809b586ef30105878e1532461ac0ad302722003d44d2ae71b4cb7a", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_02-22c8dc1.json b/tests/reference/asr-generics_array_02-22c8dc1.json index d120fab6da..b869c0013e 100644 --- a/tests/reference/asr-generics_array_02-22c8dc1.json +++ b/tests/reference/asr-generics_array_02-22c8dc1.json @@ -5,9 +5,9 @@ "infile_hash": "54b5f1d4b8fc7543c292ac0d6f7a39939816a657173937fa7dc02f07", "outfile": null, "outfile_hash": null, - "stdout": "asr-generics_array_02-22c8dc1.stdout", - "stdout_hash": "6060b35873ff8fc00781889af581731a8c7cb148d2423dfef06bc14a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_02-22c8dc1.stderr", + "stderr_hash": "ab2cfe57f54581e673039761ff5a42919ddb665b1083a36342cbe7e1", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_03-fb3706c.json b/tests/reference/asr-generics_array_03-fb3706c.json index af02823632..128484c0ae 100644 --- a/tests/reference/asr-generics_array_03-fb3706c.json +++ b/tests/reference/asr-generics_array_03-fb3706c.json @@ -5,9 +5,9 @@ "infile_hash": "5b415ae64a527ce3ab3b6878141238e227258bc2b2b8c37af6d23ff5", "outfile": null, "outfile_hash": null, - "stdout": "asr-generics_array_03-fb3706c.stdout", - "stdout_hash": "39ded0e74b830a48eddb106954df6ac01c167e2517a188d8baf246ca", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_03-fb3706c.stderr", + "stderr_hash": "7d636bddcd76853697423eb36c823f5898b8274b21a62a55f764b63b", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-string_02-499c9ff.json b/tests/reference/asr-string_02-499c9ff.json index ac33dbbf21..4eaad46910 100644 --- a/tests/reference/asr-string_02-499c9ff.json +++ b/tests/reference/asr-string_02-499c9ff.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-string_02-499c9ff.stderr", - "stderr_hash": "368ba74a1e0d6609f71e6f87f95bd0b6151420c81336e48a172cb613", + "stderr_hash": "85593e60baa6c6f930b7486a92e41fac9943108966abdacb7acb39ef", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-string_02-499c9ff.stderr b/tests/reference/asr-string_02-499c9ff.stderr index 196515476b..7ca613cb8c 100644 --- a/tests/reference/asr-string_02-499c9ff.stderr +++ b/tests/reference/asr-string_02-499c9ff.stderr @@ -1,5 +1,11 @@ -semantic error: str.join() takes type list only +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded --> tests/errors/string_02.py:6:15 | 6 | res:str = x.join(p) - | ^^^^^^^^^ + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-structs_05-fa98307.json b/tests/reference/asr-structs_05-fa98307.json index 749a2183a7..e493825921 100644 --- a/tests/reference/asr-structs_05-fa98307.json +++ b/tests/reference/asr-structs_05-fa98307.json @@ -5,17 +5,9 @@ "infile_hash": "ef1037b0936a63be679efd366920a94463900e80630a070ba440aa78", "outfile": null, "outfile_hash": null, -<<<<<<< HEAD "stdout": null, "stdout_hash": null, "stderr": "asr-structs_05-fa98307.stderr", "stderr_hash": "9425960bac284eae21adb4274aa833960c505abd6bd546f896da0216", "returncode": 2 -======= - "stdout": "asr-structs_05-fa98307.stdout", - "stdout_hash": "3f7e68ccebad6bea7e857ff10c72bf579bd9620b47635d9eeff31a46", - "stderr": null, - "stderr_hash": null, - "returncode": 0 ->>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-test_bool_binop-f856ef0.json b/tests/reference/asr-test_bool_binop-f856ef0.json index ccc4cf7e29..358216f8de 100644 --- a/tests/reference/asr-test_bool_binop-f856ef0.json +++ b/tests/reference/asr-test_bool_binop-f856ef0.json @@ -5,17 +5,9 @@ "infile_hash": "7c44fe2915b3871b3b85edf3ab129d87a75fa4b9acbb597ae801daf9", "outfile": null, "outfile_hash": null, -<<<<<<< HEAD "stdout": null, "stdout_hash": null, "stderr": "asr-test_bool_binop-f856ef0.stderr", "stderr_hash": "7e1f44ed79212fae132aca28b495a511f27ee327b9bf88b797502eff", "returncode": 2 -======= - "stdout": "asr-test_bool_binop-f856ef0.stdout", - "stdout_hash": "b2d6b1205576cabc7c44ae611eec55ba5af026dbd918972e05e8f7da", - "stderr": null, - "stderr_hash": null, - "returncode": 0 ->>>>>>> main } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.json b/tests/reference/asr-test_builtin_bin-52ba9fa.json index 7161e3a8b6..f617a29848 100644 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.json +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.json @@ -5,9 +5,9 @@ "infile_hash": "09e09eacf697c95f358b75f6491b766781bae9a5f856c2ad5848e824", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_bin-52ba9fa.stdout", - "stdout_hash": "b3d1005ae778682be163f4a836405735b4521430ea2d26bfc49cae12", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_bin-52ba9fa.stderr", + "stderr_hash": "f96ee9f35d47046bca3a9f0e40b965bf1b0e6654a0a4da0eb7a85e30", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bool-330223a.json b/tests/reference/asr-test_builtin_bool-330223a.json index aa9dd94fda..91858355b1 100644 --- a/tests/reference/asr-test_builtin_bool-330223a.json +++ b/tests/reference/asr-test_builtin_bool-330223a.json @@ -5,9 +5,9 @@ "infile_hash": "3a740faba0e36b55c179ab0fa08486dc3080332e79c8e38b8f25b4a4", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_bool-330223a.stdout", - "stdout_hash": "3752d25de1c20fd790217573771973e3af84ffbb1bdcd345099029e3", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_bool-330223a.stderr", + "stderr_hash": "5cf42029c7abd7dc2dedc535fff29c622c3871ec342b595c426b27f3", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_hex-64bd268.json b/tests/reference/asr-test_builtin_hex-64bd268.json index 06f2572907..2779c11099 100644 --- a/tests/reference/asr-test_builtin_hex-64bd268.json +++ b/tests/reference/asr-test_builtin_hex-64bd268.json @@ -5,9 +5,9 @@ "infile_hash": "e639f0251477f50376536d317630e3c026354859576a5f1b7b10bd7d", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_hex-64bd268.stdout", - "stdout_hash": "3ee188d377c463b59225031d3d1f0bf9384d91a8eef9c203f829fd30", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_hex-64bd268.stderr", + "stderr_hash": "22b2ae7d0d34d2406125547149511ab5990a5f2163c186c48c5c4f05", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_oct-20b9066.json b/tests/reference/asr-test_builtin_oct-20b9066.json index b88e3212f0..bb705fd111 100644 --- a/tests/reference/asr-test_builtin_oct-20b9066.json +++ b/tests/reference/asr-test_builtin_oct-20b9066.json @@ -5,9 +5,9 @@ "infile_hash": "c20249affa4787edf4ef56c881ebbcabdced311b5b908d9da6aceaeb", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_oct-20b9066.stdout", - "stdout_hash": "1032b2d04f48ec8a0bba1b13fbfe6764465b44b90e51702d9d098ce0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_oct-20b9066.stderr", + "stderr_hash": "986b90db11399243e0e1a9788da3876cbd8d7eecd273e46bc9437243", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json index 4aec745fd8..5bb87ef22b 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.json +++ b/tests/reference/asr-test_builtin_pow-f02fcda.json @@ -5,8 +5,8 @@ "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_pow-f02fcda.stdout", - "stdout_hash": "a7d94321eaec571a74e7b6c52bd9f200e814ae6511e4425f7363908e", + "stdout": null, + "stdout_hash": null, "stderr": "asr-test_builtin_pow-f02fcda.stderr", "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", "returncode": 2 diff --git a/tests/reference/asr-test_builtin_round-7417a21.json b/tests/reference/asr-test_builtin_round-7417a21.json index 4d65afb41e..efcd6cc31e 100644 --- a/tests/reference/asr-test_builtin_round-7417a21.json +++ b/tests/reference/asr-test_builtin_round-7417a21.json @@ -5,9 +5,9 @@ "infile_hash": "a4ff4032a45ce084eb524069046afb6ec44f1b24a667c84c7605f2c7", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_builtin_round-7417a21.stdout", - "stdout_hash": "efced280509a5f5e7b5e8197234ba1bf4bab25aba561082257bf31bc", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_round-7417a21.stderr", + "stderr_hash": "a58af3b9f4312b1036b728dc70928fe9c05f87d1b96d92b5c3da881f", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_complex_01-a6def58.json b/tests/reference/asr-test_complex_01-a6def58.json index 1d94b533bb..2a3e22a7fa 100644 --- a/tests/reference/asr-test_complex_01-a6def58.json +++ b/tests/reference/asr-test_complex_01-a6def58.json @@ -5,9 +5,9 @@ "infile_hash": "e580480b37e5bbfcd01d5eb412375a8a3c1ef374b5fedfb661485763", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_complex_01-a6def58.stdout", - "stdout_hash": "437162e161ea134837f68f4adb7cb115a3ca76bb1fb139ec64a7cff0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_complex_01-a6def58.stderr", + "stderr_hash": "5e372192068e09afc8e388039c24decbd5a11c27b4143b5643bebd10", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_complex_02-782ba2d.json b/tests/reference/asr-test_complex_02-782ba2d.json index 1f5c64e69b..3fa259e305 100644 --- a/tests/reference/asr-test_complex_02-782ba2d.json +++ b/tests/reference/asr-test_complex_02-782ba2d.json @@ -5,9 +5,9 @@ "infile_hash": "e6ee66d952deccec11d316a09f1d5b4bb4916ceb56a41a11dee03ae9", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_complex_02-782ba2d.stdout", - "stdout_hash": "6c9aa6962b8460ef6a7854c7a980f9a4fbfc982031fefd110dcff763", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_complex_02-782ba2d.stderr", + "stderr_hash": "dc3a153532aa537903852b8334a63d785edb99a11aff4e951c28b5c6", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_max_min-3c2fc51.json b/tests/reference/asr-test_max_min-3c2fc51.json index f215c7e43a..7c51d764ca 100644 --- a/tests/reference/asr-test_max_min-3c2fc51.json +++ b/tests/reference/asr-test_max_min-3c2fc51.json @@ -5,9 +5,9 @@ "infile_hash": "1aba932852adf8cc5dbff4a6ff83aa5de030dba5a5721eeace90a5d4", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_max_min-3c2fc51.stdout", - "stdout_hash": "5a3cbd3ae5c31da6a1b6f73c630c7182220bc60cefe3368efdae9ca5", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_max_min-3c2fc51.stderr", + "stderr_hash": "bc3642925ccc0f3f61e37e0bd20fc7100fddbfb37c06a3609ff78daf", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_03-e600a49.json b/tests/reference/asr-test_numpy_03-e600a49.json index 2423e90a9c..11537ffe29 100644 --- a/tests/reference/asr-test_numpy_03-e600a49.json +++ b/tests/reference/asr-test_numpy_03-e600a49.json @@ -5,9 +5,9 @@ "infile_hash": "5c3ea7436668441c056bd576ea77cdfb49e44a5f0e95088d0f62184e", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_numpy_03-e600a49.stdout", - "stdout_hash": "4ed432239936438278e7d3c4db3d9100bb70fbac91710e3961e5569f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_numpy_03-e600a49.stderr", + "stderr_hash": "934ed2ca36b7a4e431b1e4fc8dbd37edd550f7dbb5d9dca7ed49ce61", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_04-ecbb614.json b/tests/reference/asr-test_numpy_04-ecbb614.json index d0e74207c1..a0e2dcecdb 100644 --- a/tests/reference/asr-test_numpy_04-ecbb614.json +++ b/tests/reference/asr-test_numpy_04-ecbb614.json @@ -5,9 +5,9 @@ "infile_hash": "0fbd0a4280966dd9a917d3a005887954325fb1ea5468fd28dcae930f", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_numpy_04-ecbb614.stdout", - "stdout_hash": "0d7174d8ccec4f912b225d9d579a7f42e550d776dd28dc081fc16711", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_numpy_04-ecbb614.stderr", + "stderr_hash": "8f73238d34192a66d0659b3cc8e5f8a5339755da83a50790689cf53b", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow-3f5d550.json b/tests/reference/asr-test_pow-3f5d550.json index ecb315f814..95344abe65 100644 --- a/tests/reference/asr-test_pow-3f5d550.json +++ b/tests/reference/asr-test_pow-3f5d550.json @@ -5,8 +5,8 @@ "infile_hash": "073bf734150500a8b5e46940a9b0440e7e0fe30d0e2789ca049cef17", "outfile": null, "outfile_hash": null, - "stdout": "asr-test_pow-3f5d550.stdout", - "stdout_hash": "726fae2bb158304b087ba542674db17a8bc39ba174d234f8dcbe99f3", + "stdout": null, + "stdout_hash": null, "stderr": "asr-test_pow-3f5d550.stderr", "stderr_hash": "13a950a0d1f29b9a7cf4484858b22246b086a24919ca22f6b1d410b3", "returncode": 2 diff --git a/tests/reference/asr-test_zero_division-3dd84e8.json b/tests/reference/asr-test_zero_division-3dd84e8.json index 5c135e76d4..129e181bef 100644 --- a/tests/reference/asr-test_zero_division-3dd84e8.json +++ b/tests/reference/asr-test_zero_division-3dd84e8.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_zero_division-3dd84e8.stderr", - "stderr_hash": "e1770a0ba87c5155926e3d6bb3bd67e14a5c040b7584c4cf114a41b2", + "stderr_hash": "9403e36c7ace95241bf1d59a108732b298fbee5425c44455fb81ac77", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division-3dd84e8.stderr b/tests/reference/asr-test_zero_division-3dd84e8.stderr index 57611f2b32..7403437c96 100644 --- a/tests/reference/asr-test_zero_division-3dd84e8.stderr +++ b/tests/reference/asr-test_zero_division-3dd84e8.stderr @@ -1,5 +1,5 @@ -semantic error: Division by 0 is not allowed +semantic error: integer division by zero is not allowed --> tests/errors/test_zero_division.py:4:16 | 4 | print(i // 0) - | ^ + | ^ integer division by zero diff --git a/tests/reference/asr-test_zero_division2-d84989f.json b/tests/reference/asr-test_zero_division2-d84989f.json index f1fb7cbb0e..b9a7de7d1e 100644 --- a/tests/reference/asr-test_zero_division2-d84989f.json +++ b/tests/reference/asr-test_zero_division2-d84989f.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_zero_division2-d84989f.stderr", - "stderr_hash": "d2bac61e7df0875a7c93edb706661c80154b7b4d05dbf26663c36176", + "stderr_hash": "09fcb9f6244ddf2c2d14cd76ec91274cffd240e24e2b2f1c0697c8b5", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division2-d84989f.stderr b/tests/reference/asr-test_zero_division2-d84989f.stderr index 438ee0b6d4..8dc523a2a5 100644 --- a/tests/reference/asr-test_zero_division2-d84989f.stderr +++ b/tests/reference/asr-test_zero_division2-d84989f.stderr @@ -1,5 +1,5 @@ -semantic error: Division by 0 is not allowed +semantic error: float floor division by zero is not allowed --> tests/errors/test_zero_division2.py:4:16 | 4 | print(v // 0.0) - | ^^^ + | ^^^ float floor division by zero diff --git a/tests/reference/asr-vec_01-66ac423.json b/tests/reference/asr-vec_01-66ac423.json index bb3dec09d4..abd51bc145 100644 --- a/tests/reference/asr-vec_01-66ac423.json +++ b/tests/reference/asr-vec_01-66ac423.json @@ -5,9 +5,9 @@ "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", "outfile": null, "outfile_hash": null, - "stdout": "asr-vec_01-66ac423.stdout", - "stdout_hash": "8d933da14c566fd3d166c58d943c2d912b08f5439c9fd4a6d487b996", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "asr-vec_01-66ac423.stderr", + "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json index ec97c6b237..c0fcdfcb2c 100644 --- a/tests/reference/c-expr7-bb2692a.json +++ b/tests/reference/c-expr7-bb2692a.json @@ -5,8 +5,8 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": "c-expr7-bb2692a.stdout", - "stdout_hash": "1d75b4cf61dcee73adafec2a5448c953bae5476aab2502115df2eecb", + "stdout": null, + "stdout_hash": null, "stderr": "c-expr7-bb2692a.stderr", "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", "returncode": 2 diff --git a/tests/reference/cpp-expr8-704cece.json b/tests/reference/cpp-expr8-704cece.json index 1fac6d1530..5478fb2f70 100644 --- a/tests/reference/cpp-expr8-704cece.json +++ b/tests/reference/cpp-expr8-704cece.json @@ -5,9 +5,9 @@ "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", "outfile": null, "outfile_hash": null, - "stdout": "cpp-expr8-704cece.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-expr8-704cece.stderr", + "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", + "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json index 05ca48608a..346ddf6b70 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.json +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.json @@ -5,8 +5,8 @@ "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", "outfile": null, "outfile_hash": null, - "stdout": "cpp-test_builtin_pow-56b3f92.stdout", - "stdout_hash": "dec0af96e013cd38032672f4812f876e586bf697757278addd17b591", + "stdout": null, + "stdout_hash": null, "stderr": "cpp-test_builtin_pow-56b3f92.stderr", "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", "returncode": 2 diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json index 7fc7fff2e5..e023d7e0eb 100644 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json @@ -5,9 +5,9 @@ "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", "outfile": null, "outfile_hash": null, - "stdout": "pass_loop_vectorise-vec_01-be9985e.stdout", - "stdout_hash": "baa381dd5d203052002c17261471a3018958490dc0bc8d7d03f95219", - "stderr": null, - "stderr_hash": null, - "returncode": 0 + "stdout": null, + "stdout_hash": null, + "stderr": "pass_loop_vectorise-vec_01-be9985e.stderr", + "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", + "returncode": 2 } \ No newline at end of file From 18b2f70ff80f8e795de463abaf61758cba4ca368 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:29:32 +0530 Subject: [PATCH 03/18] Fix test references --- .../asr-array_01_decl-39cf894.stdout | 1043 ----- .../asr-array_02_decl-e8f6874.stdout | 833 ---- tests/reference/asr-bindc_02-bc1a7ea.stdout | 437 -- tests/reference/asr-cast-435c233.stdout | 312 -- tests/reference/asr-complex1-f26c460.stdout | 794 ---- tests/reference/asr-constants1-5828e8a.stdout | 1793 -------- .../reference/asr-elemental_01-b58df26.stdout | 3649 ----------------- tests/reference/asr-expr10-efcbb1b.stdout | 453 -- tests/reference/asr-expr13-81bdb5a.stdout | 473 --- tests/reference/asr-expr7-480ba2f.stdout | 371 -- tests/reference/asr-expr8-6beda60.stdout | 430 -- tests/reference/asr-expr_05-3a37324.stdout | 1642 -------- .../asr-generics_array_01-682b1b2.stdout | 459 --- .../asr-generics_array_02-22c8dc1.stdout | 1395 ------- .../asr-generics_array_03-fb3706c.stdout | 1880 --------- tests/reference/asr-structs_05-fa98307.stdout | 1476 ------- .../asr-test_bool_binop-f856ef0.stdout | 442 -- .../asr-test_builtin_bin-52ba9fa.stdout | 271 -- .../asr-test_builtin_bool-330223a.stdout | 896 ---- .../asr-test_builtin_hex-64bd268.stdout | 246 -- .../asr-test_builtin_oct-20b9066.stdout | 282 -- .../asr-test_builtin_pow-f02fcda.stdout | 1955 --------- .../asr-test_builtin_round-7417a21.stdout | 919 ----- .../asr-test_complex_01-a6def58.stdout | 2049 --------- .../asr-test_complex_02-782ba2d.stdout | 754 ---- .../reference/asr-test_max_min-3c2fc51.stdout | 826 ---- .../asr-test_numpy_03-e600a49.stdout | 1962 --------- .../asr-test_numpy_04-ecbb614.stdout | 519 --- tests/reference/asr-test_pow-3f5d550.stdout | 159 - tests/reference/asr-vec_01-66ac423.stdout | 295 -- tests/reference/c-expr7-bb2692a.stdout | 362 -- tests/reference/cpp-expr15-1661c0d.stdout | 92 - tests/reference/cpp-expr7-529bd53.stdout | 83 - tests/reference/cpp-expr8-704cece.stdout | 37 - .../cpp-test_builtin_pow-56b3f92.stdout | 269 -- .../pass_loop_vectorise-vec_01-be9985e.stdout | 527 --- 36 files changed, 30385 deletions(-) delete mode 100644 tests/reference/asr-array_01_decl-39cf894.stdout delete mode 100644 tests/reference/asr-array_02_decl-e8f6874.stdout delete mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stdout delete mode 100644 tests/reference/asr-cast-435c233.stdout delete mode 100644 tests/reference/asr-complex1-f26c460.stdout delete mode 100644 tests/reference/asr-constants1-5828e8a.stdout delete mode 100644 tests/reference/asr-elemental_01-b58df26.stdout delete mode 100644 tests/reference/asr-expr10-efcbb1b.stdout delete mode 100644 tests/reference/asr-expr13-81bdb5a.stdout delete mode 100644 tests/reference/asr-expr7-480ba2f.stdout delete mode 100644 tests/reference/asr-expr8-6beda60.stdout delete mode 100644 tests/reference/asr-expr_05-3a37324.stdout delete mode 100644 tests/reference/asr-generics_array_01-682b1b2.stdout delete mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stdout delete mode 100644 tests/reference/asr-generics_array_03-fb3706c.stdout delete mode 100644 tests/reference/asr-structs_05-fa98307.stdout delete mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stdout delete mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stdout delete mode 100644 tests/reference/asr-test_builtin_bool-330223a.stdout delete mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stdout delete mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stdout delete mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.stdout delete mode 100644 tests/reference/asr-test_builtin_round-7417a21.stdout delete mode 100644 tests/reference/asr-test_complex_01-a6def58.stdout delete mode 100644 tests/reference/asr-test_complex_02-782ba2d.stdout delete mode 100644 tests/reference/asr-test_max_min-3c2fc51.stdout delete mode 100644 tests/reference/asr-test_numpy_03-e600a49.stdout delete mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stdout delete mode 100644 tests/reference/asr-test_pow-3f5d550.stdout delete mode 100644 tests/reference/asr-vec_01-66ac423.stdout delete mode 100644 tests/reference/c-expr7-bb2692a.stdout delete mode 100644 tests/reference/cpp-expr15-1661c0d.stdout delete mode 100644 tests/reference/cpp-expr7-529bd53.stdout delete mode 100644 tests/reference/cpp-expr8-704cece.stdout delete mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.stdout delete mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout diff --git a/tests/reference/asr-array_01_decl-39cf894.stdout b/tests/reference/asr-array_01_decl-39cf894.stdout deleted file mode 100644 index 7afd122ab5..0000000000 --- a/tests/reference/asr-array_01_decl-39cf894.stdout +++ /dev/null @@ -1,1043 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - ArraySizes: - (EnumType - (SymbolTable - 201 - { - SIZE_10: - (Variable - 201 - SIZE_10 - [] - Local - (IntegerConstant 10 (Integer 4)) - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - SIZE_3: - (Variable - 201 - SIZE_3 - [] - Local - (IntegerConstant 3 (Integer 4)) - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - ArraySizes - [] - [SIZE_3 - SIZE_10] - Source - Public - IntegerUnique - (Integer 4) - () - ), - __main__global_stmts: - (Function - (SymbolTable - 208 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [declare_arrays] - [] - [(SubroutineCall - 2 declare_arrays - () - [] - () - )] - () - Public - .false. - .false. - () - ), - accept_f32_array: - (Function - (SymbolTable - 205 - { - _lpython_return_variable: - (Variable - 205 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - xf32: - (Variable - 205 - xf32 - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_f32_array - (FunctionType - [(Array - (Real 4) - [(() - ())] - DescriptorArray - )] - (Real 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 205 xf32)] - [(= - (ArrayItem - (Var 205 xf32) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (RealConstant - 32.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 32.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 205 _lpython_return_variable) - (ArrayItem - (Var 205 xf32) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - () - ) - (Return)] - (Var 205 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_f64_array: - (Function - (SymbolTable - 206 - { - _lpython_return_variable: - (Variable - 206 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - xf64: - (Variable - 206 - xf64 - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_f64_array - (FunctionType - [(Array - (Real 8) - [(() - ())] - DescriptorArray - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 206 xf64)] - [(= - (ArrayItem - (Var 206 xf64) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - (RealConstant - 64.000000 - (Real 8) - ) - () - ) - (= - (Var 206 _lpython_return_variable) - (ArrayItem - (Var 206 xf64) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - () - ) - (Return)] - (Var 206 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_i16_array: - (Function - (SymbolTable - 202 - { - _lpython_return_variable: - (Variable - 202 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 2) - () - Source - Public - Required - .false. - ), - xi16: - (Variable - 202 - xi16 - [] - InOut - () - () - Default - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_i16_array - (FunctionType - [(Array - (Integer 2) - [(() - ())] - DescriptorArray - )] - (Integer 2) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 xi16)] - [(= - (ArrayItem - (Var 202 xi16) - [(() - (IntegerConstant 2 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (Cast - (IntegerConstant 32 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 32 (Integer 2)) - ) - () - ) - (= - (Var 202 _lpython_return_variable) - (ArrayItem - (Var 202 xi16) - [(() - (IntegerConstant 2 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - () - ) - (Return)] - (Var 202 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_i32_array: - (Function - (SymbolTable - 203 - { - _lpython_return_variable: - (Variable - 203 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - xi32: - (Variable - 203 - xi32 - [] - InOut - () - () - Default - (Array - (Integer 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_i32_array - (FunctionType - [(Array - (Integer 4) - [(() - ())] - DescriptorArray - )] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 xi32)] - [(= - (ArrayItem - (Var 203 xi32) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 32 (Integer 4)) - () - ) - (= - (Var 203 _lpython_return_variable) - (ArrayItem - (Var 203 xi32) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - () - ) - (Return)] - (Var 203 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_i64_array: - (Function - (SymbolTable - 204 - { - _lpython_return_variable: - (Variable - 204 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - xi64: - (Variable - 204 - xi64 - [] - InOut - () - () - Default - (Array - (Integer 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_i64_array - (FunctionType - [(Array - (Integer 8) - [(() - ())] - DescriptorArray - )] - (Integer 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 204 xi64)] - [(= - (ArrayItem - (Var 204 xi64) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 8) - RowMajor - () - ) - (Cast - (IntegerConstant 64 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 64 (Integer 8)) - ) - () - ) - (= - (Var 204 _lpython_return_variable) - (ArrayItem - (Var 204 xi64) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 8) - RowMajor - () - ) - () - ) - (Return)] - (Var 204 _lpython_return_variable) - Public - .false. - .false. - () - ), - declare_arrays: - (Function - (SymbolTable - 207 - { - ac32: - (Variable - 207 - ac32 - [] - Local - () - () - Default - (Array - (Complex 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ac64: - (Variable - 207 - ac64 - [] - Local - () - () - Default - (Array - (Complex 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - af32: - (Variable - 207 - af32 - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - af64: - (Variable - 207 - af64 - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ai16: - (Variable - 207 - ai16 - [] - Local - () - () - Default - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ai32: - (Variable - 207 - ai32 - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ai64: - (Variable - 207 - ai64 - [] - Local - () - () - Default - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - declare_arrays - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [accept_i16_array - accept_i32_array - accept_i64_array - accept_f32_array - accept_f64_array] - [] - [(= - (Var 207 ai16) - (ArrayConstant - [] - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 ai32) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 ai64) - (ArrayConstant - [] - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 af32) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 af64) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 ac32) - (ArrayConstant - [] - (Array - (Complex 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 ac64) - (ArrayConstant - [] - (Array - (Complex 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (Print - () - [(FunctionCall - 2 accept_i16_array - () - [((ArrayPhysicalCast - (Var 207 ai16) - FixedSizeArray - DescriptorArray - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Integer 2) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_i32_array - () - [((ArrayPhysicalCast - (Var 207 ai32) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Integer 4) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_i64_array - () - [((ArrayPhysicalCast - (Var 207 ai64) - FixedSizeArray - DescriptorArray - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Integer 8) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_f32_array - () - [((ArrayPhysicalCast - (Var 207 af32) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Real 4) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_f64_array - () - [((ArrayPhysicalCast - (Var 207 af64) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Real 8) - () - () - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 209 - { - __main__global_stmts: - (ExternalSymbol - 209 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 209 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-array_02_decl-e8f6874.stdout b/tests/reference/asr-array_02_decl-e8f6874.stdout deleted file mode 100644 index d32364d9da..0000000000 --- a/tests/reference/asr-array_02_decl-e8f6874.stdout +++ /dev/null @@ -1,833 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 206 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [declare_arrays] - [] - [(SubroutineCall - 2 declare_arrays - () - [] - () - )] - () - Public - .false. - .false. - () - ), - accept_multidim_f32_array: - (Function - (SymbolTable - 203 - { - _lpython_return_variable: - (Variable - 203 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - xf32: - (Variable - 203 - xf32 - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_multidim_f32_array - (FunctionType - [(Array - (Real 4) - [(() - ())] - DescriptorArray - )] - (Real 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 xf32)] - [(= - (Var 203 _lpython_return_variable) - (ArrayItem - (Var 203 xf32) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - () - ) - (Return)] - (Var 203 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_multidim_f64_array: - (Function - (SymbolTable - 204 - { - _lpython_return_variable: - (Variable - 204 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - xf64: - (Variable - 204 - xf64 - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_multidim_f64_array - (FunctionType - [(Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 204 xf64)] - [(= - (Var 204 _lpython_return_variable) - (ArrayItem - (Var 204 xf64) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 1 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - () - ) - (Return)] - (Var 204 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_multidim_i32_array: - (Function - (SymbolTable - 201 - { - _lpython_return_variable: - (Variable - 201 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - xi32: - (Variable - 201 - xi32 - [] - InOut - () - () - Default - (Array - (Integer 4) - [(() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_multidim_i32_array - (FunctionType - [(Array - (Integer 4) - [(() - ()) - (() - ())] - DescriptorArray - )] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 201 xi32)] - [(= - (Var 201 _lpython_return_variable) - (ArrayItem - (Var 201 xi32) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - () - ) - (Return)] - (Var 201 _lpython_return_variable) - Public - .false. - .false. - () - ), - accept_multidim_i64_array: - (Function - (SymbolTable - 202 - { - _lpython_return_variable: - (Variable - 202 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - xi64: - (Variable - 202 - xi64 - [] - InOut - () - () - Default - (Array - (Integer 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - accept_multidim_i64_array - (FunctionType - [(Array - (Integer 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - )] - (Integer 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 xi64)] - [(= - (Var 202 _lpython_return_variable) - (ArrayItem - (Var 202 xi64) - [(() - (IntegerConstant 9 (Integer 4)) - ()) - (() - (IntegerConstant 9 (Integer 4)) - ()) - (() - (IntegerConstant 9 (Integer 4)) - ())] - (Integer 8) - RowMajor - () - ) - () - ) - (Return)] - (Var 202 _lpython_return_variable) - Public - .false. - .false. - () - ), - declare_arrays: - (Function - (SymbolTable - 205 - { - ac32: - (Variable - 205 - ac32 - [] - Local - () - () - Default - (Array - (Complex 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 99 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ac64: - (Variable - 205 - ac64 - [] - Local - () - () - Default - (Array - (Complex 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 13 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 11 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - af32: - (Variable - 205 - af32 - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - af64: - (Variable - 205 - af64 - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ai32: - (Variable - 205 - ai32 - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - ai64: - (Variable - 205 - ai64 - [] - Local - () - () - Default - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - declare_arrays - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [accept_multidim_i32_array - accept_multidim_i64_array - accept_multidim_f32_array - accept_multidim_f64_array] - [] - [(= - (Var 205 ai32) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 205 ai64) - (ArrayConstant - [] - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 205 af32) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 205 af64) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 205 ac32) - (ArrayConstant - [] - (Array - (Complex 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 99 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 205 ac64) - (ArrayConstant - [] - (Array - (Complex 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 13 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 11 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (Print - () - [(FunctionCall - 2 accept_multidim_i32_array - () - [((ArrayPhysicalCast - (Var 205 ai32) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Integer 4) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_multidim_i64_array - () - [((ArrayPhysicalCast - (Var 205 ai64) - FixedSizeArray - DescriptorArray - (Array - (Integer 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Integer 8) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_multidim_f32_array - () - [((ArrayPhysicalCast - (Var 205 af32) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Real 4) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 accept_multidim_f64_array - () - [((ArrayPhysicalCast - (Var 205 af64) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - DescriptorArray - ) - () - ))] - (Real 8) - () - () - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 207 - { - __main__global_stmts: - (ExternalSymbol - 207 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 207 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stdout b/tests/reference/asr-bindc_02-bc1a7ea.stdout deleted file mode 100644 index 9a45fc6312..0000000000 --- a/tests/reference/asr-bindc_02-bc1a7ea.stdout +++ /dev/null @@ -1,437 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 202 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(CPtrToPointer - (Var 2 queries) - (Var 2 x) - (ArrayConstant - [(IntegerConstant 1 (Integer 4))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - (ArrayConstant - [(IntegerConstant 0 (Integer 4))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - ) - (Print - () - [(Var 2 queries) - (Var 2 x)] - () - () - ) - (SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 201 - { - y: - (Variable - 201 - y - [] - Local - () - () - Default - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - yptr1: - (Variable - 201 - yptr1 - [] - Local - () - () - Default - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - Source - Public - Required - .false. - ), - yq: - (Variable - 201 - yq - [] - Local - () - () - Default - (CPtr) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 201 yq) - (PointerNullConstant - (CPtr) - ) - () - ) - (= - (Var 201 y) - (ArrayConstant - [] - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 201 y) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - ) - () - ) - (= - (ArrayItem - (Var 201 y) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - ) - () - ) - (= - (Var 201 yptr1) - (GetPointer - (Var 201 y) - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - ) - () - ) - (Print - () - [(GetPointer - (Var 201 y) - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - ) - (Var 201 yptr1)] - () - () - ) - (Print - () - [(ArrayItem - (Var 201 yptr1) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (ArrayItem - (Var 201 yptr1) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - )] - () - () - ) - (Assert - (IntegerCompare - (ArrayItem - (Var 201 yptr1) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - Eq - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (ArrayItem - (Var 201 yptr1) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - Eq - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - ) - (Logical 4) - () - ) - () - ) - (CPtrToPointer - (Var 201 yq) - (Var 201 yptr1) - (ArrayConstant - [(IntegerConstant 2 (Integer 4))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - (ArrayConstant - [(IntegerConstant 0 (Integer 4))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - ) - (Print - () - [(Var 201 yq) - (Var 201 yptr1)] - () - () - )] - () - Public - .false. - .false. - () - ), - queries: - (Variable - 2 - queries - [] - Local - (PointerNullConstant - (CPtr) - ) - (PointerNullConstant - (CPtr) - ) - Default - (CPtr) - () - Source - Public - Required - .false. - ), - x: - (Variable - 2 - x - [] - Local - () - () - Default - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - Source - Public - Required - .false. - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 203 - { - __main__global_stmts: - (ExternalSymbol - 203 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 203 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-cast-435c233.stdout b/tests/reference/asr-cast-435c233.stdout deleted file mode 100644 index aed92b3b98..0000000000 --- a/tests/reference/asr-cast-435c233.stdout +++ /dev/null @@ -1,312 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - list: - (ExternalSymbol - 3 - list - 4 list - lpython_builtin - [] - list - Private - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [list] - [] - [(= - (Var 3 s) - (StringConstant - "lpython" - (Character 1 7 ()) - ) - () - ) - (= - (Var 3 x) - (FunctionCall - 3 list - () - [((Var 3 s))] - (List - (Character 1 -2 ()) - ) - () - () - ) - () - ) - (= - (Var 3 y) - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 3 x) - (FunctionCall - 3 list - () - [((Var 3 y))] - (List - (Character 1 -2 ()) - ) - () - () - ) - () - ) - (= - (Var 3 x) - (ListConstant - [] - (List - (Character 1 -2 ()) - ) - ) - () - ) - (= - (Var 3 x) - (FunctionCall - 3 list - () - [((ListConstant - [] - (List - (Character 1 -2 ()) - ) - ))] - (List - (Character 1 -2 ()) - ) - (ListConstant - [] - (List - (Character 1 -2 ()) - ) - ) - () - ) - () - ) - (= - (Var 3 x) - (FunctionCall - 3 list - () - [((StringConstant - "lpython" - (Character 1 7 ()) - ))] - (List - (Character 1 -2 ()) - ) - (ListConstant - [(StringConstant - "l" - (Character 1 1 ()) - ) - (StringConstant - "p" - (Character 1 1 ()) - ) - (StringConstant - "y" - (Character 1 1 ()) - ) - (StringConstant - "t" - (Character 1 1 ()) - ) - (StringConstant - "h" - (Character 1 1 ()) - ) - (StringConstant - "o" - (Character 1 1 ()) - ) - (StringConstant - "n" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-complex1-f26c460.stdout b/tests/reference/asr-complex1-f26c460.stdout deleted file mode 100644 index 8076419ea1..0000000000 --- a/tests/reference/asr-complex1-f26c460.stdout +++ /dev/null @@ -1,794 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test: - (Function - (SymbolTable - 4 - { - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ) - }) - test - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 x) - (ComplexBinOp - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 2.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 3.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 4 y) - (ComplexBinOp - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 5.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 5.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 5.000000 - 5.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 4 z) - (Cast - (ComplexBinOp - (Var 4 x) - Add - (Var 4 y) - (Complex 8) - () - ) - ComplexToComplex - (Complex 4) - () - ) - () - ) - (= - (Var 4 z) - (Cast - (ComplexBinOp - (Var 4 x) - Sub - (Var 4 y) - (Complex 8) - () - ) - ComplexToComplex - (Complex 4) - () - ) - () - ) - (= - (Var 4 z) - (Cast - (ComplexBinOp - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 2.000000 - 0.000000 - (Complex 8) - ) - ) - Mul - (Var 4 x) - (Complex 8) - () - ) - ComplexToComplex - (Complex 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_complex: - (Function - (SymbolTable - 3 - { - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c1: - (Variable - 3 - c1 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c2: - (Variable - 3 - c2 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c3: - (Variable - 3 - c3 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 3 - complex - 5 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_0__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_0__complex - 5 __lpython_overloaded_0__complex - lpython_builtin - [] - __lpython_overloaded_0__complex - Public - ), - complex@__lpython_overloaded_13__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_13__complex - 5 __lpython_overloaded_13__complex - lpython_builtin - [] - __lpython_overloaded_13__complex - Public - ), - complex@__lpython_overloaded_1__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_1__complex - 5 __lpython_overloaded_1__complex - lpython_builtin - [] - __lpython_overloaded_1__complex - Public - ), - complex@__lpython_overloaded_2__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_2__complex - 5 __lpython_overloaded_2__complex - lpython_builtin - [] - __lpython_overloaded_2__complex - Public - ), - complex@__lpython_overloaded_5__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_5__complex - 5 __lpython_overloaded_5__complex - lpython_builtin - [] - __lpython_overloaded_5__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 5 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ) - }) - test_complex - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_0__complex - complex@__lpython_overloaded_1__complex - complex@__lpython_overloaded_5__complex - complex@__lpython_overloaded_2__complex - complex@__lpython_overloaded_9__complex - complex@__lpython_overloaded_13__complex] - [] - [(= - (Var 3 c) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_0__complex - 3 complex - [] - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_1__complex - 3 complex - [((RealConstant - 3.400000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.400000 - 0.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 3.400000 - 0.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_5__complex - 3 complex - [((RealConstant - 5.000000 - (Real 8) - )) - ((RealConstant - 4.300000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 5.000000 - 4.300000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 5.000000 - 4.300000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c) - (FunctionCall - 3 complex@__lpython_overloaded_2__complex - 3 complex - [((IntegerConstant 1 (Integer 4)))] - (Complex 4) - (ComplexConstant - 1.000000 - 0.000000 - (Complex 8) - ) - () - ) - () - ) - (= - (Var 3 c1) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c2) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_13__complex - 3 complex - [((IntegerConstant 2 (Integer 4))) - ((RealConstant - 4.500000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 2.000000 - 4.500000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 2.000000 - 4.500000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c3) - (FunctionCall - 3 complex@__lpython_overloaded_5__complex - 3 complex - [((RealConstant - 3.000000 - (Real 8) - )) - ((RealConstant - 4.000000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - () - ) - (= - (Var 3 b) - (ComplexCompare - (Var 3 c1) - NotEq - (Var 3 c2) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (ComplexCompare - (Cast - (Var 3 c1) - ComplexToComplex - (Complex 8) - () - ) - Eq - (Var 3 c3) - (Logical 4) - () - ) - () - ) - (= - (Var 3 c) - (ComplexBinOp - (Var 3 c1) - Add - (Var 3 c2) - (Complex 4) - () - ) - () - ) - (= - (Var 3 c) - (ComplexBinOp - (Var 3 c2) - Sub - (Var 3 c1) - (Complex 4) - () - ) - () - ) - (= - (Var 3 c) - (ComplexBinOp - (Var 3 c1) - Mul - (Var 3 c2) - (Complex 4) - () - ) - () - ) - (= - (Var 3 c) - (Cast - (ComplexBinOp - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Complex 8) - (ComplexConstant - 1.000000 - 2.000000 - (Complex 8) - ) - () - ) - Pow - (FunctionCall - 3 complex@__lpython_overloaded_5__complex - 3 complex - [((RealConstant - 3.345340 - (Real 8) - )) - ((RealConstant - 4.867868 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.345340 - 4.867868 - (Complex 8) - ) - () - ) - (Complex 8) - (ComplexConstant - 0.015553 - 0.065561 - (Complex 8) - ) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.015553 - 0.065561 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c) - (Cast - (ComplexBinOp - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Complex 8) - (ComplexConstant - 1.000000 - 2.000000 - (Complex 8) - ) - () - ) - Mul - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - (Complex 8) - (ComplexConstant - -5.000000 - 10.000000 - (Complex 8) - ) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - -5.000000 - 10.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c) - (Cast - (ComplexBinOp - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 4 (Integer 4))) - ((IntegerConstant 5 (Integer 4)))] - (Complex 8) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 8) - ) - () - ) - Sub - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - (Complex 8) - (ComplexConstant - 1.000000 - 1.000000 - (Complex 8) - ) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 1.000000 - 1.000000 - (Complex 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-constants1-5828e8a.stdout b/tests/reference/asr-constants1-5828e8a.stdout deleted file mode 100644 index e1ac329855..0000000000 --- a/tests/reference/asr-constants1-5828e8a.stdout +++ /dev/null @@ -1,1793 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_abs: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 5 - complex - 13 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_5__complex: - (ExternalSymbol - 5 - complex@__lpython_overloaded_5__complex - 13 __lpython_overloaded_5__complex - lpython_builtin - [] - __lpython_overloaded_5__complex - Public - ) - }) - test_abs - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_5__complex] - [] - [(= - (Var 5 a) - (IntrinsicScalarFunction - Abs - [(IntegerConstant 5 (Integer 4))] - 0 - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - () - ) - (= - (Var 5 a) - (IntrinsicScalarFunction - Abs - [(IntegerUnaryMinus - (IntegerConstant 500 (Integer 4)) - (Integer 4) - (IntegerConstant -500 (Integer 4)) - )] - 0 - (Integer 4) - (IntegerConstant 500 (Integer 4)) - ) - () - ) - (= - (Var 5 a) - (IntrinsicScalarFunction - Abs - [(Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 5 a) - (IntrinsicScalarFunction - Abs - [(Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 5 b) - (Cast - (IntrinsicScalarFunction - Abs - [(RealConstant - 3.450000 - (Real 8) - )] - 0 - (Real 8) - (RealConstant - 3.450000 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 3.450000 - (Real 4) - ) - ) - () - ) - (= - (Var 5 b) - (Cast - (IntrinsicScalarFunction - Abs - [(RealUnaryMinus - (RealConstant - 5346.340000 - (Real 8) - ) - (Real 8) - (RealConstant - -5346.340000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 5346.340000 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 5346.340000 - (Real 4) - ) - ) - () - ) - (= - (Var 5 b) - (Cast - (IntrinsicScalarFunction - Abs - [(FunctionCall - 5 complex@__lpython_overloaded_5__complex - 5 complex - [((RealConstant - 3.450000 - (Real 8) - )) - ((RealConstant - 5.600000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.450000 - 5.600000 - (Complex 8) - ) - () - )] - 0 - (Real 8) - (RealConstant - 6.577424 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 6.577424 - (Real 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ), - test_bool: - (Function - (SymbolTable - 7 - { - a: - (Variable - 7 - a - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 7 - complex - 13 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 7 - complex@__lpython_overloaded_9__complex - 13 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ) - }) - test_bool - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_9__complex] - [] - [(= - (Var 7 a) - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 7 a) - (Cast - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - IntegerToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 7 a) - (Cast - (StringConstant - "" - (Character 1 0 ()) - ) - CharacterToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 7 a) - (Cast - (FunctionCall - 7 complex@__lpython_overloaded_9__complex - 7 complex - [((IntegerConstant 0 (Integer 4))) - ((IntegerConstant 0 (Integer 4)))] - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - () - ) - ComplexToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (Assert - (LogicalCompare - (Var 7 a) - Eq - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 7 a) - (Cast - (StringConstant - "t" - (Character 1 1 ()) - ) - CharacterToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 7 a) - (Cast - (RealConstant - 2.300000 - (Real 8) - ) - RealToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (LogicalCompare - (Var 7 a) - Eq - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_boz: - (Function - (SymbolTable - 3 - { - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - bin: - (ExternalSymbol - 3 - bin - 13 bin - lpython_builtin - [] - bin - Private - ), - hex: - (ExternalSymbol - 3 - hex - 13 hex - lpython_builtin - [] - hex - Private - ), - oct: - (ExternalSymbol - 3 - oct - 13 oct - lpython_builtin - [] - oct - Private - ) - }) - test_boz - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [bin - oct - hex] - [] - [(= - (Var 3 b) - (FunctionCall - 3 bin - () - [((IntegerConstant 5 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0b101" - (Character 1 5 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 bin - () - [((IntegerConstant 64 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0b1000000" - (Character 1 9 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 bin - () - [((IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0b1000010110" - (Character 1 13 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 oct - () - [((IntegerConstant 8 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0o10" - (Character 1 4 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 oct - () - [((IntegerConstant 56 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0o70" - (Character 1 4 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 oct - () - [((IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0o1026" - (Character 1 7 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 hex - () - [((IntegerConstant 42 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0x2a" - (Character 1 4 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 hex - () - [((IntegerConstant 12648430 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0xc0ffee" - (Character 1 8 ()) - ) - () - ) - () - ) - (= - (Var 3 b) - (FunctionCall - 3 hex - () - [((IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0x216" - (Character 1 6 ()) - ) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_callable: - (Function - (SymbolTable - 9 - { - a: - (Variable - 9 - a - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 9 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_callable - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 9 b) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 9 a) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (LogicalCompare - (Var 9 a) - Eq - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 9 a) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (LogicalCompare - (Var 9 a) - Eq - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 9 a) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (LogicalCompare - (Var 9 a) - Eq - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_divmod: - (Function - (SymbolTable - 12 - { - a: - (Variable - 12 - a - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ), - divmod: - (ExternalSymbol - 12 - divmod - 13 divmod - lpython_builtin - [] - divmod - Private - ) - }) - test_divmod - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [divmod] - [] - [(= - (Var 12 a) - (FunctionCall - 12 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 12 a) - (FunctionCall - 12 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 12 a) - (FunctionCall - 12 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 12 a) - (FunctionCall - 12 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 12 a) - (FunctionCall - 12 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)] - ) - ) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_float: - (Function - (SymbolTable - 11 - { - a: - (Variable - 11 - a - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - test_float - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 11 a) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 11 a) - (RealConstant - 4.560000 - (Real 8) - ) - () - ) - (= - (Var 11 a) - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 5.000000 - (Real 8) - ) - ) - () - ) - (= - (Var 11 a) - (Cast - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - IntegerToReal - (Real 8) - (RealConstant - -1.000000 - (Real 8) - ) - ) - () - ) - (= - (Var 11 a) - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToReal - (Real 8) - (RealConstant - 1.000000 - (Real 8) - ) - ) - () - ) - (= - (Var 11 a) - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToReal - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - () - )] - () - Public - .false. - .false. - () - ), - test_int: - (Function - (SymbolTable - 10 - { - a: - (Variable - 10 - a - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - test_int - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 10 a) - (IntegerConstant 0 (Integer 8)) - () - ) - (= - (Var 10 a) - (Cast - (RealConstant - 4.560000 - (Real 8) - ) - RealToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ) - () - ) - (= - (Var 10 a) - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - () - ) - (= - (Var 10 a) - (Cast - (RealUnaryMinus - (RealConstant - 5.000010 - (Real 8) - ) - (Real 8) - (RealConstant - -5.000010 - (Real 8) - ) - ) - RealToInteger - (Integer 8) - (IntegerConstant -5 (Integer 8)) - ) - () - ) - (= - (Var 10 a) - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - () - ) - (= - (Var 10 a) - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - () - ) - (= - (Var 10 a) - (IntegerConstant 5346 (Integer 8)) - () - )] - () - Public - .false. - .false. - () - ), - test_len: - (Function - (SymbolTable - 6 - { - a: - (Variable - 6 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 6 - l - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - test_len - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 a) - (StringLen - (StringConstant - "" - (Character 1 0 ()) - ) - (Integer 4) - (IntegerConstant 0 (Integer 4)) - ) - () - ) - (= - (Var 6 a) - (StringLen - (StringConstant - "test" - (Character 1 4 ()) - ) - (Integer 4) - (IntegerConstant 4 (Integer 4)) - ) - () - ) - (= - (Var 6 a) - (StringLen - (StringConstant - "this is a test" - (Character 1 14 ()) - ) - (Integer 4) - (IntegerConstant 14 (Integer 4)) - ) - () - ) - (= - (Var 6 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 6 a) - (TupleLen - (TupleConstant - [(TupleConstant - [(StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (RealConstant - 3.400000 - (Real 8) - )] - (Tuple - [(Character 1 1 ()) - (Character 1 1 ()) - (Real 8)] - ) - ) - (TupleConstant - [(StringConstant - "c" - (Character 1 1 ()) - ) - (IntegerConstant 3 (Integer 4)) - (RealConstant - 5.600000 - (Real 8) - )] - (Tuple - [(Character 1 1 ()) - (Integer 4) - (Real 8)] - ) - )] - (Tuple - [(Tuple - [(Character 1 1 ()) - (Character 1 1 ()) - (Real 8)] - ) - (Tuple - [(Character 1 1 ()) - (Integer 4) - (Real 8)] - )] - ) - ) - (Integer 4) - (IntegerConstant 2 (Integer 4)) - ) - () - ) - (= - (Var 6 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 6 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 6 a) - (SetLen - (SetConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (Set - (Integer 4) - ) - ) - (Integer 4) - () - ) - () - ) - (= - (Var 6 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) - () - ) - () - ) - (= - (Var 6 l) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 6 a) - (ListLen - (Var 6 l) - (Integer 4) - () - ) - () - ) - (ListAppend - (Var 6 l) - (IntegerConstant 5 (Integer 4)) - ) - (= - (Var 6 a) - (ListLen - (Var 6 l) - (Integer 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_ord_chr: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 4 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_ord_chr - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 a) - (StringOrd - (StringConstant - "5" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 53 (Integer 4)) - ) - () - ) - (= - (Var 4 s) - (StringChr - (IntegerConstant 43 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "+" - (Character 1 1 ()) - ) - ) - () - )] - () - Public - .false. - .false. - () - ), - test_str: - (Function - (SymbolTable - 8 - { - s: - (Variable - 8 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_str - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 8 s) - (StringConstant - "" - (Character 1 0 ()) - ) - () - ) - (= - (Var 8 s) - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "5" - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 8 s) - (Cast - (IntegerUnaryMinus - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant -4 (Integer 4)) - ) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "-4" - (Character 1 2 ()) - ) - ) - () - ) - (= - (Var 8 s) - (Cast - (RealConstant - 5.600000 - (Real 8) - ) - RealToCharacter - (Character 1 -2 ()) - (StringConstant - "5.6" - (Character 1 3 ()) - ) - ) - () - ) - (= - (Var 8 s) - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "True" - (Character 1 4 ()) - ) - ) - () - ) - (= - (Var 8 s) - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "False" - (Character 1 5 ()) - ) - ) - () - ) - (= - (Var 8 s) - (StringConstant - "5346" - (Character 1 4 ()) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 128 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-elemental_01-b58df26.stdout b/tests/reference/asr-elemental_01-b58df26.stdout deleted file mode 100644 index 3e3d44dd88..0000000000 --- a/tests/reference/asr-elemental_01-b58df26.stdout +++ /dev/null @@ -1,3649 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 234 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [elemental_sin - elemental_cos - elemental_trig_identity - elemental_sum - elemental_mul] - [] - [(SubroutineCall - 2 elemental_sin - () - [] - () - ) - (SubroutineCall - 2 elemental_cos - () - [] - () - ) - (SubroutineCall - 2 elemental_trig_identity - () - [] - () - ) - (SubroutineCall - 2 elemental_sum - () - [] - () - ) - (SubroutineCall - 2 elemental_mul - () - [] - () - )] - () - Public - .false. - .false. - () - ), - cos: - (ExternalSymbol - 2 - cos - 3 cos - numpy - [] - cos - Public - ), - elemental_cos: - (Function - (SymbolTable - 209 - { - array2d: - (Variable - 209 - array2d - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - cos2d: - (Variable - 209 - cos2d - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - cos@__lpython_overloaded_0__cos: - (ExternalSymbol - 209 - cos@__lpython_overloaded_0__cos - 3 __lpython_overloaded_0__cos - numpy - [] - __lpython_overloaded_0__cos - Public - ), - i: - (Variable - 209 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 209 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - elemental_cos - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [cos@__lpython_overloaded_0__cos - verify2d] - [] - [(= - (Var 209 array2d) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 209 cos2d) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 209 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 256 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 255 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 209 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 64 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 63 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 209 array2d) - [(() - (Var 209 i) - ()) - (() - (Var 209 j) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (IntegerBinOp - (Var 209 i) - Add - (Var 209 j) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - () - )] - )] - ) - (= - (Var 209 cos2d) - (RealBinOp - (FunctionCall - 209 cos@__lpython_overloaded_0__cos - 2 cos - [((Var 209 array2d))] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (SubroutineCall - 2 verify2d - () - [((ArrayPhysicalCast - (Var 209 array2d) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 209 cos2d) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 256 (Integer 4))) - ((IntegerConstant 64 (Integer 4)))] - () - )] - () - Public - .false. - .false. - () - ), - elemental_mul: - (Function - (SymbolTable - 207 - { - array_a: - (Variable - 207 - array_a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - array_b: - (Variable - 207 - array_b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - array_c: - (Variable - 207 - array_c - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 207 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 207 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 207 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - elemental_mul - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [verify1d_mul] - [] - [(= - (Var 207 array_a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 array_b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 207 array_c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 207 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 100 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 99 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 207 array_a) - [(() - (Var 207 i) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (Var 207 i) - IntegerToReal - (Real 8) - () - ) - () - )] - ) - (DoLoop - () - ((Var 207 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 100 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 99 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 207 array_b) - [(() - (Var 207 j) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (IntegerBinOp - (Var 207 j) - Add - (IntegerConstant 5 (Integer 4)) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - () - )] - ) - (= - (Var 207 array_c) - (RealBinOp - (RealBinOp - (RealBinOp - (Var 207 array_a) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - Mul - (RealConstant - 5.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - Mul - (RealBinOp - (Var 207 array_b) - Pow - (RealConstant - 3.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (SubroutineCall - 2 verify1d_mul - () - [((ArrayPhysicalCast - (Var 207 array_a) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 207 array_b) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 207 array_c) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 100 (Integer 4)))] - () - )] - () - Public - .false. - .false. - () - ), - elemental_sin: - (Function - (SymbolTable - 208 - { - array1d: - (Variable - 208 - array1d - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - arraynd: - (Variable - 208 - arraynd - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 208 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 208 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 208 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - sin1d: - (Variable - 208 - sin1d - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - sin@__lpython_overloaded_0__sin: - (ExternalSymbol - 208 - sin@__lpython_overloaded_0__sin - 3 __lpython_overloaded_0__sin - numpy - [] - __lpython_overloaded_0__sin - Public - ), - sin@__lpython_overloaded_1__sin: - (ExternalSymbol - 208 - sin@__lpython_overloaded_1__sin - 3 __lpython_overloaded_1__sin - numpy - [] - __lpython_overloaded_1__sin - Public - ), - sinnd: - (Variable - 208 - sinnd - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - elemental_sin - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [sin@__lpython_overloaded_1__sin - verify1d - sin@__lpython_overloaded_0__sin - verifynd] - [] - [(= - (Var 208 array1d) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 208 sin1d) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 208 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 256 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 255 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 208 array1d) - [(() - (Var 208 i) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (Var 208 i) - IntegerToReal - (Real 4) - () - ) - () - )] - ) - (= - (Var 208 sin1d) - (FunctionCall - 208 sin@__lpython_overloaded_1__sin - 2 sin - [((FunctionCall - 208 sin@__lpython_overloaded_1__sin - 2 sin - [((Var 208 array1d))] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - () - ))] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - () - ) - (SubroutineCall - 2 verify1d - () - [((ArrayPhysicalCast - (Var 208 array1d) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 208 sin1d) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 256 (Integer 4)))] - () - ) - (= - (Var 208 arraynd) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 208 sinnd) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 208 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 256 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 255 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 208 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 64 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 63 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 208 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 208 arraynd) - [(() - (Var 208 i) - ()) - (() - (Var 208 j) - ()) - (() - (Var 208 k) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (IntegerBinOp - (IntegerBinOp - (Var 208 i) - Add - (Var 208 j) - (Integer 4) - () - ) - Add - (Var 208 k) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - () - )] - )] - )] - ) - (= - (Var 208 sinnd) - (RealBinOp - (FunctionCall - 208 sin@__lpython_overloaded_0__sin - 2 sin - [((Var 208 arraynd))] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (SubroutineCall - 2 verifynd - () - [((ArrayPhysicalCast - (Var 208 arraynd) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 208 sinnd) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 256 (Integer 4))) - ((IntegerConstant 64 (Integer 4))) - ((IntegerConstant 16 (Integer 4)))] - () - )] - () - Public - .false. - .false. - () - ), - elemental_sum: - (Function - (SymbolTable - 206 - { - array_a: - (Variable - 206 - array_a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - array_b: - (Variable - 206 - array_b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - array_c: - (Variable - 206 - array_c - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 206 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 206 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 206 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - elemental_sum - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [verify1d_sum] - [] - [(= - (Var 206 array_a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 206 array_b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 206 array_c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 206 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 100 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 99 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 206 array_a) - [(() - (Var 206 i) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (Var 206 i) - IntegerToReal - (Real 8) - () - ) - () - )] - ) - (DoLoop - () - ((Var 206 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 100 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 99 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 206 array_b) - [(() - (Var 206 j) - ())] - (Real 8) - RowMajor - () - ) - (Cast - (IntegerBinOp - (Var 206 j) - Add - (IntegerConstant 5 (Integer 4)) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - () - )] - ) - (= - (Var 206 array_c) - (RealBinOp - (RealBinOp - (Var 206 array_a) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - Add - (RealBinOp - (RealConstant - 5.000000 - (Real 8) - ) - Mul - (RealBinOp - (Var 206 array_b) - Pow - (RealConstant - 3.000000 - (Real 8) - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (SubroutineCall - 2 verify1d_sum - () - [((ArrayPhysicalCast - (Var 206 array_a) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 206 array_b) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 206 array_c) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 100 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 100 (Integer 4)))] - () - )] - () - Public - .false. - .false. - () - ), - elemental_trig_identity: - (Function - (SymbolTable - 210 - { - arraynd: - (Variable - 210 - arraynd - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - cos@__lpython_overloaded_1__cos: - (ExternalSymbol - 210 - cos@__lpython_overloaded_1__cos - 3 __lpython_overloaded_1__cos - numpy - [] - __lpython_overloaded_1__cos - Public - ), - eps: - (Variable - 210 - eps - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 210 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 210 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 210 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 210 - l - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - newshape: - (Variable - 210 - newshape - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - observed: - (Variable - 210 - observed - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - observed1d: - (Variable - 210 - observed1d - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 65536 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - sin@__lpython_overloaded_1__sin: - (ExternalSymbol - 210 - sin@__lpython_overloaded_1__sin - 3 __lpython_overloaded_1__sin - numpy - [] - __lpython_overloaded_1__sin - Public - ) - }) - elemental_trig_identity - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [sin@__lpython_overloaded_1__sin - cos@__lpython_overloaded_1__cos] - [] - [(= - (Var 210 eps) - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - () - ) - (= - (Var 210 arraynd) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 210 observed) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 210 observed1d) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 65536 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 210 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 64 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 63 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 210 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 32 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 31 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 210 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 8 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 7 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 210 l) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 4 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 3 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 210 arraynd) - [(() - (Var 210 i) - ()) - (() - (Var 210 j) - ()) - (() - (Var 210 k) - ()) - (() - (Var 210 l) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (IntegerBinOp - (IntegerBinOp - (IntegerBinOp - (Var 210 i) - Add - (Var 210 j) - (Integer 4) - () - ) - Add - (Var 210 k) - (Integer 4) - () - ) - Add - (Var 210 l) - (Integer 4) - () - ) - IntegerToReal - (Real 4) - () - ) - () - )] - )] - )] - )] - ) - (= - (Var 210 observed) - (RealBinOp - (RealBinOp - (FunctionCall - 210 sin@__lpython_overloaded_1__sin - 2 sin - [((Var 210 arraynd))] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - Pow - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToReal - (Real 4) - (RealConstant - 2.000000 - (Real 4) - ) - ) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - ) - Add - (RealBinOp - (FunctionCall - 210 cos@__lpython_overloaded_1__cos - 2 cos - [((Var 210 arraynd))] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - Pow - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToReal - (Real 4) - (RealConstant - 2.000000 - (Real 4) - ) - ) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - ) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 64 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 32 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 8 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (= - (Var 210 newshape) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 210 newshape) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 65536 (Integer 4)) - () - ) - (= - (Var 210 observed1d) - (ArrayReshape - (Var 210 observed) - (ArrayPhysicalCast - (Var 210 newshape) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - DescriptorArray - ) - () - ) - (Array - (Real 4) - [(() - ())] - FixedSizeArray - ) - () - ) - () - ) - (DoLoop - () - ((Var 210 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 65536 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 65535 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ArrayItem - (Var 210 observed1d) - [(() - (Var 210 i) - ())] - (Real 4) - RowMajor - () - ) - Sub - (Cast - (RealConstant - 1.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.000000 - (Real 4) - ) - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - LtE - (Var 210 eps) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ), - sin: - (ExternalSymbol - 2 - sin - 3 sin - numpy - [] - sin - Public - ), - verify1d: - (Function - (SymbolTable - 201 - { - array: - (Variable - 201 - array - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - block: - (Block - (SymbolTable - 211 - { - sin@__lpython_overloaded_1__sin: - (ExternalSymbol - 211 - sin@__lpython_overloaded_1__sin - 3 __lpython_overloaded_1__sin - numpy - [] - __lpython_overloaded_1__sin - Public - ) - }) - block - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 211 sin@__lpython_overloaded_1__sin - 2 sin - [((FunctionCall - 211 sin@__lpython_overloaded_1__sin - 2 sin - [((ArrayItem - (Var 201 array) - [(() - (Var 201 i) - ())] - (Real 4) - RowMajor - () - ))] - (Real 4) - () - () - ))] - (Real 4) - () - () - ) - Sub - (ArrayItem - (Var 201 result) - [(() - (Var 201 i) - ())] - (Real 4) - RowMajor - () - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - LtE - (Var 201 eps) - (Logical 4) - () - ) - () - )] - ), - eps: - (Variable - 201 - eps - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 201 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 201 - result - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - size: - (Variable - 201 - size - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - verify1d - (FunctionType - [(Array - (Real 4) - [(() - ())] - DescriptorArray - ) - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [sin@__lpython_overloaded_1__sin] - [(Var 201 array) - (Var 201 result) - (Var 201 size)] - [(= - (Var 201 eps) - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - () - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 201 size) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 201 block - )] - )] - () - Public - .false. - .false. - () - ), - verify1d_mul: - (Function - (SymbolTable - 205 - { - array_a: - (Variable - 205 - array_a - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - array_b: - (Variable - 205 - array_b - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 205 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 205 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 205 - result - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - size: - (Variable - 205 - size - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - verify1d_mul - (FunctionType - [(Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 205 array_a) - (Var 205 array_b) - (Var 205 result) - (Var 205 size)] - [(= - (Var 205 eps) - (RealConstant - 0.000010 - (Real 8) - ) - () - ) - (DoLoop - () - ((Var 205 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 205 size) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (RealBinOp - (RealBinOp - (ArrayItem - (Var 205 array_a) - [(() - (Var 205 i) - ())] - (Real 8) - RowMajor - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Mul - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - () - ) - Mul - (RealBinOp - (ArrayItem - (Var 205 array_b) - [(() - (Var 205 i) - ())] - (Real 8) - RowMajor - () - ) - Pow - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (ArrayItem - (Var 205 result) - [(() - (Var 205 i) - ())] - (Real 8) - RowMajor - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 205 eps) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ), - verify1d_sum: - (Function - (SymbolTable - 204 - { - array_a: - (Variable - 204 - array_a - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - array_b: - (Variable - 204 - array_b - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 204 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 204 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 204 - result - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - size: - (Variable - 204 - size - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - verify1d_sum - (FunctionType - [(Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 204 array_a) - (Var 204 array_b) - (Var 204 result) - (Var 204 size)] - [(= - (Var 204 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (DoLoop - () - ((Var 204 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 204 size) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (RealBinOp - (ArrayItem - (Var 204 array_a) - [(() - (Var 204 i) - ())] - (Real 8) - RowMajor - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Add - (RealBinOp - (RealConstant - 5.000000 - (Real 8) - ) - Mul - (RealBinOp - (ArrayItem - (Var 204 array_b) - [(() - (Var 204 i) - ())] - (Real 8) - RowMajor - () - ) - Pow - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - () - ) - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (ArrayItem - (Var 204 result) - [(() - (Var 204 i) - ())] - (Real 8) - RowMajor - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 204 eps) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ), - verify2d: - (Function - (SymbolTable - 203 - { - array: - (Variable - 203 - array - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - block: - (Block - (SymbolTable - 215 - { - block: - (Block - (SymbolTable - 216 - { - cos@__lpython_overloaded_0__cos: - (ExternalSymbol - 216 - cos@__lpython_overloaded_0__cos - 3 __lpython_overloaded_0__cos - numpy - [] - __lpython_overloaded_0__cos - Public - ) - }) - block - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (FunctionCall - 216 cos@__lpython_overloaded_0__cos - 2 cos - [((ArrayItem - (Var 203 array) - [(() - (Var 203 i) - ()) - (() - (Var 203 j) - ())] - (Real 8) - RowMajor - () - ))] - (Real 8) - () - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Sub - (ArrayItem - (Var 203 result) - [(() - (Var 203 i) - ()) - (() - (Var 203 j) - ())] - (Real 8) - RowMajor - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 203 eps) - (Logical 4) - () - ) - () - )] - ) - }) - block - [(DoLoop - () - ((Var 203 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 203 size2) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 215 block - )] - )] - ), - eps: - (Variable - 203 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 203 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 203 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 203 - result - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - size1: - (Variable - 203 - size1 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - size2: - (Variable - 203 - size2 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - verify2d - (FunctionType - [(Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - (Integer 4) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [cos@__lpython_overloaded_0__cos] - [(Var 203 array) - (Var 203 result) - (Var 203 size1) - (Var 203 size2)] - [(= - (Var 203 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (DoLoop - () - ((Var 203 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 203 size1) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 203 block - )] - )] - () - Public - .false. - .false. - () - ), - verifynd: - (Function - (SymbolTable - 202 - { - array: - (Variable - 202 - array - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - block: - (Block - (SymbolTable - 212 - { - block: - (Block - (SymbolTable - 213 - { - block: - (Block - (SymbolTable - 214 - { - sin@__lpython_overloaded_0__sin: - (ExternalSymbol - 214 - sin@__lpython_overloaded_0__sin - 3 __lpython_overloaded_0__sin - numpy - [] - __lpython_overloaded_0__sin - Public - ) - }) - block - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (FunctionCall - 214 sin@__lpython_overloaded_0__sin - 2 sin - [((ArrayItem - (Var 202 array) - [(() - (Var 202 i) - ()) - (() - (Var 202 j) - ()) - (() - (Var 202 k) - ())] - (Real 8) - RowMajor - () - ))] - (Real 8) - () - () - ) - Pow - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Sub - (ArrayItem - (Var 202 result) - [(() - (Var 202 i) - ()) - (() - (Var 202 j) - ()) - (() - (Var 202 k) - ())] - (Real 8) - RowMajor - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 202 eps) - (Logical 4) - () - ) - () - )] - ) - }) - block - [(DoLoop - () - ((Var 202 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 202 size3) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 213 block - )] - )] - ) - }) - block - [(DoLoop - () - ((Var 202 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 202 size2) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 212 block - )] - )] - ), - eps: - (Variable - 202 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 202 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 202 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 202 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 202 - result - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - size1: - (Variable - 202 - size1 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - size2: - (Variable - 202 - size2 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - size3: - (Variable - 202 - size3 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - verifynd - (FunctionType - [(Array - (Real 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - ) - (Array - (Real 8) - [(() - ()) - (() - ()) - (() - ())] - DescriptorArray - ) - (Integer 4) - (Integer 4) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [sin@__lpython_overloaded_0__sin] - [(Var 202 array) - (Var 202 result) - (Var 202 size1) - (Var 202 size2) - (Var 202 size3)] - [(= - (Var 202 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (DoLoop - () - ((Var 202 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 202 size1) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(BlockCall - -1 - 202 block - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 235 - { - __main__global_stmts: - (ExternalSymbol - 235 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 235 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-expr10-efcbb1b.stdout b/tests/reference/asr-expr10-efcbb1b.stdout deleted file mode 100644 index d0c6534e4e..0000000000 --- a/tests/reference/asr-expr10-efcbb1b.stdout +++ /dev/null @@ -1,453 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_UnaryOp: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 3 - b2 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b3: - (Variable - 3 - b3 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 3 - complex - 4 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_13__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_13__complex - 4 __lpython_overloaded_13__complex - lpython_builtin - [] - __lpython_overloaded_13__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 4 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ), - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - test_UnaryOp - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_13__complex] - [] - [(= - (Var 3 a) - (IntegerConstant 4 (Integer 4)) - () - ) - (= - (Var 3 a) - (IntegerUnaryMinus - (IntegerConstant 500 (Integer 4)) - (Integer 4) - (IntegerConstant -500 (Integer 4)) - ) - () - ) - (= - (Var 3 a) - (IntegerBitNot - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -6 (Integer 4)) - ) - () - ) - (= - (Var 3 b) - (LogicalNot - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 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 3 b) - (LogicalNot - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 f) - (RealConstant - 1.000000 - (Real 4) - ) - () - ) - (= - (Var 3 f) - (RealUnaryMinus - (Cast - (RealConstant - 183745.534000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 183745.534000 - (Real 4) - ) - ) - (Real 4) - (RealConstant - -183745.534000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 b1) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 b2) - (LogicalNot - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 b3) - (LogicalNot - (Var 3 b2) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 3 a) - (IntegerUnaryMinus - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - (IntegerConstant 0 (Integer 4)) - ) - (Integer 4) - (IntegerConstant 0 (Integer 4)) - ) - () - ) - (= - (Var 3 a) - (IntegerBitNot - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - () - ) - (= - (Var 3 c) - (ComplexConstant - 1.000000 - 2.000000 - (Complex 4) - ) - () - ) - (= - (Var 3 c) - (ComplexUnaryMinus - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_13__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((RealConstant - 65.000000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.000000 - 65.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 3.000000 - 65.000000 - (Complex 4) - ) - ) - (Complex 4) - (ComplexConstant - -3.000000 - -65.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 b1) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (= - (Var 3 b2) - (LogicalConstant - .true. - (Logical 4) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 119 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr13-81bdb5a.stdout b/tests/reference/asr-expr13-81bdb5a.stdout deleted file mode 100644 index f6376d2e47..0000000000 --- a/tests/reference/asr-expr13-81bdb5a.stdout +++ /dev/null @@ -1,473 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_Compare: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 3 - complex - 4 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_5__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_5__complex - 4 __lpython_overloaded_5__complex - lpython_builtin - [] - __lpython_overloaded_5__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 4 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ) - }) - test_Compare - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_9__complex - complex@__lpython_overloaded_5__complex] - [] - [(= - (Var 3 a) - (IntegerCompare - (IntegerConstant 5 (Integer 4)) - Gt - (IntegerConstant 4 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (IntegerCompare - (IntegerConstant 5 (Integer 4)) - LtE - (IntegerConstant 4 (Integer 4)) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (IntegerCompare - (IntegerConstant 5 (Integer 4)) - Lt - (IntegerConstant 4 (Integer 4)) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (RealCompare - (RealConstant - 5.600000 - (Real 8) - ) - GtE - (RealConstant - 5.599990 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (RealCompare - (RealConstant - 3.300000 - (Real 8) - ) - Eq - (RealConstant - 3.300000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (RealCompare - (RealConstant - 3.300000 - (Real 8) - ) - NotEq - (RealConstant - 3.400000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (ComplexCompare - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - Eq - (FunctionCall - 3 complex@__lpython_overloaded_5__complex - 3 complex - [((RealConstant - 3.000000 - (Real 8) - )) - ((RealConstant - 4.000000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "abc" - (Character 1 3 ()) - ) - Gt - (StringConstant - "abd" - (Character 1 3 ()) - ) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "" - (Character 1 0 ()) - ) - Lt - (StringConstant - "s" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "-abs" - (Character 1 4 ()) - ) - GtE - (StringConstant - "abs" - (Character 1 3 ()) - ) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "abcd" - (Character 1 4 ()) - ) - LtE - (StringConstant - "abcde" - (Character 1 5 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "abc" - (Character 1 3 ()) - ) - Eq - (StringConstant - "abc" - (Character 1 3 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "abc" - (Character 1 3 ()) - ) - NotEq - (StringConstant - "abd" - (Character 1 3 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (StringCompare - (StringConstant - "" - (Character 1 0 ()) - ) - Eq - (StringConstant - "+" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (LogicalCompare - (LogicalConstant - .true. - (Logical 4) - ) - Gt - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (LogicalCompare - (LogicalConstant - .true. - (Logical 4) - ) - Eq - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (LogicalCompare - (LogicalConstant - .false. - (Logical 4) - ) - NotEq - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a) - (LogicalCompare - (LogicalConstant - .false. - (Logical 4) - ) - GtE - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 119 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr7-480ba2f.stdout b/tests/reference/asr-expr7-480ba2f.stdout deleted file mode 100644 index 1b16413d18..0000000000 --- a/tests/reference/asr-expr7-480ba2f.stdout +++ /dev/null @@ -1,371 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 121 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 5 - { - c: - (Variable - 5 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_pow - test_pow_1] - [] - [(SubroutineCall - 2 test_pow - () - [] - () - ) - (= - (Var 5 c) - (FunctionCall - 2 test_pow_1 - () - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Integer 4) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_pow: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - pow: - (ExternalSymbol - 3 - pow - 6 pow - lpython_builtin - [] - pow - Private - ), - pow@__lpython_overloaded_0__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_0__pow - 6 __lpython_overloaded_0__pow - lpython_builtin - [] - __lpython_overloaded_0__pow - Public - ) - }) - test_pow - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [pow@__lpython_overloaded_0__pow] - [] - [(= - (Var 3 a) - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((IntegerConstant 2 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Real 8) - (RealConstant - 4.000000 - (Real 8) - ) - () - ) - RealToInteger - (Integer 4) - (IntegerConstant 4 (Integer 4)) - ) - () - )] - () - Public - .false. - .false. - () - ), - test_pow_1: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 4 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - pow: - (ExternalSymbol - 4 - pow - 6 pow - lpython_builtin - [] - pow - Private - ), - pow@__lpython_overloaded_0__pow: - (ExternalSymbol - 4 - pow@__lpython_overloaded_0__pow - 6 __lpython_overloaded_0__pow - lpython_builtin - [] - __lpython_overloaded_0__pow - Public - ), - res: - (Variable - 4 - res - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_pow_1 - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [pow@__lpython_overloaded_0__pow] - [(Var 4 a) - (Var 4 b)] - [(= - (Var 4 res) - (Cast - (FunctionCall - 4 pow@__lpython_overloaded_0__pow - 4 pow - [((Var 4 a)) - ((Var 4 b))] - (Real 8) - () - () - ) - RealToInteger - (Integer 4) - () - ) - () - ) - (= - (Var 4 _lpython_return_variable) - (Var 4 res) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 122 - { - __main__global_stmts: - (ExternalSymbol - 122 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 122 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr8-6beda60.stdout b/tests/reference/asr-expr8-6beda60.stdout deleted file mode 100644 index cda03a79a5..0000000000 --- a/tests/reference/asr-expr8-6beda60.stdout +++ /dev/null @@ -1,430 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_binop: - (Function - (SymbolTable - 3 - { - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 3 - b2 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x2: - (Variable - 3 - x2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - test_binop - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Pow - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant 8 (Integer 4)) - ) - () - ) - (= - (Var 3 x2) - (Cast - (RealBinOp - (RealConstant - 2.000000 - (Real 8) - ) - Pow - (RealConstant - 3.500000 - (Real 8) - ) - (Real 8) - (RealConstant - 11.313708 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 11.313708 - (Real 4) - ) - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (IntegerConstant 54 (Integer 4)) - Sub - (IntegerConstant 100 (Integer 4)) - (Integer 4) - (IntegerConstant -46 (Integer 4)) - ) - () - ) - (= - (Var 3 x2) - (Cast - (RealBinOp - (RealBinOp - (RealConstant - 3.454000 - (Real 8) - ) - Sub - (RealConstant - 765.430000 - (Real 8) - ) - (Real 8) - (RealConstant - -761.976000 - (Real 8) - ) - ) - Add - (RealConstant - 534.600000 - (Real 8) - ) - (Real 8) - (RealConstant - -227.376000 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - -227.376000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 x2) - (Cast - (RealBinOp - (RealConstant - 5346.565000 - (Real 8) - ) - Mul - (RealConstant - 3.450000 - (Real 8) - ) - (Real 8) - (RealConstant - 18445.649250 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 18445.649250 - (Real 4) - ) - ) - () - ) - (= - (Var 3 x2) - (Cast - (RealBinOp - (RealConstant - 5346.565000 - (Real 8) - ) - Pow - (RealConstant - 3.450000 - (Real 8) - ) - (Real 8) - (RealConstant - 7275422789925.217773 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 7275422789925.217773 - (Real 4) - ) - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Mul - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Pow - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (Var 3 b1) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 b2) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (= - (Var 3 x) - (Cast - (IntrinsicScalarFunction - FloorDiv - [(Var 3 b1) - (Var 3 b1)] - 0 - (Logical 4) - () - ) - LogicalToInteger - (Integer 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Cast - (Var 3 b1) - LogicalToInteger - (Integer 4) - () - ) - Pow - (Cast - (Var 3 b2) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_05-3a37324.stdout b/tests/reference/asr-expr_05-3a37324.stdout deleted file mode 100644 index 05fb00b886..0000000000 --- a/tests/reference/asr-expr_05-3a37324.stdout +++ /dev/null @@ -1,1642 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 121 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 5 - { - _mod: - (ExternalSymbol - 5 - _mod - 6 _mod - lpython_builtin - [] - _mod - Private - ), - _mod@__lpython_overloaded_2___mod: - (ExternalSymbol - 5 - _mod@__lpython_overloaded_2___mod - 6 __lpython_overloaded_2___mod - lpython_builtin - [] - __lpython_overloaded_2___mod - Public - ), - _mod@__lpython_overloaded_4___mod: - (ExternalSymbol - 5 - _mod@__lpython_overloaded_4___mod - 6 __lpython_overloaded_4___mod - lpython_builtin - [] - __lpython_overloaded_4___mod - Public - ), - _mod@__lpython_overloaded_9___mod: - (ExternalSymbol - 5 - _mod@__lpython_overloaded_9___mod - 6 __lpython_overloaded_9___mod - lpython_builtin - [] - __lpython_overloaded_9___mod - Public - ), - a: - (Variable - 5 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a1: - (Variable - 5 - a1 - [] - Local - () - () - Default - (UnsignedInteger - 2 - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 5 - b1 - [] - Local - () - () - Default - (UnsignedInteger - 2 - ) - () - Source - Public - Required - .false. - ), - c1: - (Variable - 5 - c1 - [] - Local - () - () - Default - (UnsignedInteger - 2 - ) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 5 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 5 - i - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - i1: - (Variable - 5 - i1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 5 - i2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i3: - (Variable - 5 - i3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i4: - (Variable - 5 - i4 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_multiply - test_mod - _mod@__lpython_overloaded_2___mod - _mod@__lpython_overloaded_9___mod - _mod@__lpython_overloaded_4___mod] - [] - [(= - (Var 5 a) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 5 b) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - () - ) - (= - (Var 5 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 test_multiply - () - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 50 (Integer 4)) - (Integer 4) - (IntegerConstant -50 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 i) - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - () - ) - (= - (Var 5 i) - (IntegerBinOp - (Var 5 i) - Add - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Integer 8) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 i) - Eq - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 5 b) - (IntegerConstant 5 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 test_mod - () - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 test_mod - () - [((IntegerConstant 23 (Integer 4))) - ((IntegerConstant 3 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerConstant 123282374 (Integer 4)) - () - ) - (= - (Var 5 b) - (IntegerConstant 32771 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 test_mod - () - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 30643 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerUnaryMinus - (IntegerConstant 5345 (Integer 4)) - (Integer 4) - (IntegerConstant -5345 (Integer 4)) - ) - () - ) - (= - (Var 5 b) - (IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 5 _mod@__lpython_overloaded_2___mod - 5 _mod - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerUnaryMinus - (IntegerConstant 123282374 (Integer 4)) - (Integer 4) - (IntegerConstant -123282374 (Integer 4)) - ) - () - ) - (= - (Var 5 b) - (IntegerConstant 32771 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 test_mod - () - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 2128 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - BitOr - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant 14 (Integer 4)) - ) - Eq - (IntegerConstant 14 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (IntegerConstant 105346 (Integer 4)) - (Integer 4) - (IntegerConstant -105346 (Integer 4)) - ) - BitOr - (IntegerUnaryMinus - (IntegerConstant 32771 (Integer 4)) - (Integer 4) - (IntegerConstant -32771 (Integer 4)) - ) - (Integer 4) - (IntegerConstant -32769 (Integer 4)) - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 32769 (Integer 4)) - (Integer 4) - (IntegerConstant -32769 (Integer 4)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - BitAnd - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant 0 (Integer 4)) - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (IntegerConstant 105346 (Integer 4)) - (Integer 4) - (IntegerConstant -105346 (Integer 4)) - ) - BitAnd - (IntegerUnaryMinus - (IntegerConstant 32771 (Integer 4)) - (Integer 4) - (IntegerConstant -32771 (Integer 4)) - ) - (Integer 4) - (IntegerConstant -105348 (Integer 4)) - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 105348 (Integer 4)) - (Integer 4) - (IntegerConstant -105348 (Integer 4)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - BitXor - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant 14 (Integer 4)) - ) - Eq - (IntegerConstant 14 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (IntegerConstant 105346 (Integer 4)) - (Integer 4) - (IntegerConstant -105346 (Integer 4)) - ) - BitXor - (IntegerUnaryMinus - (IntegerConstant 32771 (Integer 4)) - (Integer 4) - (IntegerConstant -32771 (Integer 4)) - ) - (Integer 4) - (IntegerConstant 72579 (Integer 4)) - ) - Eq - (IntegerConstant 72579 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - BitRShift - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerConstant 5 (Integer 4)) - BitLShift - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 10 (Integer 4)) - ) - Eq - (IntegerConstant 10 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 5 i1) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 5 i2) - (IntegerConstant 4 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i1) - BitLShift - (Var 5 i2) - (Integer 4) - () - ) - Eq - (IntegerConstant 160 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i1) - BitRShift - (Var 5 i2) - (Integer 4) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i1) - BitAnd - (Var 5 i2) - (Integer 4) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i1) - BitOr - (Var 5 i2) - (Integer 4) - () - ) - Eq - (IntegerConstant 14 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i1) - BitXor - (Var 5 i2) - (Integer 4) - () - ) - Eq - (IntegerConstant 14 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (Var 5 i1) - (Integer 4) - () - ) - BitXor - (IntegerUnaryMinus - (Var 5 i2) - (Integer 4) - () - ) - (Integer 4) - () - ) - Eq - (IntegerConstant 10 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 i3) - (IntegerConstant 432534534 (Integer 4)) - () - ) - (= - (Var 5 i4) - (IntegerUnaryMinus - (IntegerConstant 4325 (Integer 4)) - (Integer 4) - (IntegerConstant -4325 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i3) - BitOr - (Var 5 i4) - (Integer 4) - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 225 (Integer 4)) - (Integer 4) - (IntegerConstant -225 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (Var 5 i4) - BitRShift - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 541 (Integer 4)) - (Integer 4) - (IntegerConstant -541 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (Var 5 i3) - (Integer 4) - () - ) - BitAnd - (Var 5 i4) - (Integer 4) - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 432534758 (Integer 4)) - (Integer 4) - (IntegerConstant -432534758 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (Var 5 i3) - (Integer 4) - () - ) - BitXor - (Var 5 i4) - (Integer 4) - () - ) - Eq - (IntegerConstant 432530657 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 5 a) - (IntegerBinOp - (Var 5 a) - BitOr - (IntegerConstant 4 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 14 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerBinOp - (Var 5 a) - BitXor - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 13 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 b) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 5 a) - (FunctionCall - 5 _mod@__lpython_overloaded_2___mod - 5 _mod - [((Var 5 a)) - ((Var 5 b))] - (Integer 4) - () - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 b) - (IntegerConstant 4 (Integer 4)) - () - ) - (= - (Var 5 a) - (IntegerBinOp - (Var 5 a) - BitLShift - (Var 5 b) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 48 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerBinOp - (Var 5 a) - BitRShift - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 24 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a) - (IntegerBinOp - (Var 5 a) - BitAnd - (Var 5 b) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 b) - (IntegerBinOp - (Var 5 b) - Pow - (IntegerConstant 4 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 b) - Eq - (IntegerConstant 256 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 5 _mod@__lpython_overloaded_2___mod - 5 _mod - [((IntegerUnaryMinus - (IntegerConstant 8 (Integer 4)) - (Integer 4) - (IntegerConstant -8 (Integer 4)) - )) - ((IntegerConstant 3 (Integer 4)))] - (Integer 4) - (IntegerConstant 1 (Integer 4)) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 5 _mod@__lpython_overloaded_2___mod - 5 _mod - [((IntegerConstant 8 (Integer 4))) - ((IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ))] - (Integer 4) - (IntegerConstant -1 (Integer 4)) - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 5 _mod@__lpython_overloaded_2___mod - 5 _mod - [((IntegerUnaryMinus - (IntegerConstant 8 (Integer 4)) - (Integer 4) - (IntegerConstant -8 (Integer 4)) - )) - ((IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ))] - (Integer 4) - (IntegerConstant -2 (Integer 4)) - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 5 _mod@__lpython_overloaded_9___mod - 5 _mod - [((RealConstant - 11.000000 - (Real 8) - )) - ((RealUnaryMinus - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -3.000000 - (Real 8) - ) - ))] - (Real 8) - (RealConstant - -1.000000 - (Real 8) - ) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -1.000000 - (Real 8) - ) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 5 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 5 _mod@__lpython_overloaded_9___mod - 5 _mod - [((RealUnaryMinus - (RealConstant - 11.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -11.000000 - (Real 8) - ) - )) - ((RealConstant - 3.000000 - (Real 8) - ))] - (Real 8) - (RealConstant - 1.000000 - (Real 8) - ) - () - ) - Sub - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 5 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 5 a1) - (Cast - (IntegerConstant 10 (Integer 4)) - IntegerToUnsignedInteger - (UnsignedInteger - 2 - ) - (UnsignedIntegerConstant - 10 - (UnsignedInteger - 2 - ) - ) - ) - () - ) - (= - (Var 5 b1) - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToUnsignedInteger - (UnsignedInteger - 2 - ) - (UnsignedIntegerConstant - 3 - (UnsignedInteger - 2 - ) - ) - ) - () - ) - (= - (Var 5 c1) - (FunctionCall - 5 _mod@__lpython_overloaded_4___mod - 5 _mod - [((Var 5 a1)) - ((Var 5 b1))] - (UnsignedInteger - 2 - ) - () - () - ) - () - ) - (Assert - (UnsignedIntegerCompare - (Var 5 c1) - Eq - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToUnsignedInteger - (UnsignedInteger - 2 - ) - (UnsignedIntegerConstant - 1 - (UnsignedInteger - 2 - ) - ) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 c1) - (IntrinsicScalarFunction - FloorDiv - [(Var 5 a1) - (Var 5 b1)] - 0 - (UnsignedInteger - 2 - ) - () - ) - () - ) - (Assert - (UnsignedIntegerCompare - (Var 5 c1) - Eq - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToUnsignedInteger - (UnsignedInteger - 2 - ) - (UnsignedIntegerConstant - 3 - (UnsignedInteger - 2 - ) - ) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_mod: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - _mod: - (ExternalSymbol - 4 - _mod - 6 _mod - lpython_builtin - [] - _mod - Private - ), - _mod@__lpython_overloaded_2___mod: - (ExternalSymbol - 4 - _mod@__lpython_overloaded_2___mod - 6 __lpython_overloaded_2___mod - lpython_builtin - [] - __lpython_overloaded_2___mod - Public - ), - a: - (Variable - 4 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_mod - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [_mod@__lpython_overloaded_2___mod] - [(Var 4 a) - (Var 4 b)] - [(= - (Var 4 _lpython_return_variable) - (FunctionCall - 4 _mod@__lpython_overloaded_2___mod - 4 _mod - [((Var 4 a)) - ((Var 4 b))] - (Integer 4) - () - () - ) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_multiply: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 3 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_multiply - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 a) - (Var 3 b)] - [(= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (Var 3 a) - Mul - (Var 3 b) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 122 - { - __main__global_stmts: - (ExternalSymbol - 122 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 122 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-generics_array_01-682b1b2.stdout b/tests/reference/asr-generics_array_01-682b1b2.stdout deleted file mode 100644 index a74477dc35..0000000000 --- a/tests/reference/asr-generics_array_01-682b1b2.stdout +++ /dev/null @@ -1,459 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_f_0: - (Function - (SymbolTable - 203 - { - _lpython_return_variable: - (Variable - 203 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 203 - i - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - lst: - (Variable - 203 - lst - [] - InOut - () - () - Default - (Array - (Integer 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_f_0 - (FunctionType - [(Array - (Integer 4) - [(() - ())] - DescriptorArray - ) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 lst) - (Var 203 i)] - [(= - (ArrayItem - (Var 203 lst) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (Var 203 i) - () - ) - (= - (Var 203 _lpython_return_variable) - (ArrayItem - (Var 203 lst) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - () - ) - (Return)] - (Var 203 _lpython_return_variable) - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 204 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [use_array] - [] - [(SubroutineCall - 2 use_array - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 201 - { - _lpython_return_variable: - (Variable - 201 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 201 - i - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - lst: - (Variable - 201 - lst - [] - InOut - () - () - Default - (Array - (TypeParameter - T - ) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Array - (TypeParameter - T - ) - [(() - ())] - DescriptorArray - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 201 lst) - (Var 201 i)] - [(= - (ArrayItem - (Var 201 lst) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (TypeParameter - T - ) - RowMajor - () - ) - (Var 201 i) - () - ) - (= - (Var 201 _lpython_return_variable) - (ArrayItem - (Var 201 lst) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (TypeParameter - T - ) - RowMajor - () - ) - () - ) - (Return)] - (Var 201 _lpython_return_variable) - Public - .false. - .false. - () - ), - use_array: - (Function - (SymbolTable - 202 - { - array: - (Variable - 202 - array - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 202 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - use_array - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_f_0] - [] - [(= - (Var 202 array) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 202 x) - (IntegerConstant 69 (Integer 4)) - () - ) - (Print - () - [(FunctionCall - 2 __asr_generic_f_0 - () - [((ArrayPhysicalCast - (Var 202 array) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - DescriptorArray - ) - () - )) - ((Var 202 x))] - (Integer 4) - () - () - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 205 - { - __main__global_stmts: - (ExternalSymbol - 205 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 205 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stdout b/tests/reference/asr-generics_array_02-22c8dc1.stdout deleted file mode 100644 index 22b8883224..0000000000 --- a/tests/reference/asr-generics_array_02-22c8dc1.stdout +++ /dev/null @@ -1,1395 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_g_0: - (Function - (SymbolTable -<<<<<<< HEAD - 220 -======= - 207 ->>>>>>> main - { - a: - (Variable - 207 - a - [n] - InOut - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 207 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 207 - b - [n] - InOut - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 207 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 207 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 207 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 207 - r - [n] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 207 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_g_0 - (FunctionType - [(Integer 4) - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_integer] - [(Var 207 n) - (Var 207 a) - (Var 207 b)] - [(= - (Var 207 r) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 207 n))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 207 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 207 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 207 r) - [(() - (Var 207 i) - ())] - (Integer 4) - RowMajor - () - ) - (FunctionCall - 2 add_integer - () - [((ArrayItem - (Var 207 a) - [(() - (Var 207 i) - ())] - (Integer 4) - RowMajor - () - )) - ((ArrayItem - (Var 207 b) - [(() - (Var 207 i) - ())] - (Integer 4) - RowMajor - () - ))] - (Integer 4) - () - () - ) - () - )] - ) - (Print - () - [(ArrayItem - (Var 207 r) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - __asr_generic_g_1: - (Function - (SymbolTable - 208 - { - a: - (Variable - 208 - a - [n] - InOut - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 208 - b - [n] - InOut - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 208 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 208 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 208 - r - [n] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_g_1 - (FunctionType - [(Integer 4) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_float] - [(Var 208 n) - (Var 208 a) - (Var 208 b)] - [(= - (Var 208 r) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 208 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 208 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 208 r) - [(() - (Var 208 i) - ())] - (Real 4) - RowMajor - () - ) - (FunctionCall - 2 add_float - () - [((ArrayItem - (Var 208 a) - [(() - (Var 208 i) - ())] - (Real 4) - RowMajor - () - )) - ((ArrayItem - (Var 208 b) - [(() - (Var 208 i) - ())] - (Real 4) - RowMajor - () - ))] - (Real 4) - () - () - ) - () - )] - ) - (Print - () - [(ArrayItem - (Var 208 r) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 209 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main] - [] - [(SubroutineCall - 2 main - () - [] - () - )] - () - Public - .false. - .false. - () - ), - add: - (Function - (SymbolTable - 201 - { - _lpython_return_variable: - (Variable - 201 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 201 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 201 - y - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - add - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 201 x) - (Var 201 y)] - [] - (Var 201 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_float: - (Function - (SymbolTable - 203 - { - _lpython_return_variable: - (Variable - 203 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 203 - x - [] - In - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 203 - y - [] - In - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - add_float - (FunctionType - [(Real 4) - (Real 4)] - (Real 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 x) - (Var 203 y)] - [(= - (Var 203 _lpython_return_variable) - (RealBinOp - (Var 203 x) - Add - (Var 203 y) - (Real 4) - () - ) - () - ) - (Return)] - (Var 203 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_integer: - (Function - (SymbolTable - 202 - { - _lpython_return_variable: - (Variable - 202 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 202 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 202 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - add_integer - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 x) - (Var 202 y)] - [(= - (Var 202 _lpython_return_variable) - (IntegerBinOp - (Var 202 x) - Add - (Var 202 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 202 _lpython_return_variable) - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 204 - { - a: - (Variable - 204 - a - [n] - InOut - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 204 - b - [n] - InOut - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 204 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 204 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 204 - r - [n] - Local - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [(Integer 4) - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - ))] - PointerToDataArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add] - [(Var 204 n) - (Var 204 a) - (Var 204 b)] - [(= - (Var 204 r) - (ArrayConstant - [] - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 204 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 204 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 204 r) - [(() - (Var 204 i) - ())] - (TypeParameter - T - ) - RowMajor - () - ) - (FunctionCall - 2 add - () - [((ArrayItem - (Var 204 a) - [(() - (Var 204 i) - ())] - (TypeParameter - T - ) - RowMajor - () - )) - ((ArrayItem - (Var 204 b) - [(() - (Var 204 i) - ())] - (TypeParameter - T - ) - RowMajor - () - ))] - (TypeParameter - T - ) - () - () - ) - () - )] - ) - (Print - () - [(ArrayItem - (Var 204 r) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (TypeParameter - T - ) - RowMajor - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - main: - (Function - (SymbolTable - 205 - { - a_float: - (Variable - 205 - a_float - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - a_int: - (Variable - 205 - a_int - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b_float: - (Variable - 205 - b_float - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b_int: - (Variable - 205 - b_int - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - main - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_g_0 - __asr_generic_g_1] - [] - [(= - (Var 205 a_int) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 a_int) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 400 (Integer 4)) - () - ) - (= - (Var 205 b_int) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 b_int) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 20 (Integer 4)) - () - ) - (SubroutineCall - 2 __asr_generic_g_0 - () - [((IntegerConstant 1 (Integer 4))) - ((ArrayPhysicalCast - (Var 205 a_int) - FixedSizeArray - PointerToDataArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - )) - ((ArrayPhysicalCast - (Var 205 b_int) - FixedSizeArray - PointerToDataArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - ))] - () - ) - (= - (Var 205 a_float) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 a_float) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (RealConstant - 400.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 400.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 205 b_float) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 b_float) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (RealConstant - 20.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 20.000000 - (Real 4) - ) - ) - () - ) - (SubroutineCall - 2 __asr_generic_g_1 - () - [((IntegerConstant 1 (Integer 4))) - ((ArrayPhysicalCast - (Var 205 a_float) - FixedSizeArray - PointerToDataArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - )) - ((ArrayPhysicalCast - (Var 205 b_float) - FixedSizeArray - PointerToDataArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - ))] - () - )] - () - Public - .false. - .false. - () - ), - n: - (Variable - 2 - n - [] - Local - () - () - Default - (TypeParameter - n - ) - () - Source - Public - Required - .false. - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 210 - { - __main__global_stmts: - (ExternalSymbol - 210 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 210 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-generics_array_03-fb3706c.stdout b/tests/reference/asr-generics_array_03-fb3706c.stdout deleted file mode 100644 index ba718219e6..0000000000 --- a/tests/reference/asr-generics_array_03-fb3706c.stdout +++ /dev/null @@ -1,1880 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_g_0: - (Function - (SymbolTable - 208 - { - _lpython_return_variable: - (Variable - 208 - _lpython_return_variable - [n - m] - ReturnVar - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 208 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - a: - (Variable - 208 - a - [n - m] - InOut - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 208 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 208 - b - [n - m] - InOut - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 208 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 208 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 208 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - m: - (Variable - 208 - m - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 208 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 208 - r - [n - m] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 208 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_g_0 - (FunctionType - [(Integer 4) - (Integer 4) - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - )] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_integer] - [(Var 208 n) - (Var 208 m) - (Var 208 a) - (Var 208 b)] - [(= - (Var 208 r) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (Var 208 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 208 m))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 208 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 208 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 208 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 208 m) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 208 r) - [(() - (Var 208 i) - ()) - (() - (Var 208 j) - ())] - (Integer 4) - RowMajor - () - ) - (FunctionCall - 2 add_integer - () - [((ArrayItem - (Var 208 a) - [(() - (Var 208 i) - ()) - (() - (Var 208 j) - ())] - (Integer 4) - RowMajor - () - )) - ((ArrayItem - (Var 208 b) - [(() - (Var 208 i) - ()) - (() - (Var 208 j) - ())] - (Integer 4) - RowMajor - () - ))] - (Integer 4) - () - () - ) - () - )] - )] - ) - (Print - () - [(ArrayItem - (Var 208 r) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - )] - () - () - )] - (Var 208 _lpython_return_variable) - Public - .false. - .false. - () - ), - __asr_generic_g_1: - (Function - (SymbolTable - 209 - { - _lpython_return_variable: - (Variable - 209 - _lpython_return_variable - [n - m] - ReturnVar - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 209 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 209 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - a: - (Variable - 209 - a - [n - m] - InOut - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 209 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 209 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 209 - b - [n - m] - InOut - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 209 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 209 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 209 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 209 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - m: - (Variable - 209 - m - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 209 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 209 - r - [n - m] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 209 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 209 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_g_1 - (FunctionType - [(Integer 4) - (Integer 4) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - )] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_float] - [(Var 209 n) - (Var 209 m) - (Var 209 a) - (Var 209 b)] - [(= - (Var 209 r) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (Var 209 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 209 m))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 209 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 209 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 209 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 209 m) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 209 r) - [(() - (Var 209 i) - ()) - (() - (Var 209 j) - ())] - (Real 4) - RowMajor - () - ) - (FunctionCall - 2 add_float - () - [((ArrayItem - (Var 209 a) - [(() - (Var 209 i) - ()) - (() - (Var 209 j) - ())] - (Real 4) - RowMajor - () - )) - ((ArrayItem - (Var 209 b) - [(() - (Var 209 i) - ()) - (() - (Var 209 j) - ())] - (Real 4) - RowMajor - () - ))] - (Real 4) - () - () - ) - () - )] - )] - ) - (Print - () - [(ArrayItem - (Var 209 r) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - )] - () - () - )] - (Var 209 _lpython_return_variable) - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 210 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main] - [] - [(SubroutineCall - 2 main - () - [] - () - )] - () - Public - .false. - .false. - () - ), - add: - (Function - (SymbolTable - 201 - { - _lpython_return_variable: - (Variable - 201 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 201 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 201 - y - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - add - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 201 x) - (Var 201 y)] - [] - (Var 201 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_float: - (Function - (SymbolTable - 203 - { - _lpython_return_variable: - (Variable - 203 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 203 - x - [] - In - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 203 - y - [] - In - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - add_float - (FunctionType - [(Real 4) - (Real 4)] - (Real 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 x) - (Var 203 y)] - [(= - (Var 203 _lpython_return_variable) - (RealBinOp - (Var 203 x) - Add - (Var 203 y) - (Real 4) - () - ) - () - ) - (Return)] - (Var 203 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_integer: - (Function - (SymbolTable - 202 - { - _lpython_return_variable: - (Variable - 202 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 202 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 202 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - add_integer - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 x) - (Var 202 y)] - [(= - (Var 202 _lpython_return_variable) - (IntegerBinOp - (Var 202 x) - Add - (Var 202 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 202 _lpython_return_variable) - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 204 - { - _lpython_return_variable: - (Variable - 204 - _lpython_return_variable - [n - m] - ReturnVar - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 204 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - a: - (Variable - 204 - a - [n - m] - InOut - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 204 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 204 - b - [n - m] - InOut - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 204 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 204 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 204 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - m: - (Variable - 204 - m - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - n: - (Variable - 204 - n - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 204 - r - [n - m] - Local - () - () - Default - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 204 m))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [(Integer 4) - (Integer 4) - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - )] - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (FunctionParam - 0 - (Integer 4) - () - )) - ((IntegerConstant 0 (Integer 4)) - (FunctionParam - 1 - (Integer 4) - () - ))] - PointerToDataArray - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add] - [(Var 204 n) - (Var 204 m) - (Var 204 a) - (Var 204 b)] - [(= - (Var 204 r) - (ArrayConstant - [] - (Array - (TypeParameter - T - ) - [((IntegerConstant 0 (Integer 4)) - (Var 204 n)) - ((IntegerConstant 0 (Integer 4)) - (Var 204 m))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 204 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 204 n) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 204 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 204 m) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 204 r) - [(() - (Var 204 i) - ()) - (() - (Var 204 j) - ())] - (TypeParameter - T - ) - RowMajor - () - ) - (FunctionCall - 2 add - () - [((ArrayItem - (Var 204 a) - [(() - (Var 204 i) - ()) - (() - (Var 204 j) - ())] - (TypeParameter - T - ) - RowMajor - () - )) - ((ArrayItem - (Var 204 b) - [(() - (Var 204 i) - ()) - (() - (Var 204 j) - ())] - (TypeParameter - T - ) - RowMajor - () - ))] - (TypeParameter - T - ) - () - () - ) - () - )] - )] - ) - (Print - () - [(ArrayItem - (Var 204 r) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (TypeParameter - T - ) - RowMajor - () - )] - () - () - )] - (Var 204 _lpython_return_variable) - Public - .false. - .false. - () - ), - m: - (Variable - 2 - m - [] - Local - () - () - Default - (TypeParameter - m - ) - () - Source - Public - Required - .false. - ), - main: - (Function - (SymbolTable - 205 - { - __lcompilers_dummy: - (Variable - 205 - __lcompilers_dummy - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - __lcompilers_dummy1: - (Variable - 205 - __lcompilers_dummy1 - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - a_float: - (Variable - 205 - a_float - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - a_int: - (Variable - 205 - a_int - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b_float: - (Variable - 205 - b_float - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b_int: - (Variable - 205 - b_int - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - main - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_g_0 - __asr_generic_g_1] - [] - [(= - (Var 205 a_int) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 a_int) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 400 (Integer 4)) - () - ) - (= - (Var 205 b_int) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 b_int) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 20 (Integer 4)) - () - ) - (= - (Var 205 __lcompilers_dummy) - (FunctionCall - 2 __asr_generic_g_0 - () - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 1 (Integer 4))) - ((ArrayPhysicalCast - (Var 205 a_int) - FixedSizeArray - PointerToDataArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - )) - ((ArrayPhysicalCast - (Var 205 b_int) - FixedSizeArray - PointerToDataArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - ))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - () - ) - (= - (Var 205 a_float) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 a_float) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (IntegerConstant 400 (Integer 4)) - IntegerToReal - (Real 4) - (RealConstant - 400.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 205 b_float) - (ArrayConstant - [] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 b_float) - [(() - (IntegerConstant 0 (Integer 4)) - ()) - (() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (IntegerConstant 20 (Integer 4)) - IntegerToReal - (Real 4) - (RealConstant - 20.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 205 __lcompilers_dummy1) - (FunctionCall - 2 __asr_generic_g_1 - () - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 1 (Integer 4))) - ((ArrayPhysicalCast - (Var 205 a_float) - FixedSizeArray - PointerToDataArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - )) - ((ArrayPhysicalCast - (Var 205 b_float) - FixedSizeArray - PointerToDataArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - PointerToDataArray - ) - () - ))] - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - n: - (Variable - 2 - n - [] - Local - () - () - Default - (TypeParameter - n - ) - () - Source - Public - Required - .false. - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 211 - { - __main__global_stmts: - (ExternalSymbol - 211 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 211 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-structs_05-fa98307.stdout b/tests/reference/asr-structs_05-fa98307.stdout deleted file mode 100644 index e6c27d31a3..0000000000 --- a/tests/reference/asr-structs_05-fa98307.stdout +++ /dev/null @@ -1,1476 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 201 - { - a: - (Variable - 201 - a - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 201 - b - [] - Local - () - () - Default - (Integer 2) - () - Source - Public - Required - .false. - ), - c: - (Variable - 201 - c - [] - Local - () - () - Default - (Integer 1) - () - Source - Public - Required - .false. - ), - d: - (Variable - 201 - d - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 201 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 201 - y - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - z: - (Variable - 201 - z - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - A - [] - [y - x - z - a - b - c - d] - Source - Public - .false. - .false. - [(()) - (()) - (()) - (()) - (()) - (()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 207 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 2 g - () - [] - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 205 - { - y: - (Variable - 205 - y - [] - Local - () - () - Default - (Array - (Struct - 2 A - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [verify - update_1 - update_2] - [] - [(= - (Var 205 y) - (ArrayConstant - [] - (Array - (Struct - 2 A - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 205 y) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - (StructTypeConstructor - 2 A - [((RealConstant - 1.100000 - (Real 8) - )) - ((IntegerConstant 1 (Integer 4))) - ((Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - )) - ((Cast - (RealConstant - 1.100000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.100000 - (Real 4) - ) - )) - ((Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - )) - ((Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 1 (Integer 1)) - )) - ((LogicalConstant - .true. - (Logical 4) - ))] - (Struct - 2 A - ) - () - ) - () - ) - (= - (ArrayItem - (Var 205 y) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - (StructTypeConstructor - 2 A - [((RealConstant - 2.200000 - (Real 8) - )) - ((IntegerConstant 2 (Integer 4))) - ((Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - )) - ((Cast - (RealConstant - 2.200000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 2.200000 - (Real 4) - ) - )) - ((Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - )) - ((Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 2 (Integer 1)) - )) - ((LogicalConstant - .true. - (Logical 4) - ))] - (Struct - 2 A - ) - () - ) - () - ) - (SubroutineCall - 2 verify - () - [((ArrayPhysicalCast - (Var 205 y) - FixedSizeArray - DescriptorArray - (Array - (Struct - 2 A - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 1 (Integer 4))) - ((RealConstant - 1.100000 - (Real 8) - )) - ((IntegerConstant 2 (Integer 4))) - ((RealConstant - 2.200000 - (Real 8) - ))] - () - ) - (SubroutineCall - 2 update_1 - () - [((ArrayItem - (Var 205 y) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ))] - () - ) - (SubroutineCall - 2 update_2 - () - [((ArrayPhysicalCast - (Var 205 y) - FixedSizeArray - DescriptorArray - (Array - (Struct - 2 A - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - DescriptorArray - ) - () - ))] - () - ) - (SubroutineCall - 2 verify - () - [((ArrayPhysicalCast - (Var 205 y) - FixedSizeArray - DescriptorArray - (Array - (Struct - 2 A - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - DescriptorArray - ) - () - )) - ((IntegerConstant 2 (Integer 4))) - ((RealConstant - 1.200000 - (Real 8) - )) - ((IntegerConstant 3 (Integer 4))) - ((RealConstant - 2.300000 - (Real 8) - ))] - () - )] - () - Public - .false. - .false. - () - ), - update_1: - (Function - (SymbolTable - 203 - { - s: - (Variable - 203 - s - [] - InOut - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ) - }) - update_1 - (FunctionType - [(Struct - 2 A - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 203 s)] - [(= - (StructInstanceMember - (Var 203 s) - 201 x - (Integer 4) - () - ) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (StructInstanceMember - (Var 203 s) - 201 y - (Real 8) - () - ) - (RealConstant - 1.200000 - (Real 8) - ) - () - ) - (= - (StructInstanceMember - (Var 203 s) - 201 z - (Integer 8) - () - ) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - () - ) - (= - (StructInstanceMember - (Var 203 s) - 201 a - (Real 4) - () - ) - (Cast - (RealConstant - 1.200000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.200000 - (Real 4) - ) - ) - () - ) - (= - (StructInstanceMember - (Var 203 s) - 201 b - (Integer 2) - () - ) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - ) - () - ) - (= - (StructInstanceMember - (Var 203 s) - 201 c - (Integer 1) - () - ) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 2 (Integer 1)) - ) - () - )] - () - Public - .false. - .false. - () - ), - update_2: - (Function - (SymbolTable - 204 - { - s: - (Variable - 204 - s - [] - InOut - () - () - Default - (Array - (Struct - 2 A - ) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - update_2 - (FunctionType - [(Array - (Struct - 2 A - ) - [(() - ())] - DescriptorArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 204 s)] - [(= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 x - (Integer 4) - () - ) - (IntegerConstant 3 (Integer 4)) - () - ) - (= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 y - (Real 8) - () - ) - (RealConstant - 2.300000 - (Real 8) - ) - () - ) - (= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 z - (Integer 8) - () - ) - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - () - ) - (= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 a - (Real 4) - () - ) - (Cast - (RealConstant - 2.300000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 2.300000 - (Real 4) - ) - ) - () - ) - (= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 b - (Integer 2) - () - ) - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 3 (Integer 2)) - ) - () - ) - (= - (StructInstanceMember - (ArrayItem - (Var 204 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - 201 c - (Integer 1) - () - ) - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 3 (Integer 1)) - ) - () - )] - () - Public - .false. - .false. - () - ), - verify: - (Function - (SymbolTable - 202 - { - eps: - (Variable - 202 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - s: - (Variable - 202 - s - [] - InOut - () - () - Default - (Array - (Struct - 2 A - ) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - s0: - (Variable - 202 - s0 - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - s1: - (Variable - 202 - s1 - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - x1: - (Variable - 202 - x1 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x2: - (Variable - 202 - x2 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y1: - (Variable - 202 - y1 - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - y2: - (Variable - 202 - y2 - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - verify - (FunctionType - [(Array - (Struct - 2 A - ) - [(() - ())] - DescriptorArray - ) - (Integer 4) - (Real 8) - (Integer 4) - (Real 8)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 s) - (Var 202 x1) - (Var 202 y1) - (Var 202 x2) - (Var 202 y2)] - [(= - (Var 202 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 202 s0) - (ArrayItem - (Var 202 s) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - () - ) - (Print - () - [(StructInstanceMember - (Var 202 s0) - 201 x - (Integer 4) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 y - (Real 8) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 z - (Integer 8) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 a - (Real 4) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 b - (Integer 2) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 c - (Integer 1) - () - ) - (StructInstanceMember - (Var 202 s0) - 201 d - (Logical 4) - () - )] - () - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s0) - 201 x - (Integer 4) - () - ) - Eq - (Var 202 x1) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (StructInstanceMember - (Var 202 s0) - 201 y - (Real 8) - () - ) - Sub - (Var 202 y1) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 202 eps) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s0) - 201 z - (Integer 8) - () - ) - Eq - (Cast - (Var 202 x1) - IntegerToInteger - (Integer 8) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (StructInstanceMember - (Var 202 s0) - 201 a - (Real 4) - () - ) - Sub - (Cast - (Var 202 y1) - RealToReal - (Real 4) - () - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - Lt - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s0) - 201 b - (Integer 2) - () - ) - Eq - (Cast - (Var 202 x1) - IntegerToInteger - (Integer 2) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s0) - 201 c - (Integer 1) - () - ) - Eq - (Cast - (Var 202 x1) - IntegerToInteger - (Integer 1) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (StructInstanceMember - (Var 202 s0) - 201 d - (Logical 4) - () - ) - () - ) - (= - (Var 202 s1) - (ArrayItem - (Var 202 s) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Struct - 2 A - ) - RowMajor - () - ) - () - ) - (Print - () - [(StructInstanceMember - (Var 202 s1) - 201 x - (Integer 4) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 y - (Real 8) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 z - (Integer 8) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 a - (Real 4) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 b - (Integer 2) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 c - (Integer 1) - () - ) - (StructInstanceMember - (Var 202 s1) - 201 d - (Logical 4) - () - )] - () - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s1) - 201 x - (Integer 4) - () - ) - Eq - (Var 202 x2) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (StructInstanceMember - (Var 202 s1) - 201 y - (Real 8) - () - ) - Sub - (Var 202 y2) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 202 eps) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s1) - 201 z - (Integer 8) - () - ) - Eq - (Cast - (Var 202 x2) - IntegerToInteger - (Integer 8) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (StructInstanceMember - (Var 202 s1) - 201 a - (Real 4) - () - ) - Sub - (Cast - (Var 202 y2) - RealToReal - (Real 4) - () - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - Lt - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s1) - 201 b - (Integer 2) - () - ) - Eq - (Cast - (Var 202 x2) - IntegerToInteger - (Integer 2) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 202 s1) - 201 c - (Integer 1) - () - ) - Eq - (Cast - (Var 202 x2) - IntegerToInteger - (Integer 1) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (StructInstanceMember - (Var 202 s1) - 201 d - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 208 - { - __main__global_stmts: - (ExternalSymbol - 208 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 208 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stdout b/tests/reference/asr-test_bool_binop-f856ef0.stdout deleted file mode 100644 index f93267c185..0000000000 --- a/tests/reference/asr-test_bool_binop-f856ef0.stdout +++ /dev/null @@ -1,442 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 3 - b2 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 i) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Mul - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (Cast - (IntrinsicScalarFunction - FloorDiv - [(LogicalConstant - .true. - (Logical 4) - ) - (LogicalConstant - .true. - (Logical 4) - )] - 0 - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - LogicalToInteger - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (Cast - (IntrinsicScalarFunction - FloorDiv - [(LogicalConstant - .false. - (Logical 4) - ) - (LogicalConstant - .true. - (Logical 4) - )] - 0 - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - LogicalToInteger - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Pow - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b1) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (= - (Var 3 b2) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 f) - (RealBinOp - (Cast - (Var 3 b1) - LogicalToReal - (Real 8) - () - ) - Div - (Cast - (Var 3 b2) - LogicalToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (Var 3 f) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stdout b/tests/reference/asr-test_builtin_bin-52ba9fa.stdout deleted file mode 100644 index 5497b1299d..0000000000 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.stdout +++ /dev/null @@ -1,271 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_bin] - [] - [(SubroutineCall - 2 test_bin - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_bin: - (Function - (SymbolTable - 3 - { - bin: - (ExternalSymbol - 3 - bin - 4 bin - lpython_builtin - [] - bin - Private - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_bin - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [bin] - [] - [(= - (Var 3 i) - (IntegerConstant 5 (Integer 4)) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 bin - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "0b101" - (Character 1 5 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerConstant 64 (Integer 4)) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 bin - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "0b1000000" - (Character 1 9 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 bin - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "-0b1000010110" - (Character 1 13 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 bin - () - [((IntegerConstant 64 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0b1000000" - (Character 1 9 ()) - ) - () - ) - Eq - (StringConstant - "0b1000000" - (Character 1 9 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 bin - () - [((IntegerUnaryMinus - (IntegerConstant 534 (Integer 4)) - (Integer 4) - (IntegerConstant -534 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0b1000010110" - (Character 1 13 ()) - ) - () - ) - Eq - (StringConstant - "-0b1000010110" - (Character 1 13 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_bool-330223a.stdout b/tests/reference/asr-test_builtin_bool-330223a.stdout deleted file mode 100644 index cc514a16d8..0000000000 --- a/tests/reference/asr-test_builtin_bool-330223a.stdout +++ /dev/null @@ -1,896 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_bool] - [] - [(SubroutineCall - 2 test_bool - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_bool: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 3 - a2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - a3: - (Variable - 3 - a3 - [] - Local - () - () - Default - (Integer 1) - () - Source - Public - Required - .false. - ), - a4: - (Variable - 3 - a4 - [] - Local - () - () - Default - (Integer 2) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c1: - (Variable - 3 - c1 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 3 - complex - 4 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_13__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_13__complex - 4 __lpython_overloaded_13__complex - lpython_builtin - [] - __lpython_overloaded_13__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 4 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ), - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 3 - f2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_bool - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_9__complex - complex@__lpython_overloaded_13__complex] - [] - [(= - (Var 3 a) - (IntegerConstant 34 (Integer 4)) - () - ) - (Assert - (Cast - (Var 3 a) - IntegerToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 0 (Integer 4)) - () - ) - (Assert - (LogicalNot - (Cast - (Var 3 a) - IntegerToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (Cast - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - IntegerToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (LogicalNot - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 a2) - (Cast - (IntegerConstant 34 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 34 (Integer 8)) - ) - () - ) - (Assert - (Cast - (Var 3 a2) - IntegerToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 a3) - (Cast - (IntegerConstant 34 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 34 (Integer 1)) - ) - () - ) - (Assert - (Cast - (Var 3 a3) - IntegerToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 a4) - (IntegerUnaryMinus - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - ) - (Integer 2) - (IntegerConstant -1 (Integer 2)) - ) - () - ) - (Assert - (Cast - (Var 3 a4) - IntegerToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (LogicalNot - (Cast - (Var 3 f) - RealToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealConstant - 1.000000 - (Real 8) - ) - () - ) - (Assert - (Cast - (Var 3 f) - RealToLogical - (Logical 4) - () - ) - () - ) - (Assert - (Cast - (RealConstant - 56.786866 - (Real 8) - ) - RealToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (LogicalNot - (Cast - (RealConstant - 0.000000 - (Real 8) - ) - RealToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 f2) - (RealUnaryMinus - (Cast - (RealConstant - 235.600000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 235.600000 - (Real 4) - ) - ) - (Real 4) - (RealConstant - -235.600000 - (Real 4) - ) - ) - () - ) - (Assert - (Cast - (Var 3 f2) - RealToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 f2) - (Cast - (RealConstant - 0.000053 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000053 - (Real 4) - ) - ) - () - ) - (Assert - (Cast - (Var 3 f2) - RealToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "" - (Character 1 0 ()) - ) - () - ) - (Assert - (LogicalNot - (Cast - (Var 3 s) - CharacterToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "str" - (Character 1 3 ()) - ) - () - ) - (Assert - (Cast - (Var 3 s) - CharacterToLogical - (Logical 4) - () - ) - () - ) - (Assert - (LogicalNot - (Cast - (StringConstant - "" - (Character 1 0 ()) - ) - CharacterToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (Cast - (StringConstant - "str" - (Character 1 3 ()) - ) - CharacterToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (Var 3 b) - () - ) - (= - (Var 3 b) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (LogicalNot - (Var 3 b) - (Logical 4) - () - ) - () - ) - (Assert - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (LogicalNot - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 c) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 2 (Integer 4))) - ((IntegerConstant 3 (Integer 4)))] - (Complex 8) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 4) - ) - ) - () - ) - (Assert - (Cast - (Var 3 c) - ComplexToLogical - (Logical 4) - () - ) - () - ) - (= - (Var 3 c) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 0 (Integer 4))) - ((IntegerConstant 0 (Integer 4)))] - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 4) - ) - ) - () - ) - (Assert - (LogicalNot - (Cast - (Var 3 c) - ComplexToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (LogicalNot - (Cast - (ComplexBinOp - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - ) - ComplexToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 c1) - (FunctionCall - 3 complex@__lpython_overloaded_13__complex - 3 complex - [((IntegerConstant 0 (Integer 4))) - ((RealConstant - 0.100202 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 0.000000 - 0.100202 - (Complex 8) - ) - () - ) - () - ) - (Assert - (Cast - (Var 3 c1) - ComplexToLogical - (Logical 4) - () - ) - () - ) - (Assert - (LogicalNot - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 0 (Integer 4))) - ((IntegerConstant 0 (Integer 4)))] - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - () - ) - ComplexToLogical - (Logical 4) - (LogicalConstant - .false. - (Logical 4) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (Cast - (ComplexBinOp - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 3.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 5.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 3.000000 - 5.000000 - (Complex 8) - ) - ) - ComplexToLogical - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stdout b/tests/reference/asr-test_builtin_hex-64bd268.stdout deleted file mode 100644 index c0176738cf..0000000000 --- a/tests/reference/asr-test_builtin_hex-64bd268.stdout +++ /dev/null @@ -1,246 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_hex] - [] - [(SubroutineCall - 2 test_hex - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_hex: - (Function - (SymbolTable - 3 - { - hex: - (ExternalSymbol - 3 - hex - 4 hex - lpython_builtin - [] - hex - Private - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_hex - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [hex] - [] - [(= - (Var 3 i) - (IntegerConstant 34 (Integer 4)) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 hex - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "0x22" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 hex - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "-0x108b" - (Character 1 7 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 hex - () - [((IntegerConstant 34 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0x22" - (Character 1 4 ()) - ) - () - ) - Eq - (StringConstant - "0x22" - (Character 1 4 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 hex - () - [((IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0x108b" - (Character 1 7 ()) - ) - () - ) - Eq - (StringConstant - "-0x108b" - (Character 1 7 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stdout b/tests/reference/asr-test_builtin_oct-20b9066.stdout deleted file mode 100644 index 06973cfab3..0000000000 --- a/tests/reference/asr-test_builtin_oct-20b9066.stdout +++ /dev/null @@ -1,282 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_oct] - [] - [(SubroutineCall - 2 test_oct - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_oct: - (Function - (SymbolTable - 3 - { - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - oct: - (ExternalSymbol - 3 - oct - 4 oct - lpython_builtin - [] - oct - Private - ) - }) - test_oct - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [oct] - [] - [(= - (Var 3 i) - (IntegerConstant 34 (Integer 4)) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 oct - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "0o42" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 oct - () - [((Var 3 i))] - (Character 1 -2 ()) - () - () - ) - Eq - (StringConstant - "-0o10213" - (Character 1 8 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 oct - () - [((IntegerConstant 34 (Integer 4)))] - (Character 1 -2 ()) - (StringConstant - "0o42" - (Character 1 4 ()) - ) - () - ) - Eq - (StringConstant - "0o42" - (Character 1 4 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (FunctionCall - 3 oct - () - [((IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ))] - (Character 1 -2 ()) - (StringConstant - "-0o10213" - (Character 1 8 ()) - ) - () - ) - Eq - (StringConstant - "-0o10213" - (Character 1 8 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable -<<<<<<< HEAD -<<<<<<< HEAD - 131 - { - __main__global_stmts: - (ExternalSymbol - 131 -======= -<<<<<<< HEAD - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 -======= - 133 - { - __main__global_stmts: - (ExternalSymbol - 133 ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 ->>>>>>> main - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall -<<<<<<< HEAD -<<<<<<< HEAD - 131 __main__global_stmts -======= -<<<<<<< HEAD - 120 __main__global_stmts -======= - 133 __main__global_stmts ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 120 __main__global_stmts ->>>>>>> main - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stdout b/tests/reference/asr-test_builtin_pow-f02fcda.stdout deleted file mode 100644 index 03e652d428..0000000000 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stdout +++ /dev/null @@ -1,1955 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_pow] - [] - [(SubroutineCall - 2 test_pow - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_pow: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a1: - (Variable - 3 - a1 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 3 - a2 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 3 - b2 - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - c1: - (Variable - 3 - c1 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 3 - complex - 4 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 4 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ), - eps: - (Variable - 3 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - f1: - (Variable - 3 - f1 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 3 - f2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - i1: - (Variable - 3 - i1 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 3 - i2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - j: - (Variable - 3 - j - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - k: - (Variable - 3 - k - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - p: - (Variable - 3 - p - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - pow: - (ExternalSymbol - 3 - pow - 4 pow - lpython_builtin - [] - pow - Private - ), - pow@__lpython_overloaded_0__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_0__pow - 4 __lpython_overloaded_0__pow - lpython_builtin - [] - __lpython_overloaded_0__pow - Public - ), - pow@__lpython_overloaded_10__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_10__pow - 4 __lpython_overloaded_10__pow - lpython_builtin - [] - __lpython_overloaded_10__pow - Public - ), - pow@__lpython_overloaded_11__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_11__pow - 4 __lpython_overloaded_11__pow - lpython_builtin - [] - __lpython_overloaded_11__pow - Public - ), - pow@__lpython_overloaded_1__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_1__pow - 4 __lpython_overloaded_1__pow - lpython_builtin - [] - __lpython_overloaded_1__pow - Public - ), - pow@__lpython_overloaded_2__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_2__pow - 4 __lpython_overloaded_2__pow - lpython_builtin - [] - __lpython_overloaded_2__pow - Public - ), - pow@__lpython_overloaded_3__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_3__pow - 4 __lpython_overloaded_3__pow - lpython_builtin - [] - __lpython_overloaded_3__pow - Public - ), - pow@__lpython_overloaded_4__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_4__pow - 4 __lpython_overloaded_4__pow - lpython_builtin - [] - __lpython_overloaded_4__pow - Public - ), - pow@__lpython_overloaded_5__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_5__pow - 4 __lpython_overloaded_5__pow - lpython_builtin - [] - __lpython_overloaded_5__pow - Public - ), - pow@__lpython_overloaded_6__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_6__pow - 4 __lpython_overloaded_6__pow - lpython_builtin - [] - __lpython_overloaded_6__pow - Public - ), - pow@__lpython_overloaded_7__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_7__pow - 4 __lpython_overloaded_7__pow - lpython_builtin - [] - __lpython_overloaded_7__pow - Public - ), - pow@__lpython_overloaded_8__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_8__pow - 4 __lpython_overloaded_8__pow - lpython_builtin - [] - __lpython_overloaded_8__pow - Public - ), - pow@__lpython_overloaded_9__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_9__pow - 4 __lpython_overloaded_9__pow - lpython_builtin - [] - __lpython_overloaded_9__pow - Public - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - test_pow - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [pow@__lpython_overloaded_0__pow - pow@__lpython_overloaded_1__pow - pow@__lpython_overloaded_2__pow - pow@__lpython_overloaded_4__pow - pow@__lpython_overloaded_5__pow - pow@__lpython_overloaded_8__pow - pow@__lpython_overloaded_3__pow - pow@__lpython_overloaded_6__pow - pow@__lpython_overloaded_7__pow - pow@__lpython_overloaded_11__pow - pow@__lpython_overloaded_10__pow - complex@__lpython_overloaded_9__complex - pow@__lpython_overloaded_9__pow] - [] - [(= - (Var 3 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerConstant 5 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((Var 3 a)) - ((Var 3 b))] - (Real 8) - () - () - ) - RealToInteger - (Integer 4) - () - ) - Eq - (IntegerConstant 32 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 6 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerConstant 3 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((Var 3 a)) - ((Var 3 b))] - (Real 8) - () - () - ) - RealToInteger - (Integer 4) - () - ) - Eq - (IntegerConstant 216 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerConstant 0 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((Var 3 a)) - ((Var 3 b))] - (Real 8) - () - () - ) - RealToInteger - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - () - ) - (= - (Var 3 a) - (IntegerConstant 6 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerUnaryMinus - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant -4 (Integer 4)) - ) - () - ) - (= - (Var 3 i1) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - () - ) - (= - (Var 3 i2) - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_1__pow - 3 pow - [((Var 3 i1)) - ((Var 3 i2))] - (Real 8) - () - () - ) - RealToInteger - (Integer 8) - () - ) - Eq - (Cast - (IntegerConstant 32 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 32 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i1) - (Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - ) - () - ) - (= - (Var 3 i2) - (IntegerUnaryMinus - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -3 (Integer 8)) - ) - () - ) - (= - (Var 3 f1) - (Cast - (RealBinOp - (Cast - (IntegerConstant 525346 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 525346.000000 - (Real 8) - ) - ) - Div - (Cast - (IntegerConstant 66456 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 66456.000000 - (Real 8) - ) - ) - (Real 8) - (RealConstant - 7.905170 - (Real 8) - ) - ) - RealToReal - (Real 4) - (RealConstant - 7.905170 - (Real 4) - ) - ) - () - ) - (= - (Var 3 f2) - (Cast - (RealConstant - 3.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 p) - (FunctionCall - 3 pow@__lpython_overloaded_2__pow - 3 pow - [((Var 3 f1)) - ((Var 3 f2))] - (Real 4) - () - () - ) - () - ) - (= - (Var 3 f1) - (FunctionCall - 3 pow@__lpython_overloaded_4__pow - 3 pow - [((Var 3 a)) - ((Var 3 f2))] - (Real 4) - () - () - ) - () - ) - (= - (Var 3 f1) - (FunctionCall - 3 pow@__lpython_overloaded_5__pow - 3 pow - [((Var 3 f2)) - ((Var 3 a))] - (Real 4) - () - () - ) - () - ) - (= - (Var 3 b1) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 b2) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_8__pow - 3 pow - [((Var 3 b1)) - ((Var 3 b2))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_8__pow - 3 pow - [((Var 3 b2)) - ((Var 3 b1))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_8__pow - 3 pow - [((Var 3 b1)) - ((Var 3 b2))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_8__pow - 3 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) - ) - ) - () - ) - (= - (Var 3 a1) - (RealConstant - 4.500000 - (Real 8) - ) - () - ) - (= - (Var 3 a2) - (RealConstant - 2.300000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_3__pow - 3 pow - [((Var 3 a1)) - ((Var 3 a2))] - (Real 8) - () - () - ) - Sub - (RealConstant - 31.797193 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_3__pow - 3 pow - [((Var 3 a2)) - ((Var 3 a1))] - (Real 8) - () - () - ) - Sub - (RealConstant - 42.439989 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerConstant 3 (Integer 4)) - () - ) - (= - (Var 3 y) - (RealConstant - 2.300000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_6__pow - 3 pow - [((Var 3 x)) - ((Var 3 y))] - (Real 8) - () - () - ) - Sub - (RealConstant - 12.513503 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_7__pow - 3 pow - [((Var 3 y)) - ((Var 3 x))] - (Real 8) - () - () - ) - Sub - (RealConstant - 12.167000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_6__pow - 3 pow - [((Var 3 x)) - ((RealConstant - 5.500000 - (Real 8) - ))] - (Real 8) - () - () - ) - Sub - (RealConstant - 420.888346 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_1__pow - 3 pow - [((Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - )) - ((IntegerUnaryMinus - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -1 (Integer 8)) - ))] - (Real 8) - (RealConstant - 0.500000 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_1__pow - 3 pow - [((Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - )) - ((IntegerUnaryMinus - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -4 (Integer 8)) - ))] - (Real 8) - (RealConstant - 0.000772 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.000772 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_1__pow - 3 pow - [((IntegerUnaryMinus - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -3 (Integer 8)) - )) - ((IntegerUnaryMinus - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -5 (Integer 8)) - ))] - (Real 8) - (RealConstant - -0.004115 - (Real 8) - ) - () - ) - Add - (RealConstant - 0.004115 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_1__pow - 3 pow - [((Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - )) - ((IntegerUnaryMinus - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -4 (Integer 8)) - ))] - (Real 8) - (RealConstant - 0.000772 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.000772 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_3__pow - 3 pow - [((RealConstant - 4.500000 - (Real 8) - )) - ((RealConstant - 2.300000 - (Real 8) - ))] - (Real 8) - (RealConstant - 31.797193 - (Real 8) - ) - () - ) - Sub - (RealConstant - 31.797193 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_3__pow - 3 pow - [((RealConstant - 2.300000 - (Real 8) - )) - ((RealConstant - 0.000000 - (Real 8) - ))] - (Real 8) - (RealConstant - 1.000000 - (Real 8) - ) - () - ) - Sub - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_3__pow - 3 pow - [((RealConstant - 2.300000 - (Real 8) - )) - ((RealUnaryMinus - (RealConstant - 1.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -1.500000 - (Real 8) - ) - ))] - (Real 8) - (RealConstant - 0.286687 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.286687 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_6__pow - 3 pow - [((IntegerConstant 2 (Integer 4))) - ((RealConstant - 3.400000 - (Real 8) - ))] - (Real 8) - (RealConstant - 10.556063 - (Real 8) - ) - () - ) - Sub - (RealConstant - 10.556063 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_6__pow - 3 pow - [((IntegerConstant 2 (Integer 4))) - ((RealUnaryMinus - (RealConstant - 3.400000 - (Real 8) - ) - (Real 8) - (RealConstant - -3.400000 - (Real 8) - ) - ))] - (Real 8) - (RealConstant - 0.094732 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.094732 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_7__pow - 3 pow - [((RealConstant - 3.400000 - (Real 8) - )) - ((IntegerConstant 9 (Integer 4)))] - (Real 8) - (RealConstant - 60716.992766 - (Real 8) - ) - () - ) - Sub - (RealConstant - 60716.992766 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_7__pow - 3 pow - [((RealConstant - 0.000000 - (Real 8) - )) - ((IntegerConstant 53 (Integer 4)))] - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - Sub - (RealConstant - 0.000000 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Cast - (FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((IntegerConstant 4 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Real 8) - (RealConstant - 16.000000 - (Real 8) - ) - () - ) - RealToInteger - (Integer 4) - (IntegerConstant 16 (Integer 4)) - ) - Eq - (IntegerConstant 16 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 3 pow@__lpython_overloaded_7__pow - 3 pow - [((RealUnaryMinus - (RealConstant - 4235.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - )) - ((IntegerConstant 52 (Integer 4)))] - (Real 8) - (RealConstant - 394800380598526378720936476336799774273305305904443955996320177992404102454228192853661558132283280490733920647962082901303487965679010854404517306573035287122910924343151116372519789002752.000000 - (Real 8) - ) - () - ) - Sub - (RealConstant - 394800380598526378720936476336799774273305305904443955996320177992404102454228192853661558132283280490733920647962082901303487965679010854404517306573035287122910924343151116372519789002752.000000 - (Real 8) - ) - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 7 (Integer 8)) - ) - () - ) - (= - (Var 3 j) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - () - ) - (= - (Var 3 k) - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_11__pow - 3 pow - [((Var 3 i)) - ((Var 3 j)) - ((Var 3 k))] - (Integer 8) - () - () - ) - Eq - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 pow@__lpython_overloaded_10__pow - 3 pow - [((IntegerConstant 102 (Integer 4))) - ((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 121 (Integer 4)))] - (Integer 4) - (RealConstant - 38.000000 - (Real 8) - ) - () - ) - Eq - (IntegerConstant 38 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 c1) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 4 (Integer 4))) - ((IntegerConstant 5 (Integer 4)))] - (Complex 8) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 c1) - (FunctionCall - 3 pow@__lpython_overloaded_9__pow - 3 pow - [((Var 3 c1)) - ((IntegerConstant 4 (Integer 4)))] - (Complex 4) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable -<<<<<<< HEAD -<<<<<<< HEAD - 131 - { - __main__global_stmts: - (ExternalSymbol - 131 -======= -<<<<<<< HEAD - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 -======= - 133 - { - __main__global_stmts: - (ExternalSymbol - 133 ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 ->>>>>>> main - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall -<<<<<<< HEAD -<<<<<<< HEAD - 131 __main__global_stmts -======= -<<<<<<< HEAD - 120 __main__global_stmts -======= - 133 __main__global_stmts ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 120 __main__global_stmts ->>>>>>> main - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_round-7417a21.stdout b/tests/reference/asr-test_builtin_round-7417a21.stdout deleted file mode 100644 index 28feda2e17..0000000000 --- a/tests/reference/asr-test_builtin_round-7417a21.stdout +++ /dev/null @@ -1,919 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_round] - [] - [(SubroutineCall - 2 test_round - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_round: - (Function - (SymbolTable - 3 - { - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 3 - f2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 3 - i2 - [] - Local - () - () - Default - (Integer 1) - () - Source - Public - Required - .false. - ), - i3: - (Variable - 3 - i3 - [] - Local - () - () - Default - (Integer 2) - () - Source - Public - Required - .false. - ), - i4: - (Variable - 3 - i4 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - round: - (ExternalSymbol - 3 - round - 4 round - lpython_builtin - [] - round - Private - ), - round@__lpython_overloaded_0__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_0__round - 4 __lpython_overloaded_0__round - lpython_builtin - [] - __lpython_overloaded_0__round - Public - ), - round@__lpython_overloaded_1__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_1__round - 4 __lpython_overloaded_1__round - lpython_builtin - [] - __lpython_overloaded_1__round - Public - ), - round@__lpython_overloaded_2__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_2__round - 4 __lpython_overloaded_2__round - lpython_builtin - [] - __lpython_overloaded_2__round - Public - ), - round@__lpython_overloaded_3__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_3__round - 4 __lpython_overloaded_3__round - lpython_builtin - [] - __lpython_overloaded_3__round - Public - ), - round@__lpython_overloaded_4__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_4__round - 4 __lpython_overloaded_4__round - lpython_builtin - [] - __lpython_overloaded_4__round - Public - ), - round@__lpython_overloaded_5__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_5__round - 4 __lpython_overloaded_5__round - lpython_builtin - [] - __lpython_overloaded_5__round - Public - ), - round@__lpython_overloaded_6__round: - (ExternalSymbol - 3 - round@__lpython_overloaded_6__round - 4 __lpython_overloaded_6__round - lpython_builtin - [] - __lpython_overloaded_6__round - Public - ) - }) - test_round - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [round@__lpython_overloaded_0__round - round@__lpython_overloaded_1__round - round@__lpython_overloaded_2__round - round@__lpython_overloaded_4__round - round@__lpython_overloaded_5__round - round@__lpython_overloaded_3__round - round@__lpython_overloaded_6__round] - [] - [(= - (Var 3 f) - (RealConstant - 5.678000 - (Real 8) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 6 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealUnaryMinus - (RealConstant - 183745.230000 - (Real 8) - ) - (Real 8) - (RealConstant - -183745.230000 - (Real 8) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 183745 (Integer 4)) - (Integer 4) - (IntegerConstant -183745 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealConstant - 44.340000 - (Real 8) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 44 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealConstant - 0.500000 - (Real 8) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealUnaryMinus - (RealConstant - 50.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -50.500000 - (Real 8) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 50 (Integer 4)) - (Integer 4) - (IntegerConstant -50 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealConstant - 1.500000 - (Real 8) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((Var 3 f))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealConstant - 13.001000 - (Real 8) - ))] - (Integer 4) - (IntegerConstant 13 (Integer 4)) - () - ) - Eq - (IntegerConstant 13 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealUnaryMinus - (RealConstant - 40.499990 - (Real 8) - ) - (Real 8) - (RealConstant - -40.499990 - (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 - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealConstant - 0.500000 - (Real 8) - ))] - (Integer 4) - (IntegerConstant 0 (Integer 4)) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealUnaryMinus - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -0.500000 - (Real 8) - ) - ))] - (Integer 4) - (IntegerConstant 0 (Integer 4)) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealConstant - 1.500000 - (Real 8) - ))] - (Integer 4) - (IntegerConstant 2 (Integer 4)) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealConstant - 50.500000 - (Real 8) - ))] - (Integer 4) - (IntegerConstant 50 (Integer 4)) - () - ) - Eq - (IntegerConstant 50 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_0__round - 3 round - [((RealConstant - 56.780000 - (Real 8) - ))] - (Integer 4) - (IntegerConstant 57 (Integer 4)) - () - ) - Eq - (IntegerConstant 57 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 f2) - (Cast - (RealConstant - 5.678000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.678000 - (Real 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_1__round - 3 round - [((Var 3 f2))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 6 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_2__round - 3 round - [((Var 3 i))] - (Integer 4) - () - () - ) - Eq - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_2__round - 3 round - [((IntegerConstant 4 (Integer 4)))] - (Integer 4) - (IntegerConstant 4 (Integer 4)) - () - ) - Eq - (IntegerConstant 4 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 i2) - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 7 (Integer 1)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_4__round - 3 round - [((Var 3 i2))] - (Integer 1) - () - () - ) - Eq - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 7 (Integer 1)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i3) - (Cast - (IntegerUnaryMinus - (IntegerConstant 8 (Integer 4)) - (Integer 4) - (IntegerConstant -8 (Integer 4)) - ) - IntegerToInteger - (Integer 2) - (IntegerConstant -8 (Integer 2)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_5__round - 3 round - [((Var 3 i3))] - (Integer 2) - () - () - ) - Eq - (Cast - (IntegerUnaryMinus - (IntegerConstant 8 (Integer 4)) - (Integer 4) - (IntegerConstant -8 (Integer 4)) - ) - IntegerToInteger - (Integer 2) - (IntegerConstant -8 (Integer 2)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i4) - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_3__round - 3 round - [((Var 3 i4))] - (Integer 8) - () - () - ) - Eq - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_6__round - 3 round - [((Var 3 b))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_6__round - 3 round - [((Var 3 b))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 round@__lpython_overloaded_6__round - 3 round - [((LogicalConstant - .false. - (Logical 4) - ))] - (Integer 4) - (IntegerConstant 0 (Integer 4)) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_complex_01-a6def58.stdout b/tests/reference/asr-test_complex_01-a6def58.stdout deleted file mode 100644 index 9afdf1c930..0000000000 --- a/tests/reference/asr-test_complex_01-a6def58.stdout +++ /dev/null @@ -1,2049 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 123 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 7 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_real_imag - test_complex - test_complex_unary_minus - test_complex_not] - [] - [(SubroutineCall - 2 test_real_imag - () - [] - () - ) - (SubroutineCall - 2 test_complex - () - [] - () - ) - (SubroutineCall - 2 test_complex_unary_minus - () - [] - () - ) - (SubroutineCall - 2 test_complex_not - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_complex: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 4 - a2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - a3: - (Variable - 4 - a3 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 4 - complex - 8 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_10__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_10__complex - 8 __lpython_overloaded_10__complex - lpython_builtin - [] - __lpython_overloaded_10__complex - Public - ), - complex@__lpython_overloaded_11__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_11__complex - 8 __lpython_overloaded_11__complex - lpython_builtin - [] - __lpython_overloaded_11__complex - Public - ), - complex@__lpython_overloaded_12__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_12__complex - 8 __lpython_overloaded_12__complex - lpython_builtin - [] - __lpython_overloaded_12__complex - Public - ), - complex@__lpython_overloaded_13__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_13__complex - 8 __lpython_overloaded_13__complex - lpython_builtin - [] - __lpython_overloaded_13__complex - Public - ), - complex@__lpython_overloaded_14__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_14__complex - 8 __lpython_overloaded_14__complex - lpython_builtin - [] - __lpython_overloaded_14__complex - Public - ), - complex@__lpython_overloaded_5__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_5__complex - 8 __lpython_overloaded_5__complex - lpython_builtin - [] - __lpython_overloaded_5__complex - Public - ), - complex@__lpython_overloaded_6__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_6__complex - 8 __lpython_overloaded_6__complex - lpython_builtin - [] - __lpython_overloaded_6__complex - Public - ), - complex@__lpython_overloaded_7__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_7__complex - 8 __lpython_overloaded_7__complex - lpython_builtin - [] - __lpython_overloaded_7__complex - Public - ), - complex@__lpython_overloaded_8__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_8__complex - 8 __lpython_overloaded_8__complex - lpython_builtin - [] - __lpython_overloaded_8__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 4 - complex@__lpython_overloaded_9__complex - 8 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ), - eps: - (Variable - 4 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i1: - (Variable - 4 - i1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 4 - i2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - x2: - (Variable - 4 - x2 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ) - }) - test_complex - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_5__complex - complex@__lpython_overloaded_9__complex - complex@__lpython_overloaded_13__complex - complex@__lpython_overloaded_14__complex - complex@__lpython_overloaded_6__complex - complex@__lpython_overloaded_7__complex - complex@__lpython_overloaded_8__complex - complex@__lpython_overloaded_11__complex - complex@__lpython_overloaded_10__complex - complex@__lpython_overloaded_12__complex] - [] - [(= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_5__complex - 4 complex - [((RealConstant - 4.500000 - (Real 8) - )) - ((RealConstant - 6.700000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 4.500000 - 6.700000 - (Complex 8) - ) - () - ) - () - ) - (= - (Var 4 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 4.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 6.700000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_9__complex - 4 complex - [((IntegerUnaryMinus - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant -4 (Integer 4)) - )) - ((IntegerConstant 2 (Integer 4)))] - (Complex 8) - (ComplexConstant - -4.000000 - 2.000000 - (Complex 8) - ) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 4 x) - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 4.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4.000000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_13__complex - 4 complex - [((IntegerConstant 4 (Integer 4))) - ((RealConstant - 7.890000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 4.000000 - 7.890000 - (Complex 8) - ) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 4.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 7.890000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_14__complex - 4 complex - [((RealConstant - 5.600000 - (Real 8) - )) - ((IntegerConstant 0 (Integer 4)))] - (Complex 8) - (ComplexConstant - 5.600000 - 0.000000 - (Complex 8) - ) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 5.600000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 0.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 a) - (RealConstant - 534.600000 - (Real 8) - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_5__complex - 4 complex - [((Var 4 a)) - ((RealUnaryMinus - (Var 4 a) - (Real 8) - () - ))] - (Complex 8) - () - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 4 x) - (Real 8) - () - ) - Sub - (RealConstant - 534.600000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x) - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 534.600000 - (Real 8) - ) - (Real 8) - (RealConstant - -534.600000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 a2) - (RealUnaryMinus - (Cast - (RealConstant - 423.543081 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 423.543081 - (Real 4) - ) - ) - (Real 4) - (RealConstant - -423.543081 - (Real 4) - ) - ) - () - ) - (= - (Var 4 a3) - (Cast - (RealConstant - 34.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 34.500000 - (Real 4) - ) - ) - () - ) - (= - (Var 4 x2) - (FunctionCall - 4 complex@__lpython_overloaded_6__complex - 4 complex - [((Var 4 a2)) - ((Var 4 a3))] - (Complex 4) - () - () - ) - () - ) - (Assert - (RealCompare - (Cast - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 4 x2) - (Real 4) - () - ) - Sub - (Cast - (RealConstant - 34.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 34.500000 - (Real 4) - ) - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - LtE - (Var 4 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i1) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - () - ) - (= - (Var 4 i2) - (IntegerUnaryMinus - (Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -6 (Integer 8)) - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_7__complex - 4 complex - [((Var 4 a3)) - ((Var 4 a))] - (Complex 8) - () - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_8__complex - 4 complex - [((Var 4 a)) - ((Var 4 a3))] - (Complex 8) - () - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_11__complex - 4 complex - [((Var 4 i1)) - ((Var 4 i2))] - (Complex 8) - () - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_9__complex - 4 complex - [((Var 4 i1)) - ((IntegerUnaryMinus - (Var 4 i1) - (Integer 4) - () - ))] - (Complex 8) - () - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_10__complex - 4 complex - [((IntegerUnaryMinus - (Var 4 i2) - (Integer 8) - () - )) - ((IntegerUnaryMinus - (Var 4 i2) - (Integer 8) - () - ))] - (Complex 8) - () - () - ) - () - ) - (= - (Var 4 x) - (FunctionCall - 4 complex@__lpython_overloaded_12__complex - 4 complex - [((Var 4 i2)) - ((IntegerUnaryMinus - (Var 4 i1) - (Integer 4) - () - ))] - (Complex 8) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_complex_not: - (Function - (SymbolTable - 6 - { - b: - (Variable - 6 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 6 - c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c2: - (Variable - 6 - c2 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 6 - complex - 8 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 6 - complex@__lpython_overloaded_9__complex - 8 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ) - }) - test_complex_not - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_9__complex] - [] - [(= - (Var 6 c) - (Cast - (FunctionCall - 6 complex@__lpython_overloaded_9__complex - 6 complex - [((IntegerConstant 4 (Integer 4))) - ((IntegerConstant 5 (Integer 4)))] - (Complex 8) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 6 b) - (LogicalNot - (Cast - (Var 6 c) - ComplexToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (LogicalNot - (Var 6 b) - (Logical 4) - () - ) - () - ) - (= - (Var 6 c2) - (FunctionCall - 6 complex@__lpython_overloaded_9__complex - 6 complex - [((IntegerConstant 0 (Integer 4))) - ((IntegerConstant 0 (Integer 4)))] - (Complex 8) - (ComplexConstant - 0.000000 - 0.000000 - (Complex 8) - ) - () - ) - () - ) - (= - (Var 6 b) - (LogicalNot - (Cast - (Var 6 c2) - ComplexToLogical - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (Assert - (Var 6 b) - () - )] - () - Public - .false. - .false. - () - ), - test_complex_unary_minus: - (Function - (SymbolTable - 5 - { - _c: - (Variable - 5 - _c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - c2: - (Variable - 5 - c2 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - complex: - (ExternalSymbol - 5 - complex - 8 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_13__complex: - (ExternalSymbol - 5 - complex@__lpython_overloaded_13__complex - 8 __lpython_overloaded_13__complex - lpython_builtin - [] - __lpython_overloaded_13__complex - Public - ), - complex@__lpython_overloaded_5__complex: - (ExternalSymbol - 5 - complex@__lpython_overloaded_5__complex - 8 __lpython_overloaded_5__complex - lpython_builtin - [] - __lpython_overloaded_5__complex - Public - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 5 - complex@__lpython_overloaded_9__complex - 8 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ) - }) - test_complex_unary_minus - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_13__complex - complex@__lpython_overloaded_9__complex - complex@__lpython_overloaded_5__complex] - [] - [(= - (Var 5 c) - (Cast - (FunctionCall - 5 complex@__lpython_overloaded_13__complex - 5 complex - [((IntegerConstant 3 (Integer 4))) - ((RealConstant - 4.500000 - (Real 8) - ))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.500000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 3.000000 - 4.500000 - (Complex 4) - ) - ) - () - ) - (= - (Var 5 _c) - (ComplexUnaryMinus - (Var 5 c) - (Complex 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Cast - (ComplexRe - (Var 5 _c) - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -3.000000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Cast - (ComplexIm - (Var 5 _c) - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 4.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -4.500000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 _c) - (Cast - (FunctionCall - 5 complex@__lpython_overloaded_9__complex - 5 complex - [((IntegerConstant 5 (Integer 4))) - ((IntegerUnaryMinus - (IntegerConstant 78 (Integer 4)) - (Integer 4) - (IntegerConstant -78 (Integer 4)) - ))] - (Complex 8) - (ComplexConstant - 5.000000 - -78.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 5.000000 - -78.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 5 _c) - (ComplexUnaryMinus - (Var 5 _c) - (Complex 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Cast - (ComplexRe - (Var 5 _c) - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -5.000000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Cast - (ComplexIm - (Var 5 _c) - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Sub - (RealConstant - 78.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 c2) - (FunctionCall - 5 complex@__lpython_overloaded_5__complex - 5 complex - [((RealUnaryMinus - (RealConstant - 4.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -4.500000 - (Real 8) - ) - )) - ((RealUnaryMinus - (RealConstant - 7.800000 - (Real 8) - ) - (Real 8) - (RealConstant - -7.800000 - (Real 8) - ) - ))] - (Complex 8) - (ComplexConstant - -4.500000 - -7.800000 - (Complex 8) - ) - () - ) - () - ) - (= - (Var 5 c2) - (ComplexUnaryMinus - (Var 5 c2) - (Complex 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 5 c2) - (Real 8) - () - ) - Sub - (RealConstant - 4.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 5 c2) - (Real 8) - () - ) - Sub - (RealConstant - 7.800000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 c2) - (ComplexBinOp - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 3.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 4.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 5 c2) - (ComplexUnaryMinus - (Var 5 c2) - (Complex 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexRe - (Var 5 c2) - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -3.000000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ComplexIm - (Var 5 c2) - (Real 8) - () - ) - Sub - (RealUnaryMinus - (RealConstant - 4.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4.000000 - (Real 8) - ) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_real_imag: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 3 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ) - }) - test_real_imag - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (ComplexBinOp - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 2.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 3.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 3 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 3 a) - (ComplexRe - (Var 3 x) - (Real 8) - () - ) - () - ) - (= - (Var 3 b) - (ComplexIm - (Var 3 x) - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 a) - Sub - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 b) - Sub - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 3 eps) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable -<<<<<<< HEAD -<<<<<<< HEAD - 135 - { - __main__global_stmts: - (ExternalSymbol - 135 -======= -<<<<<<< HEAD - 124 - { - __main__global_stmts: - (ExternalSymbol - 124 -======= - 137 - { - __main__global_stmts: - (ExternalSymbol - 137 ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 124 - { - __main__global_stmts: - (ExternalSymbol - 124 ->>>>>>> main - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall -<<<<<<< HEAD -<<<<<<< HEAD - 135 __main__global_stmts -======= -<<<<<<< HEAD - 124 __main__global_stmts -======= - 137 __main__global_stmts ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 124 __main__global_stmts ->>>>>>> main - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_complex_02-782ba2d.stdout b/tests/reference/asr-test_complex_02-782ba2d.stdout deleted file mode 100644 index bb09e7e578..0000000000 --- a/tests/reference/asr-test_complex_02-782ba2d.stdout +++ /dev/null @@ -1,754 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 122 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 6 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_complex_abs - test_complex_binop_32 - test_complex_binop_64] - [] - [(SubroutineCall - 2 test_complex_abs - () - [] - () - ) - (SubroutineCall - 2 test_complex_binop_32 - () - [] - () - ) - (SubroutineCall - 2 test_complex_binop_64 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_complex_abs: - (Function - (SymbolTable - 3 - { - complex: - (ExternalSymbol - 3 - complex - 7 complex - lpython_builtin - [] - complex - Private - ), - complex@__lpython_overloaded_9__complex: - (ExternalSymbol - 3 - complex@__lpython_overloaded_9__complex - 7 __lpython_overloaded_9__complex - lpython_builtin - [] - __lpython_overloaded_9__complex - Public - ), - eps: - (Variable - 3 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ) - }) - test_complex_abs - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [complex@__lpython_overloaded_9__complex] - [] - [(= - (Var 3 x) - (Cast - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Complex 8) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 8) - ) - () - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 3.000000 - 4.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Cast - (IntrinsicScalarFunction - Abs - [(Var 3 x)] - 0 - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Sub - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - ) - (= - (Var 3 y) - (FunctionCall - 3 complex@__lpython_overloaded_9__complex - 3 complex - [((IntegerConstant 6 (Integer 4))) - ((IntegerConstant 8 (Integer 4)))] - (Complex 8) - (ComplexConstant - 6.000000 - 8.000000 - (Complex 8) - ) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (IntrinsicScalarFunction - Abs - [(Var 3 y)] - 0 - (Real 8) - () - ) - Sub - (RealConstant - 10.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 3 eps) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_complex_binop_32: - (Function - (SymbolTable - 4 - { - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ) - }) - test_complex_binop_32 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 x) - (Cast - (ComplexBinOp - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 2.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 3.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 8) - ) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 4 y) - (Cast - (ComplexBinOp - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 4.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 5.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 8) - ) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 4 z) - (ComplexBinOp - (Var 4 x) - Add - (Var 4 y) - (Complex 4) - () - ) - () - ) - (= - (Var 4 z) - (ComplexBinOp - (Var 4 x) - Sub - (Var 4 y) - (Complex 4) - () - ) - () - ) - (= - (Var 4 z) - (ComplexBinOp - (Var 4 x) - Mul - (Var 4 y) - (Complex 4) - () - ) - () - ) - (= - (Var 4 z) - (ComplexBinOp - (Var 4 x) - Pow - (Var 4 y) - (Complex 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_complex_binop_64: - (Function - (SymbolTable - 5 - { - x: - (Variable - 5 - x - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 5 - y - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - z: - (Variable - 5 - z - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ) - }) - test_complex_binop_64 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 x) - (ComplexBinOp - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 2.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 3.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 2.000000 - 3.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 5 y) - (ComplexBinOp - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 4.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 5.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 4.000000 - 5.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 5 z) - (ComplexBinOp - (Var 5 x) - Add - (Var 5 y) - (Complex 8) - () - ) - () - ) - (= - (Var 5 z) - (ComplexBinOp - (Var 5 x) - Sub - (Var 5 y) - (Complex 8) - () - ) - () - ) - (= - (Var 5 z) - (ComplexBinOp - (Var 5 x) - Mul - (Var 5 y) - (Complex 8) - () - ) - () - ) - (= - (Var 5 z) - (ComplexBinOp - (Var 5 x) - Pow - (Var 5 y) - (Complex 8) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable -<<<<<<< HEAD -<<<<<<< HEAD - 134 - { - __main__global_stmts: - (ExternalSymbol - 134 -======= -<<<<<<< HEAD - 123 - { - __main__global_stmts: - (ExternalSymbol - 123 -======= - 136 - { - __main__global_stmts: - (ExternalSymbol - 136 ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 123 - { - __main__global_stmts: - (ExternalSymbol - 123 ->>>>>>> main - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall -<<<<<<< HEAD -<<<<<<< HEAD - 134 __main__global_stmts -======= -<<<<<<< HEAD - 123 __main__global_stmts -======= - 136 __main__global_stmts ->>>>>>> 1095cb6ff (Add isspace API in str) ->>>>>>> c359259eb (Add isspace API in str) -======= - 123 __main__global_stmts ->>>>>>> main - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_max_min-3c2fc51.stdout b/tests/reference/asr-test_max_min-3c2fc51.stdout deleted file mode 100644 index 6ebc1dd036..0000000000 --- a/tests/reference/asr-test_max_min-3c2fc51.stdout +++ /dev/null @@ -1,826 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable -<<<<<<< HEAD - 136 -======= - 123 ->>>>>>> main - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 7 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_max_int - test_max_float - test_min_int - test_min_float] - [] - [(SubroutineCall - 2 test_max_int - () - [] - () - ) - (SubroutineCall - 2 test_max_float - () - [] - () - ) - (SubroutineCall - 2 test_min_int - () - [] - () - ) - (SubroutineCall - 2 test_min_float - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_max_float: - (Function - (SymbolTable - 4 - { - d: - (Variable - 4 - d - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - e: - (Variable - 4 - e - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - f: - (Variable - 4 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - max: - (ExternalSymbol - 4 - max - 8 max - lpython_builtin - [] - max - Private - ), - max@__lpython_overloaded_2__max: - (ExternalSymbol - 4 - max@__lpython_overloaded_2__max - 8 __lpython_overloaded_2__max - lpython_builtin - [] - __lpython_overloaded_2__max - Public - ), - max@__lpython_overloaded_3__max: - (ExternalSymbol - 4 - max@__lpython_overloaded_3__max - 8 __lpython_overloaded_3__max - lpython_builtin - [] - __lpython_overloaded_3__max - Public - ) - }) - test_max_float - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [max@__lpython_overloaded_2__max - max@__lpython_overloaded_3__max] - [] - [(= - (Var 4 d) - (RealConstant - 23.233000 - (Real 8) - ) - () - ) - (= - (Var 4 e) - (RealConstant - 23.223300 - (Real 8) - ) - () - ) - (= - (Var 4 f) - (RealConstant - 21.230000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (FunctionCall - 4 max@__lpython_overloaded_2__max - 4 max - [((Var 4 d)) - ((Var 4 e)) - ((Var 4 f))] - (Real 8) - () - () - ) - Eq - (Var 4 d) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (FunctionCall - 4 max@__lpython_overloaded_3__max - 4 max - [((Var 4 e)) - ((Var 4 f))] - (Real 8) - () - () - ) - Eq - (Var 4 e) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_max_int: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - max: - (ExternalSymbol - 3 - max - 8 max - lpython_builtin - [] - max - Private - ), - max@__lpython_overloaded_0__max: - (ExternalSymbol - 3 - max@__lpython_overloaded_0__max - 8 __lpython_overloaded_0__max - lpython_builtin - [] - __lpython_overloaded_0__max - Public - ), - max@__lpython_overloaded_1__max: - (ExternalSymbol - 3 - max@__lpython_overloaded_1__max - 8 __lpython_overloaded_1__max - lpython_builtin - [] - __lpython_overloaded_1__max - Public - ) - }) - test_max_int - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [max@__lpython_overloaded_0__max - max@__lpython_overloaded_1__max] - [] - [(= - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 3 c) - (IntegerConstant 3 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 max@__lpython_overloaded_0__max - 3 max - [((Var 3 a)) - ((Var 3 b))] - (Integer 4) - () - () - ) - Eq - (Var 3 b) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 max@__lpython_overloaded_1__max - 3 max - [((Var 3 a)) - ((Var 3 b)) - ((Var 3 c))] - (Integer 4) - () - () - ) - Eq - (Var 3 c) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 3 max@__lpython_overloaded_1__max - 3 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 - (IntegerCompare - (FunctionCall - 3 max@__lpython_overloaded_0__max - 3 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) - ) - ) - () - )] - () - Public - .false. - .false. - () - ), - test_min_float: - (Function - (SymbolTable - 6 - { - d: - (Variable - 6 - d - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - e: - (Variable - 6 - e - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - f: - (Variable - 6 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - test_min_float - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 d) - (RealConstant - 23.233000 - (Real 8) - ) - () - ) - (= - (Var 6 e) - (RealConstant - 23.223300 - (Real 8) - ) - () - ) - (= - (Var 6 f) - (RealConstant - 21.230000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Min - [(Var 6 d) - (Var 6 e) - (Var 6 f)] - 0 - (Real 8) - () - ) - Eq - (Var 6 f) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Min - [(Var 6 e) - (Var 6 f)] - 0 - (Real 8) - () - ) - Eq - (Var 6 f) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_min_int: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_min_int - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 a) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 5 b) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 5 c) - (IntegerConstant 3 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Min - [(Var 5 a) - (Var 5 b)] - 0 - (Integer 4) - () - ) - Eq - (Var 5 a) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Min - [(Var 5 a) - (Var 5 b) - (Var 5 c)] - 0 - (Integer 4) - () - ) - Eq - (Var 5 a) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Min - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - 0 - (Integer 4) - (IntegerConstant 1 (Integer 4)) - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Min - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 6 (Integer 4))] - 0 - (Integer 4) - (IntegerConstant 1 (Integer 4)) - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable -<<<<<<< HEAD - 137 - { - __main__global_stmts: - (ExternalSymbol - 137 -======= - 124 - { - __main__global_stmts: - (ExternalSymbol - 124 ->>>>>>> main - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 124 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_numpy_03-e600a49.stdout b/tests/reference/asr-test_numpy_03-e600a49.stdout deleted file mode 100644 index 6d062b182d..0000000000 --- a/tests/reference/asr-test_numpy_03-e600a49.stdout +++ /dev/null @@ -1,1962 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 218 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_reshape_with_argument] - [] - [(SubroutineCall - 2 test_reshape_with_argument - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_1d_to_nd: - (Function - (SymbolTable - 202 - { - a: - (Variable - 202 - a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 202 - b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 202 - c - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 202 - d - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 202 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 202 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 202 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 202 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 202 - l - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - newshape: - (Variable - 202 - newshape - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - newshape1: - (Variable - 202 - newshape1 - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - test_1d_to_nd - (FunctionType - [(Array - (Real 8) - [(() - ())] - DescriptorArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 202 d)] - [(= - (Var 202 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 202 b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 202 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 256 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 255 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 202 i) - (IntrinsicScalarFunction - FloorDiv - [(Var 202 k) - (IntegerConstant 16 (Integer 4))] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 202 j) - (IntegerBinOp - (Var 202 k) - Sub - (IntegerBinOp - (Var 202 i) - Mul - (IntegerConstant 16 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (ArrayItem - (Var 202 b) - [(() - (Var 202 k) - ())] - (Real 8) - RowMajor - () - ) - (RealBinOp - (Cast - (IntegerBinOp - (Var 202 i) - Add - (Var 202 j) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - ) - () - )] - ) - (= - (Var 202 a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 202 newshape) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 202 newshape) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 16 (Integer 4)) - () - ) - (= - (ArrayItem - (Var 202 newshape) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 16 (Integer 4)) - () - ) - (= - (Var 202 a) - (ArrayReshape - (Var 202 b) - (ArrayPhysicalCast - (Var 202 newshape) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - DescriptorArray - ) - () - ) - (Array - (Real 8) - [(() - ())] - FixedSizeArray - ) - () - ) - () - ) - (DoLoop - () - ((Var 202 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 202 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (ArrayItem - (Var 202 a) - [(() - (Var 202 i) - ()) - (() - (Var 202 j) - ())] - (Real 8) - RowMajor - () - ) - Sub - (Cast - (IntegerBinOp - (Var 202 i) - Add - (Var 202 j) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 202 eps) - (Logical 4) - () - ) - () - )] - )] - ) - (= - (Var 202 c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 202 newshape1) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 202 newshape1) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 16 (Integer 4)) - () - ) - (= - (ArrayItem - (Var 202 newshape1) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 16 (Integer 4)) - () - ) - (= - (ArrayItem - (Var 202 newshape1) - [(() - (IntegerConstant 2 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 16 (Integer 4)) - () - ) - (= - (Var 202 c) - (ArrayReshape - (Var 202 d) - (ArrayPhysicalCast - (Var 202 newshape1) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - DescriptorArray - ) - () - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - ) - () - ) - (DoLoop - () - ((Var 202 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 202 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 202 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (ArrayItem - (Var 202 c) - [(() - (Var 202 i) - ()) - (() - (Var 202 j) - ()) - (() - (Var 202 k) - ())] - (Real 8) - RowMajor - () - ) - Sub - (Cast - (IntegerBinOp - (IntegerBinOp - (Var 202 i) - Add - (Var 202 j) - (Integer 4) - () - ) - Add - (Var 202 k) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 202 eps) - (Logical 4) - () - ) - () - )] - )] - )] - )] - () - Public - .false. - .false. - () - ), - test_nd_to_1d: - (Function - (SymbolTable - 201 - { - a: - (Variable - 201 - a - [] - InOut - () - () - Default - (Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 201 - b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 201 - c - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 201 - d - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4096 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - eps: - (Variable - 201 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 201 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 201 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 201 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 201 - l - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - newshape: - (Variable - 201 - newshape - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - newshape1: - (Variable - 201 - newshape1 - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - test_nd_to_1d - (FunctionType - [(Array - (Real 8) - [(() - ()) - (() - ())] - DescriptorArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) -<<<<<<< HEAD -<<<<<<< HEAD -======= - [] - [(Var 201 a)] - [(= - (Var 201 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (= - (Var 201 b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 256 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 201 newshape) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 201 newshape) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 256 (Integer 4)) - () - ) - (= - (Var 201 b) - (ArrayReshape - (Var 201 a) - (ArrayPhysicalCast - (Var 201 newshape) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - DescriptorArray - ) - () - ) - (Array - (Real 8) - [(() - ())] - DescriptorArray - ) - () - ) - () - ) - (DoLoop - () - ((Var 201 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 256 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 255 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 201 i) - (IntrinsicScalarFunction - FloorDiv - [(Var 201 k) - (IntegerConstant 16 (Integer 4))] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 201 j) - (IntegerBinOp - (Var 201 k) - Sub - (IntegerBinOp - (Var 201 i) - Mul - (IntegerConstant 16 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (ArrayItem - (Var 201 b) - [(() - (Var 201 k) - ())] - (Real 8) - RowMajor - () - ) - Sub - (Cast - (IntegerBinOp - (Var 201 i) - Add - (Var 201 j) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 201 eps) - (Logical 4) - () - ) - () - )] - ) - (= - (Var 201 c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 201 c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 201 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 201 k) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 201 c) - [(() - (Var 201 i) - ()) - (() - (Var 201 j) - ()) - (() - (Var 201 k) - ())] - (Real 8) - RowMajor - () - ) - (RealBinOp - (Cast - (IntegerBinOp - (IntegerBinOp - (Var 201 i) - Add - (Var 201 j) - (Integer 4) - () - ) - Add - (Var 201 k) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - ) - () - )] - )] - )] - ) - (= - (Var 201 d) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4096 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 201 newshape1) - (ArrayConstant - [] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (ArrayItem - (Var 201 newshape1) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - (IntegerConstant 4096 (Integer 4)) - () - ) - (= - (Var 201 d) - (ArrayReshape - (Var 201 c) - (ArrayPhysicalCast - (Var 201 newshape1) - FixedSizeArray - DescriptorArray - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)))] - DescriptorArray - ) - () - ) - (Array - (Real 8) - [(() - ())] - FixedSizeArray - ) - () - ) - () - ) - (DoLoop - () - ((Var 201 l) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 4096 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 4095 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 201 i) - (Cast - (RealBinOp - (Cast - (Var 201 l) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (IntegerConstant 256 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 256.000000 - (Real 8) - ) - ) - (Real 8) - () - ) - RealToInteger - (Integer 4) - () - ) - () - ) - (= - (Var 201 j) - (IntrinsicScalarFunction - FloorDiv - [(IntegerBinOp - (Var 201 l) - Sub - (IntegerBinOp - (Var 201 i) - Mul - (IntegerConstant 256 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - (IntegerConstant 16 (Integer 4))] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 201 k) - (IntegerBinOp - (IntegerBinOp - (Var 201 l) - Sub - (IntegerBinOp - (Var 201 i) - Mul - (IntegerConstant 256 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - Sub - (IntegerBinOp - (Var 201 j) - Mul - (IntegerConstant 16 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (ArrayItem - (Var 201 d) - [(() - (Var 201 l) - ())] - (Real 8) - RowMajor - () - ) - Sub - (Cast - (IntegerBinOp - (IntegerBinOp - (Var 201 i) - Add - (Var 201 j) - (Integer 4) - () - ) - Add - (Var 201 k) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - Sub - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (Var 201 eps) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ), - test_reshape_with_argument: - (Function - (SymbolTable - 203 - { - a: - (Variable - 203 - a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 203 - d - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4096 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 203 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 203 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 203 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 203 - l - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_reshape_with_argument - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) ->>>>>>> main - [test_nd_to_1d - test_1d_to_nd] - [] - [(= - (Var 203 a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 214 c) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 203 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(DoLoop - () - ((Var 203 j) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 16 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 15 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 203 a) - [(() - (Var 203 i) - ()) - (() - (Var 203 j) - ())] - (Real 8) - RowMajor - () - ) - (RealBinOp - (Cast - (IntegerBinOp - (Var 203 i) - Add - (Var 203 j) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - ) - () - )] - )] - ) - (SubroutineCall - 2 test_nd_to_1d - () - [((ArrayPhysicalCast - (Var 203 a) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4))) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 16 (Integer 4)))] - DescriptorArray - ) - () - ))] - () - ) - (= - (Var 203 d) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4096 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 203 l) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 4096 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 4095 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 203 i) - (Cast - (RealBinOp - (Cast - (Var 203 l) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (IntegerConstant 256 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 256.000000 - (Real 8) - ) - ) - (Real 8) - () - ) - RealToInteger - (Integer 4) - () - ) - () - ) - (= - (Var 203 j) - (IntrinsicScalarFunction - FloorDiv - [(IntegerBinOp - (Var 203 l) - Sub - (IntegerBinOp - (Var 203 i) - Mul - (IntegerConstant 256 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - (IntegerConstant 16 (Integer 4))] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 203 k) - (IntegerBinOp - (IntegerBinOp - (Var 203 l) - Sub - (IntegerBinOp - (Var 203 i) - Mul - (IntegerConstant 256 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - Sub - (IntegerBinOp - (Var 203 j) - Mul - (IntegerConstant 16 (Integer 4)) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (= - (ArrayItem - (Var 203 d) - [(() - (Var 203 l) - ())] - (Real 8) - RowMajor - () - ) - (RealBinOp - (Cast - (IntegerBinOp - (IntegerBinOp - (Var 203 i) - Add - (Var 203 j) - (Integer 4) - () - ) - Add - (Var 203 k) - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 0.500000 - (Real 8) - ) - (Real 8) - () - ) - () - )] - ) - (SubroutineCall - 2 test_1d_to_nd - () - [((ArrayPhysicalCast - (Var 203 d) - FixedSizeArray - DescriptorArray - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 4096 (Integer 4)))] - DescriptorArray - ) - () - ))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 219 - { - __main__global_stmts: - (ExternalSymbol - 219 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 219 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stdout b/tests/reference/asr-test_numpy_04-ecbb614.stdout deleted file mode 100644 index 90f4b193b1..0000000000 --- a/tests/reference/asr-test_numpy_04-ecbb614.stdout +++ /dev/null @@ -1,519 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 204 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 203 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_array_01 - test_array_02] - [] - [(SubroutineCall - 2 test_array_01 - () - [] - () - ) - (SubroutineCall - 2 test_array_02 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_array_01: - (Function - (SymbolTable - 201 - { - eps: - (Variable - 201 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 201 - x - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - test_array_01 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 201 x) - (ArrayConstant - [(RealConstant - 1.000000 - (Real 8) - ) - (RealConstant - 2.000000 - (Real 8) - ) - (RealConstant - 3.000000 - (Real 8) - )] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (= - (Var 201 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ArrayItem - (Var 201 x) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - Sub - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 201 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ArrayItem - (Var 201 x) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - Sub - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 201 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ArrayItem - (Var 201 x) - [(() - (IntegerConstant 2 (Integer 4)) - ())] - (Real 8) - RowMajor - () - ) - Sub - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (Var 201 eps) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_array_02: - (Function - (SymbolTable - 202 - { - eps: - (Variable - 202 - eps - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 202 - x - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ) - }) - test_array_02 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 202 x) - (ArrayConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - PointerToDataArray - ) - RowMajor - ) - () - ) - (= - (Var 202 eps) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (Cast - (IntrinsicScalarFunction - Abs - [(IntegerBinOp - (ArrayItem - (Var 202 x) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Lt - (Var 202 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (IntrinsicScalarFunction - Abs - [(IntegerBinOp - (ArrayItem - (Var 202 x) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - Sub - (IntegerConstant 2 (Integer 4)) - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Lt - (Var 202 eps) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (IntrinsicScalarFunction - Abs - [(IntegerBinOp - (ArrayItem - (Var 202 x) - [(() - (IntegerConstant 2 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - Sub - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - IntegerToReal - (Real 8) - () - ) - Lt - (Var 202 eps) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 205 - { - __main__global_stmts: - (ExternalSymbol - 205 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 205 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/asr-test_pow-3f5d550.stdout b/tests/reference/asr-test_pow-3f5d550.stdout deleted file mode 100644 index 5e658298dc..0000000000 --- a/tests/reference/asr-test_pow-3f5d550.stdout +++ /dev/null @@ -1,159 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 119 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main] - [] - [(SubroutineCall - 2 main - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main: - (Function - (SymbolTable - 3 - { - pow: - (ExternalSymbol - 3 - pow - 4 pow - lpython_builtin - [] - pow - Private - ), - pow@__lpython_overloaded_0__pow: - (ExternalSymbol - 3 - pow@__lpython_overloaded_0__pow - 4 __lpython_overloaded_0__pow - lpython_builtin - [] - __lpython_overloaded_0__pow - Public - ) - }) - main - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [pow@__lpython_overloaded_0__pow] - [] - [(Print - () - [(FunctionCall - 3 pow@__lpython_overloaded_0__pow - 3 pow - [((IntegerConstant 2 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Real 8) - (RealConstant - 4.000000 - (Real 8) - ) - () - )] - () - () - ) - (Print - () - [(IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Pow - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant 4 (Integer 4)) - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [lpython_builtin] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 120 - { - __main__global_stmts: - (ExternalSymbol - 120 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 120 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-vec_01-66ac423.stdout b/tests/reference/asr-vec_01-66ac423.stdout deleted file mode 100644 index db5dab97b0..0000000000 --- a/tests/reference/asr-vec_01-66ac423.stdout +++ /dev/null @@ -1,295 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 205 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [loop_vec] - [] - [(SubroutineCall - 2 loop_vec - () - [] - () - )] - () - Public - .false. - .false. - () - ), - loop_vec: - (Function - (SymbolTable - 201 - { - a: - (Variable - 201 - a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 201 - b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 201 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - loop_vec - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 201 a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 201 b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 9216 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9215 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 201 b) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - (RealConstant - 5.000000 - (Real 8) - ) - () - )] - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 9216 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9215 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 201 a) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - (ArrayItem - (Var 201 b) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - () - )] - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 9216 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9215 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (ArrayItem - (Var 201 a) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - Eq - (RealConstant - 5.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 206 - { - __main__global_stmts: - (ExternalSymbol - 206 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 206 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) diff --git a/tests/reference/c-expr7-bb2692a.stdout b/tests/reference/c-expr7-bb2692a.stdout deleted file mode 100644 index b85fda16c9..0000000000 --- a/tests/reference/c-expr7-bb2692a.stdout +++ /dev/null @@ -1,362 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include - -float _lcompilers_optimization_floordiv_f32(float a, float b); -double _lcompilers_optimization_floordiv_f64(double a, double b); -int16_t _lcompilers_optimization_floordiv_i16(int16_t a, int16_t b); -int32_t _lcompilers_optimization_floordiv_i32(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i321(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i3210(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i322(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i323(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i324(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i325(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i326(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i327(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i328(int32_t a, int32_t b); -int32_t _lcompilers_optimization_floordiv_i329(int32_t a, int32_t b); -int64_t _lcompilers_optimization_floordiv_i64(int64_t a, int64_t b); -int8_t _lcompilers_optimization_floordiv_i8(int8_t a, int8_t b); -uint16_t _lcompilers_optimization_floordiv_u16(uint16_t a, uint16_t b); -uint32_t _lcompilers_optimization_floordiv_u32(uint32_t a, uint32_t b); -uint64_t _lcompilers_optimization_floordiv_u64(uint64_t a, uint64_t b); -uint8_t _lcompilers_optimization_floordiv_u8(uint8_t a, uint8_t b); -void test_pow(); -int32_t test_pow_1(int32_t a, int32_t b); -void main0(); -void __main__global_stmts(); - - - -// Implementations -float _lcompilers_optimization_floordiv_f32(float a, float b) -{ - double r; - float result; - int64_t tmp; - r = a/b; - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (float)(tmp); - return result; -} - -double _lcompilers_optimization_floordiv_f64(double a, double b) -{ - double r; - double result; - int64_t tmp; - r = a/b; - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (double)(tmp); - return result; -} - -int16_t _lcompilers_optimization_floordiv_i16(int16_t a, int16_t b) -{ - double r; - int16_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i32(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i321(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i3210(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i322(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i323(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i324(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i325(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i326(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i327(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i328(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int32_t _lcompilers_optimization_floordiv_i329(int32_t a, int32_t b) -{ - double r; - int32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int64_t _lcompilers_optimization_floordiv_i64(int64_t a, int64_t b) -{ - double r; - int64_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -int8_t _lcompilers_optimization_floordiv_i8(int8_t a, int8_t b) -{ - double r; - int8_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = tmp; - return result; -} - -uint16_t _lcompilers_optimization_floordiv_u16(uint16_t a, uint16_t b) -{ - double r; - uint16_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (uint16_t)(tmp); - return result; -} - -uint32_t _lcompilers_optimization_floordiv_u32(uint32_t a, uint32_t b) -{ - double r; - uint32_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (uint32_t)(tmp); - return result; -} - -uint64_t _lcompilers_optimization_floordiv_u64(uint64_t a, uint64_t b) -{ - double r; - uint64_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (uint64_t)(tmp); - return result; -} - -uint8_t _lcompilers_optimization_floordiv_u8(uint8_t a, uint8_t b) -{ - double r; - uint8_t result; - int64_t tmp; - r = (double)(a)/(double)(b); - tmp = (int64_t)(r); - if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { - tmp = tmp - 1; - } - result = (uint8_t)(tmp); - return result; -} - -double __lpython_overloaded_0__pow(int32_t x, int32_t y) -{ - double _lpython_return_variable; - _lpython_return_variable = (double)(pow(x, y)); - return _lpython_return_variable; -} - -float _lfortran_caimag(float_complex_t x); - -double _lfortran_zaimag(double_complex_t x); - -void test_pow() -{ - int32_t a; - a = (int32_t)( 4.00000000000000000e+00); -} - -int32_t test_pow_1(int32_t a, int32_t b) -{ - int32_t _lpython_return_variable; - int32_t res; - res = (int32_t)(__lpython_overloaded_0__pow(a, b)); - _lpython_return_variable = res; - return _lpython_return_variable; -} - -void main0() -{ - int32_t c; - test_pow(); - c = test_pow_1(1, 2); -} - -void __main__global_stmts() -{ - main0(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/cpp-expr15-1661c0d.stdout b/tests/reference/cpp-expr15-1661c0d.stdout deleted file mode 100644 index f1932205ba..0000000000 --- a/tests/reference/cpp-expr15-1661c0d.stdout +++ /dev/null @@ -1,92 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -double test1(); -std::complex test2(); -int32_t test3(); -std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y); -float _lfortran_caimag(std::complex x); -double _lfortran_zaimag(std::complex x); -namespace { -} - -// Implementations -std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y) -{ - std::complex _lpython_return_variable; - _lpython_return_variable = std::complex(x) + std::complex(y)*std::complex(0.000000, 1.000000); - return _lpython_return_variable; -} - -float _lfortran_caimag(std::complex x); - -double _lfortran_zaimag(std::complex x); - -double test1() -{ - double _lpython_return_variable; - double x; - x = 1.00000000000000000e+00; - _lpython_return_variable = x; - return _lpython_return_variable; -} - -std::complex test2() -{ - std::complex _lpython_return_variable; - std::complex x; - x = __lpython_overloaded_9__complex(2, 2); - _lpython_return_variable = x; - return _lpython_return_variable; -} - -int32_t test3() -{ - int32_t _lpython_return_variable; - std::complex x; - std::complex y; - x = std::complex(0.000000, 4.000000); - y = std::complex(0.000000, 4.000000); - _lpython_return_variable = 0; - return _lpython_return_variable; -} - -void __main__global_stmts() -{ - std::cout << test1() << std::endl; - std::cout << test2() << std::endl; - std::cout << test3() << std::endl; -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr7-529bd53.stdout b/tests/reference/cpp-expr7-529bd53.stdout deleted file mode 100644 index 81158df8ae..0000000000 --- a/tests/reference/cpp-expr7-529bd53.stdout +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void main0(); -void test_pow(); -int32_t test_pow_1(int32_t a, int32_t b); -double __lpython_overloaded_0__pow(int32_t x, int32_t y); -float _lfortran_caimag(std::complex x); -double _lfortran_zaimag(std::complex x); -namespace { -} - -// Implementations -double __lpython_overloaded_0__pow(int32_t x, int32_t y) -{ - double _lpython_return_variable; - _lpython_return_variable = (double)(std::pow(x, y)); - return _lpython_return_variable; -} - -float _lfortran_caimag(std::complex x); - -double _lfortran_zaimag(std::complex x); - -void test_pow() -{ - int32_t a; - a = (int32_t)(__lpython_overloaded_0__pow(2, 2)); -} - -int32_t test_pow_1(int32_t a, int32_t b) -{ - int32_t _lpython_return_variable; - int32_t res; - res = (int32_t)(__lpython_overloaded_0__pow(a, b)); - _lpython_return_variable = res; - return _lpython_return_variable; -} - -void main0() -{ - int32_t c; - test_pow(); - c = test_pow_1(1, 2); -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr8-704cece.stdout b/tests/reference/cpp-expr8-704cece.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-expr8-704cece.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stdout b/tests/reference/cpp-test_builtin_pow-56b3f92.stdout deleted file mode 100644 index 8c7a59f313..0000000000 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.stdout +++ /dev/null @@ -1,269 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void test_pow(); -double __lpython_overloaded_0__pow(int32_t x, int32_t y); -int32_t __lpython_overloaded_10__pow(int32_t x, int32_t y, int32_t z); -int64_t __lpython_overloaded_11__pow(int64_t x, int64_t y, int64_t z); -double __lpython_overloaded_1__pow(int64_t x, int64_t y); -int32_t __lpython_overloaded_2___mod(int32_t a, int32_t b); -float __lpython_overloaded_2__pow(float x, float y); -double __lpython_overloaded_3__pow(double x, double y); -float __lpython_overloaded_4__pow(int32_t x, float y); -float __lpython_overloaded_5__pow(float x, int32_t y); -double __lpython_overloaded_6__pow(int32_t x, double y); -double __lpython_overloaded_7__pow(double x, int32_t y); -int64_t __lpython_overloaded_8___mod(int64_t a, int64_t b); -int32_t __lpython_overloaded_8__pow(bool x, bool y); -std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y); -std::complex __lpython_overloaded_9__pow(std::complex c, int32_t y); -float _lfortran_caimag(std::complex x); -double _lfortran_zaimag(std::complex x); -namespace { -} - -// Implementations -double __lpython_overloaded_0__pow(int32_t x, int32_t y) -{ - double _lpython_return_variable; - _lpython_return_variable = (double)(std::pow(x, y)); - return _lpython_return_variable; -} - -int32_t __lpython_overloaded_2___mod(int32_t a, int32_t b) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = a - floordiv(a)*b; - return _lpython_return_variable; -} - -int32_t __lpython_overloaded_10__pow(int32_t x, int32_t y, int32_t z) -{ - int32_t _lpython_return_variable; - int32_t result; - if (y < 0) { - std::cerr << "ERROR STOP" << std::endl; - exit(1); - } - result = __lpython_overloaded_2___mod(std::pow(x, y), z); - _lpython_return_variable = result; - return _lpython_return_variable; -} - -int64_t __lpython_overloaded_8___mod(int64_t a, int64_t b) -{ - int64_t _lpython_return_variable; - _lpython_return_variable = a - floordiv(a)*b; - return _lpython_return_variable; -} - -int64_t __lpython_overloaded_11__pow(int64_t x, int64_t y, int64_t z) -{ - int64_t _lpython_return_variable; - int64_t result; - if (y < 0) { - std::cerr << "ERROR STOP" << std::endl; - exit(1); - } - result = __lpython_overloaded_8___mod(std::pow(x, y), z); - _lpython_return_variable = result; - return _lpython_return_variable; -} - -double __lpython_overloaded_1__pow(int64_t x, int64_t y) -{ - double _lpython_return_variable; - _lpython_return_variable = (double)(std::pow(x, y)); - return _lpython_return_variable; -} - -float __lpython_overloaded_2__pow(float x, float y) -{ - float _lpython_return_variable; - _lpython_return_variable = std::pow(x, y); - return _lpython_return_variable; -} - -double __lpython_overloaded_3__pow(double x, double y) -{ - double _lpython_return_variable; - _lpython_return_variable = std::pow(x, y); - return _lpython_return_variable; -} - -float __lpython_overloaded_4__pow(int32_t x, float y) -{ - float _lpython_return_variable; - _lpython_return_variable = std::pow((float)(x), y); - return _lpython_return_variable; -} - -float __lpython_overloaded_5__pow(float x, int32_t y) -{ - float _lpython_return_variable; - _lpython_return_variable = std::pow(x, (float)(y)); - return _lpython_return_variable; -} - -double __lpython_overloaded_6__pow(int32_t x, double y) -{ - double _lpython_return_variable; - _lpython_return_variable = std::pow((double)(x), y); - return _lpython_return_variable; -} - -double __lpython_overloaded_7__pow(double x, int32_t y) -{ - double _lpython_return_variable; - _lpython_return_variable = std::pow(x, (double)(y)); - return _lpython_return_variable; -} - -int32_t __lpython_overloaded_8__pow(bool x, bool y) -{ - int32_t _lpython_return_variable; - if (y && !x) { - _lpython_return_variable = 0; - return _lpython_return_variable; - } - _lpython_return_variable = 1; - return _lpython_return_variable; -} - -std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y) -{ - std::complex _lpython_return_variable; - _lpython_return_variable = std::complex(x) + std::complex(y)*std::complex(0.000000, 1.000000); - return _lpython_return_variable; -} - -std::complex __lpython_overloaded_9__pow(std::complex c, int32_t y) -{ - std::complex _lpython_return_variable; - _lpython_return_variable = std::pow(c, std::complex(y)); - return _lpython_return_variable; -} - -float _lfortran_caimag(std::complex x); - -double _lfortran_zaimag(std::complex x); - -void test_pow() -{ - int32_t a; - double a1; - double a2; - int32_t b; - bool b1; - bool b2; - std::complex c1; - double eps; - float f1; - float f2; - int64_t i; - int64_t i1; - int64_t i2; - int64_t j; - int64_t k; - float p; - int32_t x; - double y; - eps = 9.99999999999999980e-13; - a = 2; - b = 5; - assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 32); - a = 6; - b = 3; - assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 216); - a = 2; - b = 0; - assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 1); - a = 2; - b = -1; - a = 6; - b = -4; - i1 = 2; - i2 = 5; - assert ((int64_t)(__lpython_overloaded_1__pow(i1, i2)) == 32); - i1 = 6; - i2 = -3; - f1 = (double)(525346)/(double)(66456); - 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); - b1 = true; - b2 = false; - assert (__lpython_overloaded_8__pow(b1, b2) == 1); - assert (__lpython_overloaded_8__pow(b2, b1) == 0); - assert (__lpython_overloaded_8__pow(b1, b2) == 1); - assert (__lpython_overloaded_8__pow(false, false) == 1); - a1 = 4.50000000000000000e+00; - a2 = 2.29999999999999982e+00; - assert (abs(__lpython_overloaded_3__pow(a1, a2) - 3.17971929089206000e+01) < eps); - assert (abs(__lpython_overloaded_3__pow(a2, a1) - 4.24399889427765871e+01) < eps); - x = 3; - y = 2.29999999999999982e+00; - assert (abs(__lpython_overloaded_6__pow(x, y) - 1.25135025328431819e+01) < eps); - assert (abs(__lpython_overloaded_7__pow(y, x) - 1.21669999999999980e+01) < eps); - assert (abs(__lpython_overloaded_6__pow(x, 5.50000000000000000e+00) - 4.20888346239237194e+02) < eps); - assert (abs(__lpython_overloaded_1__pow(2, -1) - 5.00000000000000000e-01) < eps); - assert (abs(__lpython_overloaded_1__pow(6, -4) - 7.71604938271604895e-04) < eps); - assert (abs(__lpython_overloaded_1__pow(-3, -5) + 4.11522633744856002e-03) < eps); - assert (abs(__lpython_overloaded_1__pow(6, -4) - 7.71604938271604895e-04) < eps); - assert (abs(__lpython_overloaded_3__pow( 4.50000000000000000e+00, 2.29999999999999982e+00) - 3.17971929089206000e+01) < eps); - assert (abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, 0.00000000000000000e+00) - 1.00000000000000000e+00) < eps); - assert (abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, - 1.50000000000000000e+00) - 2.86687162345994395e-01) < eps); - assert (abs(__lpython_overloaded_6__pow(2, 3.39999999999999991e+00) - 1.05560632861831536e+01) < eps); - assert (abs(__lpython_overloaded_6__pow(2, - 3.39999999999999991e+00) - 9.47322854068998882e-02) < eps); - assert (abs(__lpython_overloaded_7__pow( 3.39999999999999991e+00, 9) - 6.07169927664639836e+04) < eps); - assert (abs(__lpython_overloaded_7__pow( 0.00000000000000000e+00, 53) - 0.00000000000000000e+00) < eps); - assert ((int32_t)(__lpython_overloaded_0__pow(4, 2)) == 16); - assert (abs(__lpython_overloaded_7__pow(- 4.23500000000000000e+03, 52) - 3.94800380598526379e+188) < eps); - i = 7; - j = 2; - k = 5; - assert (__lpython_overloaded_11__pow(i, j, k) == 4); - assert (__lpython_overloaded_10__pow(102, 3, 121) == 38); - c1 = __lpython_overloaded_9__complex(4, 5); - c1 = __lpython_overloaded_9__pow(c1, 4); -} - -void __main__global_stmts() -{ - test_pow(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout deleted file mode 100644 index 9add220de0..0000000000 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout +++ /dev/null @@ -1,527 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 205 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [loop_vec] - [] - [(SubroutineCall - 2 loop_vec - () - [] - () - )] - () - Public - .false. - .false. - () - ), - loop_vec: - (Function - (SymbolTable - 201 - { - a: - (Variable - 201 - a - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 201 - b - [] - Local - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 201 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization: - (Function - (SymbolTable - 207 - { - __1_k: - (Variable - 207 - __1_k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - arg0: - (Variable - 207 - arg0 - [] - In - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - arg1: - (Variable - 207 - arg1 - [] - In - () - () - Default - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - arg2: - (Variable - 207 - arg2 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - arg3: - (Variable - 207 - arg3 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - arg4: - (Variable - 207 - arg4 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - arg5: - (Variable - 207 - arg5 - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization - (FunctionType - [(Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - (Integer 4) - (Integer 4) - (Integer 4) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 207 arg0) - (Var 207 arg1) - (Var 207 arg2) - (Var 207 arg3) - (Var 207 arg4) - (Var 207 arg5)] - [(= - (Var 207 __1_k) - (IntegerBinOp - (Var 207 arg2) - Sub - (Var 207 arg4) - (Integer 4) - () - ) - () - ) - (WhileLoop - () - (IntegerCompare - (IntegerBinOp - (Var 207 __1_k) - Add - (Var 207 arg4) - (Integer 4) - () - ) - Lt - (Var 207 arg3) - (Logical 4) - () - ) - [(= - (Var 207 __1_k) - (IntegerBinOp - (Var 207 __1_k) - Add - (Var 207 arg4) - (Integer 4) - () - ) - () - ) - (= - (ArrayItem - (Var 207 arg0) - [(() - (Var 207 __1_k) - ())] - (Real 8) - RowMajor - () - ) - (ArrayItem - (Var 207 arg1) - [(() - (Var 207 __1_k) - ())] - (Real 8) - RowMajor - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - loop_vec - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization] - [] - [(= - (Var 201 a) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (= - (Var 201 b) - (ArrayConstant - [] - (Array - (Real 8) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 9216 (Integer 4)))] - FixedSizeArray - ) - RowMajor - ) - () - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 9216 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9215 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 201 b) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - (RealConstant - 5.000000 - (Real 8) - ) - () - )] - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerConstant 1151 (Integer 4)) - (IntegerConstant 1 (Integer 4))) - [(SubroutineCall - 201 vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization - () - [((Var 201 a)) - ((Var 201 b)) - ((IntegerBinOp - (Var 201 i) - Mul - (IntegerConstant 8 (Integer 4)) - (Integer 4) - () - )) - ((IntegerBinOp - (IntegerBinOp - (Var 201 i) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - Mul - (IntegerConstant 8 (Integer 4)) - (Integer 4) - () - )) - ((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 8 (Integer 4)))] - () - )] - ) - (DoLoop - () - ((Var 201 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 9216 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9215 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (ArrayItem - (Var 201 a) - [(() - (Var 201 i) - ())] - (Real 8) - RowMajor - () - ) - Eq - (RealConstant - 5.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [numpy] - .false. - .false. - ), - lpython_builtin: - (IntrinsicModule lpython_builtin), - main_program: - (Program - (SymbolTable - 206 - { - __main__global_stmts: - (ExternalSymbol - 206 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 206 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - numpy: - (Module numpy) - }) - [] -) From b89419d34e06a8d549052bc33cf52c0004dc3a9d Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:38:34 +0530 Subject: [PATCH 04/18] Delete test references --- .../reference/asr-array_01_decl-39cf894.json | 13 - .../asr-array_01_decl-39cf894.stderr | 17 - .../reference/asr-array_02_decl-e8f6874.json | 13 - .../asr-array_02_decl-e8f6874.stderr | 17 - tests/reference/asr-arrays_01-a617b64.json | 13 - tests/reference/asr-arrays_01-a617b64.stderr | 17 - tests/reference/asr-arrays_02-da94458.json | 13 - tests/reference/asr-arrays_02-da94458.stderr | 17 - tests/reference/asr-arrays_03-de2e952.json | 13 - tests/reference/asr-arrays_03-de2e952.stderr | 17 - tests/reference/asr-arrays_04-880407c.json | 13 - tests/reference/asr-arrays_04-880407c.stderr | 17 - tests/reference/asr-arrays_05-ec8fbd5.json | 13 - tests/reference/asr-arrays_05-ec8fbd5.stderr | 17 - tests/reference/asr-arrays_06-fbb09a3.json | 13 - tests/reference/asr-arrays_06-fbb09a3.stderr | 17 - tests/reference/asr-arrays_07-de430fd.json | 13 - tests/reference/asr-arrays_07-de430fd.stderr | 17 - tests/reference/asr-arrays_08-ba317a3.json | 13 - tests/reference/asr-arrays_08-ba317a3.stderr | 17 - tests/reference/asr-arrays_09-50ee586.json | 13 - tests/reference/asr-arrays_09-50ee586.stderr | 17 - tests/reference/asr-arrays_10-bc82d75.json | 13 - tests/reference/asr-arrays_10-bc82d75.stderr | 17 - tests/reference/asr-arrays_11-fc505b4.json | 13 - tests/reference/asr-arrays_11-fc505b4.stderr | 17 - tests/reference/asr-arrays_12-63d6f25.json | 13 - tests/reference/asr-arrays_12-63d6f25.stderr | 17 - tests/reference/asr-arrays_13-b5fcc7e.json | 13 - tests/reference/asr-arrays_13-b5fcc7e.stderr | 17 - tests/reference/asr-arrays_14-78be00e.json | 13 - tests/reference/asr-arrays_14-78be00e.stderr | 17 - tests/reference/asr-assert1-1ce92ea.json | 13 - tests/reference/asr-assert1-1ce92ea.stdout | 102 - tests/reference/asr-assign1-886f049.json | 13 - tests/reference/asr-assign1-886f049.stdout | 196 - tests/reference/asr-assign2-8d1a2ee.json | 13 - tests/reference/asr-assign2-8d1a2ee.stdout | 118 - tests/reference/asr-bindc_01-6d521a9.json | 13 - tests/reference/asr-bindc_01-6d521a9.stdout | 210 - tests/reference/asr-bindc_01-f761165.json | 13 - tests/reference/asr-bindc_01-f761165.stderr | 8 - tests/reference/asr-bindc_02-5092d8e.json | 13 - tests/reference/asr-bindc_02-5092d8e.stderr | 8 - tests/reference/asr-bindc_02-bc1a7ea.json | 13 - tests/reference/asr-bindc_02-bc1a7ea.stderr | 17 - tests/reference/asr-bindc_03-95dbba7.json | 13 - tests/reference/asr-bindc_03-95dbba7.stderr | 17 - tests/reference/asr-bindc_04-06bd800.json | 13 - tests/reference/asr-bindc_04-06bd800.stderr | 17 - tests/reference/asr-bindc_10e-8b10394.json | 13 - tests/reference/asr-bindc_10e-8b10394.stderr | 14 - tests/reference/asr-c_interop1-cf2e9b4.json | 13 - tests/reference/asr-c_interop1-cf2e9b4.stdout | 568 -- tests/reference/asr-callback_01-df40fd5.json | 13 - .../reference/asr-callback_01-df40fd5.stdout | 569 -- tests/reference/asr-cast-435c233.json | 13 - tests/reference/asr-cast-435c233.stderr | 11 - tests/reference/asr-complex1-f26c460.json | 13 - tests/reference/asr-complex1-f26c460.stderr | 11 - tests/reference/asr-const_01-af8289b.json | 13 - tests/reference/asr-const_01-af8289b.stderr | 5 - tests/reference/asr-const_02-fce29b7.json | 13 - tests/reference/asr-const_02-fce29b7.stderr | 5 - tests/reference/asr-constants1-5828e8a.json | 13 - tests/reference/asr-constants1-5828e8a.stderr | 11 - tests/reference/asr-cptr_01-4e660f1.json | 13 - tests/reference/asr-cptr_01-4e660f1.stderr | 5 - tests/reference/asr-dictionary1-a105a36.json | 13 - .../reference/asr-dictionary1-a105a36.stdout | 608 -- .../asr-doconcurrentloop_01-3fdc189.json | 13 - .../asr-doconcurrentloop_01-3fdc189.stdout | 580 -- tests/reference/asr-elemental_01-b58df26.json | 13 - .../reference/asr-elemental_01-b58df26.stderr | 17 - tests/reference/asr-enum_01-30e1b4a.json | 13 - tests/reference/asr-enum_01-30e1b4a.stderr | 9 - tests/reference/asr-enum_02-54656c5.json | 13 - tests/reference/asr-enum_02-54656c5.stderr | 9 - tests/reference/asr-expr1-8df2d66.json | 13 - tests/reference/asr-expr1-8df2d66.stdout | 148 - tests/reference/asr-expr10-efcbb1b.json | 13 - tests/reference/asr-expr10-efcbb1b.stderr | 11 - tests/reference/asr-expr11-9b91d35.json | 13 - tests/reference/asr-expr11-9b91d35.stdout | 186 - tests/reference/asr-expr12-5c5b71e.json | 13 - tests/reference/asr-expr12-5c5b71e.stdout | 307 - tests/reference/asr-expr13-81bdb5a.json | 13 - tests/reference/asr-expr13-81bdb5a.stderr | 11 - tests/reference/asr-expr16-a3dc453.json | 13 - tests/reference/asr-expr16-a3dc453.stderr | 5 - tests/reference/asr-expr2-2e78a12.json | 13 - tests/reference/asr-expr2-2e78a12.stdout | 187 - tests/reference/asr-expr4-cef6743.json | 13 - tests/reference/asr-expr4-cef6743.stdout | 104 - tests/reference/asr-expr5-645ffcc.json | 13 - tests/reference/asr-expr5-645ffcc.stdout | 142 - tests/reference/asr-expr6-368e5ed.json | 13 - tests/reference/asr-expr6-368e5ed.stdout | 151 - tests/reference/asr-expr7-480ba2f.json | 13 - tests/reference/asr-expr7-480ba2f.stderr | 11 - tests/reference/asr-expr8-6beda60.json | 13 - tests/reference/asr-expr8-6beda60.stderr | 11 - tests/reference/asr-expr9-814e4bc.json | 13 - tests/reference/asr-expr9-814e4bc.stdout | 424 - tests/reference/asr-expr_01-211000e.json | 13 - tests/reference/asr-expr_01-211000e.stdout | 195 - tests/reference/asr-expr_01-a0d4829.json | 13 - tests/reference/asr-expr_01-a0d4829.stdout | 418 - tests/reference/asr-expr_05-3a37324.json | 13 - tests/reference/asr-expr_05-3a37324.stderr | 11 - tests/reference/asr-expr_07-7742668.json | 13 - tests/reference/asr-expr_07-7742668.stdout | 432 - tests/reference/asr-expr_09-f3e89c8.json | 13 - tests/reference/asr-expr_09-f3e89c8.stdout | 1009 -- tests/reference/asr-expr_10-d39708c.json | 13 - tests/reference/asr-expr_10-d39708c.stdout | 301 - tests/reference/asr-expr_12-6769be0.json | 13 - tests/reference/asr-expr_12-6769be0.stdout | 444 - tests/reference/asr-expr_14-f2bd343.json | 13 - tests/reference/asr-expr_14-f2bd343.stdout | 929 -- tests/reference/asr-func_01-d87aa4a.json | 13 - tests/reference/asr-func_01-d87aa4a.stderr | 9 - tests/reference/asr-func_02-b439474.json | 13 - tests/reference/asr-func_02-b439474.stderr | 5 - tests/reference/asr-func_03-cd744a0.json | 13 - tests/reference/asr-func_03-cd744a0.stderr | 5 - tests/reference/asr-func_04-eef2656.json | 13 - tests/reference/asr-func_04-eef2656.stderr | 5 - tests/reference/asr-func_05-c22b921.json | 13 - tests/reference/asr-func_05-c22b921.stderr | 5 - tests/reference/asr-func_06-62e738c.json | 13 - tests/reference/asr-func_06-62e738c.stderr | 8 - tests/reference/asr-func_07-4a8c076.json | 13 - tests/reference/asr-func_07-4a8c076.stderr | 5 - tests/reference/asr-func_08-c137415.json | 13 - tests/reference/asr-func_08-c137415.stderr | 5 - .../reference/asr-func_inline_01-56af272.json | 13 - .../asr-func_inline_01-56af272.stdout | 313 - tests/reference/asr-generics_01-d616074.json | 13 - .../reference/asr-generics_01-d616074.stdout | 712 -- tests/reference/asr-generics_02-e2ea5c9.json | 13 - .../reference/asr-generics_02-e2ea5c9.stdout | 411 - .../asr-generics_array_01-682b1b2.json | 13 - .../asr-generics_array_01-682b1b2.stderr | 17 - .../asr-generics_array_02-22c8dc1.json | 13 - .../asr-generics_array_02-22c8dc1.stderr | 17 - .../asr-generics_array_03-fb3706c.json | 13 - .../asr-generics_array_03-fb3706c.stderr | 17 - .../asr-generics_error_01-1e05cd6.json | 13 - .../asr-generics_error_01-1e05cd6.stderr | 5 - .../asr-generics_error_02-d614928.json | 13 - .../asr-generics_error_02-d614928.stderr | 5 - .../asr-generics_error_03-208d10d.json | 13 - .../asr-generics_error_03-208d10d.stderr | 9 - .../asr-generics_list_01-39c4044.json | 13 - .../asr-generics_list_01-39c4044.stdout | 2023 ---- .../reference/asr-global_scope1-354e217.json | 13 - .../asr-global_scope1-354e217.stdout | 94 - .../reference/asr-global_syms_01-273906f.json | 13 - .../asr-global_syms_01-273906f.stdout | 189 - tests/reference/asr-intent_01-66824bc.json | 13 - tests/reference/asr-intent_01-66824bc.stdout | 184 - .../asr-kwargs_01_error-ab9530d.json | 13 - .../asr-kwargs_01_error-ab9530d.stderr | 5 - .../asr-kwargs_02_error-7c91f8f.json | 13 - .../asr-kwargs_02_error-7c91f8f.stderr | 11 - .../asr-kwargs_03_error-a68cc46.json | 13 - .../asr-kwargs_03_error-a68cc46.stderr | 5 - tests/reference/asr-lambda_01-1ec3e01.json | 13 - tests/reference/asr-lambda_01-1ec3e01.stderr | 5 - tests/reference/asr-list1-770ba33.json | 13 - tests/reference/asr-list1-770ba33.stdout | 439 - tests/reference/asr-loop1-10d3109.json | 13 - tests/reference/asr-loop1-10d3109.stdout | 604 -- tests/reference/asr-loop3-a579196.json | 13 - tests/reference/asr-loop3-a579196.stdout | 90 - tests/reference/asr-loop4-3d3216e.json | 13 - tests/reference/asr-loop4-3d3216e.stdout | 176 - tests/reference/asr-loop_01-e7aa06a.json | 13 - tests/reference/asr-loop_01-e7aa06a.stderr | 5 - tests/reference/asr-loop_02-5741651.json | 13 - tests/reference/asr-loop_02-5741651.stderr | 5 - tests/reference/asr-loop_03-401ab45.json | 13 - tests/reference/asr-loop_03-401ab45.stderr | 5 - tests/reference/asr-modules_02-ec92e6f.json | 13 - tests/reference/asr-modules_02-ec92e6f.stdout | 283 - tests/reference/asr-print_02-afbe092.json | 13 - tests/reference/asr-print_02-afbe092.stdout | 2957 ------ .../asr-print_list_tuple_03-9de3736.json | 13 - .../asr-print_list_tuple_03-9de3736.stdout | 244 - tests/reference/asr-set1-b7b913a.json | 13 - tests/reference/asr-set1-b7b913a.stdout | 186 - tests/reference/asr-string_01-78629c4.json | 13 - tests/reference/asr-string_01-78629c4.stderr | 5 - tests/reference/asr-string_02-499c9ff.json | 13 - tests/reference/asr-string_02-499c9ff.stderr | 11 - tests/reference/asr-structs_01-0893e35.json | 13 - tests/reference/asr-structs_01-0893e35.stderr | 5 - tests/reference/asr-structs_01-66dc2c9.json | 13 - tests/reference/asr-structs_01-66dc2c9.stdout | 190 - tests/reference/asr-structs_01-be14d49.json | 13 - tests/reference/asr-structs_01-be14d49.stdout | 535 - tests/reference/asr-structs_02-2ab459a.json | 13 - tests/reference/asr-structs_02-2ab459a.stdout | 403 - tests/reference/asr-structs_02-f95782c.json | 13 - tests/reference/asr-structs_02-f95782c.stderr | 5 - tests/reference/asr-structs_03-0cef911.json | 13 - tests/reference/asr-structs_03-0cef911.stdout | 384 - tests/reference/asr-structs_03-754fb64.json | 13 - tests/reference/asr-structs_03-754fb64.stderr | 5 - tests/reference/asr-structs_04-387747b.json | 13 - tests/reference/asr-structs_04-387747b.stdout | 648 -- tests/reference/asr-structs_04-7b864bc.json | 13 - tests/reference/asr-structs_04-7b864bc.stderr | 5 - tests/reference/asr-structs_05-fa98307.json | 13 - tests/reference/asr-structs_05-fa98307.stderr | 17 - tests/reference/asr-structs_06-6e14537.json | 13 - tests/reference/asr-structs_06-6e14537.stderr | 5 - tests/reference/asr-structs_07-83694b7.json | 13 - tests/reference/asr-structs_07-83694b7.stderr | 5 - tests/reference/asr-structs_08-fa4dbf0.json | 13 - tests/reference/asr-structs_08-fa4dbf0.stderr | 5 - tests/reference/asr-structs_09-f3ffe08.json | 13 - tests/reference/asr-structs_09-f3ffe08.stderr | 5 - tests/reference/asr-structs_10-cb8a283.json | 13 - tests/reference/asr-structs_10-cb8a283.stderr | 9 - tests/reference/asr-structs_16-44de89a.json | 13 - tests/reference/asr-structs_16-44de89a.stdout | 327 - tests/reference/asr-subscript1-1acfc19.json | 13 - tests/reference/asr-subscript1-1acfc19.stdout | 335 - .../asr-test_annassign_01-2f18669.json | 13 - .../asr-test_annassign_01-2f18669.stderr | 5 - .../asr-test_annassign_02-accf6db.json | 13 - .../asr-test_annassign_02-accf6db.stderr | 5 - .../asr-test_annassign_03-f8c6160.json | 13 - .../asr-test_annassign_03-f8c6160.stderr | 5 - ...-test_annassign_type_mismatch-7dac7be.json | 13 - ...est_annassign_type_mismatch-7dac7be.stderr | 5 - ...test_annassign_type_mismatch2-fc883f7.json | 13 - ...st_annassign_type_mismatch2-fc883f7.stderr | 5 - ...asr-test_append_type_mismatch-030e9c7.json | 13 - ...r-test_append_type_mismatch-030e9c7.stderr | 5 - tests/reference/asr-test_assign1-a94d41e.json | 13 - .../reference/asr-test_assign1-a94d41e.stderr | 5 - tests/reference/asr-test_assign2-fa29029.json | 13 - .../reference/asr-test_assign2-fa29029.stderr | 5 - tests/reference/asr-test_assign3-cc6fc9d.json | 13 - .../reference/asr-test_assign3-cc6fc9d.stderr | 5 - tests/reference/asr-test_assign4-a2136e0.json | 13 - .../reference/asr-test_assign4-a2136e0.stderr | 5 - tests/reference/asr-test_assign5-694a98f.json | 13 - .../reference/asr-test_assign5-694a98f.stderr | 5 - tests/reference/asr-test_assign6-05cd64f.json | 13 - .../reference/asr-test_assign6-05cd64f.stderr | 5 - tests/reference/asr-test_assign7-beebac3.json | 13 - .../reference/asr-test_assign7-beebac3.stderr | 5 - tests/reference/asr-test_assign8-4b26e63.json | 13 - .../reference/asr-test_assign8-4b26e63.stderr | 11 - tests/reference/asr-test_assign9-51278b8.json | 13 - .../reference/asr-test_assign9-51278b8.stderr | 5 - tests/reference/asr-test_binop1-50b63f6.json | 13 - .../reference/asr-test_binop1-50b63f6.stderr | 5 - tests/reference/asr-test_binop2-e5749af.json | 13 - .../reference/asr-test_binop2-e5749af.stderr | 5 - tests/reference/asr-test_binop3-a67201d.json | 13 - .../reference/asr-test_binop3-a67201d.stderr | 11 - .../asr-test_bit_length-da3a264.json | 13 - .../asr-test_bit_length-da3a264.stderr | 5 - .../asr-test_bitwise_on_complex-dd9568b.json | 13 - ...asr-test_bitwise_on_complex-dd9568b.stderr | 5 - .../asr-test_bitwise_on_float-2e09b30.json | 13 - .../asr-test_bitwise_on_float-2e09b30.stderr | 5 - .../asr-test_bool_binop-f856ef0.json | 13 - .../asr-test_bool_binop-f856ef0.stderr | 11 - tests/reference/asr-test_builtin-aa64615.json | 13 - .../reference/asr-test_builtin-aa64615.stdout | 2149 ---- .../asr-test_builtin_abs-c74d2c9.json | 13 - .../asr-test_builtin_abs-c74d2c9.stdout | 605 -- .../asr-test_builtin_bin-52ba9fa.json | 13 - .../asr-test_builtin_bin-52ba9fa.stderr | 11 - .../asr-test_builtin_bool-330223a.json | 13 - .../asr-test_builtin_bool-330223a.stderr | 11 - .../asr-test_builtin_float-20601dd.json | 13 - .../asr-test_builtin_float-20601dd.stdout | 530 - .../asr-test_builtin_hex-64bd268.json | 13 - .../asr-test_builtin_hex-64bd268.stderr | 11 - .../asr-test_builtin_int-8f88fdc.json | 13 - .../asr-test_builtin_int-8f88fdc.stdout | 1010 -- .../asr-test_builtin_len-55b0dec.json | 13 - .../asr-test_builtin_len-55b0dec.stdout | 691 -- .../asr-test_builtin_oct-20b9066.json | 13 - .../asr-test_builtin_oct-20b9066.stderr | 11 - .../asr-test_builtin_pow-f02fcda.json | 13 - .../asr-test_builtin_pow-f02fcda.stderr | 11 - .../asr-test_builtin_round-7417a21.json | 13 - .../asr-test_builtin_round-7417a21.stderr | 11 - .../asr-test_builtin_str-580e920.json | 13 - .../asr-test_builtin_str-580e920.stdout | 1471 --- .../asr-test_c_interop_01-e374f43.json | 13 - .../asr-test_c_interop_01-e374f43.stdout | 711 -- tests/reference/asr-test_chr-91f4987.json | 13 - tests/reference/asr-test_chr-91f4987.stderr | 5 - .../asr-test_compare_01-c594bbe.json | 13 - .../asr-test_compare_01-c594bbe.stderr | 5 - .../asr-test_compare_02-bf2c76e.json | 13 - .../asr-test_compare_02-bf2c76e.stderr | 5 - .../asr-test_complex_01-a6def58.json | 13 - .../asr-test_complex_01-a6def58.stderr | 11 - .../asr-test_complex_02-782ba2d.json | 13 - .../asr-test_complex_02-782ba2d.stderr | 11 - tests/reference/asr-test_dict1-a45a075.json | 13 - tests/reference/asr-test_dict1-a45a075.stderr | 5 - tests/reference/asr-test_dict10-8c0beff.json | 13 - .../reference/asr-test_dict10-8c0beff.stderr | 5 - tests/reference/asr-test_dict11-2ab4e6c.json | 13 - .../reference/asr-test_dict11-2ab4e6c.stderr | 5 - tests/reference/asr-test_dict12-7c74d08.json | 13 - .../reference/asr-test_dict12-7c74d08.stderr | 5 - tests/reference/asr-test_dict13-683b290.json | 13 - .../reference/asr-test_dict13-683b290.stderr | 11 - tests/reference/asr-test_dict2-4587f02.json | 13 - tests/reference/asr-test_dict2-4587f02.stderr | 5 - tests/reference/asr-test_dict3-d28f38f.json | 13 - tests/reference/asr-test_dict3-d28f38f.stderr | 5 - tests/reference/asr-test_dict4-39489fa.json | 13 - tests/reference/asr-test_dict4-39489fa.stderr | 5 - tests/reference/asr-test_dict5-c436d37.json | 13 - tests/reference/asr-test_dict5-c436d37.stderr | 5 - tests/reference/asr-test_dict6-95e3b14.json | 13 - tests/reference/asr-test_dict6-95e3b14.stderr | 5 - tests/reference/asr-test_dict7-1415e14.json | 13 - tests/reference/asr-test_dict7-1415e14.stderr | 5 - tests/reference/asr-test_dict8-d960ce0.json | 13 - tests/reference/asr-test_dict8-d960ce0.stderr | 5 - tests/reference/asr-test_dict9-907bda7.json | 13 - tests/reference/asr-test_dict9-907bda7.stderr | 5 - .../asr-test_end_sep_keywords-2226a67.json | 13 - .../asr-test_end_sep_keywords-2226a67.stdout | 189 - tests/reference/asr-test_for2-e5d893f.json | 13 - tests/reference/asr-test_for2-e5d893f.stderr | 9 - .../reference/asr-test_func_args-a898a72.json | 13 - .../asr-test_func_args-a898a72.stderr | 5 - .../reference/asr-test_import_01-b859c43.json | 13 - .../asr-test_import_01-b859c43.stderr | 10 - .../reference/asr-test_import_02-55b47fa.json | 13 - .../asr-test_import_02-55b47fa.stderr | 11 - tests/reference/asr-test_len1-839a615.json | 13 - tests/reference/asr-test_len1-839a615.stderr | 5 - tests/reference/asr-test_list1-73fd538.json | 13 - tests/reference/asr-test_list1-73fd538.stderr | 5 - tests/reference/asr-test_list2-10ffdd7.json | 13 - tests/reference/asr-test_list2-10ffdd7.stderr | 5 - tests/reference/asr-test_list3-5f4d2a8.json | 13 - tests/reference/asr-test_list3-5f4d2a8.stderr | 5 - tests/reference/asr-test_list4-d18a7e3.json | 13 - tests/reference/asr-test_list4-d18a7e3.stderr | 5 - .../asr-test_list_concat-41d186f.json | 13 - .../asr-test_list_concat-41d186f.stderr | 5 - .../asr-test_list_count-4b42498.json | 13 - .../asr-test_list_count-4b42498.stderr | 5 - .../asr-test_list_slicing-984fbf0.json | 13 - .../asr-test_list_slicing-984fbf0.stderr | 5 - tests/reference/asr-test_max_min-3c2fc51.json | 13 - .../reference/asr-test_max_min-3c2fc51.stderr | 11 - .../reference/asr-test_numpy_03-e600a49.json | 13 - .../asr-test_numpy_03-e600a49.stderr | 17 - .../reference/asr-test_numpy_04-ecbb614.json | 13 - .../asr-test_numpy_04-ecbb614.stderr | 17 - .../asr-test_operator_01-0f232bf.json | 13 - .../asr-test_operator_01-0f232bf.stderr | 5 - tests/reference/asr-test_ord-316ce61.json | 13 - tests/reference/asr-test_ord-316ce61.stderr | 5 - .../asr-test_pointer_types-1bf0d01.json | 13 - .../asr-test_pointer_types-1bf0d01.stderr | 5 - tests/reference/asr-test_pow-3f5d550.json | 13 - tests/reference/asr-test_pow-3f5d550.stderr | 11 - tests/reference/asr-test_pow1-581ef42.json | 13 - tests/reference/asr-test_pow1-581ef42.stderr | 11 - tests/reference/asr-test_pow2-0dcbd7d.json | 13 - tests/reference/asr-test_pow2-0dcbd7d.stderr | 11 - tests/reference/asr-test_pow3-79749ed.json | 13 - tests/reference/asr-test_pow3-79749ed.stderr | 11 - tests/reference/asr-test_pow4-ef60978.json | 13 - tests/reference/asr-test_pow4-ef60978.stderr | 11 - tests/reference/asr-test_print1-f1f36f1.json | 13 - .../reference/asr-test_print1-f1f36f1.stderr | 5 - tests/reference/asr-test_print2-64acb15.json | 13 - .../reference/asr-test_print2-64acb15.stderr | 5 - tests/reference/asr-test_return1-2603c9e.json | 13 - .../reference/asr-test_return1-2603c9e.stderr | 5 - tests/reference/asr-test_return2-add829b.json | 13 - .../reference/asr-test_return2-add829b.stderr | 5 - tests/reference/asr-test_set1-11379c7.json | 13 - tests/reference/asr-test_set1-11379c7.stderr | 5 - tests/reference/asr-test_set2-d91a6f0.json | 13 - tests/reference/asr-test_set2-d91a6f0.stderr | 5 - tests/reference/asr-test_set3-f9bbffb.json | 13 - tests/reference/asr-test_set3-f9bbffb.stderr | 5 - tests/reference/asr-test_set4-53fea39.json | 13 - tests/reference/asr-test_set4-53fea39.stderr | 5 - .../asr-test_set_indexing-a1c21b8.json | 13 - .../asr-test_set_indexing-a1c21b8.stderr | 5 - .../asr-test_str_capitalize-9f8dfa9.json | 13 - .../asr-test_str_capitalize-9f8dfa9.stderr | 5 - .../asr-test_str_indexing-b200a4e.json | 13 - .../asr-test_str_indexing-b200a4e.stderr | 5 - .../asr-test_str_slicing-eca1381.json | 13 - .../asr-test_str_slicing-eca1381.stderr | 5 - .../asr-test_str_slicing2-2f07e9a.json | 13 - .../asr-test_str_slicing2-2f07e9a.stderr | 5 - .../asr-test_str_slicing3-fe6a03c.json | 13 - .../asr-test_str_slicing3-fe6a03c.stderr | 5 - .../asr-test_str_slicing4-a0c7a69.json | 13 - .../asr-test_str_slicing4-a0c7a69.stderr | 5 - .../asr-test_str_to_int-61553e7.json | 13 - .../asr-test_str_to_int-61553e7.stderr | 5 - tests/reference/asr-test_tuple1-7abe88f.json | 13 - .../reference/asr-test_tuple1-7abe88f.stderr | 5 - tests/reference/asr-test_tuple2-b046610.json | 13 - .../reference/asr-test_tuple2-b046610.stderr | 5 - tests/reference/asr-test_tuple3-19fa47f.json | 13 - .../reference/asr-test_tuple3-19fa47f.stderr | 5 - .../asr-test_type_mismatch_01-09e8af3.json | 13 - .../asr-test_type_mismatch_01-09e8af3.stderr | 5 - .../asr-test_unary_op_03-e799eae.json | 13 - .../asr-test_unary_op_03-e799eae.stdout | 191 - .../asr-test_unsupported_type-0d813dd.json | 13 - .../asr-test_unsupported_type-0d813dd.stderr | 5 - .../asr-test_zero_division-3dd84e8.json | 13 - .../asr-test_zero_division-3dd84e8.stderr | 5 - .../asr-test_zero_division2-d84989f.json | 13 - .../asr-test_zero_division2-d84989f.stderr | 5 - .../asr-test_zero_division3-29efb9e.json | 13 - .../asr-test_zero_division3-29efb9e.stderr | 5 - .../asr-test_zero_division4-bf4af64.json | 13 - .../asr-test_zero_division4-bf4af64.stderr | 5 - tests/reference/asr-tuple1-09972ab.json | 13 - tests/reference/asr-tuple1-09972ab.stdout | 587 -- .../reference/asr-type_mismatch-61052c7.json | 13 - .../asr-type_mismatch-61052c7.stderr | 5 - tests/reference/asr-unsigned_01-892b178.json | 13 - .../reference/asr-unsigned_01-892b178.stderr | 5 - tests/reference/asr-unsigned_02-6563e58.json | 13 - .../reference/asr-unsigned_02-6563e58.stderr | 5 - tests/reference/asr-unsigned_03-f785652.json | 13 - .../reference/asr-unsigned_03-f785652.stderr | 5 - tests/reference/asr-unsigned_04-c856d3a.json | 13 - .../reference/asr-unsigned_04-c856d3a.stderr | 5 - tests/reference/asr-vec_01-66ac423.json | 13 - tests/reference/asr-vec_01-66ac423.stderr | 17 - .../asr_json-modules_02-53952e6.json | 13 - .../asr_json-modules_02-53952e6.stdout | 1000 -- tests/reference/ast-assert1-b0154ee.json | 13 - tests/reference/ast-assert1-b0154ee.stdout | 70 - tests/reference/ast-assign1-2a4c9ed.json | 13 - tests/reference/ast-assign1-2a4c9ed.stdout | 151 - tests/reference/ast-complex1-800b4bb.json | 13 - tests/reference/ast-complex1-800b4bb.stdout | 686 -- tests/reference/ast-constants1-91cb6ff.json | 13 - tests/reference/ast-constants1-91cb6ff.stdout | 1820 ---- tests/reference/ast-dictionary1-1a7e00a.json | 13 - .../reference/ast-dictionary1-1a7e00a.stdout | 618 -- .../ast-doconcurrentloop_01-ed7017b.json | 13 - .../ast-doconcurrentloop_01-ed7017b.stdout | 437 - tests/reference/ast-ellipsis1-4f6c4dd.json | 13 - tests/reference/ast-ellipsis1-4f6c4dd.stdout | 427 - tests/reference/ast-expr1-1e8f7b1.json | 13 - tests/reference/ast-expr1-1e8f7b1.stdout | 124 - tests/reference/ast-expr10-a8d646d.json | 13 - tests/reference/ast-expr10-a8d646d.stdout | 434 - tests/reference/ast-expr11-1d29f78.json | 13 - tests/reference/ast-expr11-1d29f78.stdout | 149 - tests/reference/ast-expr12-adaecda.json | 13 - tests/reference/ast-expr12-adaecda.stdout | 149 - tests/reference/ast-expr13-c35ace1.json | 13 - tests/reference/ast-expr13-c35ace1.stdout | 374 - tests/reference/ast-expr2-6642d4a.json | 13 - tests/reference/ast-expr2-6642d4a.stdout | 184 - tests/reference/ast-expr4-49316cb.json | 13 - tests/reference/ast-expr4-49316cb.stdout | 72 - tests/reference/ast-expr5-bbc6e71.json | 13 - tests/reference/ast-expr5-bbc6e71.stdout | 89 - tests/reference/ast-expr6-0b12a67.json | 13 - tests/reference/ast-expr6-0b12a67.stdout | 119 - tests/reference/ast-expr7-fe52776.json | 13 - tests/reference/ast-expr7-fe52776.stdout | 204 - tests/reference/ast-expr8-7db6b28.json | 13 - tests/reference/ast-expr8-7db6b28.stdout | 352 - tests/reference/ast-expr9-d184496.json | 13 - tests/reference/ast-expr9-d184496.stdout | 231 - tests/reference/ast-expr_01-d0927f9.json | 13 - tests/reference/ast-expr_01-d0927f9.stdout | 112 - tests/reference/ast-global1-b2690cf.json | 13 - tests/reference/ast-global1-b2690cf.stdout | 219 - .../reference/ast-global_scope1-1d68a6c.json | 13 - .../ast-global_scope1-1d68a6c.stdout | 26 - tests/reference/ast-list1-9ce2da0.json | 13 - tests/reference/ast-list1-9ce2da0.stdout | 539 - tests/reference/ast-loop1-194a137.json | 13 - tests/reference/ast-loop1-194a137.stdout | 480 - tests/reference/ast-loop3-f7e0393.json | 13 - tests/reference/ast-loop3-f7e0393.stdout | 54 - tests/reference/ast-set1-ebd6ee0.json | 13 - tests/reference/ast-set1-ebd6ee0.stdout | 190 - tests/reference/ast-subscript1-bd5584b.json | 13 - tests/reference/ast-subscript1-bd5584b.stdout | 415 - tests/reference/ast-tuple1-2fb5396.json | 13 - tests/reference/ast-tuple1-2fb5396.stdout | 702 -- tests/reference/ast_new-async1-b3d07ed.json | 13 - tests/reference/ast_new-async1-b3d07ed.stdout | 752 -- tests/reference/ast_new-boolOp1-478328f.json | 13 - .../reference/ast_new-boolOp1-478328f.stdout | 206 - .../reference/ast_new-class_def1-fe69291.json | 13 - .../ast_new-class_def1-fe69291.stdout | 500 - .../reference/ast_new-class_def2-c6db986.json | 13 - .../ast_new-class_def2-c6db986.stdout | 201 - tests/reference/ast_new-comment2-f0984d5.json | 13 - .../reference/ast_new-comment2-f0984d5.stdout | 150 - .../ast_new-comprehension1-69cf2af.json | 13 - .../ast_new-comprehension1-69cf2af.stdout | 1363 --- .../ast_new-conditional_expr1-07ccb9e.json | 13 - .../ast_new-conditional_expr1-07ccb9e.stdout | 1069 -- .../ast_new-dictionary1-445e718.json | 13 - .../ast_new-dictionary1-445e718.stdout | 299 - .../reference/ast_new-ellipsis2-3a9750b.json | 13 - .../ast_new-ellipsis2-3a9750b.stdout | 336 - tests/reference/ast_new-for1-887432e.json | 13 - tests/reference/ast_new-for1-887432e.stdout | 485 - tests/reference/ast_new-for2-af08901.json | 13 - tests/reference/ast_new-for2-af08901.stdout | 504 - .../ast_new-function_def1-1a872df.json | 13 - .../ast_new-function_def1-1a872df.stdout | 558 -- .../ast_new-function_def2-52c4587.json | 13 - .../ast_new-function_def2-52c4587.stdout | 1315 --- .../ast_new-function_def3-f66064a.json | 13 - .../ast_new-function_def3-f66064a.stdout | 538 - tests/reference/ast_new-global1-38edfbd.json | 13 - .../reference/ast_new-global1-38edfbd.stdout | 219 - tests/reference/ast_new-if1-db43586.json | 13 - tests/reference/ast_new-if1-db43586.stdout | 458 - tests/reference/ast_new-if2-c3b6022.json | 13 - tests/reference/ast_new-if2-c3b6022.stdout | 364 - tests/reference/ast_new-import1-f643fd3.json | 13 - .../reference/ast_new-import1-f643fd3.stdout | 185 - tests/reference/ast_new-lambda1-260d046.json | 13 - .../reference/ast_new-lambda1-260d046.stdout | 1093 -- tests/reference/ast_new-lambda2-d84336e.json | 13 - .../reference/ast_new-lambda2-d84336e.stdout | 968 -- .../ast_new-match_stmt1-9e84d24.json | 13 - .../ast_new-match_stmt1-9e84d24.stdout | 2245 ----- tests/reference/ast_new-slice1-9c440e3.json | 13 - tests/reference/ast_new-slice1-9c440e3.stdout | 291 - .../ast_new-statements1-e081093.json | 13 - .../ast_new-statements1-e081093.stdout | 1695 ---- .../ast_new-statements2-c4cdc5f.json | 13 - .../ast_new-statements2-c4cdc5f.stdout | 507 - tests/reference/ast_new-string1-96b90b3.json | 13 - .../reference/ast_new-string1-96b90b3.stdout | 520 - tests/reference/ast_new-string2-44323ea.json | 13 - .../reference/ast_new-string2-44323ea.stdout | 118 - tests/reference/ast_new-string3-37f35a0.json | 13 - .../reference/ast_new-string3-37f35a0.stdout | 129 - tests/reference/ast_new-try1-a9a22cf.json | 13 - tests/reference/ast_new-try1-a9a22cf.stdout | 301 - tests/reference/ast_new-tuple1-29c08af.json | 13 - tests/reference/ast_new-tuple1-29c08af.stdout | 650 -- .../ast_new-type_comment1-710ea6c.json | 13 - .../ast_new-type_comment1-710ea6c.stdout | 175 - tests/reference/ast_new-unicode-d3199dc.json | 13 - .../reference/ast_new-unicode-d3199dc.stdout | 96 - tests/reference/ast_new-while1-a4c6382.json | 13 - tests/reference/ast_new-while1-a4c6382.stdout | 84 - tests/reference/ast_new-with1-6c88c0f.json | 13 - tests/reference/ast_new-with1-6c88c0f.stdout | 331 - tests/reference/ast_new-yield-4c41668.json | 13 - tests/reference/ast_new-yield-4c41668.stdout | 346 - tests/reference/c-c_interop1-e215531.json | 13 - tests/reference/c-c_interop1-e215531.stdout | 33 - tests/reference/c-expr7-bb2692a.json | 13 - tests/reference/c-expr7-bb2692a.stderr | 11 - tests/reference/c-expr_01-28f449f.json | 13 - tests/reference/c-expr_01-28f449f.stdout | 54 - tests/reference/c-expr_11-c452314.json | 13 - tests/reference/c-expr_11-c452314.stdout | 35 - tests/reference/c-expr_12-93c7780.json | 13 - tests/reference/c-expr_12-93c7780.stdout | 70 - tests/reference/c-func_static_01-fc146ec.json | 13 - .../reference/c-func_static_01-fc146ec.stdout | 46 - .../reference/c-import_order_01-3ebf3c3.json | 13 - .../c-import_order_01-3ebf3c3.stdout | 27 - tests/reference/c-loop1-3e341c7.json | 13 - tests/reference/c-loop1-3e341c7.stdout | 85 - tests/reference/c-loop4-eec10d3.json | 13 - tests/reference/c-loop4-eec10d3.stdout | 41 - tests/reference/c-print_01-4d44628.json | 13 - tests/reference/c-print_01-4d44628.stdout | 40 - tests/reference/c-test_import_02-d2c54c4.json | 13 - .../reference/c-test_import_02-d2c54c4.stdout | 53 - tests/reference/c-test_issue_518-fbbd299.json | 13 - .../reference/c-test_issue_518-fbbd299.stdout | 55 - .../reference/c-variable_decl_03-fa1823b.json | 13 - .../c-variable_decl_03-fa1823b.stdout | 52 - tests/reference/cpp-assert1-ba60925.json | 13 - tests/reference/cpp-assert1-ba60925.stdout | 37 - .../cpp-doconcurrentloop_01-4e9f274.json | 13 - .../cpp-doconcurrentloop_01-4e9f274.stdout | 105 - tests/reference/cpp-expr12-fd2ea87.json | 13 - tests/reference/cpp-expr12-fd2ea87.stdout | 69 - tests/reference/cpp-expr15-1661c0d.json | 13 - tests/reference/cpp-expr15-1661c0d.stderr | 11 - tests/reference/cpp-expr2-09c05ad.json | 13 - tests/reference/cpp-expr2-09c05ad.stdout | 37 - tests/reference/cpp-expr5-1de0e30.json | 13 - tests/reference/cpp-expr5-1de0e30.stdout | 37 - tests/reference/cpp-expr6-f337f4f.json | 13 - tests/reference/cpp-expr6-f337f4f.stdout | 37 - tests/reference/cpp-expr7-529bd53.json | 13 - tests/reference/cpp-expr7-529bd53.stderr | 11 - tests/reference/cpp-expr8-704cece.json | 13 - tests/reference/cpp-expr8-704cece.stderr | 11 - tests/reference/cpp-expr9-48868e9.json | 13 - tests/reference/cpp-expr9-48868e9.stdout | 82 - tests/reference/cpp-expr_11-422c839.json | 13 - tests/reference/cpp-expr_11-422c839.stdout | 55 - tests/reference/cpp-loop1-0a8cf3b.json | 13 - tests/reference/cpp-loop1-0a8cf3b.stdout | 105 - tests/reference/cpp-loop3-6020091.json | 13 - tests/reference/cpp-loop3-6020091.stdout | 37 - tests/reference/cpp-loop4-cdb2174.json | 13 - tests/reference/cpp-loop4-cdb2174.stdout | 61 - tests/reference/cpp-print_01-026ef17.json | 13 - tests/reference/cpp-print_01-026ef17.stdout | 61 - .../cpp-test_builtin_pow-56b3f92.json | 13 - .../cpp-test_builtin_pow-56b3f92.stderr | 11 - .../cpp-test_list_repeat2-698d7f4.json | 13 - .../cpp-test_list_repeat2-698d7f4.stdout | 256 - .../cpp-test_unary_op_03-fd9669a.json | 13 - .../cpp-test_unary_op_03-fd9669a.stdout | 56 - tests/reference/llvm-assert1-8df4f31.json | 13 - tests/reference/llvm-assert1-8df4f31.stdout | 10 - tests/reference/llvm-bindc_01-c984f09.json | 13 - tests/reference/llvm-bindc_01-c984f09.stdout | 81 - tests/reference/llvm-bool1-af4376b.json | 13 - tests/reference/llvm-bool1-af4376b.stdout | 64 - tests/reference/llvm-expr14-b96b5b1.json | 13 - tests/reference/llvm-expr14-b96b5b1.stdout | 10 - tests/reference/llvm-expr_01-54467c1.json | 13 - tests/reference/llvm-expr_01-54467c1.stdout | 41 - .../llvm-func_inline_01-2d4583a.json | 13 - .../llvm-func_inline_01-2d4583a.stdout | 100 - tests/reference/llvm-lpython1-23c5987.json | 13 - tests/reference/llvm-lpython1-23c5987.stdout | 10 - tests/reference/llvm-print_04-443a8d8.json | 13 - tests/reference/llvm-print_04-443a8d8.stdout | 46 - tests/reference/llvm-structs_11-09fea6a.json | 13 - .../reference/llvm-structs_11-09fea6a.stdout | 45 - .../llvm-test_issue_518-cdb641a.json | 13 - .../llvm-test_issue_518-cdb641a.stdout | 121 - .../llvm-test_unary_op_03-046fb86.json | 13 - .../llvm-test_unary_op_03-046fb86.stdout | 69 - tests/reference/llvm_dbg-expr_01-9fc5f30.json | 13 - .../reference/llvm_dbg-expr_01-9fc5f30.stdout | 79 - ..._class_constructor-structs_16-5e3508f.json | 13 - ...lass_constructor-structs_16-5e3508f.stdout | 356 - ...function_calls-func_inline_01-8b6a5da.json | 13 - ...nction_calls-func_inline_01-8b6a5da.stdout | 432 - .../pass_loop_vectorise-vec_01-be9985e.json | 13 - .../pass_loop_vectorise-vec_01-be9985e.stderr | 17 - ...ass_print_list_tuple-print_02-09600eb.json | 13 - ...s_print_list_tuple-print_02-09600eb.stdout | 8761 ----------------- ...ist_tuple-print_list_tuple_03-195fa9c.json | 13 - ...t_tuple-print_list_tuple_03-195fa9c.stdout | 522 - .../run_dbg-test_assert_01-2f34744.json | 13 - .../run_dbg-test_assert_01-2f34744.stderr | 7 - .../run_dbg-test_assert_02-c6de25a.json | 13 - .../run_dbg-test_assert_02-c6de25a.stderr | 7 - .../run_dbg-test_assert_03-bd7b7dd.json | 13 - .../run_dbg-test_assert_03-bd7b7dd.stderr | 11 - .../run_dbg-test_quit_01-30889cc.json | 13 - .../run_dbg-test_quit_01-30889cc.stderr | 7 - .../run_dbg-test_raise_01-dfd86ca.json | 13 - .../run_dbg-test_raise_01-dfd86ca.stderr | 7 - .../runtime-test_dict14-421fe53.json | 13 - .../runtime-test_dict14-421fe53.stderr | 1 - .../runtime-test_dict15-6f3af0d.json | 13 - .../runtime-test_dict15-6f3af0d.stderr | 1 - .../runtime-test_dict16-c5a958d.json | 13 - .../runtime-test_dict16-c5a958d.stderr | 1 - .../runtime-test_list_01-3ee9b3e.json | 13 - .../runtime-test_list_01-3ee9b3e.stderr | 1 - .../runtime-test_list_02-5f7db5f.json | 13 - .../runtime-test_list_02-5f7db5f.stderr | 1 - .../runtime-test_list_index-0483808.json | 13 - .../runtime-test_list_index-0483808.stderr | 1 - .../runtime-test_list_index2-1249233.json | 13 - .../runtime-test_list_index2-1249233.stderr | 1 - .../runtime-test_list_index3-647a94a.json | 13 - .../runtime-test_list_index3-647a94a.stderr | 1 - .../runtime-test_list_index4-c31dfdb.json | 13 - .../runtime-test_list_index4-c31dfdb.stderr | 1 - .../runtime-test_str_01-50bdf2f.json | 13 - .../runtime-test_str_01-50bdf2f.stdout | 1 - .../runtime-test_str_02-c38ba27.json | 13 - .../runtime-test_str_02-c38ba27.stdout | 1 - tests/reference/tokens-comment1-2f8ab90.json | 13 - .../reference/tokens-comment1-2f8ab90.stdout | 34 - tests/reference/tokens-comment2-b289dad.json | 13 - .../reference/tokens-comment2-b289dad.stdout | 133 - .../reference/tokens-docstring1-1355fbb.json | 13 - .../tokens-docstring1-1355fbb.stdout | 36 - tests/reference/tokens-indent1-0b243c5.json | 13 - tests/reference/tokens-indent1-0b243c5.stderr | 5 - tests/reference/tokens-indent1-290e858.json | 13 - tests/reference/tokens-indent1-290e858.stdout | 73 - tests/reference/tokens-indent2-a8438a0.json | 13 - tests/reference/tokens-indent2-a8438a0.stderr | 5 - tests/reference/tokens-indent2-e702789.json | 13 - tests/reference/tokens-indent2-e702789.stdout | 88 - tests/reference/tokens-indent3-0eaf3e6.json | 13 - tests/reference/tokens-indent3-0eaf3e6.stderr | 5 - tests/reference/tokens-numbers1-589063f.json | 13 - .../reference/tokens-numbers1-589063f.stdout | 242 - tests/reference/tokens-paren1-94fa736.json | 13 - tests/reference/tokens-paren1-94fa736.stderr | 5 - tests/reference/tokens-paren2-0eef339.json | 13 - tests/reference/tokens-paren2-0eef339.stderr | 5 - tests/reference/tokens-paren3-0d47100.json | 13 - tests/reference/tokens-paren3-0d47100.stderr | 5 - tests/reference/tokens-paren4-5c2fc32.json | 13 - tests/reference/tokens-paren4-5c2fc32.stderr | 5 - tests/reference/tokens-symbols1-658c990.json | 13 - .../reference/tokens-symbols1-658c990.stdout | 340 - tests/reference/wat-bool1-234bcd1.json | 13 - tests/reference/wat-bool1-234bcd1.stdout | 218 - tests/reference/wat-expr14-5e0cb96.json | 13 - tests/reference/wat-expr14-5e0cb96.stdout | 57 - tests/reference/wat-expr2-8b17723.json | 13 - tests/reference/wat-expr2-8b17723.stdout | 57 - tests/reference/wat-expr9-f73afd1.json | 13 - tests/reference/wat-expr9-f73afd1.stdout | 113 - tests/reference/wat-loop1-e0046d4.json | 13 - tests/reference/wat-loop1-e0046d4.stdout | 197 - tests/reference/wat-print_str-385e953.json | 13 - tests/reference/wat-print_str-385e953.stdout | 162 - 744 files changed, 78178 deletions(-) delete mode 100644 tests/reference/asr-array_01_decl-39cf894.json delete mode 100644 tests/reference/asr-array_01_decl-39cf894.stderr delete mode 100644 tests/reference/asr-array_02_decl-e8f6874.json delete mode 100644 tests/reference/asr-array_02_decl-e8f6874.stderr delete mode 100644 tests/reference/asr-arrays_01-a617b64.json delete mode 100644 tests/reference/asr-arrays_01-a617b64.stderr delete mode 100644 tests/reference/asr-arrays_02-da94458.json delete mode 100644 tests/reference/asr-arrays_02-da94458.stderr delete mode 100644 tests/reference/asr-arrays_03-de2e952.json delete mode 100644 tests/reference/asr-arrays_03-de2e952.stderr delete mode 100644 tests/reference/asr-arrays_04-880407c.json delete mode 100644 tests/reference/asr-arrays_04-880407c.stderr delete mode 100644 tests/reference/asr-arrays_05-ec8fbd5.json delete mode 100644 tests/reference/asr-arrays_05-ec8fbd5.stderr delete mode 100644 tests/reference/asr-arrays_06-fbb09a3.json delete mode 100644 tests/reference/asr-arrays_06-fbb09a3.stderr delete mode 100644 tests/reference/asr-arrays_07-de430fd.json delete mode 100644 tests/reference/asr-arrays_07-de430fd.stderr delete mode 100644 tests/reference/asr-arrays_08-ba317a3.json delete mode 100644 tests/reference/asr-arrays_08-ba317a3.stderr delete mode 100644 tests/reference/asr-arrays_09-50ee586.json delete mode 100644 tests/reference/asr-arrays_09-50ee586.stderr delete mode 100644 tests/reference/asr-arrays_10-bc82d75.json delete mode 100644 tests/reference/asr-arrays_10-bc82d75.stderr delete mode 100644 tests/reference/asr-arrays_11-fc505b4.json delete mode 100644 tests/reference/asr-arrays_11-fc505b4.stderr delete mode 100644 tests/reference/asr-arrays_12-63d6f25.json delete mode 100644 tests/reference/asr-arrays_12-63d6f25.stderr delete mode 100644 tests/reference/asr-arrays_13-b5fcc7e.json delete mode 100644 tests/reference/asr-arrays_13-b5fcc7e.stderr delete mode 100644 tests/reference/asr-arrays_14-78be00e.json delete mode 100644 tests/reference/asr-arrays_14-78be00e.stderr delete mode 100644 tests/reference/asr-assert1-1ce92ea.json delete mode 100644 tests/reference/asr-assert1-1ce92ea.stdout delete mode 100644 tests/reference/asr-assign1-886f049.json delete mode 100644 tests/reference/asr-assign1-886f049.stdout delete mode 100644 tests/reference/asr-assign2-8d1a2ee.json delete mode 100644 tests/reference/asr-assign2-8d1a2ee.stdout delete mode 100644 tests/reference/asr-bindc_01-6d521a9.json delete mode 100644 tests/reference/asr-bindc_01-6d521a9.stdout delete mode 100644 tests/reference/asr-bindc_01-f761165.json delete mode 100644 tests/reference/asr-bindc_01-f761165.stderr delete mode 100644 tests/reference/asr-bindc_02-5092d8e.json delete mode 100644 tests/reference/asr-bindc_02-5092d8e.stderr delete mode 100644 tests/reference/asr-bindc_02-bc1a7ea.json delete mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stderr delete mode 100644 tests/reference/asr-bindc_03-95dbba7.json delete mode 100644 tests/reference/asr-bindc_03-95dbba7.stderr delete mode 100644 tests/reference/asr-bindc_04-06bd800.json delete mode 100644 tests/reference/asr-bindc_04-06bd800.stderr delete mode 100644 tests/reference/asr-bindc_10e-8b10394.json delete mode 100644 tests/reference/asr-bindc_10e-8b10394.stderr delete mode 100644 tests/reference/asr-c_interop1-cf2e9b4.json delete mode 100644 tests/reference/asr-c_interop1-cf2e9b4.stdout delete mode 100644 tests/reference/asr-callback_01-df40fd5.json delete mode 100644 tests/reference/asr-callback_01-df40fd5.stdout delete mode 100644 tests/reference/asr-cast-435c233.json delete mode 100644 tests/reference/asr-cast-435c233.stderr delete mode 100644 tests/reference/asr-complex1-f26c460.json delete mode 100644 tests/reference/asr-complex1-f26c460.stderr delete mode 100644 tests/reference/asr-const_01-af8289b.json delete mode 100644 tests/reference/asr-const_01-af8289b.stderr delete mode 100644 tests/reference/asr-const_02-fce29b7.json delete mode 100644 tests/reference/asr-const_02-fce29b7.stderr delete mode 100644 tests/reference/asr-constants1-5828e8a.json delete mode 100644 tests/reference/asr-constants1-5828e8a.stderr delete mode 100644 tests/reference/asr-cptr_01-4e660f1.json delete mode 100644 tests/reference/asr-cptr_01-4e660f1.stderr delete mode 100644 tests/reference/asr-dictionary1-a105a36.json delete mode 100644 tests/reference/asr-dictionary1-a105a36.stdout delete mode 100644 tests/reference/asr-doconcurrentloop_01-3fdc189.json delete mode 100644 tests/reference/asr-doconcurrentloop_01-3fdc189.stdout delete mode 100644 tests/reference/asr-elemental_01-b58df26.json delete mode 100644 tests/reference/asr-elemental_01-b58df26.stderr delete mode 100644 tests/reference/asr-enum_01-30e1b4a.json delete mode 100644 tests/reference/asr-enum_01-30e1b4a.stderr delete mode 100644 tests/reference/asr-enum_02-54656c5.json delete mode 100644 tests/reference/asr-enum_02-54656c5.stderr delete mode 100644 tests/reference/asr-expr1-8df2d66.json delete mode 100644 tests/reference/asr-expr1-8df2d66.stdout delete mode 100644 tests/reference/asr-expr10-efcbb1b.json delete mode 100644 tests/reference/asr-expr10-efcbb1b.stderr delete mode 100644 tests/reference/asr-expr11-9b91d35.json delete mode 100644 tests/reference/asr-expr11-9b91d35.stdout delete mode 100644 tests/reference/asr-expr12-5c5b71e.json delete mode 100644 tests/reference/asr-expr12-5c5b71e.stdout delete mode 100644 tests/reference/asr-expr13-81bdb5a.json delete mode 100644 tests/reference/asr-expr13-81bdb5a.stderr delete mode 100644 tests/reference/asr-expr16-a3dc453.json delete mode 100644 tests/reference/asr-expr16-a3dc453.stderr delete mode 100644 tests/reference/asr-expr2-2e78a12.json delete mode 100644 tests/reference/asr-expr2-2e78a12.stdout delete mode 100644 tests/reference/asr-expr4-cef6743.json delete mode 100644 tests/reference/asr-expr4-cef6743.stdout delete mode 100644 tests/reference/asr-expr5-645ffcc.json delete mode 100644 tests/reference/asr-expr5-645ffcc.stdout delete mode 100644 tests/reference/asr-expr6-368e5ed.json delete mode 100644 tests/reference/asr-expr6-368e5ed.stdout delete mode 100644 tests/reference/asr-expr7-480ba2f.json delete mode 100644 tests/reference/asr-expr7-480ba2f.stderr delete mode 100644 tests/reference/asr-expr8-6beda60.json delete mode 100644 tests/reference/asr-expr8-6beda60.stderr delete mode 100644 tests/reference/asr-expr9-814e4bc.json delete mode 100644 tests/reference/asr-expr9-814e4bc.stdout delete mode 100644 tests/reference/asr-expr_01-211000e.json delete mode 100644 tests/reference/asr-expr_01-211000e.stdout delete mode 100644 tests/reference/asr-expr_01-a0d4829.json delete mode 100644 tests/reference/asr-expr_01-a0d4829.stdout delete mode 100644 tests/reference/asr-expr_05-3a37324.json delete mode 100644 tests/reference/asr-expr_05-3a37324.stderr delete mode 100644 tests/reference/asr-expr_07-7742668.json delete mode 100644 tests/reference/asr-expr_07-7742668.stdout delete mode 100644 tests/reference/asr-expr_09-f3e89c8.json delete mode 100644 tests/reference/asr-expr_09-f3e89c8.stdout delete mode 100644 tests/reference/asr-expr_10-d39708c.json delete mode 100644 tests/reference/asr-expr_10-d39708c.stdout delete mode 100644 tests/reference/asr-expr_12-6769be0.json delete mode 100644 tests/reference/asr-expr_12-6769be0.stdout delete mode 100644 tests/reference/asr-expr_14-f2bd343.json delete mode 100644 tests/reference/asr-expr_14-f2bd343.stdout delete mode 100644 tests/reference/asr-func_01-d87aa4a.json delete mode 100644 tests/reference/asr-func_01-d87aa4a.stderr delete mode 100644 tests/reference/asr-func_02-b439474.json delete mode 100644 tests/reference/asr-func_02-b439474.stderr delete mode 100644 tests/reference/asr-func_03-cd744a0.json delete mode 100644 tests/reference/asr-func_03-cd744a0.stderr delete mode 100644 tests/reference/asr-func_04-eef2656.json delete mode 100644 tests/reference/asr-func_04-eef2656.stderr delete mode 100644 tests/reference/asr-func_05-c22b921.json delete mode 100644 tests/reference/asr-func_05-c22b921.stderr delete mode 100644 tests/reference/asr-func_06-62e738c.json delete mode 100644 tests/reference/asr-func_06-62e738c.stderr delete mode 100644 tests/reference/asr-func_07-4a8c076.json delete mode 100644 tests/reference/asr-func_07-4a8c076.stderr delete mode 100644 tests/reference/asr-func_08-c137415.json delete mode 100644 tests/reference/asr-func_08-c137415.stderr delete mode 100644 tests/reference/asr-func_inline_01-56af272.json delete mode 100644 tests/reference/asr-func_inline_01-56af272.stdout delete mode 100644 tests/reference/asr-generics_01-d616074.json delete mode 100644 tests/reference/asr-generics_01-d616074.stdout delete mode 100644 tests/reference/asr-generics_02-e2ea5c9.json delete mode 100644 tests/reference/asr-generics_02-e2ea5c9.stdout delete mode 100644 tests/reference/asr-generics_array_01-682b1b2.json delete mode 100644 tests/reference/asr-generics_array_01-682b1b2.stderr delete mode 100644 tests/reference/asr-generics_array_02-22c8dc1.json delete mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stderr delete mode 100644 tests/reference/asr-generics_array_03-fb3706c.json delete mode 100644 tests/reference/asr-generics_array_03-fb3706c.stderr delete mode 100644 tests/reference/asr-generics_error_01-1e05cd6.json delete mode 100644 tests/reference/asr-generics_error_01-1e05cd6.stderr delete mode 100644 tests/reference/asr-generics_error_02-d614928.json delete mode 100644 tests/reference/asr-generics_error_02-d614928.stderr delete mode 100644 tests/reference/asr-generics_error_03-208d10d.json delete mode 100644 tests/reference/asr-generics_error_03-208d10d.stderr delete mode 100644 tests/reference/asr-generics_list_01-39c4044.json delete mode 100644 tests/reference/asr-generics_list_01-39c4044.stdout delete mode 100644 tests/reference/asr-global_scope1-354e217.json delete mode 100644 tests/reference/asr-global_scope1-354e217.stdout delete mode 100644 tests/reference/asr-global_syms_01-273906f.json delete mode 100644 tests/reference/asr-global_syms_01-273906f.stdout delete mode 100644 tests/reference/asr-intent_01-66824bc.json delete mode 100644 tests/reference/asr-intent_01-66824bc.stdout delete mode 100644 tests/reference/asr-kwargs_01_error-ab9530d.json delete mode 100644 tests/reference/asr-kwargs_01_error-ab9530d.stderr delete mode 100644 tests/reference/asr-kwargs_02_error-7c91f8f.json delete mode 100644 tests/reference/asr-kwargs_02_error-7c91f8f.stderr delete mode 100644 tests/reference/asr-kwargs_03_error-a68cc46.json delete mode 100644 tests/reference/asr-kwargs_03_error-a68cc46.stderr delete mode 100644 tests/reference/asr-lambda_01-1ec3e01.json delete mode 100644 tests/reference/asr-lambda_01-1ec3e01.stderr delete mode 100644 tests/reference/asr-list1-770ba33.json delete mode 100644 tests/reference/asr-list1-770ba33.stdout delete mode 100644 tests/reference/asr-loop1-10d3109.json delete mode 100644 tests/reference/asr-loop1-10d3109.stdout delete mode 100644 tests/reference/asr-loop3-a579196.json delete mode 100644 tests/reference/asr-loop3-a579196.stdout delete mode 100644 tests/reference/asr-loop4-3d3216e.json delete mode 100644 tests/reference/asr-loop4-3d3216e.stdout delete mode 100644 tests/reference/asr-loop_01-e7aa06a.json delete mode 100644 tests/reference/asr-loop_01-e7aa06a.stderr delete mode 100644 tests/reference/asr-loop_02-5741651.json delete mode 100644 tests/reference/asr-loop_02-5741651.stderr delete mode 100644 tests/reference/asr-loop_03-401ab45.json delete mode 100644 tests/reference/asr-loop_03-401ab45.stderr delete mode 100644 tests/reference/asr-modules_02-ec92e6f.json delete mode 100644 tests/reference/asr-modules_02-ec92e6f.stdout delete mode 100644 tests/reference/asr-print_02-afbe092.json delete mode 100644 tests/reference/asr-print_02-afbe092.stdout delete mode 100644 tests/reference/asr-print_list_tuple_03-9de3736.json delete mode 100644 tests/reference/asr-print_list_tuple_03-9de3736.stdout delete mode 100644 tests/reference/asr-set1-b7b913a.json delete mode 100644 tests/reference/asr-set1-b7b913a.stdout delete mode 100644 tests/reference/asr-string_01-78629c4.json delete mode 100644 tests/reference/asr-string_01-78629c4.stderr delete mode 100644 tests/reference/asr-string_02-499c9ff.json delete mode 100644 tests/reference/asr-string_02-499c9ff.stderr delete mode 100644 tests/reference/asr-structs_01-0893e35.json delete mode 100644 tests/reference/asr-structs_01-0893e35.stderr delete mode 100644 tests/reference/asr-structs_01-66dc2c9.json delete mode 100644 tests/reference/asr-structs_01-66dc2c9.stdout delete mode 100644 tests/reference/asr-structs_01-be14d49.json delete mode 100644 tests/reference/asr-structs_01-be14d49.stdout delete mode 100644 tests/reference/asr-structs_02-2ab459a.json delete mode 100644 tests/reference/asr-structs_02-2ab459a.stdout delete mode 100644 tests/reference/asr-structs_02-f95782c.json delete mode 100644 tests/reference/asr-structs_02-f95782c.stderr delete mode 100644 tests/reference/asr-structs_03-0cef911.json delete mode 100644 tests/reference/asr-structs_03-0cef911.stdout delete mode 100644 tests/reference/asr-structs_03-754fb64.json delete mode 100644 tests/reference/asr-structs_03-754fb64.stderr delete mode 100644 tests/reference/asr-structs_04-387747b.json delete mode 100644 tests/reference/asr-structs_04-387747b.stdout delete mode 100644 tests/reference/asr-structs_04-7b864bc.json delete mode 100644 tests/reference/asr-structs_04-7b864bc.stderr delete mode 100644 tests/reference/asr-structs_05-fa98307.json delete mode 100644 tests/reference/asr-structs_05-fa98307.stderr delete mode 100644 tests/reference/asr-structs_06-6e14537.json delete mode 100644 tests/reference/asr-structs_06-6e14537.stderr delete mode 100644 tests/reference/asr-structs_07-83694b7.json delete mode 100644 tests/reference/asr-structs_07-83694b7.stderr delete mode 100644 tests/reference/asr-structs_08-fa4dbf0.json delete mode 100644 tests/reference/asr-structs_08-fa4dbf0.stderr delete mode 100644 tests/reference/asr-structs_09-f3ffe08.json delete mode 100644 tests/reference/asr-structs_09-f3ffe08.stderr delete mode 100644 tests/reference/asr-structs_10-cb8a283.json delete mode 100644 tests/reference/asr-structs_10-cb8a283.stderr delete mode 100644 tests/reference/asr-structs_16-44de89a.json delete mode 100644 tests/reference/asr-structs_16-44de89a.stdout delete mode 100644 tests/reference/asr-subscript1-1acfc19.json delete mode 100644 tests/reference/asr-subscript1-1acfc19.stdout delete mode 100644 tests/reference/asr-test_annassign_01-2f18669.json delete mode 100644 tests/reference/asr-test_annassign_01-2f18669.stderr delete mode 100644 tests/reference/asr-test_annassign_02-accf6db.json delete mode 100644 tests/reference/asr-test_annassign_02-accf6db.stderr delete mode 100644 tests/reference/asr-test_annassign_03-f8c6160.json delete mode 100644 tests/reference/asr-test_annassign_03-f8c6160.stderr delete mode 100644 tests/reference/asr-test_annassign_type_mismatch-7dac7be.json delete mode 100644 tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr delete mode 100644 tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json delete mode 100644 tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr delete mode 100644 tests/reference/asr-test_append_type_mismatch-030e9c7.json delete mode 100644 tests/reference/asr-test_append_type_mismatch-030e9c7.stderr delete mode 100644 tests/reference/asr-test_assign1-a94d41e.json delete mode 100644 tests/reference/asr-test_assign1-a94d41e.stderr delete mode 100644 tests/reference/asr-test_assign2-fa29029.json delete mode 100644 tests/reference/asr-test_assign2-fa29029.stderr delete mode 100644 tests/reference/asr-test_assign3-cc6fc9d.json delete mode 100644 tests/reference/asr-test_assign3-cc6fc9d.stderr delete mode 100644 tests/reference/asr-test_assign4-a2136e0.json delete mode 100644 tests/reference/asr-test_assign4-a2136e0.stderr delete mode 100644 tests/reference/asr-test_assign5-694a98f.json delete mode 100644 tests/reference/asr-test_assign5-694a98f.stderr delete mode 100644 tests/reference/asr-test_assign6-05cd64f.json delete mode 100644 tests/reference/asr-test_assign6-05cd64f.stderr delete mode 100644 tests/reference/asr-test_assign7-beebac3.json delete mode 100644 tests/reference/asr-test_assign7-beebac3.stderr delete mode 100644 tests/reference/asr-test_assign8-4b26e63.json delete mode 100644 tests/reference/asr-test_assign8-4b26e63.stderr delete mode 100644 tests/reference/asr-test_assign9-51278b8.json delete mode 100644 tests/reference/asr-test_assign9-51278b8.stderr delete mode 100644 tests/reference/asr-test_binop1-50b63f6.json delete mode 100644 tests/reference/asr-test_binop1-50b63f6.stderr delete mode 100644 tests/reference/asr-test_binop2-e5749af.json delete mode 100644 tests/reference/asr-test_binop2-e5749af.stderr delete mode 100644 tests/reference/asr-test_binop3-a67201d.json delete mode 100644 tests/reference/asr-test_binop3-a67201d.stderr delete mode 100644 tests/reference/asr-test_bit_length-da3a264.json delete mode 100644 tests/reference/asr-test_bit_length-da3a264.stderr delete mode 100644 tests/reference/asr-test_bitwise_on_complex-dd9568b.json delete mode 100644 tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr delete mode 100644 tests/reference/asr-test_bitwise_on_float-2e09b30.json delete mode 100644 tests/reference/asr-test_bitwise_on_float-2e09b30.stderr delete mode 100644 tests/reference/asr-test_bool_binop-f856ef0.json delete mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stderr delete mode 100644 tests/reference/asr-test_builtin-aa64615.json delete mode 100644 tests/reference/asr-test_builtin-aa64615.stdout delete mode 100644 tests/reference/asr-test_builtin_abs-c74d2c9.json delete mode 100644 tests/reference/asr-test_builtin_abs-c74d2c9.stdout delete mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.json delete mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stderr delete mode 100644 tests/reference/asr-test_builtin_bool-330223a.json delete mode 100644 tests/reference/asr-test_builtin_bool-330223a.stderr delete mode 100644 tests/reference/asr-test_builtin_float-20601dd.json delete mode 100644 tests/reference/asr-test_builtin_float-20601dd.stdout delete mode 100644 tests/reference/asr-test_builtin_hex-64bd268.json delete mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stderr delete mode 100644 tests/reference/asr-test_builtin_int-8f88fdc.json delete mode 100644 tests/reference/asr-test_builtin_int-8f88fdc.stdout delete mode 100644 tests/reference/asr-test_builtin_len-55b0dec.json delete mode 100644 tests/reference/asr-test_builtin_len-55b0dec.stdout delete mode 100644 tests/reference/asr-test_builtin_oct-20b9066.json delete mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stderr delete mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.json delete mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.stderr delete mode 100644 tests/reference/asr-test_builtin_round-7417a21.json delete mode 100644 tests/reference/asr-test_builtin_round-7417a21.stderr delete mode 100644 tests/reference/asr-test_builtin_str-580e920.json delete mode 100644 tests/reference/asr-test_builtin_str-580e920.stdout delete mode 100644 tests/reference/asr-test_c_interop_01-e374f43.json delete mode 100644 tests/reference/asr-test_c_interop_01-e374f43.stdout delete mode 100644 tests/reference/asr-test_chr-91f4987.json delete mode 100644 tests/reference/asr-test_chr-91f4987.stderr delete mode 100644 tests/reference/asr-test_compare_01-c594bbe.json delete mode 100644 tests/reference/asr-test_compare_01-c594bbe.stderr delete mode 100644 tests/reference/asr-test_compare_02-bf2c76e.json delete mode 100644 tests/reference/asr-test_compare_02-bf2c76e.stderr delete mode 100644 tests/reference/asr-test_complex_01-a6def58.json delete mode 100644 tests/reference/asr-test_complex_01-a6def58.stderr delete mode 100644 tests/reference/asr-test_complex_02-782ba2d.json delete mode 100644 tests/reference/asr-test_complex_02-782ba2d.stderr delete mode 100644 tests/reference/asr-test_dict1-a45a075.json delete mode 100644 tests/reference/asr-test_dict1-a45a075.stderr delete mode 100644 tests/reference/asr-test_dict10-8c0beff.json delete mode 100644 tests/reference/asr-test_dict10-8c0beff.stderr delete mode 100644 tests/reference/asr-test_dict11-2ab4e6c.json delete mode 100644 tests/reference/asr-test_dict11-2ab4e6c.stderr delete mode 100644 tests/reference/asr-test_dict12-7c74d08.json delete mode 100644 tests/reference/asr-test_dict12-7c74d08.stderr delete mode 100644 tests/reference/asr-test_dict13-683b290.json delete mode 100644 tests/reference/asr-test_dict13-683b290.stderr delete mode 100644 tests/reference/asr-test_dict2-4587f02.json delete mode 100644 tests/reference/asr-test_dict2-4587f02.stderr delete mode 100644 tests/reference/asr-test_dict3-d28f38f.json delete mode 100644 tests/reference/asr-test_dict3-d28f38f.stderr delete mode 100644 tests/reference/asr-test_dict4-39489fa.json delete mode 100644 tests/reference/asr-test_dict4-39489fa.stderr delete mode 100644 tests/reference/asr-test_dict5-c436d37.json delete mode 100644 tests/reference/asr-test_dict5-c436d37.stderr delete mode 100644 tests/reference/asr-test_dict6-95e3b14.json delete mode 100644 tests/reference/asr-test_dict6-95e3b14.stderr delete mode 100644 tests/reference/asr-test_dict7-1415e14.json delete mode 100644 tests/reference/asr-test_dict7-1415e14.stderr delete mode 100644 tests/reference/asr-test_dict8-d960ce0.json delete mode 100644 tests/reference/asr-test_dict8-d960ce0.stderr delete mode 100644 tests/reference/asr-test_dict9-907bda7.json delete mode 100644 tests/reference/asr-test_dict9-907bda7.stderr delete mode 100644 tests/reference/asr-test_end_sep_keywords-2226a67.json delete mode 100644 tests/reference/asr-test_end_sep_keywords-2226a67.stdout delete mode 100644 tests/reference/asr-test_for2-e5d893f.json delete mode 100644 tests/reference/asr-test_for2-e5d893f.stderr delete mode 100644 tests/reference/asr-test_func_args-a898a72.json delete mode 100644 tests/reference/asr-test_func_args-a898a72.stderr delete mode 100644 tests/reference/asr-test_import_01-b859c43.json delete mode 100644 tests/reference/asr-test_import_01-b859c43.stderr delete mode 100644 tests/reference/asr-test_import_02-55b47fa.json delete mode 100644 tests/reference/asr-test_import_02-55b47fa.stderr delete mode 100644 tests/reference/asr-test_len1-839a615.json delete mode 100644 tests/reference/asr-test_len1-839a615.stderr delete mode 100644 tests/reference/asr-test_list1-73fd538.json delete mode 100644 tests/reference/asr-test_list1-73fd538.stderr delete mode 100644 tests/reference/asr-test_list2-10ffdd7.json delete mode 100644 tests/reference/asr-test_list2-10ffdd7.stderr delete mode 100644 tests/reference/asr-test_list3-5f4d2a8.json delete mode 100644 tests/reference/asr-test_list3-5f4d2a8.stderr delete mode 100644 tests/reference/asr-test_list4-d18a7e3.json delete mode 100644 tests/reference/asr-test_list4-d18a7e3.stderr delete mode 100644 tests/reference/asr-test_list_concat-41d186f.json delete mode 100644 tests/reference/asr-test_list_concat-41d186f.stderr delete mode 100644 tests/reference/asr-test_list_count-4b42498.json delete mode 100644 tests/reference/asr-test_list_count-4b42498.stderr delete mode 100644 tests/reference/asr-test_list_slicing-984fbf0.json delete mode 100644 tests/reference/asr-test_list_slicing-984fbf0.stderr delete mode 100644 tests/reference/asr-test_max_min-3c2fc51.json delete mode 100644 tests/reference/asr-test_max_min-3c2fc51.stderr delete mode 100644 tests/reference/asr-test_numpy_03-e600a49.json delete mode 100644 tests/reference/asr-test_numpy_03-e600a49.stderr delete mode 100644 tests/reference/asr-test_numpy_04-ecbb614.json delete mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stderr delete mode 100644 tests/reference/asr-test_operator_01-0f232bf.json delete mode 100644 tests/reference/asr-test_operator_01-0f232bf.stderr delete mode 100644 tests/reference/asr-test_ord-316ce61.json delete mode 100644 tests/reference/asr-test_ord-316ce61.stderr delete mode 100644 tests/reference/asr-test_pointer_types-1bf0d01.json delete mode 100644 tests/reference/asr-test_pointer_types-1bf0d01.stderr delete mode 100644 tests/reference/asr-test_pow-3f5d550.json delete mode 100644 tests/reference/asr-test_pow-3f5d550.stderr delete mode 100644 tests/reference/asr-test_pow1-581ef42.json delete mode 100644 tests/reference/asr-test_pow1-581ef42.stderr delete mode 100644 tests/reference/asr-test_pow2-0dcbd7d.json delete mode 100644 tests/reference/asr-test_pow2-0dcbd7d.stderr delete mode 100644 tests/reference/asr-test_pow3-79749ed.json delete mode 100644 tests/reference/asr-test_pow3-79749ed.stderr delete mode 100644 tests/reference/asr-test_pow4-ef60978.json delete mode 100644 tests/reference/asr-test_pow4-ef60978.stderr delete mode 100644 tests/reference/asr-test_print1-f1f36f1.json delete mode 100644 tests/reference/asr-test_print1-f1f36f1.stderr delete mode 100644 tests/reference/asr-test_print2-64acb15.json delete mode 100644 tests/reference/asr-test_print2-64acb15.stderr delete mode 100644 tests/reference/asr-test_return1-2603c9e.json delete mode 100644 tests/reference/asr-test_return1-2603c9e.stderr delete mode 100644 tests/reference/asr-test_return2-add829b.json delete mode 100644 tests/reference/asr-test_return2-add829b.stderr delete mode 100644 tests/reference/asr-test_set1-11379c7.json delete mode 100644 tests/reference/asr-test_set1-11379c7.stderr delete mode 100644 tests/reference/asr-test_set2-d91a6f0.json delete mode 100644 tests/reference/asr-test_set2-d91a6f0.stderr delete mode 100644 tests/reference/asr-test_set3-f9bbffb.json delete mode 100644 tests/reference/asr-test_set3-f9bbffb.stderr delete mode 100644 tests/reference/asr-test_set4-53fea39.json delete mode 100644 tests/reference/asr-test_set4-53fea39.stderr delete mode 100644 tests/reference/asr-test_set_indexing-a1c21b8.json delete mode 100644 tests/reference/asr-test_set_indexing-a1c21b8.stderr delete mode 100644 tests/reference/asr-test_str_capitalize-9f8dfa9.json delete mode 100644 tests/reference/asr-test_str_capitalize-9f8dfa9.stderr delete mode 100644 tests/reference/asr-test_str_indexing-b200a4e.json delete mode 100644 tests/reference/asr-test_str_indexing-b200a4e.stderr delete mode 100644 tests/reference/asr-test_str_slicing-eca1381.json delete mode 100644 tests/reference/asr-test_str_slicing-eca1381.stderr delete mode 100644 tests/reference/asr-test_str_slicing2-2f07e9a.json delete mode 100644 tests/reference/asr-test_str_slicing2-2f07e9a.stderr delete mode 100644 tests/reference/asr-test_str_slicing3-fe6a03c.json delete mode 100644 tests/reference/asr-test_str_slicing3-fe6a03c.stderr delete mode 100644 tests/reference/asr-test_str_slicing4-a0c7a69.json delete mode 100644 tests/reference/asr-test_str_slicing4-a0c7a69.stderr delete mode 100644 tests/reference/asr-test_str_to_int-61553e7.json delete mode 100644 tests/reference/asr-test_str_to_int-61553e7.stderr delete mode 100644 tests/reference/asr-test_tuple1-7abe88f.json delete mode 100644 tests/reference/asr-test_tuple1-7abe88f.stderr delete mode 100644 tests/reference/asr-test_tuple2-b046610.json delete mode 100644 tests/reference/asr-test_tuple2-b046610.stderr delete mode 100644 tests/reference/asr-test_tuple3-19fa47f.json delete mode 100644 tests/reference/asr-test_tuple3-19fa47f.stderr delete mode 100644 tests/reference/asr-test_type_mismatch_01-09e8af3.json delete mode 100644 tests/reference/asr-test_type_mismatch_01-09e8af3.stderr delete mode 100644 tests/reference/asr-test_unary_op_03-e799eae.json delete mode 100644 tests/reference/asr-test_unary_op_03-e799eae.stdout delete mode 100644 tests/reference/asr-test_unsupported_type-0d813dd.json delete mode 100644 tests/reference/asr-test_unsupported_type-0d813dd.stderr delete mode 100644 tests/reference/asr-test_zero_division-3dd84e8.json delete mode 100644 tests/reference/asr-test_zero_division-3dd84e8.stderr delete mode 100644 tests/reference/asr-test_zero_division2-d84989f.json delete mode 100644 tests/reference/asr-test_zero_division2-d84989f.stderr delete mode 100644 tests/reference/asr-test_zero_division3-29efb9e.json delete mode 100644 tests/reference/asr-test_zero_division3-29efb9e.stderr delete mode 100644 tests/reference/asr-test_zero_division4-bf4af64.json delete mode 100644 tests/reference/asr-test_zero_division4-bf4af64.stderr delete mode 100644 tests/reference/asr-tuple1-09972ab.json delete mode 100644 tests/reference/asr-tuple1-09972ab.stdout delete mode 100644 tests/reference/asr-type_mismatch-61052c7.json delete mode 100644 tests/reference/asr-type_mismatch-61052c7.stderr delete mode 100644 tests/reference/asr-unsigned_01-892b178.json delete mode 100644 tests/reference/asr-unsigned_01-892b178.stderr delete mode 100644 tests/reference/asr-unsigned_02-6563e58.json delete mode 100644 tests/reference/asr-unsigned_02-6563e58.stderr delete mode 100644 tests/reference/asr-unsigned_03-f785652.json delete mode 100644 tests/reference/asr-unsigned_03-f785652.stderr delete mode 100644 tests/reference/asr-unsigned_04-c856d3a.json delete mode 100644 tests/reference/asr-unsigned_04-c856d3a.stderr delete mode 100644 tests/reference/asr-vec_01-66ac423.json delete mode 100644 tests/reference/asr-vec_01-66ac423.stderr delete mode 100644 tests/reference/asr_json-modules_02-53952e6.json delete mode 100644 tests/reference/asr_json-modules_02-53952e6.stdout delete mode 100644 tests/reference/ast-assert1-b0154ee.json delete mode 100644 tests/reference/ast-assert1-b0154ee.stdout delete mode 100644 tests/reference/ast-assign1-2a4c9ed.json delete mode 100644 tests/reference/ast-assign1-2a4c9ed.stdout delete mode 100644 tests/reference/ast-complex1-800b4bb.json delete mode 100644 tests/reference/ast-complex1-800b4bb.stdout delete mode 100644 tests/reference/ast-constants1-91cb6ff.json delete mode 100644 tests/reference/ast-constants1-91cb6ff.stdout delete mode 100644 tests/reference/ast-dictionary1-1a7e00a.json delete mode 100644 tests/reference/ast-dictionary1-1a7e00a.stdout delete mode 100644 tests/reference/ast-doconcurrentloop_01-ed7017b.json delete mode 100644 tests/reference/ast-doconcurrentloop_01-ed7017b.stdout delete mode 100644 tests/reference/ast-ellipsis1-4f6c4dd.json delete mode 100644 tests/reference/ast-ellipsis1-4f6c4dd.stdout delete mode 100644 tests/reference/ast-expr1-1e8f7b1.json delete mode 100644 tests/reference/ast-expr1-1e8f7b1.stdout delete mode 100644 tests/reference/ast-expr10-a8d646d.json delete mode 100644 tests/reference/ast-expr10-a8d646d.stdout delete mode 100644 tests/reference/ast-expr11-1d29f78.json delete mode 100644 tests/reference/ast-expr11-1d29f78.stdout delete mode 100644 tests/reference/ast-expr12-adaecda.json delete mode 100644 tests/reference/ast-expr12-adaecda.stdout delete mode 100644 tests/reference/ast-expr13-c35ace1.json delete mode 100644 tests/reference/ast-expr13-c35ace1.stdout delete mode 100644 tests/reference/ast-expr2-6642d4a.json delete mode 100644 tests/reference/ast-expr2-6642d4a.stdout delete mode 100644 tests/reference/ast-expr4-49316cb.json delete mode 100644 tests/reference/ast-expr4-49316cb.stdout delete mode 100644 tests/reference/ast-expr5-bbc6e71.json delete mode 100644 tests/reference/ast-expr5-bbc6e71.stdout delete mode 100644 tests/reference/ast-expr6-0b12a67.json delete mode 100644 tests/reference/ast-expr6-0b12a67.stdout delete mode 100644 tests/reference/ast-expr7-fe52776.json delete mode 100644 tests/reference/ast-expr7-fe52776.stdout delete mode 100644 tests/reference/ast-expr8-7db6b28.json delete mode 100644 tests/reference/ast-expr8-7db6b28.stdout delete mode 100644 tests/reference/ast-expr9-d184496.json delete mode 100644 tests/reference/ast-expr9-d184496.stdout delete mode 100644 tests/reference/ast-expr_01-d0927f9.json delete mode 100644 tests/reference/ast-expr_01-d0927f9.stdout delete mode 100644 tests/reference/ast-global1-b2690cf.json delete mode 100644 tests/reference/ast-global1-b2690cf.stdout delete mode 100644 tests/reference/ast-global_scope1-1d68a6c.json delete mode 100644 tests/reference/ast-global_scope1-1d68a6c.stdout delete mode 100644 tests/reference/ast-list1-9ce2da0.json delete mode 100644 tests/reference/ast-list1-9ce2da0.stdout delete mode 100644 tests/reference/ast-loop1-194a137.json delete mode 100644 tests/reference/ast-loop1-194a137.stdout delete mode 100644 tests/reference/ast-loop3-f7e0393.json delete mode 100644 tests/reference/ast-loop3-f7e0393.stdout delete mode 100644 tests/reference/ast-set1-ebd6ee0.json delete mode 100644 tests/reference/ast-set1-ebd6ee0.stdout delete mode 100644 tests/reference/ast-subscript1-bd5584b.json delete mode 100644 tests/reference/ast-subscript1-bd5584b.stdout delete mode 100644 tests/reference/ast-tuple1-2fb5396.json delete mode 100644 tests/reference/ast-tuple1-2fb5396.stdout delete mode 100644 tests/reference/ast_new-async1-b3d07ed.json delete mode 100644 tests/reference/ast_new-async1-b3d07ed.stdout delete mode 100644 tests/reference/ast_new-boolOp1-478328f.json delete mode 100644 tests/reference/ast_new-boolOp1-478328f.stdout delete mode 100644 tests/reference/ast_new-class_def1-fe69291.json delete mode 100644 tests/reference/ast_new-class_def1-fe69291.stdout delete mode 100644 tests/reference/ast_new-class_def2-c6db986.json delete mode 100644 tests/reference/ast_new-class_def2-c6db986.stdout delete mode 100644 tests/reference/ast_new-comment2-f0984d5.json delete mode 100644 tests/reference/ast_new-comment2-f0984d5.stdout delete mode 100644 tests/reference/ast_new-comprehension1-69cf2af.json delete mode 100644 tests/reference/ast_new-comprehension1-69cf2af.stdout delete mode 100644 tests/reference/ast_new-conditional_expr1-07ccb9e.json delete mode 100644 tests/reference/ast_new-conditional_expr1-07ccb9e.stdout delete mode 100644 tests/reference/ast_new-dictionary1-445e718.json delete mode 100644 tests/reference/ast_new-dictionary1-445e718.stdout delete mode 100644 tests/reference/ast_new-ellipsis2-3a9750b.json delete mode 100644 tests/reference/ast_new-ellipsis2-3a9750b.stdout delete mode 100644 tests/reference/ast_new-for1-887432e.json delete mode 100644 tests/reference/ast_new-for1-887432e.stdout delete mode 100644 tests/reference/ast_new-for2-af08901.json delete mode 100644 tests/reference/ast_new-for2-af08901.stdout delete mode 100644 tests/reference/ast_new-function_def1-1a872df.json delete mode 100644 tests/reference/ast_new-function_def1-1a872df.stdout delete mode 100644 tests/reference/ast_new-function_def2-52c4587.json delete mode 100644 tests/reference/ast_new-function_def2-52c4587.stdout delete mode 100644 tests/reference/ast_new-function_def3-f66064a.json delete mode 100644 tests/reference/ast_new-function_def3-f66064a.stdout delete mode 100644 tests/reference/ast_new-global1-38edfbd.json delete mode 100644 tests/reference/ast_new-global1-38edfbd.stdout delete mode 100644 tests/reference/ast_new-if1-db43586.json delete mode 100644 tests/reference/ast_new-if1-db43586.stdout delete mode 100644 tests/reference/ast_new-if2-c3b6022.json delete mode 100644 tests/reference/ast_new-if2-c3b6022.stdout delete mode 100644 tests/reference/ast_new-import1-f643fd3.json delete mode 100644 tests/reference/ast_new-import1-f643fd3.stdout delete mode 100644 tests/reference/ast_new-lambda1-260d046.json delete mode 100644 tests/reference/ast_new-lambda1-260d046.stdout delete mode 100644 tests/reference/ast_new-lambda2-d84336e.json delete mode 100644 tests/reference/ast_new-lambda2-d84336e.stdout delete mode 100644 tests/reference/ast_new-match_stmt1-9e84d24.json delete mode 100644 tests/reference/ast_new-match_stmt1-9e84d24.stdout delete mode 100644 tests/reference/ast_new-slice1-9c440e3.json delete mode 100644 tests/reference/ast_new-slice1-9c440e3.stdout delete mode 100644 tests/reference/ast_new-statements1-e081093.json delete mode 100644 tests/reference/ast_new-statements1-e081093.stdout delete mode 100644 tests/reference/ast_new-statements2-c4cdc5f.json delete mode 100644 tests/reference/ast_new-statements2-c4cdc5f.stdout delete mode 100644 tests/reference/ast_new-string1-96b90b3.json delete mode 100644 tests/reference/ast_new-string1-96b90b3.stdout delete mode 100644 tests/reference/ast_new-string2-44323ea.json delete mode 100644 tests/reference/ast_new-string2-44323ea.stdout delete mode 100644 tests/reference/ast_new-string3-37f35a0.json delete mode 100644 tests/reference/ast_new-string3-37f35a0.stdout delete mode 100644 tests/reference/ast_new-try1-a9a22cf.json delete mode 100644 tests/reference/ast_new-try1-a9a22cf.stdout delete mode 100644 tests/reference/ast_new-tuple1-29c08af.json delete mode 100644 tests/reference/ast_new-tuple1-29c08af.stdout delete mode 100644 tests/reference/ast_new-type_comment1-710ea6c.json delete mode 100644 tests/reference/ast_new-type_comment1-710ea6c.stdout delete mode 100644 tests/reference/ast_new-unicode-d3199dc.json delete mode 100644 tests/reference/ast_new-unicode-d3199dc.stdout delete mode 100644 tests/reference/ast_new-while1-a4c6382.json delete mode 100644 tests/reference/ast_new-while1-a4c6382.stdout delete mode 100644 tests/reference/ast_new-with1-6c88c0f.json delete mode 100644 tests/reference/ast_new-with1-6c88c0f.stdout delete mode 100644 tests/reference/ast_new-yield-4c41668.json delete mode 100644 tests/reference/ast_new-yield-4c41668.stdout delete mode 100644 tests/reference/c-c_interop1-e215531.json delete mode 100644 tests/reference/c-c_interop1-e215531.stdout delete mode 100644 tests/reference/c-expr7-bb2692a.json delete mode 100644 tests/reference/c-expr7-bb2692a.stderr delete mode 100644 tests/reference/c-expr_01-28f449f.json delete mode 100644 tests/reference/c-expr_01-28f449f.stdout delete mode 100644 tests/reference/c-expr_11-c452314.json delete mode 100644 tests/reference/c-expr_11-c452314.stdout delete mode 100644 tests/reference/c-expr_12-93c7780.json delete mode 100644 tests/reference/c-expr_12-93c7780.stdout delete mode 100644 tests/reference/c-func_static_01-fc146ec.json delete mode 100644 tests/reference/c-func_static_01-fc146ec.stdout delete mode 100644 tests/reference/c-import_order_01-3ebf3c3.json delete mode 100644 tests/reference/c-import_order_01-3ebf3c3.stdout delete mode 100644 tests/reference/c-loop1-3e341c7.json delete mode 100644 tests/reference/c-loop1-3e341c7.stdout delete mode 100644 tests/reference/c-loop4-eec10d3.json delete mode 100644 tests/reference/c-loop4-eec10d3.stdout delete mode 100644 tests/reference/c-print_01-4d44628.json delete mode 100644 tests/reference/c-print_01-4d44628.stdout delete mode 100644 tests/reference/c-test_import_02-d2c54c4.json delete mode 100644 tests/reference/c-test_import_02-d2c54c4.stdout delete mode 100644 tests/reference/c-test_issue_518-fbbd299.json delete mode 100644 tests/reference/c-test_issue_518-fbbd299.stdout delete mode 100644 tests/reference/c-variable_decl_03-fa1823b.json delete mode 100644 tests/reference/c-variable_decl_03-fa1823b.stdout delete mode 100644 tests/reference/cpp-assert1-ba60925.json delete mode 100644 tests/reference/cpp-assert1-ba60925.stdout delete mode 100644 tests/reference/cpp-doconcurrentloop_01-4e9f274.json delete mode 100644 tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout delete mode 100644 tests/reference/cpp-expr12-fd2ea87.json delete mode 100644 tests/reference/cpp-expr12-fd2ea87.stdout delete mode 100644 tests/reference/cpp-expr15-1661c0d.json delete mode 100644 tests/reference/cpp-expr15-1661c0d.stderr delete mode 100644 tests/reference/cpp-expr2-09c05ad.json delete mode 100644 tests/reference/cpp-expr2-09c05ad.stdout delete mode 100644 tests/reference/cpp-expr5-1de0e30.json delete mode 100644 tests/reference/cpp-expr5-1de0e30.stdout delete mode 100644 tests/reference/cpp-expr6-f337f4f.json delete mode 100644 tests/reference/cpp-expr6-f337f4f.stdout delete mode 100644 tests/reference/cpp-expr7-529bd53.json delete mode 100644 tests/reference/cpp-expr7-529bd53.stderr delete mode 100644 tests/reference/cpp-expr8-704cece.json delete mode 100644 tests/reference/cpp-expr8-704cece.stderr delete mode 100644 tests/reference/cpp-expr9-48868e9.json delete mode 100644 tests/reference/cpp-expr9-48868e9.stdout delete mode 100644 tests/reference/cpp-expr_11-422c839.json delete mode 100644 tests/reference/cpp-expr_11-422c839.stdout delete mode 100644 tests/reference/cpp-loop1-0a8cf3b.json delete mode 100644 tests/reference/cpp-loop1-0a8cf3b.stdout delete mode 100644 tests/reference/cpp-loop3-6020091.json delete mode 100644 tests/reference/cpp-loop3-6020091.stdout delete mode 100644 tests/reference/cpp-loop4-cdb2174.json delete mode 100644 tests/reference/cpp-loop4-cdb2174.stdout delete mode 100644 tests/reference/cpp-print_01-026ef17.json delete mode 100644 tests/reference/cpp-print_01-026ef17.stdout delete mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.json delete mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.stderr delete mode 100644 tests/reference/cpp-test_list_repeat2-698d7f4.json delete mode 100644 tests/reference/cpp-test_list_repeat2-698d7f4.stdout delete mode 100644 tests/reference/cpp-test_unary_op_03-fd9669a.json delete mode 100644 tests/reference/cpp-test_unary_op_03-fd9669a.stdout delete mode 100644 tests/reference/llvm-assert1-8df4f31.json delete mode 100644 tests/reference/llvm-assert1-8df4f31.stdout delete mode 100644 tests/reference/llvm-bindc_01-c984f09.json delete mode 100644 tests/reference/llvm-bindc_01-c984f09.stdout delete mode 100644 tests/reference/llvm-bool1-af4376b.json delete mode 100644 tests/reference/llvm-bool1-af4376b.stdout delete mode 100644 tests/reference/llvm-expr14-b96b5b1.json delete mode 100644 tests/reference/llvm-expr14-b96b5b1.stdout delete mode 100644 tests/reference/llvm-expr_01-54467c1.json delete mode 100644 tests/reference/llvm-expr_01-54467c1.stdout delete mode 100644 tests/reference/llvm-func_inline_01-2d4583a.json delete mode 100644 tests/reference/llvm-func_inline_01-2d4583a.stdout delete mode 100644 tests/reference/llvm-lpython1-23c5987.json delete mode 100644 tests/reference/llvm-lpython1-23c5987.stdout delete mode 100644 tests/reference/llvm-print_04-443a8d8.json delete mode 100644 tests/reference/llvm-print_04-443a8d8.stdout delete mode 100644 tests/reference/llvm-structs_11-09fea6a.json delete mode 100644 tests/reference/llvm-structs_11-09fea6a.stdout delete mode 100644 tests/reference/llvm-test_issue_518-cdb641a.json delete mode 100644 tests/reference/llvm-test_issue_518-cdb641a.stdout delete mode 100644 tests/reference/llvm-test_unary_op_03-046fb86.json delete mode 100644 tests/reference/llvm-test_unary_op_03-046fb86.stdout delete mode 100644 tests/reference/llvm_dbg-expr_01-9fc5f30.json delete mode 100644 tests/reference/llvm_dbg-expr_01-9fc5f30.stdout delete mode 100644 tests/reference/pass_class_constructor-structs_16-5e3508f.json delete mode 100644 tests/reference/pass_class_constructor-structs_16-5e3508f.stdout delete mode 100644 tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json delete mode 100644 tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout delete mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.json delete mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr delete mode 100644 tests/reference/pass_print_list_tuple-print_02-09600eb.json delete mode 100644 tests/reference/pass_print_list_tuple-print_02-09600eb.stdout delete mode 100644 tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json delete mode 100644 tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout delete mode 100644 tests/reference/run_dbg-test_assert_01-2f34744.json delete mode 100644 tests/reference/run_dbg-test_assert_01-2f34744.stderr delete mode 100644 tests/reference/run_dbg-test_assert_02-c6de25a.json delete mode 100644 tests/reference/run_dbg-test_assert_02-c6de25a.stderr delete mode 100644 tests/reference/run_dbg-test_assert_03-bd7b7dd.json delete mode 100644 tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr delete mode 100644 tests/reference/run_dbg-test_quit_01-30889cc.json delete mode 100644 tests/reference/run_dbg-test_quit_01-30889cc.stderr delete mode 100644 tests/reference/run_dbg-test_raise_01-dfd86ca.json delete mode 100644 tests/reference/run_dbg-test_raise_01-dfd86ca.stderr delete mode 100644 tests/reference/runtime-test_dict14-421fe53.json delete mode 100644 tests/reference/runtime-test_dict14-421fe53.stderr delete mode 100644 tests/reference/runtime-test_dict15-6f3af0d.json delete mode 100644 tests/reference/runtime-test_dict15-6f3af0d.stderr delete mode 100644 tests/reference/runtime-test_dict16-c5a958d.json delete mode 100644 tests/reference/runtime-test_dict16-c5a958d.stderr delete mode 100644 tests/reference/runtime-test_list_01-3ee9b3e.json delete mode 100644 tests/reference/runtime-test_list_01-3ee9b3e.stderr delete mode 100644 tests/reference/runtime-test_list_02-5f7db5f.json delete mode 100644 tests/reference/runtime-test_list_02-5f7db5f.stderr delete mode 100644 tests/reference/runtime-test_list_index-0483808.json delete mode 100644 tests/reference/runtime-test_list_index-0483808.stderr delete mode 100644 tests/reference/runtime-test_list_index2-1249233.json delete mode 100644 tests/reference/runtime-test_list_index2-1249233.stderr delete mode 100644 tests/reference/runtime-test_list_index3-647a94a.json delete mode 100644 tests/reference/runtime-test_list_index3-647a94a.stderr delete mode 100644 tests/reference/runtime-test_list_index4-c31dfdb.json delete mode 100644 tests/reference/runtime-test_list_index4-c31dfdb.stderr delete mode 100644 tests/reference/runtime-test_str_01-50bdf2f.json delete mode 100644 tests/reference/runtime-test_str_01-50bdf2f.stdout delete mode 100644 tests/reference/runtime-test_str_02-c38ba27.json delete mode 100644 tests/reference/runtime-test_str_02-c38ba27.stdout delete mode 100644 tests/reference/tokens-comment1-2f8ab90.json delete mode 100644 tests/reference/tokens-comment1-2f8ab90.stdout delete mode 100644 tests/reference/tokens-comment2-b289dad.json delete mode 100644 tests/reference/tokens-comment2-b289dad.stdout delete mode 100644 tests/reference/tokens-docstring1-1355fbb.json delete mode 100644 tests/reference/tokens-docstring1-1355fbb.stdout delete mode 100644 tests/reference/tokens-indent1-0b243c5.json delete mode 100644 tests/reference/tokens-indent1-0b243c5.stderr delete mode 100644 tests/reference/tokens-indent1-290e858.json delete mode 100644 tests/reference/tokens-indent1-290e858.stdout delete mode 100644 tests/reference/tokens-indent2-a8438a0.json delete mode 100644 tests/reference/tokens-indent2-a8438a0.stderr delete mode 100644 tests/reference/tokens-indent2-e702789.json delete mode 100644 tests/reference/tokens-indent2-e702789.stdout delete mode 100644 tests/reference/tokens-indent3-0eaf3e6.json delete mode 100644 tests/reference/tokens-indent3-0eaf3e6.stderr delete mode 100644 tests/reference/tokens-numbers1-589063f.json delete mode 100644 tests/reference/tokens-numbers1-589063f.stdout delete mode 100644 tests/reference/tokens-paren1-94fa736.json delete mode 100644 tests/reference/tokens-paren1-94fa736.stderr delete mode 100644 tests/reference/tokens-paren2-0eef339.json delete mode 100644 tests/reference/tokens-paren2-0eef339.stderr delete mode 100644 tests/reference/tokens-paren3-0d47100.json delete mode 100644 tests/reference/tokens-paren3-0d47100.stderr delete mode 100644 tests/reference/tokens-paren4-5c2fc32.json delete mode 100644 tests/reference/tokens-paren4-5c2fc32.stderr delete mode 100644 tests/reference/tokens-symbols1-658c990.json delete mode 100644 tests/reference/tokens-symbols1-658c990.stdout delete mode 100644 tests/reference/wat-bool1-234bcd1.json delete mode 100644 tests/reference/wat-bool1-234bcd1.stdout delete mode 100644 tests/reference/wat-expr14-5e0cb96.json delete mode 100644 tests/reference/wat-expr14-5e0cb96.stdout delete mode 100644 tests/reference/wat-expr2-8b17723.json delete mode 100644 tests/reference/wat-expr2-8b17723.stdout delete mode 100644 tests/reference/wat-expr9-f73afd1.json delete mode 100644 tests/reference/wat-expr9-f73afd1.stdout delete mode 100644 tests/reference/wat-loop1-e0046d4.json delete mode 100644 tests/reference/wat-loop1-e0046d4.stdout delete mode 100644 tests/reference/wat-print_str-385e953.json delete mode 100644 tests/reference/wat-print_str-385e953.stdout diff --git a/tests/reference/asr-array_01_decl-39cf894.json b/tests/reference/asr-array_01_decl-39cf894.json deleted file mode 100644 index b23bdaa272..0000000000 --- a/tests/reference/asr-array_01_decl-39cf894.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-array_01_decl-39cf894", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/array_01_decl.py", - "infile_hash": "3dff59bab7475d254ce0470065c11e797e52a5b2a3d7546acc0e6705", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-array_01_decl-39cf894.stderr", - "stderr_hash": "5155e10cd4958bdda66178e2ed1b6faed6f415ff1cf3ff78e45f9cbb", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-array_01_decl-39cf894.stderr b/tests/reference/asr-array_01_decl-39cf894.stderr deleted file mode 100644 index 2ef3142ddf..0000000000 --- a/tests/reference/asr-array_01_decl-39cf894.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/array_01_decl.py:2:1 - | -2 | from numpy import empty, int16, int32, int64, float32, float64, complex64, complex128 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-array_02_decl-e8f6874.json b/tests/reference/asr-array_02_decl-e8f6874.json deleted file mode 100644 index f59af233fa..0000000000 --- a/tests/reference/asr-array_02_decl-e8f6874.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-array_02_decl-e8f6874", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/array_02_decl.py", - "infile_hash": "9a398864499c7a3b4e2a480faf3a5dccaa65f9771a8de27f55f11ca4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-array_02_decl-e8f6874.stderr", - "stderr_hash": "b9fd331511456947bef74d5df2f292244e7fa1861ab43918a6e02acd", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-array_02_decl-e8f6874.stderr b/tests/reference/asr-array_02_decl-e8f6874.stderr deleted file mode 100644 index 143230f959..0000000000 --- a/tests/reference/asr-array_02_decl-e8f6874.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/array_02_decl.py:2:1 - | -2 | from numpy import empty, int32, int64, float32, float64, complex64, complex128 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_01-a617b64.json b/tests/reference/asr-arrays_01-a617b64.json deleted file mode 100644 index ca8f874250..0000000000 --- a/tests/reference/asr-arrays_01-a617b64.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_01-a617b64", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_01.py", - "infile_hash": "9e11033fc97f884cd3d55a9194cb45add6805e5fc4d9473f9e1b9611", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_01-a617b64.stderr", - "stderr_hash": "ddb2640e06012a8ab9efe1bc1dbe130321fb96721ce3fd749813c988", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_01-a617b64.stderr b/tests/reference/asr-arrays_01-a617b64.stderr deleted file mode 100644 index e712ee9cf1..0000000000 --- a/tests/reference/asr-arrays_01-a617b64.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_01.py:2:1 - | -2 | from numpy import empty, int8 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_02-da94458.json b/tests/reference/asr-arrays_02-da94458.json deleted file mode 100644 index 2dfc6c7f7c..0000000000 --- a/tests/reference/asr-arrays_02-da94458.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_02-da94458", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_02.py", - "infile_hash": "05e70a0056dc67dbf3a54ea66965db8746f9de012561ca95cb1fdb43", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_02-da94458.stderr", - "stderr_hash": "b7b907310495016dfb487fccb13739865174dda44541ade08931bae9", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_02-da94458.stderr b/tests/reference/asr-arrays_02-da94458.stderr deleted file mode 100644 index 5229403208..0000000000 --- a/tests/reference/asr-arrays_02-da94458.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_02.py:2:1 - | -2 | from numpy import (empty, int8) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_03-de2e952.json b/tests/reference/asr-arrays_03-de2e952.json deleted file mode 100644 index 77b002c31e..0000000000 --- a/tests/reference/asr-arrays_03-de2e952.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_03-de2e952", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_03.py", - "infile_hash": "429c486d84e37401f89fe1e678039ae0e16b2cf5bf13417767160858", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_03-de2e952.stderr", - "stderr_hash": "ddfa8ceea3cb39c9b59069d2a67d13c8752ec2511fc62c162e77b206", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_03-de2e952.stderr b/tests/reference/asr-arrays_03-de2e952.stderr deleted file mode 100644 index 00df208054..0000000000 --- a/tests/reference/asr-arrays_03-de2e952.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_03.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_04-880407c.json b/tests/reference/asr-arrays_04-880407c.json deleted file mode 100644 index 69bda74cc5..0000000000 --- a/tests/reference/asr-arrays_04-880407c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_04-880407c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_04.py", - "infile_hash": "9dfe40ad5fd610b75685a45ffd700ff14e263738dd5ba968952d7874", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_04-880407c.stderr", - "stderr_hash": "ee2a3d13e91567e2924e0154d6c09db79923debe4c2733b246964808", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_04-880407c.stderr b/tests/reference/asr-arrays_04-880407c.stderr deleted file mode 100644 index 692cb026bf..0000000000 --- a/tests/reference/asr-arrays_04-880407c.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_04.py:2:1 - | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_05-ec8fbd5.json b/tests/reference/asr-arrays_05-ec8fbd5.json deleted file mode 100644 index 8ff8c5a20d..0000000000 --- a/tests/reference/asr-arrays_05-ec8fbd5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_05-ec8fbd5", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_05.py", - "infile_hash": "c525449694f73038495a6bd8fded408301f43d18b1c387765b92b792", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_05-ec8fbd5.stderr", - "stderr_hash": "066b86f582348bb519b6a39a7e7421ac5a666b29d9ef96d753be0207", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_05-ec8fbd5.stderr b/tests/reference/asr-arrays_05-ec8fbd5.stderr deleted file mode 100644 index ee5cc62302..0000000000 --- a/tests/reference/asr-arrays_05-ec8fbd5.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_05.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_06-fbb09a3.json b/tests/reference/asr-arrays_06-fbb09a3.json deleted file mode 100644 index 8c473166fc..0000000000 --- a/tests/reference/asr-arrays_06-fbb09a3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_06-fbb09a3", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_06.py", - "infile_hash": "670cbcac5e942bae5293cd94090bab65a2039384d71fb8be4c6db5a1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_06-fbb09a3.stderr", - "stderr_hash": "529c8dc2333a83b0b67feb5db104ea294258fdcac341dad9e314cfee", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_06-fbb09a3.stderr b/tests/reference/asr-arrays_06-fbb09a3.stderr deleted file mode 100644 index 8d8b27a690..0000000000 --- a/tests/reference/asr-arrays_06-fbb09a3.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_06.py:2:1 - | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_07-de430fd.json b/tests/reference/asr-arrays_07-de430fd.json deleted file mode 100644 index a3c5bfc680..0000000000 --- a/tests/reference/asr-arrays_07-de430fd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_07-de430fd", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_07.py", - "infile_hash": "efe8b3c4a474aca55cb8a537a3ea2cd30eb5d5abf140d8c2c0b9e3f4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_07-de430fd.stderr", - "stderr_hash": "78a96ca7fbcae19b8cdaa9f9a2d18de003d7569070edb855bd07bff6", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_07-de430fd.stderr b/tests/reference/asr-arrays_07-de430fd.stderr deleted file mode 100644 index f5f3ff9143..0000000000 --- a/tests/reference/asr-arrays_07-de430fd.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_07.py:2:1 - | -2 | from numpy import empty, complex64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_08-ba317a3.json b/tests/reference/asr-arrays_08-ba317a3.json deleted file mode 100644 index 068d21e7d1..0000000000 --- a/tests/reference/asr-arrays_08-ba317a3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_08-ba317a3", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_08.py", - "infile_hash": "3f7a5a8889301df17222a777f7e92a5667097ffca9ac4d275ccb310f", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_08-ba317a3.stderr", - "stderr_hash": "2c0dffd29d0f996f1403e49241e6fe1cfbf7df0ce479e4434c3a7c6a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_08-ba317a3.stderr b/tests/reference/asr-arrays_08-ba317a3.stderr deleted file mode 100644 index d5aad26c5b..0000000000 --- a/tests/reference/asr-arrays_08-ba317a3.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_08.py:2:1 - | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_09-50ee586.json b/tests/reference/asr-arrays_09-50ee586.json deleted file mode 100644 index 1180b9b694..0000000000 --- a/tests/reference/asr-arrays_09-50ee586.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_09-50ee586", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_09.py", - "infile_hash": "e6f2cca7de4ecfddffdc96ee4c278de35c220b608c9e4fe4731fd9b8", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_09-50ee586.stderr", - "stderr_hash": "31ae490ebcebebc570a4846a32f1723dd3e9861f47c6805e9cc5e9b4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_09-50ee586.stderr b/tests/reference/asr-arrays_09-50ee586.stderr deleted file mode 100644 index efb877322b..0000000000 --- a/tests/reference/asr-arrays_09-50ee586.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_09.py:2:1 - | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_10-bc82d75.json b/tests/reference/asr-arrays_10-bc82d75.json deleted file mode 100644 index 8125d1c0f8..0000000000 --- a/tests/reference/asr-arrays_10-bc82d75.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_10-bc82d75", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_10.py", - "infile_hash": "05aedf3d1013c61f73afc3de4ddca88ee33f029dcd62fadb66e7ec83", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_10-bc82d75.stderr", - "stderr_hash": "12434839db5b4ef953cdf8002472348be5b31f95ed106f68c6646523", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_10-bc82d75.stderr b/tests/reference/asr-arrays_10-bc82d75.stderr deleted file mode 100644 index af28c4fcb3..0000000000 --- a/tests/reference/asr-arrays_10-bc82d75.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_10.py:2:1 - | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_11-fc505b4.json b/tests/reference/asr-arrays_11-fc505b4.json deleted file mode 100644 index 31cf31d842..0000000000 --- a/tests/reference/asr-arrays_11-fc505b4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_11-fc505b4", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_11.py", - "infile_hash": "111b4224a1988a90dc091fda4e0b1ebfd096f25f7b4ccc2f13728c1c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_11-fc505b4.stderr", - "stderr_hash": "f5a3fde8bbd2fd083b1f1d2148c92c3ae71ef4aaaed74e725061cb94", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_11-fc505b4.stderr b/tests/reference/asr-arrays_11-fc505b4.stderr deleted file mode 100644 index 1fd700c7b4..0000000000 --- a/tests/reference/asr-arrays_11-fc505b4.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_11.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_12-63d6f25.json b/tests/reference/asr-arrays_12-63d6f25.json deleted file mode 100644 index 4f456715f5..0000000000 --- a/tests/reference/asr-arrays_12-63d6f25.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_12-63d6f25", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_12.py", - "infile_hash": "03cc809a4ee6a2ff47b5a91111d26e501ded647478e7fa03bde5bdf7", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_12-63d6f25.stderr", - "stderr_hash": "28d115256d1f8e36fdce5f2192e17e06c4b6daaa2166ece7bed3947c", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_12-63d6f25.stderr b/tests/reference/asr-arrays_12-63d6f25.stderr deleted file mode 100644 index 4dc8ec210c..0000000000 --- a/tests/reference/asr-arrays_12-63d6f25.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_12.py:2:1 - | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_13-b5fcc7e.json b/tests/reference/asr-arrays_13-b5fcc7e.json deleted file mode 100644 index d2c834ff6a..0000000000 --- a/tests/reference/asr-arrays_13-b5fcc7e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_13-b5fcc7e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_13.py", - "infile_hash": "6aa585e55d5ba97e0c139b1a86268b41104955236fc6f87a11771505", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_13-b5fcc7e.stderr", - "stderr_hash": "684ced8828de6debbd6d46dd706f9bbb993e8c85b22b656583c3a077", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_13-b5fcc7e.stderr b/tests/reference/asr-arrays_13-b5fcc7e.stderr deleted file mode 100644 index 1533a34f7a..0000000000 --- a/tests/reference/asr-arrays_13-b5fcc7e.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_13.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-arrays_14-78be00e.json b/tests/reference/asr-arrays_14-78be00e.json deleted file mode 100644 index 9a235f1984..0000000000 --- a/tests/reference/asr-arrays_14-78be00e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-arrays_14-78be00e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/arrays_14.py", - "infile_hash": "f724b8a5dfe7bc481f465e6f9105c9a2e6a8b7a5985a63ba52b58db2", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-arrays_14-78be00e.stderr", - "stderr_hash": "3539282cce2d83675ca57e47d093800765d28c5b74a04eb46457f715", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-arrays_14-78be00e.stderr b/tests/reference/asr-arrays_14-78be00e.stderr deleted file mode 100644 index 14bdfe6421..0000000000 --- a/tests/reference/asr-arrays_14-78be00e.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_14.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-assert1-1ce92ea.json b/tests/reference/asr-assert1-1ce92ea.json deleted file mode 100644 index 5e5858a464..0000000000 --- a/tests/reference/asr-assert1-1ce92ea.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-assert1-1ce92ea", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/assert1.py", - "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-assert1-1ce92ea.stdout", - "stdout_hash": "ce8797c74c843e69622a590671ed85a981a9261278f1f83878327414", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-assert1-1ce92ea.stdout b/tests/reference/asr-assert1-1ce92ea.stdout deleted file mode 100644 index 6f1053a992..0000000000 --- a/tests/reference/asr-assert1-1ce92ea.stdout +++ /dev/null @@ -1,102 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_assert: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_assert - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (IntegerConstant 5 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (Var 3 a) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - (StringConstant - "a is not 5" - (Character 1 10 ()) - ) - ) - (Assert - (IntegerCompare - (Var 3 a) - NotEq - (IntegerConstant 10 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-assign1-886f049.json b/tests/reference/asr-assign1-886f049.json deleted file mode 100644 index 6e23997392..0000000000 --- a/tests/reference/asr-assign1-886f049.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-assign1-886f049", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/assign1.py", - "infile_hash": "3b82a73e457bd65e85828b72d56596ca927e7c661e333691f154912b", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-assign1-886f049.stdout", - "stdout_hash": "c2ffd64d63b0780c568d6f28ec8306cade4e74588adc6f7db056603f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-assign1-886f049.stdout b/tests/reference/asr-assign1-886f049.stdout deleted file mode 100644 index eff4af54bc..0000000000 --- a/tests/reference/asr-assign1-886f049.stdout +++ /dev/null @@ -1,196 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_augassign: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - r: - (Variable - 3 - r - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_augassign - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 r) - (IntegerConstant 0 (Integer 4)) - () - ) - (= - (Var 3 r) - (IntegerBinOp - (Var 3 r) - Add - (IntegerConstant 4 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (Var 3 s) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 3 r) - (IntegerBinOp - (Var 3 r) - Mul - (Var 3 s) - (Integer 4) - () - ) - () - ) - (= - (Var 3 r) - (IntegerBinOp - (Var 3 r) - Sub - (IntegerConstant 2 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (Var 3 s) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 3 r) - (RealBinOp - (Cast - (Var 3 r) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (Var 3 s) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (= - (Var 3 a) - (StringConstant - "" - (Character 1 0 ()) - ) - () - ) - (= - (Var 3 a) - (StringConcat - (Var 3 a) - (StringConstant - "test" - (Character 1 4 ()) - ) - (Character 1 2 ()) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-assign2-8d1a2ee.json b/tests/reference/asr-assign2-8d1a2ee.json deleted file mode 100644 index a0e50b5045..0000000000 --- a/tests/reference/asr-assign2-8d1a2ee.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-assign2-8d1a2ee", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/assign2.py", - "infile_hash": "9b182950a8d1abbd951007b692fff95382e90ada103c7f14c4497b06", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-assign2-8d1a2ee.stdout", - "stdout_hash": "7bec7662e29763790b836536cc3a60aacdaf849a44e8cb9c5d4d3298", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-assign2-8d1a2ee.stdout b/tests/reference/asr-assign2-8d1a2ee.stdout deleted file mode 100644 index cace4a2618..0000000000 --- a/tests/reference/asr-assign2-8d1a2ee.stdout +++ /dev/null @@ -1,118 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - f: - (Variable - 2 - f - [] - Local - (Cast - (RealConstant - 1.234568 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.234568 - (Real 4) - ) - ) - (RealConstant - 1.234568 - (Real 4) - ) - Default - (Real 4) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 2 - f2 - [] - Local - (RealConstant - 1.234568 - (Real 8) - ) - (RealConstant - 1.234568 - (Real 8) - ) - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 2 - i - [] - Local - (IntegerConstant 5 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 2 - i2 - [] - Local - (Cast - (IntegerConstant 53430903434 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 53430903434 (Integer 8)) - ) - (IntegerConstant 53430903434 (Integer 8)) - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 3 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-bindc_01-6d521a9.json b/tests/reference/asr-bindc_01-6d521a9.json deleted file mode 100644 index f16953e5e3..0000000000 --- a/tests/reference/asr-bindc_01-6d521a9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_01-6d521a9", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/bindc_01.py", - "infile_hash": "3cfb601d3294c470842a85777832f5582ab52cb5bd64c0e02d40deb6", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-bindc_01-6d521a9.stdout", - "stdout_hash": "ec7543eae1d1bbaeba72993e35e98165ba0248ab59dc6597f9c50e7b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_01-6d521a9.stdout b/tests/reference/asr-bindc_01-6d521a9.stdout deleted file mode 100644 index 9e5a7b2cd4..0000000000 --- a/tests/reference/asr-bindc_01-6d521a9.stdout +++ /dev/null @@ -1,210 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_issue_1781] - [] - [(CPtrToPointer - (Var 2 queries) - (Var 2 x) - () - () - ) - (Print - () - [(Var 2 queries) - (Var 2 x)] - () - () - ) - (SubroutineCall - 2 test_issue_1781 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - queries: - (Variable - 2 - queries - [] - Local - (PointerNullConstant - (CPtr) - ) - (PointerNullConstant - (CPtr) - ) - Default - (CPtr) - () - Source - Public - Required - .false. - ), - test_issue_1781: - (Function - (SymbolTable - 3 - { - p: - (Variable - 3 - p - [] - Local - () - () - Default - (CPtr) - () - Source - Public - Required - .false. - ) - }) - test_issue_1781 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 p) - (PointerNullConstant - (CPtr) - ) - () - ) - (Assert - (CPtrCompare - (Var 3 p) - Eq - (PointerNullConstant - (CPtr) - ) - (Logical 4) - () - ) - () - ) - (Assert - (LogicalNot - (CPtrCompare - (Var 3 p) - NotEq - (PointerNullConstant - (CPtr) - ) - (Logical 4) - () - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - x: - (Variable - 2 - x - [] - Local - () - () - Default - (Pointer - (Integer 2) - ) - () - Source - Public - Required - .false. - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-bindc_01-f761165.json b/tests/reference/asr-bindc_01-f761165.json deleted file mode 100644 index 24d385098d..0000000000 --- a/tests/reference/asr-bindc_01-f761165.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_01-f761165", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/bindc_01.py", - "infile_hash": "5f60d96ef8d39100cf775974c5af355ebc1d1f3e67d442564faf7f07", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_01-f761165.stderr", - "stderr_hash": "b2d416fa6afa00923a130cb76dbd580798a9ee0841e34980c531b050", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_01-f761165.stderr b/tests/reference/asr-bindc_01-f761165.stderr deleted file mode 100644 index 7fe85cd32b..0000000000 --- a/tests/reference/asr-bindc_01-f761165.stderr +++ /dev/null @@ -1,8 +0,0 @@ -semantic error: Type mismatch in procedure call; the types must be compatible - --> tests/errors/bindc_01.py:9:14 - | -9 | cptr_arg(int32obj) - | ^^^^^^^^ type mismatch (passed argument type is i32 but required type is CPtr) - | -4 | def cptr_arg(arg1: CPtr): - | ^^^^ type mismatch (passed argument type is i32 but required type is CPtr) diff --git a/tests/reference/asr-bindc_02-5092d8e.json b/tests/reference/asr-bindc_02-5092d8e.json deleted file mode 100644 index 6b3c472b5c..0000000000 --- a/tests/reference/asr-bindc_02-5092d8e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_02-5092d8e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/bindc_02.py", - "infile_hash": "c1e886c2295631b0c4647c418c68d0edf53d5ab4ce3439b058a657ee", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_02-5092d8e.stderr", - "stderr_hash": "315076027d80c91db75f4ec44ea5cf8d5fd37a499a367f627b6f6553", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-5092d8e.stderr b/tests/reference/asr-bindc_02-5092d8e.stderr deleted file mode 100644 index 4ac4183597..0000000000 --- a/tests/reference/asr-bindc_02-5092d8e.stderr +++ /dev/null @@ -1,8 +0,0 @@ -semantic error: Type mismatch in procedure call; the types must be compatible - --> tests/errors/bindc_02.py:9:24 - | -9 | s: Struct = Struct(int32obj) - | ^^^^^^^^ type mismatch (passed argument type is i32 but required type is CPtr) - | -5 | cptr_member: CPtr - | ^^^^ type mismatch (passed argument type is i32 but required type is CPtr) diff --git a/tests/reference/asr-bindc_02-bc1a7ea.json b/tests/reference/asr-bindc_02-bc1a7ea.json deleted file mode 100644 index b8abd26275..0000000000 --- a/tests/reference/asr-bindc_02-bc1a7ea.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_02-bc1a7ea", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/bindc_02.py", - "infile_hash": "a29f0f269c494419077ca8725e7c2d2dc7a5b4964d5c909347f1caa4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_02-bc1a7ea.stderr", - "stderr_hash": "f35a1e2233396c7620436bb77c9e617e33e60fb9c92da2552280ed2c", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stderr b/tests/reference/asr-bindc_02-bc1a7ea.stderr deleted file mode 100644 index 0366febb6a..0000000000 --- a/tests/reference/asr-bindc_02-bc1a7ea.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/bindc_02.py:2:1 - | -2 | from numpy import empty, int16, array - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-bindc_03-95dbba7.json b/tests/reference/asr-bindc_03-95dbba7.json deleted file mode 100644 index fa55114a3e..0000000000 --- a/tests/reference/asr-bindc_03-95dbba7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_03-95dbba7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/bindc_03.py", - "infile_hash": "68e9bc4105ff94df854ee89163425cdc8fd26bcb5615938f6993985c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_03-95dbba7.stderr", - "stderr_hash": "9225af71c044978cc3832abb4a60a5d13f6d143a8c4dc219e930eab9", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_03-95dbba7.stderr b/tests/reference/asr-bindc_03-95dbba7.stderr deleted file mode 100644 index 98e9a26f07..0000000000 --- a/tests/reference/asr-bindc_03-95dbba7.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/bindc_03.py:3:1 - | -3 | from numpy import array - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-bindc_04-06bd800.json b/tests/reference/asr-bindc_04-06bd800.json deleted file mode 100644 index a19d71962d..0000000000 --- a/tests/reference/asr-bindc_04-06bd800.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_04-06bd800", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/bindc_04.py", - "infile_hash": "009fad63ac85061e603f011869c2439b67409edcf8cc633d1fde9013", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_04-06bd800.stderr", - "stderr_hash": "6aa8aa05ae2628d04b771044165e1c9078ba3c5ae211906def3ff0be", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_04-06bd800.stderr b/tests/reference/asr-bindc_04-06bd800.stderr deleted file mode 100644 index 704b35ab47..0000000000 --- a/tests/reference/asr-bindc_04-06bd800.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/bindc_04.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-bindc_10e-8b10394.json b/tests/reference/asr-bindc_10e-8b10394.json deleted file mode 100644 index 38439231b2..0000000000 --- a/tests/reference/asr-bindc_10e-8b10394.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-bindc_10e-8b10394", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/bindc_10e.py", - "infile_hash": "fa023d4ad17e426f778a99326998e6dbeac5428fa252974a39a3219d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_10e-8b10394.stderr", - "stderr_hash": "9ea4ff2c8a8789057456196deb5772e4b3a2dffadbd10ecfe5f15f29", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-bindc_10e-8b10394.stderr b/tests/reference/asr-bindc_10e-8b10394.stderr deleted file mode 100644 index cc7c1cd0aa..0000000000 --- a/tests/reference/asr-bindc_10e-8b10394.stderr +++ /dev/null @@ -1,14 +0,0 @@ -semantic error: The struct in c_p_pointer must be C interoperable - --> tests/errors/bindc_10e.py:15:38 - | -15 | p2: Pointer[S] = c_p_pointer(p1, S) - | ^ not C interoperable - - --> tests/errors/bindc_10e_mod.py:5:1 - 7:10 - | - 5 | class S: - | ~~~~~~~~... -... - | - 7 | b: i64 - | ...~~~~~~~~~~ help: add the @ccallable decorator to this struct to make it C interoperable diff --git a/tests/reference/asr-c_interop1-cf2e9b4.json b/tests/reference/asr-c_interop1-cf2e9b4.json deleted file mode 100644 index 9295ebdefe..0000000000 --- a/tests/reference/asr-c_interop1-cf2e9b4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-c_interop1-cf2e9b4", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/c_interop1.py", - "infile_hash": "aeb797508318740ae58a14cf663910a8fa077c574eaf79b9f54656ef", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-c_interop1-cf2e9b4.stdout", - "stdout_hash": "9801d10f9a077b9618063bdc3ab6905625e0469a40b17a3f805419e7", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-c_interop1-cf2e9b4.stdout b/tests/reference/asr-c_interop1-cf2e9b4.stdout deleted file mode 100644 index 872e8d8b37..0000000000 --- a/tests/reference/asr-c_interop1-cf2e9b4.stdout +++ /dev/null @@ -1,568 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - f: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - BindC - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (Real 8) - () - BindC - Public - Required - .true. - ) - }) - f - (FunctionType - [(Real 8)] - (Real 8) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x)] - [] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - In - () - () - Default - (Real 8) - () - BindC - Public - Required - .true. - ), - b: - (Variable - 4 - b - [] - In - () - () - Default - (Real 4) - () - BindC - Public - Required - .true. - ), - c: - (Variable - 4 - c - [] - In - () - () - Default - (Integer 8) - () - BindC - Public - Required - .true. - ), - d: - (Variable - 4 - d - [] - In - () - () - Default - (Integer 4) - () - BindC - Public - Required - .true. - ) - }) - g - (FunctionType - [(Real 8) - (Real 4) - (Integer 8) - (Integer 4)] - () - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 a) - (Var 4 b) - (Var 4 c) - (Var 4 d)] - [] - () - Public - .false. - .false. - () - ), - h: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - BindC - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - In - () - () - Default - (Real 8) - () - BindC - Public - Required - .true. - ) - }) - h - (FunctionType - [(Real 8)] - (Real 8) - BindC - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 x)] - [(= - (Var 5 _lpython_return_variable) - (RealBinOp - (Var 5 x) - Add - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - () - ) - () - ) - (Return)] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ), - l: - (Function - (SymbolTable - 6 - { - a: - (Variable - 6 - a - [] - In - () - () - Default - (Real 8) - () - BindC - Public - Required - .true. - ), - b: - (Variable - 6 - b - [] - In - () - () - Default - (Real 4) - () - BindC - Public - Required - .true. - ), - c: - (Variable - 6 - c - [] - In - () - () - Default - (Integer 8) - () - BindC - Public - Required - .true. - ), - d: - (Variable - 6 - d - [] - In - () - () - Default - (Integer 4) - () - BindC - Public - Required - .true. - ) - }) - l - (FunctionType - [(Real 8) - (Real 4) - (Integer 8) - (Integer 4)] - () - BindC - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 6 a) - (Var 6 b) - (Var 6 c) - (Var 6 d)] - [(Print - () - [(StringConstant - "OK" - (Character 1 2 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 7 - { - i: - (Variable - 7 - i - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 7 - x - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 7 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - z: - (Variable - 7 - z - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - zz: - (Variable - 7 - zz - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - g - h - l] - [] - [(= - (Var 7 x) - (RealConstant - 5.000000 - (Real 8) - ) - () - ) - (= - (Var 7 i) - (FunctionCall - 2 f - () - [((Var 7 x))] - (Real 8) - () - () - ) - () - ) - (= - (Var 7 y) - (Cast - (RealConstant - 5.400000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.400000 - (Real 4) - ) - ) - () - ) - (= - (Var 7 z) - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - () - ) - (= - (Var 7 zz) - (IntegerConstant 2 (Integer 4)) - () - ) - (SubroutineCall - 2 g - () - [((Var 7 x)) - ((Var 7 y)) - ((Var 7 z)) - ((Var 7 zz))] - () - ) - (= - (Var 7 i) - (FunctionCall - 2 h - () - [((Var 7 x))] - (Real 8) - () - () - ) - () - ) - (SubroutineCall - 2 l - () - [((Var 7 x)) - ((Var 7 y)) - ((Var 7 z)) - ((Var 7 zz))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 8 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-callback_01-df40fd5.json b/tests/reference/asr-callback_01-df40fd5.json deleted file mode 100644 index bd4b1b73fc..0000000000 --- a/tests/reference/asr-callback_01-df40fd5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-callback_01-df40fd5", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/callback_01.py", - "infile_hash": "c3ab71a93f40edda000ae863149c38c388bb43a8329ebae9320a7ab4", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-callback_01-df40fd5.stdout", - "stdout_hash": "5be73c5b09034604701853c55fffbdca38993aa3f92782e89a50c91e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-callback_01-df40fd5.stdout b/tests/reference/asr-callback_01-df40fd5.stdout deleted file mode 100644 index 2151b35be2..0000000000 --- a/tests/reference/asr-callback_01-df40fd5.stdout +++ /dev/null @@ -1,569 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 9 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 8 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(Assert - (IntegerCompare - (FunctionCall - 2 g - () - [((Var 2 f)) - ((IntegerConstant 10 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 11 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 g - () - [((Var 2 f2)) - ((IntegerConstant 20 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 30 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 g - () - [((Var 2 f3)) - ((IntegerConstant 5 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 21 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x)] - [(= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (Var 3 x) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - f2: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f2 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x)] - [(= - (Var 4 _lpython_return_variable) - (IntegerBinOp - (Var 4 x) - Add - (IntegerConstant 10 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - f3: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f3 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - f2] - [(Var 5 x)] - [(= - (Var 5 _lpython_return_variable) - (IntegerBinOp - (FunctionCall - 2 f - () - [((Var 5 x))] - (Integer 4) - () - () - ) - Add - (FunctionCall - 2 f2 - () - [((Var 5 x))] - (Integer 4) - () - () - ) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 6 - { - _lpython_return_variable: - (Variable - 6 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - arg: - (Variable - 6 - arg - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - func: - (Function - (SymbolTable - 7 - { - func_arg_0: - (Variable - 7 - func_arg_0 - [] - Unspecified - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - func_return_var_name: - (Variable - 7 - func_return_var_name - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - func - (FunctionType - [(Integer 4)] - (Integer 4) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 7 func_arg_0)] - [] - (Var 7 func_return_var_name) - Public - .false. - .false. - () - ), - ret: - (Variable - 6 - ret - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [(FunctionType - [(Integer 4)] - (Integer 4) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [func] - [(Var 6 func) - (Var 6 arg)] - [(= - (Var 6 ret) - (FunctionCall - 6 func - () - [((Var 6 arg))] - (Integer 4) - () - () - ) - () - ) - (= - (Var 6 _lpython_return_variable) - (Var 6 ret) - () - ) - (Return)] - (Var 6 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 10 - { - __main__global_stmts: - (ExternalSymbol - 10 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 10 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-cast-435c233.json b/tests/reference/asr-cast-435c233.json deleted file mode 100644 index 8614194075..0000000000 --- a/tests/reference/asr-cast-435c233.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-cast-435c233", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/cast.py", - "infile_hash": "6e4219b25f4aa2035b57c9658dbb133f2dff55db0d9c128b19214f62", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-cast-435c233.stderr", - "stderr_hash": "94b3ddb64aab37aa358cd260252df21698826606401d00e07c873603", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-cast-435c233.stderr b/tests/reference/asr-cast-435c233.stderr deleted file mode 100644 index 74531e3791..0000000000 --- a/tests/reference/asr-cast-435c233.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/cast.py:5:9 - | -5 | x = list(s) - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json deleted file mode 100644 index 2eb40d0cd8..0000000000 --- a/tests/reference/asr-complex1-f26c460.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-complex1-f26c460", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/complex1.py", - "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-complex1-f26c460.stderr", - "stderr_hash": "850f4cbe87b0a7ae8138fbfb71f94b82843abf09e50752159f900292", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-complex1-f26c460.stderr b/tests/reference/asr-complex1-f26c460.stderr deleted file mode 100644 index b6f4d1d8f0..0000000000 --- a/tests/reference/asr-complex1-f26c460.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/complex1.py:11:13 - | -11 | c = c32(complex()) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-const_01-af8289b.json b/tests/reference/asr-const_01-af8289b.json deleted file mode 100644 index c54ff59cdd..0000000000 --- a/tests/reference/asr-const_01-af8289b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-const_01-af8289b", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/const_01.py", - "infile_hash": "c147e6905815b0476dd2ec10669bb4c7fd65d604910e00b8b9eade30", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-const_01-af8289b.stderr", - "stderr_hash": "f47e74e916315ec82f38680f66c9cf5ef3c958bcdfa87b9efe09b264", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-const_01-af8289b.stderr b/tests/reference/asr-const_01-af8289b.stderr deleted file mode 100644 index 47034b6158..0000000000 --- a/tests/reference/asr-const_01-af8289b.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Constant variable x is not initialised at declaration. - --> tests/errors/const_01.py:4:5 - | -4 | x: Const[i32] - | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-const_02-fce29b7.json b/tests/reference/asr-const_02-fce29b7.json deleted file mode 100644 index af31951d5b..0000000000 --- a/tests/reference/asr-const_02-fce29b7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-const_02-fce29b7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/const_02.py", - "infile_hash": "9548b6585315578b1844bea16afc1ebe3b17df7b548574c871226e47", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-const_02-fce29b7.stderr", - "stderr_hash": "b8b90da28518edbe487dbe6f52f1f25f004042fe463e8fba7b96d174", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-const_02-fce29b7.stderr b/tests/reference/asr-const_02-fce29b7.stderr deleted file mode 100644 index 3bdb12c237..0000000000 --- a/tests/reference/asr-const_02-fce29b7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Targets with Const[i32] type cannot be re-assigned. - --> tests/errors/const_02.py:5:5 - | -5 | x = 5 - | ^ diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json deleted file mode 100644 index 5abb75edfe..0000000000 --- a/tests/reference/asr-constants1-5828e8a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-constants1-5828e8a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/constants1.py", - "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-constants1-5828e8a.stderr", - "stderr_hash": "ebf1574a4c5a5194ffa967d7e3a768aad6fe823a3eae7b48b0ea46f2", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-constants1-5828e8a.stderr b/tests/reference/asr-constants1-5828e8a.stderr deleted file mode 100644 index d831d31282..0000000000 --- a/tests/reference/asr-constants1-5828e8a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/constants1.py:5:9 - | -5 | b = bin(5) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-cptr_01-4e660f1.json b/tests/reference/asr-cptr_01-4e660f1.json deleted file mode 100644 index c554aa6d5b..0000000000 --- a/tests/reference/asr-cptr_01-4e660f1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-cptr_01-4e660f1", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/cptr_01.py", - "infile_hash": "92647f6c175f3599be307df700902b5f7fe69826f22fd5f082713ee4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-cptr_01-4e660f1.stderr", - "stderr_hash": "0477f93b29ff4932b3471a59731a173fb19d6e44273236829eeaffbe", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-cptr_01-4e660f1.stderr b/tests/reference/asr-cptr_01-4e660f1.stderr deleted file mode 100644 index 510fd3ad0c..0000000000 --- a/tests/reference/asr-cptr_01-4e660f1.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Indexing CPtr typed expressions is not supported yet - --> tests/errors/cptr_01.py:5:11 - | -5 | print(x[0]) - | ^^^^ diff --git a/tests/reference/asr-dictionary1-a105a36.json b/tests/reference/asr-dictionary1-a105a36.json deleted file mode 100644 index 3bc6f3bfd1..0000000000 --- a/tests/reference/asr-dictionary1-a105a36.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-dictionary1-a105a36", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/dictionary1.py", - "infile_hash": "f164e8dbe52a04e4fd541d6ff6edae2994d683074087d8785a1759e4", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-dictionary1-a105a36.stdout", - "stdout_hash": "ac9f74e24e585a3382e6615e4f197e6ebda5ba099def0664967fbcc0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-dictionary1-a105a36.stdout b/tests/reference/asr-dictionary1-a105a36.stdout deleted file mode 100644 index b434f5addf..0000000000 --- a/tests/reference/asr-dictionary1-a105a36.stdout +++ /dev/null @@ -1,608 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - f: - (Function - (SymbolTable - 7 - { - x: - (Variable - 7 - x - [] - InOut - () - () - Default - (Dict - (Integer 4) - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Dict - (Integer 4) - (Integer 4) - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 7 x)] - [(DictInsert - (Var 7 x) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - )] - () - Public - .false. - .false. - () - ), - test_Dict: - (Function - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Dict - (Integer 4) - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Dict - (Character 1 -2 ()) - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - z: - (Variable - 3 - z - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_Dict - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (DictConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - [(IntegerConstant 2 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (Dict - (Integer 4) - (Integer 4) - ) - ) - () - ) - (= - (Var 3 y) - (DictConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - )] - [(IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - )] - (Dict - (Character 1 1 ()) - (Integer 4) - ) - ) - () - ) - (= - (Var 3 z) - (DictItem - (Var 3 y) - (StringConstant - "a" - (Character 1 1 ()) - ) - () - (Integer 4) - () - ) - () - ) - (= - (Var 3 z) - (DictItem - (Var 3 y) - (StringConstant - "b" - (Character 1 1 ()) - ) - () - (Integer 4) - () - ) - () - ) - (= - (Var 3 z) - (DictItem - (Var 3 x) - (IntegerConstant 1 (Integer 4)) - () - (Integer 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_dict_get: - (Function - (SymbolTable - 5 - { - x: - (Variable - 5 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 5 - y - [] - Local - () - () - Default - (Dict - (Character 1 -2 ()) - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - test_dict_get - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 y) - (DictConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - )] - [(IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - )] - (Dict - (Character 1 1 ()) - (Integer 4) - ) - ) - () - ) - (= - (Var 5 x) - (DictItem - (Var 5 y) - (StringConstant - "a" - (Character 1 1 ()) - ) - () - (Integer 4) - () - ) - () - ) - (= - (Var 5 x) - (DictItem - (Var 5 y) - (StringConstant - "a" - (Character 1 1 ()) - ) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_dict_insert: - (Function - (SymbolTable - 4 - { - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Dict - (Character 1 -2 ()) - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - test_dict_insert - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 y) - (DictConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - )] - [(IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - )] - (Dict - (Character 1 1 ()) - (Integer 4) - ) - ) - () - ) - (DictInsert - (Var 4 y) - (StringConstant - "c" - (Character 1 1 ()) - ) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - )] - () - Public - .false. - .false. - () - ), - test_dict_pop: - (Function - (SymbolTable - 6 - { - x: - (Variable - 6 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 6 - y - [] - Local - () - () - Default - (Dict - (Character 1 -2 ()) - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - test_dict_pop - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 y) - (DictConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - )] - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Dict - (Character 1 1 ()) - (Integer 4) - ) - ) - () - ) - (= - (Var 6 x) - (DictPop - (Var 6 y) - (StringConstant - "a" - (Character 1 1 ()) - ) - (Integer 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_issue_204: - (Function - (SymbolTable - 8 - { - x: - (Variable - 8 - x - [] - Local - () - () - Default - (Dict - (Integer 4) - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - test_issue_204 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [((Var 8 x))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.json b/tests/reference/asr-doconcurrentloop_01-3fdc189.json deleted file mode 100644 index 8d45750ad1..0000000000 --- a/tests/reference/asr-doconcurrentloop_01-3fdc189.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-doconcurrentloop_01-3fdc189", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/doconcurrentloop_01.py", - "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-doconcurrentloop_01-3fdc189.stdout", - "stdout_hash": "0975f7d22eeb12c370338f1c6b5edb6292a8f4e076cb484ccab66b06", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout deleted file mode 100644 index ccf8993bd0..0000000000 --- a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout +++ /dev/null @@ -1,580 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 7 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 4 - c - [] - Local - () - () - Default - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 4 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - nsize: - (Variable - 4 - nsize - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - scalar: - (Variable - 4 - scalar - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [triad] - [] - [(= - (Var 4 scalar) - (Cast - (RealConstant - 10.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 10.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 4 nsize) - (ArraySize - (Var 4 a) - () - (Integer 4) - () - ) - () - ) - (DoConcurrentLoop - ((Var 4 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 4 nsize) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 4 a) - [(() - (Var 4 i) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (RealConstant - 5.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.000000 - (Real 4) - ) - ) - () - ) - (= - (ArrayItem - (Var 4 b) - [(() - (Var 4 i) - ())] - (Real 4) - RowMajor - () - ) - (Cast - (RealConstant - 5.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.000000 - (Real 4) - ) - ) - () - )] - ) - (SubroutineCall - 2 triad - () - [((ArrayPhysicalCast - (Var 4 a) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - DescriptorArray - ) - () - )) - ((ArrayPhysicalCast - (Var 4 b) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - DescriptorArray - ) - () - )) - ((Var 4 scalar)) - ((ArrayPhysicalCast - (Var 4 c) - FixedSizeArray - DescriptorArray - (Array - (Real 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 10000 (Integer 4)))] - DescriptorArray - ) - () - ))] - () - ) - (Print - () - [(StringConstant - "End Stream Triad" - (Character 1 16 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - triad: - (Function - (SymbolTable - 3 - { - N: - (Variable - 3 - N - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 3 - a - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - InOut - () - () - Default - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - scalar: - (Variable - 3 - scalar - [] - In - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - triad - (FunctionType - [(Array - (Real 4) - [(() - ())] - DescriptorArray - ) - (Array - (Real 4) - [(() - ())] - DescriptorArray - ) - (Real 4) - (Array - (Real 4) - [(() - ())] - DescriptorArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 a) - (Var 3 b) - (Var 3 scalar) - (Var 3 c)] - [(= - (Var 3 N) - (ArraySize - (Var 3 a) - () - (Integer 4) - () - ) - () - ) - (DoConcurrentLoop - ((Var 3 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 3 N) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (ArrayItem - (Var 3 c) - [(() - (Var 3 i) - ())] - (Real 4) - RowMajor - () - ) - (RealBinOp - (ArrayItem - (Var 3 a) - [(() - (Var 3 i) - ())] - (Real 4) - RowMajor - () - ) - Add - (RealBinOp - (Var 3 scalar) - Mul - (ArrayItem - (Var 3 b) - [(() - (Var 3 i) - ())] - (Real 4) - RowMajor - () - ) - (Real 4) - () - ) - (Real 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 8 - { - __main__global_stmts: - (ExternalSymbol - 8 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 8 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-elemental_01-b58df26.json b/tests/reference/asr-elemental_01-b58df26.json deleted file mode 100644 index 91ad0f8c5d..0000000000 --- a/tests/reference/asr-elemental_01-b58df26.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-elemental_01-b58df26", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/elemental_01.py", - "infile_hash": "1d1eb8ce26df5817c1e474e4f69b0b96e53df362a31f1b722efaadf0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-elemental_01-b58df26.stderr", - "stderr_hash": "cd10f41e485a55b944782ec55b168ba07907570bc9c92869d02f705e", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-elemental_01-b58df26.stderr b/tests/reference/asr-elemental_01-b58df26.stderr deleted file mode 100644 index 464e01fed8..0000000000 --- a/tests/reference/asr-elemental_01-b58df26.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/elemental_01.py:2:1 - | -2 | from numpy import empty, sin, cos, reshape, int32, float32, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-enum_01-30e1b4a.json b/tests/reference/asr-enum_01-30e1b4a.json deleted file mode 100644 index f21587576e..0000000000 --- a/tests/reference/asr-enum_01-30e1b4a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-enum_01-30e1b4a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/enum_01.py", - "infile_hash": "5f229c1dc30fb06044461359242b2a63d9b93c4086669b391cef7426", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-enum_01-30e1b4a.stderr", - "stderr_hash": "ee3775d6e144fa8c18d4beeae5a5790e317f7c4d26212100d03f29d4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-enum_01-30e1b4a.stderr b/tests/reference/asr-enum_01-30e1b4a.stderr deleted file mode 100644 index 0947a787ea..0000000000 --- a/tests/reference/asr-enum_01-30e1b4a.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Enumerations with non-integer or non-unique integer values cannot interoperate with C code. - --> tests/errors/enum_01.py:5:1 - 8:19 - | -5 | class Color(Enum): - | ^^^^^^^^^^^^^^^^^^... -... - | -8 | BLUE: f64 = 0.7 - | ...^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-enum_02-54656c5.json b/tests/reference/asr-enum_02-54656c5.json deleted file mode 100644 index a989cef176..0000000000 --- a/tests/reference/asr-enum_02-54656c5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-enum_02-54656c5", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/enum_02.py", - "infile_hash": "8ef155d733622824b261f286d72fb1be235bc6e73586a7acc02906d3", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-enum_02-54656c5.stderr", - "stderr_hash": "88c95223e82c39f9d40d9f62923d1bffdf3a9f0a47565bad19b37dee", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-enum_02-54656c5.stderr b/tests/reference/asr-enum_02-54656c5.stderr deleted file mode 100644 index 39fb6429e6..0000000000 --- a/tests/reference/asr-enum_02-54656c5.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Enumerations with non-integer or non-unique integer values cannot interoperate with C code. - --> tests/errors/enum_02.py:5:1 - 8:17 - | -5 | class Color(Enum): - | ^^^^^^^^^^^^^^^^^^... -... - | -8 | BLUE: i32 = 2 - | ...^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-expr1-8df2d66.json b/tests/reference/asr-expr1-8df2d66.json deleted file mode 100644 index 1d822feb22..0000000000 --- a/tests/reference/asr-expr1-8df2d66.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr1-8df2d66", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr1.py", - "infile_hash": "a0c9e93e40f29b7d4541f8c513de490a892abf78a34700478d1827dd", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr1-8df2d66.stdout", - "stdout_hash": "f6ee3d989186cae0852628aac61f23c4831bdc638435bc489e4bdf7c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr1-8df2d66.stdout b/tests/reference/asr-expr1-8df2d66.stdout deleted file mode 100644 index 8a80d6e5f9..0000000000 --- a/tests/reference/asr-expr1-8df2d66.stdout +++ /dev/null @@ -1,148 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_namedexpr: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_namedexpr - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (NamedExpr - (Var 3 y) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - ) - () - ) - (If - (NamedExpr - (Var 3 a) - (StringOrd - (StringConstant - "3" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 51 (Integer 4)) - ) - (Integer 4) - ) - [(= - (Var 3 x) - (IntegerConstant 1 (Integer 4)) - () - )] - [] - ) - (WhileLoop - () - (NamedExpr - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - ) - [(= - (Var 3 y) - (IntegerConstant 1 (Integer 4)) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json deleted file mode 100644 index 62a4828972..0000000000 --- a/tests/reference/asr-expr10-efcbb1b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr10-efcbb1b", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr10.py", - "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr10-efcbb1b.stderr", - "stderr_hash": "32b0a64a7d73278b8d793b2991e8550827128c4df7fd48bc82d20311", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr10-efcbb1b.stderr b/tests/reference/asr-expr10-efcbb1b.stderr deleted file mode 100644 index e35c34b037..0000000000 --- a/tests/reference/asr-expr10-efcbb1b.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr10.py:28:14 - | -28 | c = +c32(complex(1, 2)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr11-9b91d35.json b/tests/reference/asr-expr11-9b91d35.json deleted file mode 100644 index 27fc53c56a..0000000000 --- a/tests/reference/asr-expr11-9b91d35.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr11-9b91d35", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr11.py", - "infile_hash": "940f2d32759315dfb8d54ea50819f2bfef9737e486615703609fd47a", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr11-9b91d35.stdout", - "stdout_hash": "119588e11efc6683fe77260a150cf2622aad182814252c73dbc0b2e1", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr11-9b91d35.stdout b/tests/reference/asr-expr11-9b91d35.stdout deleted file mode 100644 index 499a59590c..0000000000 --- a/tests/reference/asr-expr11-9b91d35.stdout +++ /dev/null @@ -1,186 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_StrOp_repeat: - (Function - (SymbolTable - 3 - { - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_StrOp_repeat - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (StringRepeat - (StringConstant - "a" - (Character 1 1 ()) - ) - (IntegerConstant 2 (Integer 4)) - (Character 1 2 ()) - (StringConstant - "aa" - (Character 1 2 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringRepeat - (StringConstant - "a" - (Character 1 1 ()) - ) - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Character 1 0 ()) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringRepeat - (StringConstant - "test" - (Character 1 4 ()) - ) - (IntegerConstant 5 (Integer 4)) - (Character 1 20 ()) - (StringConstant - "testtesttesttesttest" - (Character 1 20 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringRepeat - (StringConstant - "bb" - (Character 1 2 ()) - ) - (IntegerConstant 4 (Integer 4)) - (Character 1 8 ()) - (StringConstant - "bbbbbbbb" - (Character 1 8 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringRepeat - (StringConstant - "bb" - (Character 1 2 ()) - ) - (IntegerUnaryMinus - (IntegerConstant 40 (Integer 4)) - (Integer 4) - (IntegerConstant -40 (Integer 4)) - ) - (Character 1 0 ()) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringRepeat - (StringRepeat - (StringConstant - "a" - (Character 1 1 ()) - ) - (IntegerConstant 3 (Integer 4)) - (Character 1 3 ()) - (StringConstant - "aaa" - (Character 1 3 ()) - ) - ) - (IntegerConstant 3 (Integer 4)) - (Character 1 9 ()) - (StringConstant - "aaaaaaaaa" - (Character 1 9 ()) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr12-5c5b71e.json b/tests/reference/asr-expr12-5c5b71e.json deleted file mode 100644 index f191d58517..0000000000 --- a/tests/reference/asr-expr12-5c5b71e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr12-5c5b71e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr12.py", - "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr12-5c5b71e.stdout", - "stdout_hash": "68b01cfc65c60b82cb2ba5017c95cb10e05d130d085674593975310e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr12-5c5b71e.stdout b/tests/reference/asr-expr12-5c5b71e.stdout deleted file mode 100644 index 4b91ecc679..0000000000 --- a/tests/reference/asr-expr12-5c5b71e.stdout +++ /dev/null @@ -1,307 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - check - (FunctionType - [] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test] - [] - [(= - (Var 4 a) - (FunctionCall - 2 test - () - [((IntegerConstant 2 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Integer 4) - () - () - ) - () - ) - (= - (Var 4 _lpython_return_variable) - (Var 4 a) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 5 - { - x: - (Variable - 5 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(= - (Var 5 x) - (FunctionCall - 2 check - () - [] - (Integer 4) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 3 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 a) - (Var 3 b)] - [(= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (Var 3 a) - Pow - (Var 3 b) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json deleted file mode 100644 index 739e799cd5..0000000000 --- a/tests/reference/asr-expr13-81bdb5a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr13-81bdb5a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr13.py", - "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr13-81bdb5a.stderr", - "stderr_hash": "0699d234dbdd85c470cbdb001dd7447b9419e96ce3aafa7642a9edc3", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr13-81bdb5a.stderr b/tests/reference/asr-expr13-81bdb5a.stderr deleted file mode 100644 index d05293f0a0..0000000000 --- a/tests/reference/asr-expr13-81bdb5a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr13.py:9:9 - | -9 | a = complex(3, 4) == complex(3., 4.) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr16-a3dc453.json b/tests/reference/asr-expr16-a3dc453.json deleted file mode 100644 index 14ce11462e..0000000000 --- a/tests/reference/asr-expr16-a3dc453.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr16-a3dc453", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr16.py", - "infile_hash": "c87ce02d4b227d695bad17d79c7359c0d8ffd64b5c5c231bce5528e4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr16-a3dc453.stderr", - "stderr_hash": "67cb0d8b08c9910cfdf81faffe003dec601823ff0fd07990a478baf4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr16-a3dc453.stderr b/tests/reference/asr-expr16-a3dc453.stderr deleted file mode 100644 index 7b8ae5a07d..0000000000 --- a/tests/reference/asr-expr16-a3dc453.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in shorthand operator, the types must be compatible - --> tests/expr16.py:6:9 - | -6 | sum += data[i] - | ^^^ ^^^^^^^ type mismatch ('f64' and 'i32') diff --git a/tests/reference/asr-expr2-2e78a12.json b/tests/reference/asr-expr2-2e78a12.json deleted file mode 100644 index fb9017f692..0000000000 --- a/tests/reference/asr-expr2-2e78a12.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr2-2e78a12", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr2.py", - "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr2-2e78a12.stdout", - "stdout_hash": "2ff834685a67310d1ac788a1882209a5179ab17c41e4be40773a53a6", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr2-2e78a12.stdout b/tests/reference/asr-expr2-2e78a12.stdout deleted file mode 100644 index 510df79e02..0000000000 --- a/tests/reference/asr-expr2-2e78a12.stdout +++ /dev/null @@ -1,187 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_boolOp: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ) - }) - test_boolOp - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 a) - (LogicalBinOp - (Var 3 a) - And - (Var 3 b) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalBinOp - (Var 3 a) - Or - (LogicalConstant - .true. - (Logical 4) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (LogicalBinOp - (Var 3 a) - Or - (Var 3 b) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (LogicalBinOp - (Var 3 a) - And - (LogicalCompare - (Var 3 b) - Eq - (Var 3 b) - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (LogicalBinOp - (Var 3 a) - And - (LogicalCompare - (Var 3 b) - NotEq - (Var 3 b) - (Logical 4) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 a) - (LogicalBinOp - (Var 3 b) - Or - (Var 3 b) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr4-cef6743.json b/tests/reference/asr-expr4-cef6743.json deleted file mode 100644 index 76521609ad..0000000000 --- a/tests/reference/asr-expr4-cef6743.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr4-cef6743", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr4.py", - "infile_hash": "5cba7a5d589f54fc31463e48903d5b46604fb64e3e64ba215339047c", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr4-cef6743.stdout", - "stdout_hash": "666ba33cd5ae1e6c79478d456ed9d2ad73bf5497f8a541debadd4738", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr4-cef6743.stdout b/tests/reference/asr-expr4-cef6743.stdout deleted file mode 100644 index 30d1e989c5..0000000000 --- a/tests/reference/asr-expr4-cef6743.stdout +++ /dev/null @@ -1,104 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_del: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_del - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (IntegerConstant 4 (Integer 4)) - () - ) - (= - (Var 3 b) - (IntegerConstant 20 (Integer 4)) - () - ) - (ExplicitDeallocate - [(Var 3 a) - (Var 3 b)] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr5-645ffcc.json b/tests/reference/asr-expr5-645ffcc.json deleted file mode 100644 index 890d1b68c6..0000000000 --- a/tests/reference/asr-expr5-645ffcc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr5-645ffcc", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr5.py", - "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr5-645ffcc.stdout", - "stdout_hash": "c7893c51dec391aa10b49e7839e0b95eff9b93332273faad253f758f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr5-645ffcc.stdout b/tests/reference/asr-expr5-645ffcc.stdout deleted file mode 100644 index 52dd2fcc4b..0000000000 --- a/tests/reference/asr-expr5-645ffcc.stdout +++ /dev/null @@ -1,142 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_StrOp_concat: - (Function - (SymbolTable - 3 - { - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_StrOp_concat - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (StringConcat - (StringConstant - "3" - (Character 1 1 ()) - ) - (StringConstant - "4" - (Character 1 1 ()) - ) - (Character 1 2 ()) - (StringConstant - "34" - (Character 1 2 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringConcat - (StringConstant - "a " - (Character 1 2 ()) - ) - (StringConstant - "test" - (Character 1 4 ()) - ) - (Character 1 6 ()) - (StringConstant - "a test" - (Character 1 6 ()) - ) - ) - () - ) - (= - (Var 3 s) - (StringConcat - (StringConcat - (StringConstant - "test" - (Character 1 4 ()) - ) - (StringConstant - "test" - (Character 1 4 ()) - ) - (Character 1 8 ()) - (StringConstant - "testtest" - (Character 1 8 ()) - ) - ) - (StringConstant - "test" - (Character 1 4 ()) - ) - (Character 1 12 ()) - (StringConstant - "testtesttest" - (Character 1 12 ()) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr6-368e5ed.json b/tests/reference/asr-expr6-368e5ed.json deleted file mode 100644 index 3255a6bb27..0000000000 --- a/tests/reference/asr-expr6-368e5ed.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr6-368e5ed", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr6.py", - "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr6-368e5ed.stdout", - "stdout_hash": "eb681d9c5f81c0d94cd1f175bfb84ec29803a153327f1c7a5a17b7d4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr6-368e5ed.stdout b/tests/reference/asr-expr6-368e5ed.stdout deleted file mode 100644 index bb68ad16a9..0000000000 --- a/tests/reference/asr-expr6-368e5ed.stdout +++ /dev/null @@ -1,151 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_ifexp: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ) - }) - test_ifexp - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (Var 3 b) - (IfExp - (IntegerCompare - (Var 3 a) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - (IntegerConstant 6 (Integer 4)) - (IntegerConstant 8 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (Var 3 c) - (IfExp - (IntegerCompare - (Var 3 b) - Gt - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - (LogicalConstant - .true. - (Logical 4) - ) - (LogicalConstant - .false. - (Logical 4) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json deleted file mode 100644 index 7d13377709..0000000000 --- a/tests/reference/asr-expr7-480ba2f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr7-480ba2f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr7.py", - "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr7-480ba2f.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr7-480ba2f.stderr b/tests/reference/asr-expr7-480ba2f.stderr deleted file mode 100644 index d1b84ec030..0000000000 --- a/tests/reference/asr-expr7-480ba2f.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr7.py:4:13 - | -4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json deleted file mode 100644 index 7801dbd06d..0000000000 --- a/tests/reference/asr-expr8-6beda60.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr8-6beda60", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr8.py", - "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr8-6beda60.stderr", - "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr8-6beda60.stderr b/tests/reference/asr-expr8-6beda60.stderr deleted file mode 100644 index 6e9d8d0f32..0000000000 --- a/tests/reference/asr-expr8-6beda60.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr8.py:22:13 - | -22 | x = i32(b1//b1) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr9-814e4bc.json b/tests/reference/asr-expr9-814e4bc.json deleted file mode 100644 index 5e5e4e24e7..0000000000 --- a/tests/reference/asr-expr9-814e4bc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr9-814e4bc", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr9.py", - "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr9-814e4bc.stdout", - "stdout_hash": "a8334d45029aef40c38c8014b64aa2520c38fdc0186ae85869d72c36", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr9-814e4bc.stdout b/tests/reference/asr-expr9-814e4bc.stdout deleted file mode 100644 index 70042e2dcd..0000000000 --- a/tests/reference/asr-expr9-814e4bc.stdout +++ /dev/null @@ -1,424 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 7 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 6 - { - i: - (Variable - 6 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 6 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_return_1 - test_return_2 - test_return_3] - [] - [(= - (Var 6 i) - (FunctionCall - 2 test_return_1 - () - [((IntegerConstant 4 (Integer 4)))] - (Integer 4) - () - () - ) - () - ) - (= - (Var 6 s) - (FunctionCall - 2 test_return_2 - () - [((IntegerConstant 4 (Integer 4)))] - (Character 1 -2 ()) - () - () - ) - () - ) - (= - (Var 6 i) - (FunctionCall - 2 test_return_3 - () - [((IntegerConstant 4 (Integer 4)))] - (Integer 4) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_return_1: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 3 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_return_1 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 a)] - [(= - (Var 3 x) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 3 _lpython_return_variable) - (Var 3 x) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_return_2: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - a: - (Variable - 4 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_return_2 - (FunctionType - [(Integer 4)] - (Character 1 -2 ()) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 a)] - [(= - (Var 4 x) - (StringConstant - "test" - (Character 1 4 ()) - ) - () - ) - (= - (Var 4 _lpython_return_variable) - (Var 4 x) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_return_3: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 5 - a - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_return_3 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 a)] - [(= - (Var 5 _lpython_return_variable) - (Var 5 a) - () - ) - (Return)] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 8 - { - __main__global_stmts: - (ExternalSymbol - 8 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 8 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_01-211000e.json b/tests/reference/asr-expr_01-211000e.json deleted file mode 100644 index 3ce3960ab9..0000000000 --- a/tests/reference/asr-expr_01-211000e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_01-211000e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/expr_01.py", - "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_01-211000e.stdout", - "stdout_hash": "41ef0d077c9deb5cbf309b21493b9d6780254a09a635e4c01dcc096e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_01-211000e.stdout b/tests/reference/asr-expr_01-211000e.stdout deleted file mode 100644 index d3d3cfdf8a..0000000000 --- a/tests/reference/asr-expr_01-211000e.stdout +++ /dev/null @@ -1,195 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x2: - (Variable - 3 - x2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - y2: - (Variable - 3 - y2 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (IntegerBinOp - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Add - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Mul - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant 25 (Integer 4)) - ) - () - ) - (Print - () - [(Var 3 x)] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_01-a0d4829.json b/tests/reference/asr-expr_01-a0d4829.json deleted file mode 100644 index 23075b510d..0000000000 --- a/tests/reference/asr-expr_01-a0d4829.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_01-a0d4829", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_01.py", - "infile_hash": "230a65e2cddb76f58d56747325caf24b8a1f6277810186581948c514", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_01-a0d4829.stdout", - "stdout_hash": "22c544446be0bf9235672437a74b58e230def3217713441058c35b49", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_01-a0d4829.stdout b/tests/reference/asr-expr_01-a0d4829.stdout deleted file mode 100644 index 2f80c815e4..0000000000 --- a/tests/reference/asr-expr_01-a0d4829.stdout +++ /dev/null @@ -1,418 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - add: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - add - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .true. - .false. - [] - .false. - ) - [] - [(Var 3 x) - (Var 3 y)] - [(= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (Var 3 x) - Add - (Var 3 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - and_op: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - and_op - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .true. - .false. - [] - .false. - ) - [] - [(Var 4 x) - (Var 4 y)] - [(= - (Var 4 _lpython_return_variable) - (IntegerBinOp - (Var 4 x) - BitAnd - (Var 4 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 5 - { - x: - (Variable - 5 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 5 - y - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - z: - (Variable - 5 - z - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [add - and_op] - [] - [(= - (Var 5 x) - (IntegerBinOp - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Add - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Mul - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant 25 (Integer 4)) - ) - () - ) - (= - (Var 5 y) - (IntegerBinOp - (FunctionCall - 2 add - () - [((Var 5 x)) - ((IntegerConstant 2 (Integer 4)))] - (Integer 4) - () - () - ) - Mul - (IntegerConstant 2 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 x) - Eq - (IntegerConstant 25 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 y) - Eq - (IntegerConstant 54 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 5 z) - (FunctionCall - 2 and_op - () - [((Var 5 x)) - ((Var 5 y))] - (Integer 4) - () - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 z) - Eq - (IntegerConstant 16 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_05-3a37324.json b/tests/reference/asr-expr_05-3a37324.json deleted file mode 100644 index e366badac0..0000000000 --- a/tests/reference/asr-expr_05-3a37324.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_05-3a37324", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_05.py", - "infile_hash": "cc922bec30fac0a8eb10efd99f72234aa5638b3c9cd92c68044c69ea", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr_05-3a37324.stderr", - "stderr_hash": "ec167ccde0bcc3539244c081abc86809b00655e649722a96f082d86b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_05-3a37324.stderr b/tests/reference/asr-expr_05-3a37324.stderr deleted file mode 100644 index a8b017fcee..0000000000 --- a/tests/reference/asr-expr_05-3a37324.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/expr_05.py:7:12 - | -7 | return a%b - | ^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr_07-7742668.json b/tests/reference/asr-expr_07-7742668.json deleted file mode 100644 index 7d24bdbbdf..0000000000 --- a/tests/reference/asr-expr_07-7742668.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_07-7742668", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_07.py", - "infile_hash": "5c3cc1f1662783acd989ceafcb0eb3259e0194dad005c5bd4e502710", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_07-7742668.stdout", - "stdout_hash": "05202a24fb95d20a4ae8d229b4bcd3729916613a20603101197da0f8", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_07-7742668.stdout b/tests/reference/asr-expr_07-7742668.stdout deleted file mode 100644 index c0727259d4..0000000000 --- a/tests/reference/asr-expr_07-7742668.stdout +++ /dev/null @@ -1,432 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - bool_to_str] - [] - [(SubroutineCall - 2 f - () - [] - () - ) - (SubroutineCall - 2 bool_to_str - () - [] - () - )] - () - Public - .false. - .false. - () - ), - bool_to_str: - (Function - (SymbolTable - 5 - { - var: - (Variable - 5 - var - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ) - }) - bool_to_str - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 var) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Print - () - [(Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "True" - (Character 1 4 ()) - ) - )] - () - () - ) - (Assert - (StringCompare - (Cast - (Var 5 var) - LogicalToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "True" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 5 var) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (StringCompare - (Cast - (Var 5 var) - LogicalToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "False" - (Character 1 5 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "True" - (Character 1 4 ()) - ) - ) - Eq - (StringConstant - "True" - (Character 1 4 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(= - (Var 4 a) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 4 x) - (IntegerConstant 3 (Integer 4)) - () - ) - (= - (Var 4 x) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Var 4 x) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - ) - (Print - () - [(Var 4 a) - (Var 4 b)] - () - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 6 (Integer 4)) - (Logical 4) - () - ) - () - ) - (SubroutineCall - 2 g - () - [((IntegerBinOp - (IntegerBinOp - (Var 4 a) - Mul - (Var 4 b) - (Integer 4) - () - ) - Add - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - ))] - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [(Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x)] - [(Print - () - [(Var 3 x)] - () - () - )] - () - Public - .false. - .false. - () - ), - x: - (Variable - 2 - x - [] - Local - (IntegerConstant 7 (Integer 4)) - (IntegerConstant 7 (Integer 4)) - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_09-f3e89c8.json b/tests/reference/asr-expr_09-f3e89c8.json deleted file mode 100644 index 2c3196b845..0000000000 --- a/tests/reference/asr-expr_09-f3e89c8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_09-f3e89c8", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_09.py", - "infile_hash": "5786bfd0706e0850ec51d9f6cface5c7df4c30f3b4715f2e76cc553b", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_09-f3e89c8.stdout", - "stdout_hash": "ba3074d0bc0b2017872e27e730d06054b799d295c6599949176a0e15", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_09-f3e89c8.stdout b/tests/reference/asr-expr_09-f3e89c8.stdout deleted file mode 100644 index b6bad33ca5..0000000000 --- a/tests/reference/asr-expr_09-f3e89c8.stdout +++ /dev/null @@ -1,1009 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_multiple_assign_1 - test_issue_928 - main0] - [] - [(SubroutineCall - 2 test_multiple_assign_1 - () - [] - () - ) - (SubroutineCall - 2 test_issue_928 - () - [] - () - ) - (SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 3 - { - i1: - (Variable - 3 - i1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 3 - i2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 i1) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 3 i2) - (IntegerConstant 4 (Integer 4)) - () - ) - (= - (Var 3 i1) - (IntegerConstant 3 (Integer 4)) - () - ) - (= - (Var 3 i2) - (IntegerConstant 5 (Integer 4)) - () - ) - (Print - () - [(IntegerBinOp - (IntegerUnaryMinus - (Var 3 i1) - (Integer 4) - () - ) - BitXor - (IntegerUnaryMinus - (Var 3 i2) - (Integer 4) - () - ) - (Integer 4) - () - )] - () - () - ) - (Assert - (IntegerCompare - (IntegerBinOp - (IntegerUnaryMinus - (Var 3 i1) - (Integer 4) - () - ) - BitXor - (IntegerUnaryMinus - (Var 3 i2) - (Integer 4) - () - ) - (Integer 4) - () - ) - Eq - (IntegerConstant 6 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_issue_928: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ) - }) - test_issue_928 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (TupleConstant - [(Var 5 a) - (Var 5 b)] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - ) - (= - (Var 5 c) - (TupleConstant - [(IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 5 a) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 5 b) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (LogicalBinOp - (IntegerCompare - (TupleItem - (Var 5 c) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - ) - Eq - (Var 5 a) - (Logical 4) - () - ) - And - (IntegerCompare - (TupleItem - (Var 5 c) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - Eq - (Var 5 b) - (Logical 4) - () - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_multiple_assign_1: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - c: - (Variable - 4 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - d: - (Variable - 4 - d - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - e: - (Variable - 4 - e - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - g: - (Variable - 4 - g - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 4 - i - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - j: - (Variable - 4 - j - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - k: - (Variable - 4 - k - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - test_multiple_assign_1 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 g) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 4 d) - (RealBinOp - (Cast - (Var 4 g) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - () - ) - () - ) - (= - (Var 4 e) - (RealBinOp - (Cast - (Var 4 g) - IntegerToReal - (Real 8) - () - ) - Add - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - () - ) - () - ) - (= - (Var 4 a) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 4 b) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 4 c) - (IntegerConstant 10 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (Var 4 a) - Eq - (Var 4 b) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (Var 4 c) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 a) - Eq - (IntegerConstant 10 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (RealConstant - 23.000000 - (Real 8) - ) - () - ) - (= - (Var 4 y) - (RealConstant - 23.000000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 4 x) - Sub - (RealConstant - 23.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000001 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 4 y) - Sub - (RealConstant - 23.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 4 e) - Sub - (RealConstant - 6.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000001 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 4 d) - Sub - (RealConstant - 6.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 k) - (ListConstant - [] - (List - (Real 8) - ) - ) - () - ) - (= - (Var 4 g) - (IntegerConstant 0 (Integer 4)) - () - ) - (DoLoop - () - ((Var 4 g) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(ListAppend - (Var 4 k) - (RealBinOp - (RealBinOp - (Cast - (Var 4 g) - IntegerToReal - (Real 8) - () - ) - Mul - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Add - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - () - ) - )] - ) - (= - (Var 4 i) - (Var 4 k) - () - ) - (= - (Var 4 j) - (Var 4 k) - () - ) - (DoLoop - () - ((Var 4 g) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ListItem - (Var 4 i) - (Var 4 g) - (Real 8) - () - ) - Sub - (ListItem - (Var 4 j) - (Var 4 g) - (Real 8) - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (ListItem - (Var 4 i) - (Var 4 g) - (Real 8) - () - ) - Sub - (ListItem - (Var 4 k) - (Var 4 g) - (Real 8) - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (RealBinOp - (RealBinOp - (Cast - (Var 4 g) - IntegerToReal - (Real 8) - () - ) - Mul - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - Add - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - () - ) - Sub - (ListItem - (Var 4 k) - (Var 4 g) - (Real 8) - () - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_10-d39708c.json b/tests/reference/asr-expr_10-d39708c.json deleted file mode 100644 index 41fbf0dd7e..0000000000 --- a/tests/reference/asr-expr_10-d39708c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_10-d39708c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_10.py", - "infile_hash": "a371877a6249c5d8af75ad5afdd4c6f762841733ed517dafcdfd6b10", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_10-d39708c.stdout", - "stdout_hash": "0a4b79034e67e8b6d3eb0d84aea96436f45dea9e63ce4b3910c76dd7", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_10-d39708c.stdout b/tests/reference/asr-expr_10-d39708c.stdout deleted file mode 100644 index 6ff9e6698f..0000000000 --- a/tests/reference/asr-expr_10-d39708c.stdout +++ /dev/null @@ -1,301 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_fn1] - [] - [(SubroutineCall - 2 test_fn1 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 _lpython_return_variable) - (IntegerConstant 5 (Integer 4)) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - gsubrout: - (Function - (SymbolTable - 4 - { - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - gsubrout - (FunctionType - [(Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x)] - [(Print - () - [(Var 4 x)] - () - () - )] - () - Public - .false. - .false. - () - ), - test_fn1: - (Function - (SymbolTable - 5 - { - __lcompilers_dummy: - (Variable - 5 - __lcompilers_dummy - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 5 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 5 - j - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_fn1 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g - gsubrout] - [] - [(= - (Var 5 i) - (FunctionCall - 2 g - () - [] - (Integer 4) - () - () - ) - () - ) - (= - (Var 5 j) - (FunctionCall - 2 g - () - [] - (Integer 4) - () - () - ) - () - ) - (= - (Var 5 __lcompilers_dummy) - (FunctionCall - 2 g - () - [] - (Integer 4) - () - () - ) - () - ) - (SubroutineCall - 2 gsubrout - () - [((Var 5 i))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_12-6769be0.json b/tests/reference/asr-expr_12-6769be0.json deleted file mode 100644 index 852cabe5ff..0000000000 --- a/tests/reference/asr-expr_12-6769be0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_12-6769be0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_12.py", - "infile_hash": "00534ea8d2143408735ea96d7a26888e53563758c1b14569daf0f962", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_12-6769be0.stdout", - "stdout_hash": "d2a7d644dcafd925278b7bd2689679b2a0c3cb3397a784579679b64a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_12-6769be0.stdout b/tests/reference/asr-expr_12-6769be0.stdout deleted file mode 100644 index 2db31cd76d..0000000000 --- a/tests/reference/asr-expr_12-6769be0.stdout +++ /dev/null @@ -1,444 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 4 - { - ptr: - (Variable - 4 - ptr - [] - InOut - () - () - Default - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - Source - Public - Required - .false. - ) - }) - check - (FunctionType - [(Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 ptr)] - [(Assert - (IntegerCompare - (ArrayItem - (Var 4 ptr) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - Eq - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (ArrayItem - (Var 4 ptr) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - Eq - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 5 - { - y: - (Variable - 5 - y - [] - Local - () - () - Default - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - yptr1: - (Variable - 5 - yptr1 - [] - Local - () - () - Default - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g - check] - [] - [(SubroutineCall - 2 g - () - [((Var 5 yptr1)) - ((ArrayPhysicalCast - (Var 5 y) - FixedSizeArray - DescriptorArray - (Array - (Integer 2) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - DescriptorArray - ) - () - ))] - () - ) - (SubroutineCall - 2 check - () - [((Var 5 yptr1))] - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - InOut - () - () - Default - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - InOut - () - () - Default - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [(Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - (Array - (Integer 2) - [(() - ())] - DescriptorArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x) - (Var 3 y)] - [(= - (ArrayItem - (Var 3 y) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 1 (Integer 2)) - ) - () - ) - (= - (ArrayItem - (Var 3 y) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 2 (Integer 2)) - ) - () - ) - (= - (Var 3 x) - (GetPointer - (Var 3 y) - (Pointer - (Array - (Integer 2) - [(() - ())] - DescriptorArray - ) - ) - () - ) - () - ) - (Print - () - [(ArrayItem - (Var 3 x) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - ) - (ArrayItem - (Var 3 x) - [(() - (IntegerConstant 1 (Integer 4)) - ())] - (Integer 2) - RowMajor - () - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-expr_14-f2bd343.json b/tests/reference/asr-expr_14-f2bd343.json deleted file mode 100644 index 59cc62002a..0000000000 --- a/tests/reference/asr-expr_14-f2bd343.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-expr_14-f2bd343", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/expr_14.py", - "infile_hash": "bf5d0d167082af64149be967dc182b9e2e8cb35091fa410ae4afee6f", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-expr_14-f2bd343.stdout", - "stdout_hash": "b03cf9660c69a5bd18468550cc176ffd6f219869f5b9a198c2b23e71", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-expr_14-f2bd343.stdout b/tests/reference/asr-expr_14-f2bd343.stdout deleted file mode 100644 index 004396081b..0000000000 --- a/tests/reference/asr-expr_14-f2bd343.stdout +++ /dev/null @@ -1,929 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_divide] - [] - [(SubroutineCall - 2 test_divide - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_divide: - (Function - (SymbolTable - 3 - { - a1: - (Variable - 3 - a1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 3 - a2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a3: - (Variable - 3 - a3 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 3 - b2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - b3: - (Variable - 3 - b3 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - c1: - (Variable - 3 - c1 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - c2: - (Variable - 3 - c2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - c3: - (Variable - 3 - c3 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - d1: - (Variable - 3 - d1 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - d2: - (Variable - 3 - d2 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - d3: - (Variable - 3 - d3 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - e1: - (Variable - 3 - e1 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - e2: - (Variable - 3 - e2 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - e3: - (Variable - 3 - e3 - [] - Local - () - () - Default - (Complex 4) - () - Source - Public - Required - .false. - ), - f1: - (Variable - 3 - f1 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 3 - f2 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ), - f3: - (Variable - 3 - f3 - [] - Local - () - () - Default - (Complex 8) - () - Source - Public - Required - .false. - ) - }) - test_divide - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a1) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 3 a2) - (IntegerConstant 9 (Integer 4)) - () - ) - (= - (Var 3 a3) - (RealBinOp - (Cast - (Var 3 a2) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (Var 3 a1) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 a3) - Sub - (RealConstant - 9.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b1) - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - () - ) - (= - (Var 3 b2) - (Cast - (IntegerConstant 10 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 10 (Integer 8)) - ) - () - ) - (= - (Var 3 b3) - (RealBinOp - (Cast - (Var 3 b2) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (Var 3 b1) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 b3) - Sub - (RealConstant - 5.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 c1) - (Cast - (RealConstant - 3.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 c2) - (Cast - (RealConstant - 11.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 11.000000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 c3) - (RealBinOp - (Var 3 c2) - Div - (Var 3 c1) - (Real 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 c3) - Sub - (Cast - (RealConstant - 3.666666 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.666666 - (Real 4) - ) - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - LtE - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 d1) - (RealConstant - 4.000000 - (Real 8) - ) - () - ) - (= - (Var 3 d2) - (RealConstant - 12.000000 - (Real 8) - ) - () - ) - (= - (Var 3 d3) - (RealBinOp - (Var 3 d2) - Div - (Var 3 d1) - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (Var 3 d3) - Sub - (RealConstant - 3.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 e1) - (ComplexBinOp - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToComplex - (Complex 4) - (ComplexConstant - 5.000000 - 0.000000 - (Complex 4) - ) - ) - Add - (Cast - (ComplexConstant - 0.000000 - 6.000000 - (Complex 8) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.000000 - 6.000000 - (Complex 4) - ) - ) - (Complex 4) - (ComplexConstant - 5.000000 - 6.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 e2) - (ComplexBinOp - (Cast - (IntegerConstant 13 (Integer 4)) - IntegerToComplex - (Complex 4) - (ComplexConstant - 13.000000 - 0.000000 - (Complex 4) - ) - ) - Add - (Cast - (ComplexConstant - 0.000000 - 14.000000 - (Complex 8) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.000000 - 14.000000 - (Complex 4) - ) - ) - (Complex 4) - (ComplexConstant - 13.000000 - 14.000000 - (Complex 4) - ) - ) - () - ) - (= - (Var 3 e3) - (ComplexBinOp - (Var 3 e2) - Div - (Var 3 e1) - (Complex 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(ComplexBinOp - (ComplexBinOp - (Var 3 e3) - Sub - (Cast - (RealConstant - 2.442623 - (Real 8) - ) - RealToComplex - (Complex 4) - (ComplexConstant - 2.442623 - 0.000000 - (Complex 4) - ) - ) - (Complex 4) - () - ) - Add - (Cast - (ComplexConstant - 0.000000 - 0.131148 - (Complex 8) - ) - ComplexToComplex - (Complex 4) - (ComplexConstant - 0.000000 - 0.131148 - (Complex 4) - ) - ) - (Complex 4) - () - )] - 0 - (Real 4) - () - ) - LtE - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f1) - (ComplexBinOp - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 7.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 8.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 7.000000 - 8.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 3 f2) - (ComplexBinOp - (Cast - (IntegerConstant 15 (Integer 4)) - IntegerToComplex - (Complex 8) - (ComplexConstant - 15.000000 - 0.000000 - (Complex 8) - ) - ) - Add - (ComplexConstant - 0.000000 - 16.000000 - (Complex 8) - ) - (Complex 8) - (ComplexConstant - 15.000000 - 16.000000 - (Complex 8) - ) - ) - () - ) - (= - (Var 3 f3) - (ComplexBinOp - (Var 3 f2) - Div - (Var 3 f1) - (Complex 8) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(ComplexBinOp - (ComplexBinOp - (Var 3 f3) - Sub - (Cast - (RealConstant - 2.061947 - (Real 8) - ) - RealToComplex - (Complex 8) - (ComplexConstant - 2.061947 - 0.000000 - (Complex 8) - ) - ) - (Complex 8) - () - ) - Add - (ComplexConstant - 0.000000 - 0.070796 - (Complex 8) - ) - (Complex 8) - () - )] - 0 - (Real 8) - () - ) - LtE - (RealConstant - 0.000001 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-func_01-d87aa4a.json b/tests/reference/asr-func_01-d87aa4a.json deleted file mode 100644 index 2ac3164ce4..0000000000 --- a/tests/reference/asr-func_01-d87aa4a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_01-d87aa4a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_01.py", - "infile_hash": "feb3ed4318642084eaa53e796f3f055c2faa47af50bcb1d90c03910c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_01-d87aa4a.stderr", - "stderr_hash": "2a773033fab41aadd3ddf3732cfb473ba5da6c9649453516286dacf1", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_01-d87aa4a.stderr b/tests/reference/asr-func_01-d87aa4a.stderr deleted file mode 100644 index 3963b1e1d5..0000000000 --- a/tests/reference/asr-func_01-d87aa4a.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Function f is already defined - --> tests/errors/func_01.py:9:1 - 10:16 - | - 9 | def f(i: i32): - | ^^^^^^^^^^^^^^... -... - | -10 | print(i + 2) - | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-func_02-b439474.json b/tests/reference/asr-func_02-b439474.json deleted file mode 100644 index bc648e06af..0000000000 --- a/tests/reference/asr-func_02-b439474.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_02-b439474", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_02.py", - "infile_hash": "452658f9bae7ccab4d21b9b1c993adb7fbaf117c093dd82672755aa5", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_02-b439474.stderr", - "stderr_hash": "855967bc8c46a46b93c348de6e3004107861b10fad24496866c8a197", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_02-b439474.stderr b/tests/reference/asr-func_02-b439474.stderr deleted file mode 100644 index e4d6ca0563..0000000000 --- a/tests/reference/asr-func_02-b439474.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assignment to an input function parameter `n` is not allowed - --> tests/errors/func_02.py:4:5 - | -4 | n = 5 - | ^ Hint: create a new local variable with a different name diff --git a/tests/reference/asr-func_03-cd744a0.json b/tests/reference/asr-func_03-cd744a0.json deleted file mode 100644 index e0e191485d..0000000000 --- a/tests/reference/asr-func_03-cd744a0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_03-cd744a0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_03.py", - "infile_hash": "763216ad3cb1090dc322e63706d4f92be4e806b1fc2df6f160d02fd0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_03-cd744a0.stderr", - "stderr_hash": "d1201fe81d9eeb213996a3f316f463ee4071c9192fb20d7bf327a898", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_03-cd744a0.stderr b/tests/reference/asr-func_03-cd744a0.stderr deleted file mode 100644 index 74251ce6c7..0000000000 --- a/tests/reference/asr-func_03-cd744a0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assignment to an input function parameter `l` is not allowed - --> tests/errors/func_03.py:4:5 - | -4 | l[5] = 5 - | ^ Use InOut[list[i32]] to allow assignment diff --git a/tests/reference/asr-func_04-eef2656.json b/tests/reference/asr-func_04-eef2656.json deleted file mode 100644 index 6fa82a6009..0000000000 --- a/tests/reference/asr-func_04-eef2656.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_04-eef2656", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_04.py", - "infile_hash": "f8a6eed44ebd1dee435e6db842a874c41b8ba2b13d88d16944a4d265", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_04-eef2656.stderr", - "stderr_hash": "d1e5bb4b5356e57124ff34eea9e5b96ecc44d3bc8a1da4b0a7db5b4a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_04-eef2656.stderr b/tests/reference/asr-func_04-eef2656.stderr deleted file mode 100644 index 744b9460d2..0000000000 --- a/tests/reference/asr-func_04-eef2656.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Modifying input function parameter `l` is not allowed - --> tests/errors/func_04.py:4:5 - | -4 | l.append(5) - | ^^^^^^^^^^^ diff --git a/tests/reference/asr-func_05-c22b921.json b/tests/reference/asr-func_05-c22b921.json deleted file mode 100644 index 46cec1c7b4..0000000000 --- a/tests/reference/asr-func_05-c22b921.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_05-c22b921", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_05.py", - "infile_hash": "70a0b0ddad67252c7488d322ffc565a6669e1f79b96c3ef3014b0d0a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_05-c22b921.stderr", - "stderr_hash": "9611beb75ae308f86e573592164c5aca50c4e1acec2e91e48687ba96", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_05-c22b921.stderr b/tests/reference/asr-func_05-c22b921.stderr deleted file mode 100644 index fc959f032f..0000000000 --- a/tests/reference/asr-func_05-c22b921.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Simple Type i32 cannot be intent InOut/Out - --> tests/errors/func_05.py:3:7 - | -3 | def f(n: InOut[i32]): - | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-func_06-62e738c.json b/tests/reference/asr-func_06-62e738c.json deleted file mode 100644 index 00d0a1051b..0000000000 --- a/tests/reference/asr-func_06-62e738c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_06-62e738c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_06.py", - "infile_hash": "eed0fcf15f1964c916df4aa9bc4fab78f74f87243a42549a99234b7b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_06-62e738c.stderr", - "stderr_hash": "a97e6d8f812ec9e81cb4b0565dc2fd30f3bd194ccab41770962f6e32", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_06-62e738c.stderr b/tests/reference/asr-func_06-62e738c.stderr deleted file mode 100644 index 5e5827b226..0000000000 --- a/tests/reference/asr-func_06-62e738c.stderr +++ /dev/null @@ -1,8 +0,0 @@ -semantic error: Parameter is already declared - --> tests/errors/func_06.py:1:12 - | -1 | def init_X(m:i32, n: i32, b: CPtr, m: i32) -> None: - | ~~~~~ original declaration - | -1 | def init_X(m:i32, n: i32, b: CPtr, m: i32) -> None: - | ^^^^^^ redeclaration diff --git a/tests/reference/asr-func_07-4a8c076.json b/tests/reference/asr-func_07-4a8c076.json deleted file mode 100644 index 23a3ff6d21..0000000000 --- a/tests/reference/asr-func_07-4a8c076.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_07-4a8c076", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_07.py", - "infile_hash": "1f03729509b64de761a779737f886f9c86e548a903cb875e8f9f15f0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_07-4a8c076.stderr", - "stderr_hash": "7ed110581f050d55b95ace1c09b3dc30176b30213c125e3ec19f5c68", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_07-4a8c076.stderr b/tests/reference/asr-func_07-4a8c076.stderr deleted file mode 100644 index d876637cc3..0000000000 --- a/tests/reference/asr-func_07-4a8c076.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assignment to an input function parameter `this` is not allowed - --> tests/errors/func_07.py:12:5 - | -12 | this._len = len(this._buf) - | ^^^^ Use InOut[struct StringIO] to allow assignment diff --git a/tests/reference/asr-func_08-c137415.json b/tests/reference/asr-func_08-c137415.json deleted file mode 100644 index e8987fe7e0..0000000000 --- a/tests/reference/asr-func_08-c137415.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_08-c137415", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/func_08.py", - "infile_hash": "7db9398db0036bb22e787d74ea36241f6535928f25e66c09c59e76e3", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-func_08-c137415.stderr", - "stderr_hash": "5fe28460d4f28e79ced8c17e75ba6da4cdfccd36e20d1c3a85d07cf1", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-func_08-c137415.stderr b/tests/reference/asr-func_08-c137415.stderr deleted file mode 100644 index c372ea27dd..0000000000 --- a/tests/reference/asr-func_08-c137415.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Intent annotation 'In' cannot be used here - --> tests/errors/func_08.py:3:17 - | -3 | def main0(x: In[In[i32]]): - | ^^^^^^^ diff --git a/tests/reference/asr-func_inline_01-56af272.json b/tests/reference/asr-func_inline_01-56af272.json deleted file mode 100644 index bbebb60fee..0000000000 --- a/tests/reference/asr-func_inline_01-56af272.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-func_inline_01-56af272", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/func_inline_01.py", - "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-func_inline_01-56af272.stdout", - "stdout_hash": "0bb57e1f00283e1d9702b73b5ac6e2cd149919abafe5f228b1650859", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-func_inline_01-56af272.stdout b/tests/reference/asr-func_inline_01-56af272.stdout deleted file mode 100644 index 8b9b41222c..0000000000 --- a/tests/reference/asr-func_inline_01-56af272.stdout +++ /dev/null @@ -1,313 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 5 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main] - [] - [(SubroutineCall - 2 main - () - [] - () - )] - () - Public - .false. - .false. - () - ), - fib: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - n: - (Variable - 3 - n - [] - In - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - fib - (FunctionType - [(Integer 8)] - (Integer 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [fib] - [(Var 3 n)] - [(If - (IntegerCompare - (Var 3 n) - Lt - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Logical 4) - () - ) - [(= - (Var 3 _lpython_return_variable) - (Var 3 n) - () - ) - (Return)] - [] - ) - (= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 3 n) - Sub - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - Add - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 3 n) - Sub - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - (Integer 8) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - main: - (Function - (SymbolTable - 4 - { - ans: - (Variable - 4 - ans - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - main - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [fib] - [] - [(= - (Var 4 x) - (Cast - (IntegerConstant 40 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 40 (Integer 8)) - ) - () - ) - (= - (Var 4 ans) - (FunctionCall - 2 fib - () - [((Var 4 x))] - (Integer 8) - () - () - ) - () - ) - (Print - () - [(Var 4 ans)] - () - () - ) - (Assert - (IntegerCompare - (Var 4 ans) - Eq - (Cast - (IntegerConstant 102334155 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 102334155 (Integer 8)) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 6 - { - __main__global_stmts: - (ExternalSymbol - 6 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 6 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-generics_01-d616074.json b/tests/reference/asr-generics_01-d616074.json deleted file mode 100644 index 6cfb7b0201..0000000000 --- a/tests/reference/asr-generics_01-d616074.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_01-d616074", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_01.py", - "infile_hash": "3062320cca6688cea4b76b4c18dbaf5d1dcc1de193459ee598e84935", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-generics_01-d616074.stdout", - "stdout_hash": "a86dbbc3855a11fac0c305599cd98e368c31b0fc172e78dfc1fe484b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_01-d616074.stdout b/tests/reference/asr-generics_01-d616074.stdout deleted file mode 100644 index c9d885a77b..0000000000 --- a/tests/reference/asr-generics_01-d616074.stdout +++ /dev/null @@ -1,712 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_f_0: - (Function - (SymbolTable - 7 - { - _lpython_return_variable: - (Variable - 7 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 7 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 7 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_f_0 - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_integer] - [(Var 7 x) - (Var 7 y)] - [(= - (Var 7 _lpython_return_variable) - (FunctionCall - 2 add_integer - () - [((Var 7 x)) - ((Var 7 y))] - (Integer 4) - () - () - ) - () - ) - (Return)] - (Var 7 _lpython_return_variable) - Public - .false. - .false. - () - ), - __asr_generic_f_1: - (Function - (SymbolTable - 8 - { - _lpython_return_variable: - (Variable - 8 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Character 1 1 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 8 - x - [] - In - () - () - Default - (Character 1 1 ()) - () - Source - Public - Required - .false. - ), - y: - (Variable - 8 - y - [] - In - () - () - Default - (Character 1 1 ()) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_f_1 - (FunctionType - [(Character 1 1 ()) - (Character 1 1 ())] - (Character 1 1 ()) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add_string] - [(Var 8 x) - (Var 8 y)] - [(= - (Var 8 _lpython_return_variable) - (FunctionCall - 2 add_string - () - [((Var 8 x)) - ((Var 8 y))] - (Character 1 1 ()) - () - () - ) - () - ) - (Return)] - (Var 8 _lpython_return_variable) - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 9 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_f_0 - __asr_generic_f_1] - [] - [(Print - () - [(FunctionCall - 2 __asr_generic_f_0 - () - [((IntegerConstant 1 (Integer 4))) - ((IntegerConstant 2 (Integer 4)))] - (Integer 4) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 __asr_generic_f_1 - () - [((StringConstant - "a" - (Character 1 1 ()) - )) - ((StringConstant - "b" - (Character 1 1 ()) - ))] - (Character 1 1 ()) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 __asr_generic_f_1 - () - [((StringConstant - "c" - (Character 1 1 ()) - )) - ((StringConstant - "d" - (Character 1 1 ()) - ))] - (Character 1 1 ()) - () - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - add: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - add - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 3 x) - (Var 3 y)] - [] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_integer: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - add_integer - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x) - (Var 4 y)] - [(= - (Var 4 _lpython_return_variable) - (IntegerBinOp - (Var 4 x) - Add - (Var 4 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_string: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - y: - (Variable - 5 - y - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - add_string - (FunctionType - [(Character 1 -2 ()) - (Character 1 -2 ())] - (Character 1 -2 ()) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 x) - (Var 5 y)] - [(= - (Var 5 _lpython_return_variable) - (StringConcat - (Var 5 x) - (Var 5 y) - (Character 1 -4 ()) - () - ) - () - ) - (Return)] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 6 - { - _lpython_return_variable: - (Variable - 6 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 6 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 6 - y - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 add] - .false. - ) - [add] - [(Var 6 x) - (Var 6 y)] - [(= - (Var 6 _lpython_return_variable) - (FunctionCall - 2 add - () - [((Var 6 x)) - ((Var 6 y))] - (TypeParameter - T - ) - () - () - ) - () - ) - (Return)] - (Var 6 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 10 - { - __main__global_stmts: - (ExternalSymbol - 10 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 10 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-generics_02-e2ea5c9.json b/tests/reference/asr-generics_02-e2ea5c9.json deleted file mode 100644 index e3f76b5d84..0000000000 --- a/tests/reference/asr-generics_02-e2ea5c9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_02-e2ea5c9", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_02.py", - "infile_hash": "8406b1b9329997678ed067f896373fbbf49daeb2e379c700c5c2e917", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-generics_02-e2ea5c9.stdout", - "stdout_hash": "f5a159e575ecf0fdad20418b4106f3da761a8abaf39ed65de2a7b83e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_02-e2ea5c9.stdout b/tests/reference/asr-generics_02-e2ea5c9.stdout deleted file mode 100644 index b6133e896a..0000000000 --- a/tests/reference/asr-generics_02-e2ea5c9.stdout +++ /dev/null @@ -1,411 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_swap_0: - (Function - (SymbolTable - 5 - { - temp: - (Variable - 5 - temp - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - InOut - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 5 - y - [] - InOut - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_swap_0 - (FunctionType - [(Integer 4) - (Integer 4)] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 x) - (Var 5 y)] - [(= - (Var 5 temp) - (Var 5 x) - () - ) - (= - (Var 5 x) - (Var 5 y) - () - ) - (= - (Var 5 y) - (Var 5 temp) - () - ) - (Print - () - [(Var 5 x)] - () - () - ) - (Print - () - [(Var 5 y)] - () - () - )] - () - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b: - (Variable - 4 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_swap_0] - [] - [(= - (Var 4 a) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 4 b) - (IntegerConstant 10 (Integer 4)) - () - ) - (Print - () - [(Var 4 a) - (Var 4 b)] - () - () - ) - (SubroutineCall - 2 __asr_generic_swap_0 - () - [((Var 4 a)) - ((Var 4 b))] - () - ) - (Print - () - [(Var 4 a) - (Var 4 b)] - () - () - )] - () - Public - .false. - .false. - () - ), - swap: - (Function - (SymbolTable - 3 - { - temp: - (Variable - 3 - temp - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - InOut - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - InOut - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - swap - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x) - (Var 3 y)] - [(= - (Var 3 temp) - (Var 3 x) - () - ) - (= - (Var 3 x) - (Var 3 y) - () - ) - (= - (Var 3 y) - (Var 3 temp) - () - ) - (Print - () - [(Var 3 x)] - () - () - ) - (Print - () - [(Var 3 y)] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-generics_array_01-682b1b2.json b/tests/reference/asr-generics_array_01-682b1b2.json deleted file mode 100644 index 2da3a03bc0..0000000000 --- a/tests/reference/asr-generics_array_01-682b1b2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_array_01-682b1b2", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_array_01.py", - "infile_hash": "6e943dd0e26ab4d1ffb6ed6909a365b4135b6f5295957b2478cfb479", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_01-682b1b2.stderr", - "stderr_hash": "07809b586ef30105878e1532461ac0ad302722003d44d2ae71b4cb7a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_01-682b1b2.stderr b/tests/reference/asr-generics_array_01-682b1b2.stderr deleted file mode 100644 index 91024d158c..0000000000 --- a/tests/reference/asr-generics_array_01-682b1b2.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_01.py:2:1 - | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_02-22c8dc1.json b/tests/reference/asr-generics_array_02-22c8dc1.json deleted file mode 100644 index b869c0013e..0000000000 --- a/tests/reference/asr-generics_array_02-22c8dc1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_array_02-22c8dc1", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_array_02.py", - "infile_hash": "54b5f1d4b8fc7543c292ac0d6f7a39939816a657173937fa7dc02f07", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_02-22c8dc1.stderr", - "stderr_hash": "ab2cfe57f54581e673039761ff5a42919ddb665b1083a36342cbe7e1", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stderr b/tests/reference/asr-generics_array_02-22c8dc1.stderr deleted file mode 100644 index 252a42ae21..0000000000 --- a/tests/reference/asr-generics_array_02-22c8dc1.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_02.py:2:1 - | -2 | from numpy import empty, int32, float32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_03-fb3706c.json b/tests/reference/asr-generics_array_03-fb3706c.json deleted file mode 100644 index 128484c0ae..0000000000 --- a/tests/reference/asr-generics_array_03-fb3706c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_array_03-fb3706c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_array_03.py", - "infile_hash": "5b415ae64a527ce3ab3b6878141238e227258bc2b2b8c37af6d23ff5", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_03-fb3706c.stderr", - "stderr_hash": "7d636bddcd76853697423eb36c823f5898b8274b21a62a55f764b63b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_03-fb3706c.stderr b/tests/reference/asr-generics_array_03-fb3706c.stderr deleted file mode 100644 index 873e342ad1..0000000000 --- a/tests/reference/asr-generics_array_03-fb3706c.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_03.py:2:1 - | -2 | from numpy import empty, int32, float32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_error_01-1e05cd6.json b/tests/reference/asr-generics_error_01-1e05cd6.json deleted file mode 100644 index 80dcd03351..0000000000 --- a/tests/reference/asr-generics_error_01-1e05cd6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_error_01-1e05cd6", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/generics_error_01.py", - "infile_hash": "2c26a040a0d03561f54a6af9cdd9db262fa0e9db7a6db2b115f6c4eb", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_error_01-1e05cd6.stderr", - "stderr_hash": "45a4d8fba734f967b36ed69d703fe503111c67dc6c8887013477c791", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_01-1e05cd6.stderr b/tests/reference/asr-generics_error_01-1e05cd6.stderr deleted file mode 100644 index 9d7abb86ef..0000000000 --- a/tests/reference/asr-generics_error_01-1e05cd6.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Inconsistent type variable for the function call - --> tests/errors/generics_error_01.py:12:7 - | -12 | print(f(1,"a")) - | ^^^^^^^^ diff --git a/tests/reference/asr-generics_error_02-d614928.json b/tests/reference/asr-generics_error_02-d614928.json deleted file mode 100644 index 950f37b435..0000000000 --- a/tests/reference/asr-generics_error_02-d614928.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_error_02-d614928", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/generics_error_02.py", - "infile_hash": "0cd9c07bbe28138a3cca57b750b625c528773ac79c36b15e5dc5830a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_error_02-d614928.stderr", - "stderr_hash": "2b82c797067dc1c722d416f8f13d837cfec47a0d4adb11c64f5b7e02", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_02-d614928.stderr b/tests/reference/asr-generics_error_02-d614928.stderr deleted file mode 100644 index 22668c4d18..0000000000 --- a/tests/reference/asr-generics_error_02-d614928.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: No applicable argument to the restriction zero - --> tests/errors/generics_error_02.py:37:7 - | -37 | print(mean(["a","b","c"], add=add_string, div=div_string)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-generics_error_03-208d10d.json b/tests/reference/asr-generics_error_03-208d10d.json deleted file mode 100644 index a5e6b0f007..0000000000 --- a/tests/reference/asr-generics_error_03-208d10d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_error_03-208d10d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/generics_error_03.py", - "infile_hash": "d09e6306de96ad3575262220417ea0af090d29b26c6fceb01e73fd6d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_error_03-208d10d.stderr", - "stderr_hash": "e4803340775b153d9eafeae36cff39a9469260a0e139f0fc41e9317d", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_03-208d10d.stderr b/tests/reference/asr-generics_error_03-208d10d.stderr deleted file mode 100644 index ef155d1bb4..0000000000 --- a/tests/reference/asr-generics_error_03-208d10d.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Restriction mismatch with provided arguments - --> tests/errors/generics_error_03.py:20:1 - 21:16 - | -20 | def add_string(x: i32, y: i32) -> i32: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... -... - | -21 | return x + y - | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-generics_list_01-39c4044.json b/tests/reference/asr-generics_list_01-39c4044.json deleted file mode 100644 index 3171241402..0000000000 --- a/tests/reference/asr-generics_list_01-39c4044.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-generics_list_01-39c4044", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/generics_list_01.py", - "infile_hash": "fee10ba2a43151e515695ea4179e42231e1fd80d7c75637747511144", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-generics_list_01-39c4044.stdout", - "stdout_hash": "1b67e64b1337c59fb1f94f0afe307382c49ce404d59e61fc657c5225", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-generics_list_01-39c4044.stdout b/tests/reference/asr-generics_list_01-39c4044.stdout deleted file mode 100644 index 9344bbb3dc..0000000000 --- a/tests/reference/asr-generics_list_01-39c4044.stdout +++ /dev/null @@ -1,2023 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - T: - (Variable - 2 - T - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - __asr_generic_mean_0: - (Function - (SymbolTable - 17 - { - _lpython_return_variable: - (Variable - 17 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 17 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 17 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - res: - (Variable - 17 - res - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 17 - x - [] - In - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_mean_0 - (FunctionType - [(List - (Integer 4) - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 zero - 2 add - 2 div] - .false. - ) - [empty_integer - add_integer - div_integer] - [(Var 17 x)] - [(= - (Var 17 k) - (ListLen - (Var 17 x) - (Integer 4) - () - ) - () - ) - (If - (IntegerCompare - (Var 17 k) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 17 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - [] - ) - (= - (Var 17 res) - (FunctionCall - 2 empty_integer - () - [((ListItem - (Var 17 x) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - ))] - (Integer 4) - () - () - ) - () - ) - (DoLoop - () - ((Var 17 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 17 k) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 17 res) - (FunctionCall - 2 add_integer - () - [((Var 17 res)) - ((ListItem - (Var 17 x) - (Var 17 i) - (Integer 4) - () - ))] - (Integer 4) - () - () - ) - () - )] - ) - (= - (Var 17 _lpython_return_variable) - (FunctionCall - 2 div_integer - () - [((Var 17 res)) - ((Var 17 k))] - (Real 8) - () - () - ) - () - ) - (Return)] - (Var 17 _lpython_return_variable) - Public - .false. - .false. - () - ), - __asr_generic_mean_1: - (Function - (SymbolTable - 18 - { - _lpython_return_variable: - (Variable - 18 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 18 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 18 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - res: - (Variable - 18 - res - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 18 - x - [] - In - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_mean_1 - (FunctionType - [(List - (Real 8) - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 zero - 2 add - 2 div] - .false. - ) - [empty_float - add_float - div_float] - [(Var 18 x)] - [(= - (Var 18 k) - (ListLen - (Var 18 x) - (Integer 4) - () - ) - () - ) - (If - (IntegerCompare - (Var 18 k) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 18 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - [] - ) - (= - (Var 18 res) - (FunctionCall - 2 empty_float - () - [((ListItem - (Var 18 x) - (IntegerConstant 0 (Integer 4)) - (Real 8) - () - ))] - (Real 8) - () - () - ) - () - ) - (DoLoop - () - ((Var 18 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 18 k) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 18 res) - (FunctionCall - 2 add_float - () - [((Var 18 res)) - ((ListItem - (Var 18 x) - (Var 18 i) - (Real 8) - () - ))] - (Real 8) - () - () - ) - () - )] - ) - (= - (Var 18 _lpython_return_variable) - (FunctionCall - 2 div_float - () - [((Var 18 res)) - ((Var 18 k))] - (Real 8) - () - () - ) - () - ) - (Return)] - (Var 18 _lpython_return_variable) - Public - .false. - .false. - () - ), - __asr_generic_mean_2: - (Function - (SymbolTable - 19 - { - _lpython_return_variable: - (Variable - 19 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 19 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 19 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - res: - (Variable - 19 - res - [] - Local - () - () - Default - (Character 1 1 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 19 - x - [] - In - () - () - Default - (List - (Character 1 1 ()) - ) - () - Source - Public - Required - .false. - ) - }) - __asr_generic_mean_2 - (FunctionType - [(List - (Character 1 1 ()) - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 zero - 2 add - 2 div] - .false. - ) - [empty_string - add_string - div_string] - [(Var 19 x)] - [(= - (Var 19 k) - (ListLen - (Var 19 x) - (Integer 4) - () - ) - () - ) - (If - (IntegerCompare - (Var 19 k) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 19 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - [] - ) - (= - (Var 19 res) - (FunctionCall - 2 empty_string - () - [((ListItem - (Var 19 x) - (IntegerConstant 0 (Integer 4)) - (Character 1 1 ()) - () - ))] - (Character 1 1 ()) - () - () - ) - () - ) - (DoLoop - () - ((Var 19 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 19 k) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 19 res) - (FunctionCall - 2 add_string - () - [((Var 19 res)) - ((ListItem - (Var 19 x) - (Var 19 i) - (Character 1 1 ()) - () - ))] - (Character 1 1 ()) - () - () - ) - () - )] - ) - (= - (Var 19 _lpython_return_variable) - (FunctionCall - 2 div_string - () - [((Var 19 res)) - ((Var 19 k))] - (Real 8) - () - () - ) - () - ) - (Return)] - (Var 19 _lpython_return_variable) - Public - .false. - .false. - () - ), - __main__global_stmts: - (Function - (SymbolTable - 20 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [__asr_generic_mean_0 - __asr_generic_mean_1 - __asr_generic_mean_2] - [] - [(Print - () - [(FunctionCall - 2 __asr_generic_mean_0 - () - [((ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (List - (Integer 4) - ) - ))] - (Real 8) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 __asr_generic_mean_1 - () - [((ListConstant - [(RealConstant - 1.000000 - (Real 8) - ) - (RealConstant - 2.000000 - (Real 8) - ) - (RealConstant - 3.000000 - (Real 8) - )] - (List - (Real 8) - ) - ))] - (Real 8) - () - () - )] - () - () - ) - (Print - () - [(FunctionCall - 2 __asr_generic_mean_2 - () - [((ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ))] - (Real 8) - () - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - add: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - add - (FunctionType - [(TypeParameter - T - ) - (TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 4 x) - (Var 4 y)] - [] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_float: - (Function - (SymbolTable - 10 - { - _lpython_return_variable: - (Variable - 10 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 10 - x - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - y: - (Variable - 10 - y - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - add_float - (FunctionType - [(Real 8) - (Real 8)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 10 x) - (Var 10 y)] - [(= - (Var 10 _lpython_return_variable) - (RealBinOp - (Var 10 x) - Add - (Var 10 y) - (Real 8) - () - ) - () - ) - (Return)] - (Var 10 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_integer: - (Function - (SymbolTable - 7 - { - _lpython_return_variable: - (Variable - 7 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 7 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 7 - y - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - add_integer - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 7 x) - (Var 7 y)] - [(= - (Var 7 _lpython_return_variable) - (IntegerBinOp - (Var 7 x) - Add - (Var 7 y) - (Integer 4) - () - ) - () - ) - (Return)] - (Var 7 _lpython_return_variable) - Public - .false. - .false. - () - ), - add_string: - (Function - (SymbolTable - 13 - { - _lpython_return_variable: - (Variable - 13 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 13 - x - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - y: - (Variable - 13 - y - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - add_string - (FunctionType - [(Character 1 -2 ()) - (Character 1 -2 ())] - (Character 1 -2 ()) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 13 x) - (Var 13 y)] - [(= - (Var 13 _lpython_return_variable) - (StringConcat - (Var 13 x) - (Var 13 y) - (Character 1 -4 ()) - () - ) - () - ) - (Return)] - (Var 13 _lpython_return_variable) - Public - .false. - .false. - () - ), - div: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - k: - (Variable - 5 - k - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - div - (FunctionType - [(TypeParameter - T - ) - (Integer 4)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 5 x) - (Var 5 k)] - [] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ), - div_float: - (Function - (SymbolTable - 11 - { - _lpython_return_variable: - (Variable - 11 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - k: - (Variable - 11 - k - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 11 - x - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - div_float - (FunctionType - [(Real 8) - (Integer 4)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 11 x) - (Var 11 k)] - [(= - (Var 11 _lpython_return_variable) - (RealBinOp - (Var 11 x) - Div - (Cast - (Var 11 k) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (Return)] - (Var 11 _lpython_return_variable) - Public - .false. - .false. - () - ), - div_integer: - (Function - (SymbolTable - 8 - { - _lpython_return_variable: - (Variable - 8 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - k: - (Variable - 8 - k - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 8 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - div_integer - (FunctionType - [(Integer 4) - (Integer 4)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 8 x) - (Var 8 k)] - [(= - (Var 8 _lpython_return_variable) - (RealBinOp - (Cast - (Var 8 x) - IntegerToReal - (Real 8) - () - ) - Div - (Cast - (Var 8 k) - IntegerToReal - (Real 8) - () - ) - (Real 8) - () - ) - () - ) - (Return)] - (Var 8 _lpython_return_variable) - Public - .false. - .false. - () - ), - div_string: - (Function - (SymbolTable - 14 - { - _lpython_return_variable: - (Variable - 14 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - k: - (Variable - 14 - k - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 14 - x - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - div_string - (FunctionType - [(Character 1 -2 ()) - (Integer 4)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 14 x) - (Var 14 k)] - [(= - (Var 14 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - (Var 14 _lpython_return_variable) - Public - .false. - .false. - () - ), - empty_float: - (Function - (SymbolTable - 9 - { - _lpython_return_variable: - (Variable - 9 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 9 - x - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - empty_float - (FunctionType - [(Real 8)] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 9 x)] - [(= - (Var 9 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - (Var 9 _lpython_return_variable) - Public - .false. - .false. - () - ), - empty_integer: - (Function - (SymbolTable - 6 - { - _lpython_return_variable: - (Variable - 6 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 6 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - empty_integer - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 6 x)] - [(= - (Var 6 _lpython_return_variable) - (IntegerConstant 0 (Integer 4)) - () - ) - (Return)] - (Var 6 _lpython_return_variable) - Public - .false. - .false. - () - ), - empty_string: - (Function - (SymbolTable - 12 - { - _lpython_return_variable: - (Variable - 12 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 12 - x - [] - In - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - empty_string - (FunctionType - [(Character 1 -2 ())] - (Character 1 -2 ()) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 12 x)] - [(= - (Var 12 _lpython_return_variable) - (StringConstant - "" - (Character 1 0 ()) - ) - () - ) - (Return)] - (Var 12 _lpython_return_variable) - Public - .false. - .false. - () - ), - mean: - (Function - (SymbolTable - 15 - { - _lpython_return_variable: - (Variable - 15 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 15 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - k: - (Variable - 15 - k - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - res: - (Variable - 15 - res - [] - Local - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 15 - x - [] - In - () - () - Default - (List - (TypeParameter - T - ) - ) - () - Source - Public - Required - .false. - ) - }) - mean - (FunctionType - [(List - (TypeParameter - T - ) - )] - (Real 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [2 zero - 2 add - 2 div] - .false. - ) - [zero - add - div] - [(Var 15 x)] - [(= - (Var 15 k) - (ListLen - (Var 15 x) - (Integer 4) - () - ) - () - ) - (If - (IntegerCompare - (Var 15 k) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 15 _lpython_return_variable) - (RealConstant - 0.000000 - (Real 8) - ) - () - ) - (Return)] - [] - ) - (= - (Var 15 res) - (FunctionCall - 2 zero - () - [((ListItem - (Var 15 x) - (IntegerConstant 0 (Integer 4)) - (TypeParameter - T - ) - () - ))] - (TypeParameter - T - ) - () - () - ) - () - ) - (DoLoop - () - ((Var 15 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (Var 15 k) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 15 res) - (FunctionCall - 2 add - () - [((Var 15 res)) - ((ListItem - (Var 15 x) - (Var 15 i) - (TypeParameter - T - ) - () - ))] - (TypeParameter - T - ) - () - () - ) - () - )] - ) - (= - (Var 15 _lpython_return_variable) - (FunctionCall - 2 div - () - [((Var 15 res)) - ((Var 15 k))] - (Real 8) - () - () - ) - () - ) - (Return)] - (Var 15 _lpython_return_variable) - Public - .false. - .false. - () - ), - zero: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (TypeParameter - T - ) - () - Source - Public - Required - .false. - ) - }) - zero - (FunctionType - [(TypeParameter - T - )] - (TypeParameter - T - ) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .true. - ) - [] - [(Var 3 x)] - [] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 21 - { - __main__global_stmts: - (ExternalSymbol - 21 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 21 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-global_scope1-354e217.json b/tests/reference/asr-global_scope1-354e217.json deleted file mode 100644 index 2f52991153..0000000000 --- a/tests/reference/asr-global_scope1-354e217.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-global_scope1-354e217", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/global_scope1.py", - "infile_hash": "e7b33a2680429ee47d15af5af7c31ac24cc802d18d5566b568fc8ef4", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-global_scope1-354e217.stdout", - "stdout_hash": "a8135cc1724a7d8f68c2d2136484125b8962b707c21873560dbaa04b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-global_scope1-354e217.stdout b/tests/reference/asr-global_scope1-354e217.stdout deleted file mode 100644 index 350c3d4b39..0000000000 --- a/tests/reference/asr-global_scope1-354e217.stdout +++ /dev/null @@ -1,94 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 3 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 2 i) - (IntegerConstant 5 (Integer 4)) - () - )] - () - Public - .false. - .false. - () - ), - i: - (Variable - 2 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - __main__global_stmts: - (ExternalSymbol - 4 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 4 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-global_syms_01-273906f.json b/tests/reference/asr-global_syms_01-273906f.json deleted file mode 100644 index 223ea28a2c..0000000000 --- a/tests/reference/asr-global_syms_01-273906f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-global_syms_01-273906f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/global_syms_01.py", - "infile_hash": "a561c85e452a7be71b45f7b5277fd3ab7ff79fcc596f059f00c9dd45", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-global_syms_01-273906f.stdout", - "stdout_hash": "8a038638305efddca192d6bdb758eb4f5c4e701efc7a21e1cdd14a06", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-global_syms_01-273906f.stdout b/tests/reference/asr-global_syms_01-273906f.stdout deleted file mode 100644 index 317e736a9c..0000000000 --- a/tests/reference/asr-global_syms_01-273906f.stdout +++ /dev/null @@ -1,189 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_global_symbols] - [] - [(= - (Var 2 x) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 2 i) - (ListItem - (Var 2 x) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - ) - () - ) - (SubroutineCall - 2 test_global_symbols - () - [] - () - )] - () - Public - .false. - .false. - () - ), - i: - (Variable - 2 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - test_global_symbols: - (Function - (SymbolTable - 3 - { - - }) - test_global_symbols - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(Assert - (IntegerCompare - (Var 2 i) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (ListItem - (Var 2 x) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - x: - (Variable - 2 - x - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-intent_01-66824bc.json b/tests/reference/asr-intent_01-66824bc.json deleted file mode 100644 index c981754321..0000000000 --- a/tests/reference/asr-intent_01-66824bc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-intent_01-66824bc", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/intent_01.py", - "infile_hash": "0a8fa2940567fccee2cfccd4af40f353b74dbe542590460a195246a5", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-intent_01-66824bc.stdout", - "stdout_hash": "415fb57ee7c986fc49e7c0801edae4e37d6ea06143d27a998c50ab5c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-intent_01-66824bc.stdout b/tests/reference/asr-intent_01-66824bc.stdout deleted file mode 100644 index d668611200..0000000000 --- a/tests/reference/asr-intent_01-66824bc.stdout +++ /dev/null @@ -1,184 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - Foo: - (StructType - (SymbolTable - 3 - { - p: - (Variable - 3 - p - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - Foo - [] - [p] - Source - Public - .false. - .false. - [(())] - () - () - ), - f: - (Function - (SymbolTable - 4 - { - w: - (Variable - 4 - w - [] - Out - () - () - Default - (Array - (Struct - 2 Foo - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4)))] - PointerToDataArray - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - In - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - InOut - () - () - Default - (List - (UnsignedInteger - 4 - ) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Integer 4) - (Real 8) - (List - (UnsignedInteger - 4 - ) - ) - (Array - (Struct - 2 Foo - ) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4)))] - PointerToDataArray - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x) - (Var 4 y) - (Var 4 z) - (Var 4 w)] - [] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 6 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-kwargs_01_error-ab9530d.json b/tests/reference/asr-kwargs_01_error-ab9530d.json deleted file mode 100644 index 6f05aa772d..0000000000 --- a/tests/reference/asr-kwargs_01_error-ab9530d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-kwargs_01_error-ab9530d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/kwargs_01_error.py", - "infile_hash": "101436b7097d29f2b8dc97561054d2ffe33d11ae5a54336813c7dada", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-kwargs_01_error-ab9530d.stderr", - "stderr_hash": "9acb6dea7d63917291858cf2cac49e5270e11ea1dd547f66303224c1", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_01_error-ab9530d.stderr b/tests/reference/asr-kwargs_01_error-ab9530d.stderr deleted file mode 100644 index dbdf5c98eb..0000000000 --- a/tests/reference/asr-kwargs_01_error-ab9530d.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: func01() got multiple values for argument 'a' - --> tests/errors/kwargs_01_error.py:11:5 - | -11 | func01(arg1, a=int(8)) - | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.json b/tests/reference/asr-kwargs_02_error-7c91f8f.json deleted file mode 100644 index bac9cf8743..0000000000 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-kwargs_02_error-7c91f8f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/kwargs_02_error.py", - "infile_hash": "9f131c35f01a18365764a32dee072403fcc283705320ef6703627e5c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-kwargs_02_error-7c91f8f.stderr", - "stderr_hash": "d7988f2217bab99a6e782c6cb63f3d2f505b5d59c8976e4e4fab5042", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr deleted file mode 100644 index 738691275d..0000000000 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/kwargs_02_error.py:4:12 - | -4 | return complex(float(a), b) + c - | ^^^^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-kwargs_03_error-a68cc46.json b/tests/reference/asr-kwargs_03_error-a68cc46.json deleted file mode 100644 index 2b3ac444fa..0000000000 --- a/tests/reference/asr-kwargs_03_error-a68cc46.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-kwargs_03_error-a68cc46", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/kwargs_03_error.py", - "infile_hash": "1cee111472c1f8b7eea276f308ac7a1fea12438606c658bd0757973c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-kwargs_03_error-a68cc46.stderr", - "stderr_hash": "83b858c0d4e17fe2f03b1e47652414c4478d709def5d3fbaa71aad71", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_03_error-a68cc46.stderr b/tests/reference/asr-kwargs_03_error-a68cc46.stderr deleted file mode 100644 index 1a811894e0..0000000000 --- a/tests/reference/asr-kwargs_03_error-a68cc46.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Function func01 doesn't have an argument named 'd' - --> tests/errors/kwargs_03_error.py:11:5 - | -11 | func01(arg1, d=int(8)) - | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-lambda_01-1ec3e01.json b/tests/reference/asr-lambda_01-1ec3e01.json deleted file mode 100644 index 31b51267b2..0000000000 --- a/tests/reference/asr-lambda_01-1ec3e01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-lambda_01-1ec3e01", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/lambda_01.py", - "infile_hash": "0a22dc5de76f7c3f4f97dc4349f62e51261c0a9b3fc5e932926d438e", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-lambda_01-1ec3e01.stderr", - "stderr_hash": "99ca916bd82540da6812ad3149c0026c812efdbc777dbb5fb465e868", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-lambda_01-1ec3e01.stderr b/tests/reference/asr-lambda_01-1ec3e01.stderr deleted file mode 100644 index 482e01b32e..0000000000 --- a/tests/reference/asr-lambda_01-1ec3e01.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: The number of args to lambda function much match the number of args declared in function type - --> tests/errors/lambda_01.py:5:8 - | -5 | x: Callable[[i32, i32, i32], i32] = lambda p, q, r, s: p + q + r + s - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ diff --git a/tests/reference/asr-list1-770ba33.json b/tests/reference/asr-list1-770ba33.json deleted file mode 100644 index 9a3720e721..0000000000 --- a/tests/reference/asr-list1-770ba33.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-list1-770ba33", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/list1.py", - "infile_hash": "9d6b3f1a83a585d5a7a5e50ff5e1ddd15705fce268208d0cc2749514", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-list1-770ba33.stdout", - "stdout_hash": "6b6e9737c184719a7d269490a7fcdfe22f3c1e69d34e20502528f1ac", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-list1-770ba33.stdout b/tests/reference/asr-list1-770ba33.stdout deleted file mode 100644 index 5042167566..0000000000 --- a/tests/reference/asr-list1-770ba33.stdout +++ /dev/null @@ -1,439 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_List: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - a11: - (Variable - 3 - a11 - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - b11: - (Variable - 3 - b11 - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (List - (List - (Integer 4) - ) - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 3 - d - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - e: - (Variable - 3 - e - [] - Local - () - () - Default - (List - (List - (Character 1 -2 ()) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_List - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 3 a) - (ListConstant - [(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)) - )] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 3 b) - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 3 c) - (ListConstant - [(ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - (IntegerConstant 6 (Integer 4))] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - ) - () - ) - (= - (Var 3 d) - (ListItem - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (Var 3 e) - (ListConstant - [(ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (ListConstant - [(StringConstant - "d" - (Character 1 1 ()) - ) - (StringConstant - "e" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - )] - (List - (List - (Character 1 1 ()) - ) - ) - ) - () - ) - (ListAppend - (Var 3 a) - (IntegerConstant 10 (Integer 4)) - ) - (ListRemove - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - ) - (ListInsert - (Var 3 a) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 13 (Integer 4)) - ) - (= - (Var 3 a) - (ListSection - (Var 3 a) - ((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - ()) - (List - (Integer 4) - ) - () - ) - () - ) - (= - (Var 3 d) - (IntrinsicScalarFunction - ListPop - [(Var 3 a)] - 0 - (Integer 4) - () - ) - () - ) - (= - (Var 3 d) - (IntrinsicScalarFunction - ListPop - [(Var 3 a) - (IntegerConstant 2 (Integer 4))] - 1 - (Integer 4) - () - ) - () - ) - (= - (Var 3 a) - (ListConcat - (Var 3 a) - (ListConstant - [(IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4))] - (List - (Integer 4) - ) - ) - (List - (Integer 4) - ) - () - ) - () - ) - (= - (Var 3 a) - (ListConcat - (ListConstant - [(IntegerConstant 6 (Integer 4)) - (IntegerConstant 7 (Integer 4))] - (List - (Integer 4) - ) - ) - (Var 3 a) - (List - (Integer 4) - ) - () - ) - () - ) - (= - (Var 3 a11) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 3 b11) - (ListConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (Assert - (ListCompare - (Var 3 a11) - Eq - (Var 3 b11) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-loop1-10d3109.json b/tests/reference/asr-loop1-10d3109.json deleted file mode 100644 index 5562e043d0..0000000000 --- a/tests/reference/asr-loop1-10d3109.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop1-10d3109", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/loop1.py", - "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-loop1-10d3109.stdout", - "stdout_hash": "25e0882ec286f388253c8fd367e03f135204a71f5550a7f773938ae6", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-loop1-10d3109.stdout b/tests/reference/asr-loop1-10d3109.stdout deleted file mode 100644 index 222dbd43c5..0000000000 --- a/tests/reference/asr-loop1-10d3109.stdout +++ /dev/null @@ -1,604 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 6 - { - i: - (Variable - 6 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - j: - (Variable - 6 - j - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_factorial_1 - test_factorial_2 - test_factorial_3] - [] - [(= - (Var 6 i) - (FunctionCall - 2 test_factorial_1 - () - [((IntegerConstant 4 (Integer 4)))] - (Integer 4) - () - () - ) - () - ) - (= - (Var 6 i) - (FunctionCall - 2 test_factorial_2 - () - [((IntegerConstant 4 (Integer 4)))] - (Integer 4) - () - () - ) - () - ) - (= - (Var 6 j) - (FunctionCall - 2 test_factorial_3 - () - [((IntegerConstant 5 (Integer 4)))] - (Integer 8) - () - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_factorial_1: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 3 - result - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_factorial_1 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x)] - [(If - (IntegerCompare - (Var 3 x) - Lt - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 3 _lpython_return_variable) - (IntegerConstant 0 (Integer 4)) - () - ) - (Return)] - [] - ) - (= - (Var 3 result) - (IntegerConstant 1 (Integer 4)) - () - ) - (WhileLoop - () - (IntegerCompare - (Var 3 x) - Gt - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 3 result) - (IntegerBinOp - (Var 3 result) - Mul - (Var 3 x) - (Integer 4) - () - ) - () - ) - (= - (Var 3 x) - (IntegerBinOp - (Var 3 x) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - )] - ) - (= - (Var 3 _lpython_return_variable) - (Var 3 result) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_factorial_2: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 4 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - result: - (Variable - 4 - result - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_factorial_2 - (FunctionType - [(Integer 4)] - (Integer 4) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x)] - [(= - (Var 4 result) - (IntegerConstant 1 (Integer 4)) - () - ) - (DoLoop - () - ((Var 4 i) - (IntegerConstant 1 (Integer 4)) - (IntegerBinOp - (IntegerBinOp - (Var 4 x) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 4 result) - (IntegerBinOp - (Var 4 result) - Mul - (Var 4 i) - (Integer 4) - () - ) - () - )] - ) - (= - (Var 4 _lpython_return_variable) - (Var 4 result) - () - ) - (Return)] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_factorial_3: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - result: - (Variable - 5 - result - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 5 - x - [] - In - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_factorial_3 - (FunctionType - [(Integer 4)] - (Integer 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 x)] - [(= - (Var 5 result) - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - () - ) - (If - (IntegerCompare - (Var 5 x) - Lt - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 5 _lpython_return_variable) - (Var 5 result) - () - ) - (Return)] - [] - ) - (= - (Var 5 result) - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - () - ) - (WhileLoop - () - (IntegerCompare - (Var 5 x) - Gt - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(= - (Var 5 result) - (IntegerBinOp - (Var 5 result) - Mul - (Cast - (Var 5 x) - IntegerToInteger - (Integer 8) - () - ) - (Integer 8) - () - ) - () - ) - (= - (Var 5 x) - (IntegerBinOp - (Var 5 x) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - )] - ) - (= - (Var 5 _lpython_return_variable) - (Var 5 result) - () - ) - (Return)] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-loop3-a579196.json b/tests/reference/asr-loop3-a579196.json deleted file mode 100644 index fd61395be8..0000000000 --- a/tests/reference/asr-loop3-a579196.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop3-a579196", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/loop3.py", - "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-loop3-a579196.stdout", - "stdout_hash": "871e9f9402932018e5122327d38ca7822eb61596f04e0bdc4e03ad7a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-loop3-a579196.stdout b/tests/reference/asr-loop3-a579196.stdout deleted file mode 100644 index d192935551..0000000000 --- a/tests/reference/asr-loop3-a579196.stdout +++ /dev/null @@ -1,90 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_pass: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_pass - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - () - ) - (WhileLoop - () - (IntegerCompare - (Var 3 a) - Gt - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-loop4-3d3216e.json b/tests/reference/asr-loop4-3d3216e.json deleted file mode 100644 index dacb23ebe6..0000000000 --- a/tests/reference/asr-loop4-3d3216e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop4-3d3216e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/loop4.py", - "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-loop4-3d3216e.stdout", - "stdout_hash": "f74b039f6ca87f2d78637403f0039095208cb96167a72af3ada13690", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-loop4-3d3216e.stdout b/tests/reference/asr-loop4-3d3216e.stdout deleted file mode 100644 index 128265c980..0000000000 --- a/tests/reference/asr-loop4-3d3216e.stdout +++ /dev/null @@ -1,176 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 5 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_for] - [] - [(SubroutineCall - 2 test_for - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_for: - (Function - (SymbolTable - 3 - { - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_for - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(DoLoop - () - ((Var 3 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 10 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 9 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(If - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - [(Cycle - () - )] - [] - ) - (If - (IntegerCompare - (Var 3 i) - Gt - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - [(Exit - () - )] - [] - ) - (If - (IntegerCompare - (Var 3 i) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - [(Stop - () - )] - [] - )] - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 6 - { - __main__global_stmts: - (ExternalSymbol - 6 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 6 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-loop_01-e7aa06a.json b/tests/reference/asr-loop_01-e7aa06a.json deleted file mode 100644 index 943ce68e64..0000000000 --- a/tests/reference/asr-loop_01-e7aa06a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop_01-e7aa06a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/loop_01.py", - "infile_hash": "fd8dbfec9ebfe2be47e713f169a8bba58de81c0d1b8988dcc86523b2", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_01-e7aa06a.stderr", - "stderr_hash": "256fe74af3480ca97b87c1b6f770cee10753e5f097d5a2d79135e736", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-loop_01-e7aa06a.stderr b/tests/reference/asr-loop_01-e7aa06a.stderr deleted file mode 100644 index 1b50246d4c..0000000000 --- a/tests/reference/asr-loop_01-e7aa06a.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in loop start and loop end values, the types must be compatible - --> tests/errors/loop_01.py:5:20 - | -5 | for i in range(15, i16(-1), i16(-1)): - | ^^ ^^^^^^^ type mismatch ('i32' and 'i16') diff --git a/tests/reference/asr-loop_02-5741651.json b/tests/reference/asr-loop_02-5741651.json deleted file mode 100644 index 236ad8ba7a..0000000000 --- a/tests/reference/asr-loop_02-5741651.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop_02-5741651", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/loop_02.py", - "infile_hash": "7d28fdea517343528470d43c64f2759fd202ee66764d2d4ddbe5ea27", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_02-5741651.stderr", - "stderr_hash": "a8262496250102a77a9e5718d40aaf1067fb21a18fb047885aa643ac", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-loop_02-5741651.stderr b/tests/reference/asr-loop_02-5741651.stderr deleted file mode 100644 index c9198f2d37..0000000000 --- a/tests/reference/asr-loop_02-5741651.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in loop start and increment values, the types must be compatible - --> tests/errors/loop_02.py:5:20 - | -5 | for i in range(i16(15), i16(-1), -1): - | ^^^^^^^ ^^ type mismatch ('i16' and 'i32') diff --git a/tests/reference/asr-loop_03-401ab45.json b/tests/reference/asr-loop_03-401ab45.json deleted file mode 100644 index 16313f16a7..0000000000 --- a/tests/reference/asr-loop_03-401ab45.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-loop_03-401ab45", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/loop_03.py", - "infile_hash": "0dce15506e10f77faf350e3e7bf5dc4f39a6723c74f33eeb1f6342bc", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_03-401ab45.stderr", - "stderr_hash": "cc8945240941626554f3ebeecadc96aa4ee6ea80415352dfefce2786", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-loop_03-401ab45.stderr b/tests/reference/asr-loop_03-401ab45.stderr deleted file mode 100644 index f558b6c0fd..0000000000 --- a/tests/reference/asr-loop_03-401ab45.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assignment to loop variable `i` is not allowed - --> tests/errors/loop_03.py:5:9 - | -5 | i=i*10 - | ^ diff --git a/tests/reference/asr-modules_02-ec92e6f.json b/tests/reference/asr-modules_02-ec92e6f.json deleted file mode 100644 index c5fb14dbf6..0000000000 --- a/tests/reference/asr-modules_02-ec92e6f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-modules_02-ec92e6f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/modules_02.py", - "infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-modules_02-ec92e6f.stdout", - "stdout_hash": "20ce6ad550f4e6b83356075795a39dafee13dc48bebf2eaf65d13edd", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-modules_02-ec92e6f.stdout b/tests/reference/asr-modules_02-ec92e6f.stdout deleted file mode 100644 index 7497bd6280..0000000000 --- a/tests/reference/asr-modules_02-ec92e6f.stdout +++ /dev/null @@ -1,283 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (ExternalSymbol - 2 - f - 3 f - modules_02b - [] - f - Public - ), - main0: - (Function - (SymbolTable - 7 - { - x: - (Variable - 7 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(= - (Var 7 x) - (IntegerBinOp - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Add - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Mul - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant 25 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (Var 7 x) - Eq - (IntegerConstant 25 (Integer 4)) - (Logical 4) - () - ) - () - ) - (SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [modules_02b] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ), - modules_02b: - (Module - (SymbolTable - 3 - { - f: - (Function - (SymbolTable - 6 - { - - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 3 g - () - [] - () - ) - (Print - () - [(StringConstant - "f()" - (Character 1 3 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - g: - (ExternalSymbol - 3 - g - 4 g - modules_02c - [] - g - Public - ) - }) - modules_02b - [modules_02c] - .false. - .false. - ), - modules_02c: - (Module - (SymbolTable - 4 - { - g: - (Function - (SymbolTable - 5 - { - - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(Print - () - [(StringConstant - "g()" - (Character 1 3 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - modules_02c - [] - .false. - .false. - ) - }) - [] -) diff --git a/tests/reference/asr-print_02-afbe092.json b/tests/reference/asr-print_02-afbe092.json deleted file mode 100644 index 87677b2e44..0000000000 --- a/tests/reference/asr-print_02-afbe092.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-print_02-afbe092", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/print_02.py", - "infile_hash": "c4513f1b2ab1a2f33a0784fe80b4d32b506c05799b0c920c4f5b0411", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-print_02-afbe092.stdout", - "stdout_hash": "7d720d7ce5e8ce34faf6115b15788289382dd344e4716efc29cb7251", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-print_02-afbe092.stdout b/tests/reference/asr-print_02-afbe092.stdout deleted file mode 100644 index f8435c5c33..0000000000 --- a/tests/reference/asr-print_02-afbe092.stdout +++ /dev/null @@ -1,2957 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 7 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - test_nested_lists - test_nested_lists2 - test_print_list_tuple] - [] - [(SubroutineCall - 2 f - () - [] - () - ) - (SubroutineCall - 2 test_nested_lists - () - [] - () - ) - (SubroutineCall - 2 test_nested_lists2 - () - [] - () - ) - (SubroutineCall - 2 test_print_list_tuple - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 3 - d - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (ListConstant - [(StringConstant - "ab" - (Character 1 2 ()) - ) - (StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "abcd" - (Character 1 4 ()) - )] - (List - (Character 1 2 ()) - ) - ) - () - ) - (= - (Var 3 b) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 3 c) - (ListConstant - [(RealConstant - 1.230000 - (Real 8) - ) - (RealConstant - 324.300000 - (Real 8) - ) - (RealConstant - 56.431000 - (Real 8) - ) - (RealConstant - 90.500000 - (Real 8) - ) - (RealConstant - 34.100000 - (Real 8) - )] - (List - (Real 8) - ) - ) - () - ) - (= - (Var 3 d) - (ListConstant - [] - (List - (Integer 4) - ) - ) - () - ) - (Print - () - [(Var 3 a)] - () - () - ) - (Print - () - [(Var 3 b)] - () - () - ) - (Print - () - [(Var 3 c)] - () - () - ) - (Print - () - [(Var 3 d)] - () - () - ) - (Print - () - [(Var 3 a) - (Var 3 a) - (Var 3 b) - (Var 3 c) - (Var 3 d)] - () - () - ) - (Print - () - [(Var 3 a) - (Var 3 a) - (IntegerConstant 1 (Integer 4)) - (Var 3 b) - (Var 3 c) - (RealConstant - 1.100000 - (Real 8) - ) - (Var 3 d)] - () - () - ) - (Print - () - [(ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 0 (Integer 4))] - (List - (Integer 4) - ) - )] - () - () - ) - (Print - () - [(ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "d" - (Character 1 1 ()) - ) - (StringConstant - "e" - (Character 1 1 ()) - ) - (StringConstant - "f" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - )] - () - () - ) - (Print - () - [(ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - (Var 3 a) - (Var 3 c)] - () - () - )] - () - Public - .false. - .false. - () - ), - test_nested_lists: - (Function - (SymbolTable - 4 - { - w: - (Variable - 4 - w - [] - Local - () - () - Default - (List - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (List - (List - (List - (Integer 4) - ) - ) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (List - (List - (Real 8) - ) - ) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - Local - () - () - Default - (List - (List - (Character 1 -2 ()) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_nested_lists - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 w) - (ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 2.130000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 98.170000 - (Real 8) - ) - (Real 8) - (RealConstant - -98.170000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 1.110000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - )] - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - )] - (List - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - ) - () - ) - (= - (Var 4 x) - (ListConstant - [(ListConstant - [(ListConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - )] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (IntegerConstant 5 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 5 (Integer 4))] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - ) - (ListConstant - [(ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 2 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - )] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - )] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - )] - (List - (List - (List - (Integer 4) - ) - ) - ) - ) - () - ) - (= - (Var 4 y) - (ListConstant - [(ListConstant - [(RealConstant - 3.140000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 1.001200 - (Real 8) - ) - (Real 8) - (RealConstant - -1.001200 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 2.380000 - (Real 8) - ) - (Real 8) - (RealConstant - -2.380000 - (Real 8) - ) - ) - (RealConstant - 5.510000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - () - ) - (= - (Var 4 z) - (ListConstant - [(ListConstant - [(StringConstant - "bat" - (Character 1 3 ()) - ) - (StringConstant - "ball" - (Character 1 4 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "cat" - (Character 1 3 ()) - ) - (StringConstant - "dog" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "c++" - (Character 1 3 ()) - ) - (StringConstant - "java" - (Character 1 4 ()) - ) - (StringConstant - "python" - (Character 1 6 ()) - )] - (List - (Character 1 1 ()) - ) - )] - (List - (List - (Character 1 3 ()) - ) - ) - ) - () - ) - (Print - () - [(Var 4 w)] - () - () - ) - (Print - () - [(Var 4 x)] - () - () - ) - (Print - () - [(Var 4 y)] - () - () - ) - (Print - () - [(Var 4 z)] - () - () - )] - () - Public - .false. - .false. - () - ), - test_nested_lists2: - (Function - (SymbolTable - 6 - { - p: - (Variable - 6 - p - [] - Local - () - () - Default - (List - (List - (Integer 4) - ) - ) - () - Source - Public - Required - .false. - ), - q: - (Variable - 6 - q - [] - Local - () - () - Default - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - Source - Public - Required - .false. - ), - r: - (Variable - 6 - r - [] - Local - () - () - Default - (List - (List - (List - (Character 1 -2 ()) - ) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_nested_lists2 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 p) - (ListConstant - [(ListConstant - [(IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - (IntegerConstant 6 (Integer 4)) - (IntegerConstant 7 (Integer 4)) - (IntegerConstant 8 (Integer 4)) - (IntegerConstant 9 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 10 (Integer 4)) - (IntegerConstant 11 (Integer 4)) - (IntegerConstant 12 (Integer 4)) - (IntegerConstant 13 (Integer 4)) - (IntegerConstant 14 (Integer 4)) - (IntegerConstant 15 (Integer 4)) - (IntegerConstant 16 (Integer 4)) - (IntegerConstant 17 (Integer 4)) - (IntegerConstant 18 (Integer 4)) - (IntegerConstant 19 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 20 (Integer 4)) - (IntegerConstant 21 (Integer 4)) - (IntegerConstant 22 (Integer 4)) - (IntegerConstant 23 (Integer 4)) - (IntegerConstant 24 (Integer 4)) - (IntegerConstant 25 (Integer 4)) - (IntegerConstant 26 (Integer 4)) - (IntegerConstant 27 (Integer 4)) - (IntegerConstant 28 (Integer 4)) - (IntegerConstant 29 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 30 (Integer 4)) - (IntegerConstant 31 (Integer 4)) - (IntegerConstant 32 (Integer 4)) - (IntegerConstant 33 (Integer 4)) - (IntegerConstant 34 (Integer 4)) - (IntegerConstant 35 (Integer 4)) - (IntegerConstant 36 (Integer 4)) - (IntegerConstant 37 (Integer 4)) - (IntegerConstant 38 (Integer 4)) - (IntegerConstant 39 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 40 (Integer 4)) - (IntegerConstant 41 (Integer 4)) - (IntegerConstant 42 (Integer 4)) - (IntegerConstant 43 (Integer 4)) - (IntegerConstant 44 (Integer 4)) - (IntegerConstant 45 (Integer 4)) - (IntegerConstant 46 (Integer 4)) - (IntegerConstant 47 (Integer 4)) - (IntegerConstant 48 (Integer 4)) - (IntegerConstant 49 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 50 (Integer 4)) - (IntegerConstant 51 (Integer 4)) - (IntegerConstant 52 (Integer 4)) - (IntegerConstant 53 (Integer 4)) - (IntegerConstant 54 (Integer 4)) - (IntegerConstant 55 (Integer 4)) - (IntegerConstant 56 (Integer 4)) - (IntegerConstant 57 (Integer 4)) - (IntegerConstant 58 (Integer 4)) - (IntegerConstant 59 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 60 (Integer 4)) - (IntegerConstant 61 (Integer 4)) - (IntegerConstant 62 (Integer 4)) - (IntegerConstant 63 (Integer 4)) - (IntegerConstant 64 (Integer 4)) - (IntegerConstant 65 (Integer 4)) - (IntegerConstant 66 (Integer 4)) - (IntegerConstant 67 (Integer 4)) - (IntegerConstant 68 (Integer 4)) - (IntegerConstant 69 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 70 (Integer 4)) - (IntegerConstant 71 (Integer 4)) - (IntegerConstant 72 (Integer 4)) - (IntegerConstant 73 (Integer 4)) - (IntegerConstant 74 (Integer 4)) - (IntegerConstant 75 (Integer 4)) - (IntegerConstant 76 (Integer 4)) - (IntegerConstant 77 (Integer 4)) - (IntegerConstant 78 (Integer 4)) - (IntegerConstant 79 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 80 (Integer 4)) - (IntegerConstant 81 (Integer 4)) - (IntegerConstant 82 (Integer 4)) - (IntegerConstant 83 (Integer 4)) - (IntegerConstant 84 (Integer 4)) - (IntegerConstant 85 (Integer 4)) - (IntegerConstant 86 (Integer 4)) - (IntegerConstant 87 (Integer 4)) - (IntegerConstant 88 (Integer 4)) - (IntegerConstant 89 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 90 (Integer 4)) - (IntegerConstant 91 (Integer 4)) - (IntegerConstant 92 (Integer 4)) - (IntegerConstant 93 (Integer 4)) - (IntegerConstant 94 (Integer 4)) - (IntegerConstant 95 (Integer 4)) - (IntegerConstant 96 (Integer 4)) - (IntegerConstant 97 (Integer 4)) - (IntegerConstant 98 (Integer 4)) - (IntegerConstant 99 (Integer 4))] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - ) - () - ) - (= - (Var 6 q) - (ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 74.550000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 77.640000 - (Real 8) - ) - (Real 8) - (RealConstant - -77.640000 - (Real 8) - ) - ) - (RealConstant - 52.350000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 78.250000 - (Real 8) - ) - (Real 8) - (RealConstant - -78.250000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 19.240000 - (Real 8) - ) - (Real 8) - (RealConstant - -19.240000 - (Real 8) - ) - ) - (RealConstant - 81.380000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 7.860000 - (Real 8) - ) - (RealConstant - 12.110000 - (Real 8) - ) - (RealConstant - 27.500000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 98.930000 - (Real 8) - ) - (Real 8) - (RealConstant - -98.930000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 79.620000 - (Real 8) - ) - (Real 8) - (RealConstant - -79.620000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 73.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -73.760000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 42.050000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 90.290000 - (Real 8) - ) - (Real 8) - (RealConstant - -90.290000 - (Real 8) - ) - ) - (RealConstant - 69.950000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 59.320000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 70.780000 - (Real 8) - ) - (Real 8) - (RealConstant - -70.780000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 53.220000 - (Real 8) - ) - (Real 8) - (RealConstant - -53.220000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 53.520000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 93.880000 - (Real 8) - ) - (Real 8) - (RealConstant - -93.880000 - (Real 8) - ) - ) - (RealConstant - 49.650000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 2.180000 - (Real 8) - ) - (RealConstant - 19.910000 - (Real 8) - ) - (RealConstant - 69.240000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 78.510000 - (Real 8) - ) - (RealConstant - 89.690000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 86.680000 - (Real 8) - ) - (Real 8) - (RealConstant - -86.680000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 92.480000 - (Real 8) - ) - (Real 8) - (RealConstant - -92.480000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 80.750000 - (Real 8) - ) - (Real 8) - (RealConstant - -80.750000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 27.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -27.760000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 13.350000 - (Real 8) - ) - (Real 8) - (RealConstant - -13.350000 - (Real 8) - ) - ) - (RealConstant - 12.280000 - (Real 8) - ) - (RealConstant - 79.610000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 48.480000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 10.490000 - (Real 8) - ) - (Real 8) - (RealConstant - -10.490000 - (Real 8) - ) - ) - (RealConstant - 41.100000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 20.330000 - (Real 8) - ) - (RealConstant - 14.520000 - (Real 8) - ) - (RealConstant - 82.560000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 57.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -57.760000 - (Real 8) - ) - ) - (RealConstant - 76.030000 - (Real 8) - ) - (RealConstant - 67.330000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 21.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -21.500000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 11.920000 - (Real 8) - ) - (Real 8) - (RealConstant - -11.920000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 31.840000 - (Real 8) - ) - (Real 8) - (RealConstant - -31.840000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 9.650000 - (Real 8) - ) - (RealConstant - 11.150000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 36.580000 - (Real 8) - ) - (Real 8) - (RealConstant - -36.580000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 56.550000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 70.850000 - (Real 8) - ) - (Real 8) - (RealConstant - -70.850000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 50.670000 - (Real 8) - ) - (Real 8) - (RealConstant - -50.670000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 94.630000 - (Real 8) - ) - (RealConstant - 25.680000 - (Real 8) - ) - (RealConstant - 89.300000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 28.530000 - (Real 8) - ) - (RealConstant - 71.220000 - (Real 8) - ) - (RealConstant - 71.870000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 58.390000 - (Real 8) - ) - (Real 8) - (RealConstant - -58.390000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 6.960000 - (Real 8) - ) - (Real 8) - (RealConstant - -6.960000 - (Real 8) - ) - ) - (RealConstant - 42.980000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 8.950000 - (Real 8) - ) - (Real 8) - (RealConstant - -8.950000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 75.090000 - (Real 8) - ) - (Real 8) - (RealConstant - -75.090000 - (Real 8) - ) - ) - (RealConstant - 37.960000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 31.750000 - (Real 8) - ) - (Real 8) - (RealConstant - -31.750000 - (Real 8) - ) - ) - (RealConstant - 67.330000 - (Real 8) - ) - (RealConstant - 58.170000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 64.010000 - (Real 8) - ) - (Real 8) - (RealConstant - -64.010000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 9.220000 - (Real 8) - ) - (Real 8) - (RealConstant - -9.220000 - (Real 8) - ) - ) - (RealConstant - 9.590000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 15.710000 - (Real 8) - ) - (RealConstant - 82.360000 - (Real 8) - ) - (RealConstant - 51.180000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 100.290000 - (Real 8) - ) - (Real 8) - (RealConstant - -100.290000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 32.720000 - (Real 8) - ) - (Real 8) - (RealConstant - -32.720000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 54.940000 - (Real 8) - ) - (Real 8) - (RealConstant - -54.940000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 0.320000 - (Real 8) - ) - (Real 8) - (RealConstant - -0.320000 - (Real 8) - ) - ) - (RealConstant - 68.810000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 55.090000 - (Real 8) - ) - (Real 8) - (RealConstant - -55.090000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 97.280000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 28.200000 - (Real 8) - ) - (Real 8) - (RealConstant - -28.200000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 62.610000 - (Real 8) - ) - (Real 8) - (RealConstant - -62.610000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - )] - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - () - ) - (= - (Var 6 r) - (ListConstant - [(ListConstant - [(ListConstant - [(StringConstant - "Io" - (Character 1 2 ()) - ) - (StringConstant - "tl" - (Character 1 2 ()) - ) - (StringConstant - "bLvjV" - (Character 1 5 ()) - ) - (StringConstant - "wjFKQ" - (Character 1 5 ()) - ) - (StringConstant - "lY2" - (Character 1 3 ()) - )] - (List - (Character 1 2 ()) - ) - ) - (ListConstant - [(StringConstant - "Be2l6bqE" - (Character 1 8 ()) - ) - (StringConstant - "pQER3utIXA" - (Character 1 10 ()) - ) - (StringConstant - "llZBJj5Cdu" - (Character 1 10 ()) - ) - (StringConstant - "C8" - (Character 1 2 ()) - ) - (StringConstant - "gwTr77PdYR" - (Character 1 10 ()) - )] - (List - (Character 1 8 ()) - ) - ) - (ListConstant - [(StringConstant - "4M6L" - (Character 1 4 ()) - ) - (StringConstant - "ktPdowqERy" - (Character 1 10 ()) - ) - (StringConstant - "KSifqTkR" - (Character 1 8 ()) - ) - (StringConstant - "ZE2p1N78f1" - (Character 1 10 ()) - ) - (StringConstant - "Mi5e87Xw" - (Character 1 8 ()) - )] - (List - (Character 1 4 ()) - ) - ) - (ListConstant - [(StringConstant - "uwfzqDq9g" - (Character 1 9 ()) - ) - (StringConstant - "QaM1s" - (Character 1 5 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "LB" - (Character 1 2 ()) - )] - (List - (Character 1 9 ()) - ) - ) - (ListConstant - [(StringConstant - "OJFRY6k" - (Character 1 7 ()) - ) - (StringConstant - "iz7Oie" - (Character 1 6 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "LUYLF" - (Character 1 5 ()) - ) - (StringConstant - "JBND5FuV7l" - (Character 1 10 ()) - )] - (List - (Character 1 7 ()) - ) - )] - (List - (List - (Character 1 2 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "m" - (Character 1 1 ()) - ) - (StringConstant - "WIQBQfV" - (Character 1 7 ()) - ) - (StringConstant - "jxjDrqxu" - (Character 1 8 ()) - ) - (StringConstant - "kea" - (Character 1 3 ()) - ) - (StringConstant - "mu" - (Character 1 2 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "GI8aOwLMe" - (Character 1 9 ()) - ) - (StringConstant - "Y5m8" - (Character 1 4 ()) - ) - (StringConstant - "a02Rz" - (Character 1 5 ()) - ) - (StringConstant - "xNKCJ" - (Character 1 5 ()) - )] - (List - (Character 1 0 ()) - ) - ) - (ListConstant - [(StringConstant - "LzkhyiJQHP" - (Character 1 10 ()) - ) - (StringConstant - "uzc3xyoXL" - (Character 1 9 ()) - ) - (StringConstant - "sKGnYfpRy" - (Character 1 9 ()) - ) - (StringConstant - "7x" - (Character 1 2 ()) - ) - (StringConstant - "WTVKrnPO" - (Character 1 8 ()) - )] - (List - (Character 1 10 ()) - ) - ) - (ListConstant - [(StringConstant - "TZa6" - (Character 1 4 ()) - ) - (StringConstant - "GXRuyRX" - (Character 1 7 ()) - ) - (StringConstant - "R" - (Character 1 1 ()) - ) - (StringConstant - "JQxS" - (Character 1 4 ()) - ) - (StringConstant - "OH" - (Character 1 2 ()) - )] - (List - (Character 1 4 ()) - ) - ) - (ListConstant - [(StringConstant - "bSVJZ1OQ" - (Character 1 8 ()) - ) - (StringConstant - "M" - (Character 1 1 ()) - ) - (StringConstant - "I9omlF" - (Character 1 6 ()) - ) - (StringConstant - "x7FR" - (Character 1 4 ()) - ) - (StringConstant - "XtpL" - (Character 1 4 ()) - )] - (List - (Character 1 8 ()) - ) - )] - (List - (List - (Character 1 1 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "DKOpK" - (Character 1 5 ()) - ) - (StringConstant - "eg8Nz" - (Character 1 5 ()) - ) - (StringConstant - "ru" - (Character 1 2 ()) - ) - (StringConstant - "Sj" - (Character 1 2 ()) - ) - (StringConstant - "YUDxyI" - (Character 1 6 ()) - )] - (List - (Character 1 5 ()) - ) - ) - (ListConstant - [(StringConstant - "Q5uyhvp" - (Character 1 7 ()) - ) - (StringConstant - "Ydx" - (Character 1 3 ()) - ) - (StringConstant - "p" - (Character 1 1 ()) - ) - (StringConstant - "DLM5RX" - (Character 1 6 ()) - ) - (StringConstant - "pwOujxCO" - (Character 1 8 ()) - )] - (List - (Character 1 7 ()) - ) - ) - (ListConstant - [(StringConstant - "s5GOWnNJV" - (Character 1 9 ()) - ) - (StringConstant - "af" - (Character 1 2 ()) - ) - (StringConstant - "KAkD" - (Character 1 4 ()) - ) - (StringConstant - "4IIZK" - (Character 1 5 ()) - ) - (StringConstant - "JQK040x" - (Character 1 7 ()) - )] - (List - (Character 1 9 ()) - ) - ) - (ListConstant - [(StringConstant - "9vF" - (Character 1 3 ()) - ) - (StringConstant - "9pc7R8v" - (Character 1 7 ()) - ) - (StringConstant - "nDReIU7" - (Character 1 7 ()) - ) - (StringConstant - "K" - (Character 1 1 ()) - ) - (StringConstant - "btn" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "wVeivkdi" - (Character 1 8 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "C" - (Character 1 1 ()) - )] - (List - (Character 1 0 ()) - ) - )] - (List - (List - (Character 1 5 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "vNTtcRXD" - (Character 1 8 ()) - ) - (StringConstant - "rsi" - (Character 1 3 ()) - ) - (StringConstant - "YsoF7mZD" - (Character 1 8 ()) - ) - (StringConstant - "VrPXU50rgA" - (Character 1 10 ()) - ) - (StringConstant - "mG7zqN0G" - (Character 1 8 ()) - )] - (List - (Character 1 8 ()) - ) - ) - (ListConstant - [(StringConstant - "la7cJ" - (Character 1 5 ()) - ) - (StringConstant - "M5rLJ8Go" - (Character 1 8 ()) - ) - (StringConstant - "gb" - (Character 1 2 ()) - ) - (StringConstant - "FjKwYZ7E" - (Character 1 8 ()) - ) - (StringConstant - "uSPD" - (Character 1 4 ()) - )] - (List - (Character 1 5 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "oOa79jWcMx" - (Character 1 10 ()) - ) - (StringConstant - "yyAYZZ" - (Character 1 6 ()) - ) - (StringConstant - "wbvggXm" - (Character 1 7 ()) - ) - (StringConstant - "aE3BkCL4" - (Character 1 8 ()) - )] - (List - (Character 1 0 ()) - ) - ) - (ListConstant - [(StringConstant - "RdP" - (Character 1 3 ()) - ) - (StringConstant - "Hwc0x9RZ" - (Character 1 8 ()) - ) - (StringConstant - "sy" - (Character 1 2 ()) - ) - (StringConstant - "9" - (Character 1 1 ()) - ) - (StringConstant - "W1d9xA2BXe" - (Character 1 10 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "A" - (Character 1 1 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "QnK" - (Character 1 3 ()) - ) - (StringConstant - "N5tzN" - (Character 1 5 ()) - ) - (StringConstant - "ou7Lp" - (Character 1 5 ()) - )] - (List - (Character 1 1 ()) - ) - )] - (List - (List - (Character 1 8 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "DL68rDF" - (Character 1 7 ()) - ) - (StringConstant - "v" - (Character 1 1 ()) - ) - (StringConstant - "kQ3Mxm" - (Character 1 6 ()) - ) - (StringConstant - "g" - (Character 1 1 ()) - ) - (StringConstant - "6KTeF4Eo" - (Character 1 8 ()) - )] - (List - (Character 1 7 ()) - ) - ) - (ListConstant - [(StringConstant - "Hx9" - (Character 1 3 ()) - ) - (StringConstant - "Y1IzQm85Z4" - (Character 1 10 ()) - ) - (StringConstant - "3D8" - (Character 1 3 ()) - ) - (StringConstant - "ZLZ5" - (Character 1 4 ()) - ) - (StringConstant - "rWn" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "LtT" - (Character 1 3 ()) - ) - (StringConstant - "Dh5B" - (Character 1 4 ()) - ) - (StringConstant - "M" - (Character 1 1 ()) - ) - (StringConstant - "F" - (Character 1 1 ()) - ) - (StringConstant - "QTARbY" - (Character 1 6 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "Sh" - (Character 1 2 ()) - ) - (StringConstant - "WL" - (Character 1 2 ()) - ) - (StringConstant - "yvAfWvZSx1" - (Character 1 10 ()) - ) - (StringConstant - "90yx" - (Character 1 4 ()) - ) - (StringConstant - "v" - (Character 1 1 ()) - )] - (List - (Character 1 2 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "7IBW" - (Character 1 4 ()) - ) - (StringConstant - "nI" - (Character 1 2 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "6Cbp5c8RT" - (Character 1 9 ()) - )] - (List - (Character 1 0 ()) - ) - )] - (List - (List - (Character 1 7 ()) - ) - ) - )] - (List - (List - (List - (Character 1 2 ()) - ) - ) - ) - ) - () - ) - (Print - () - [(Var 6 p)] - () - () - ) - (Print - () - [(Var 6 q)] - () - () - ) - (Print - () - [(Var 6 r)] - () - () - )] - () - Public - .false. - .false. - () - ), - test_print_list_tuple: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - Local - () - () - Default - (List - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Tuple - [(List - (Character 1 -2 ()) - ) - (List - (Integer 4) - ) - (Real 8)] - ) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 5 - b1 - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 5 - b2 - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (List - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_print_list_tuple - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 a) - (ListConstant - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 5 (Integer 4)) - (IntegerConstant 6 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - )] - (List - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - ) - () - ) - (= - (Var 5 c) - (ListConstant - [(ListConstant - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (StringConstant - "a" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - (TupleConstant - [(IntegerConstant 2 (Integer 4)) - (StringConstant - "b" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - )] - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - ) - (ListConstant - [(TupleConstant - [(IntegerConstant 3 (Integer 4)) - (StringConstant - "c" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - (TupleConstant - [(IntegerConstant 4 (Integer 4)) - (StringConstant - "d" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - )] - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - )] - (List - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - ) - ) - () - ) - (= - (Var 5 b1) - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "bb" - (Character 1 2 ()) - ) - (StringConstant - "ccc" - (Character 1 3 ()) - ) - (StringConstant - "dddd" - (Character 1 4 ()) - ) - (StringConstant - "eeeee" - (Character 1 5 ()) - )] - (List - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 5 b2) - (ListConstant - [(IntegerConstant 10 (Integer 4)) - (IntegerConstant 20 (Integer 4)) - (IntegerConstant 30 (Integer 4)) - (IntegerConstant 40 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 5 b) - (TupleConstant - [(Var 5 b1) - (Var 5 b2) - (RealConstant - 6.030500 - (Real 8) - )] - (Tuple - [(List - (Character 1 -2 ()) - ) - (List - (Integer 4) - ) - (Real 8)] - ) - ) - () - ) - (Print - () - [(Var 5 a) - (Var 5 b)] - () - () - ) - (Print - () - [(Var 5 c) - (Var 5 b1) - (Var 5 b2) - (RealConstant - 3.420000 - (Real 8) - ) - (StringConstant - "okay" - (Character 1 4 ()) - ) - (LogicalConstant - .true. - (Logical 4) - ) - (IntegerConstant 14483 (Integer 4))] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-print_list_tuple_03-9de3736.json b/tests/reference/asr-print_list_tuple_03-9de3736.json deleted file mode 100644 index 74cc19ed51..0000000000 --- a/tests/reference/asr-print_list_tuple_03-9de3736.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-print_list_tuple_03-9de3736", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/print_list_tuple_03.py", - "infile_hash": "5131d7b6049e22c278ad41494969ff1f70c1dc811313032a9fcf58f3", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-print_list_tuple_03-9de3736.stdout", - "stdout_hash": "bc2f13615265f5b0339b735e2dfb39050221bf4dc5c026f118259d7e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-print_list_tuple_03-9de3736.stdout b/tests/reference/asr-print_list_tuple_03-9de3736.stdout deleted file mode 100644 index aff4796d0e..0000000000 --- a/tests/reference/asr-print_list_tuple_03-9de3736.stdout +++ /dev/null @@ -1,244 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Dict - (Integer 4) - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Dict - (Integer 4) - (List - (Integer 4) - ) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (DictConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - )] - (Dict - (Integer 4) - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - ) - () - ) - (= - (Var 3 y) - (DictConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - [(ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - )] - (Dict - (Integer 4) - (List - (Integer 4) - ) - ) - ) - () - ) - (Print - () - [(DictItem - (Var 3 x) - (IntegerConstant 1 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (DictItem - (Var 3 x) - (IntegerConstant 2 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (DictItem - (Var 3 y) - (IntegerConstant 1 (Integer 4)) - () - (List - (Integer 4) - ) - () - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-set1-b7b913a.json b/tests/reference/asr-set1-b7b913a.json deleted file mode 100644 index 3f8600d01f..0000000000 --- a/tests/reference/asr-set1-b7b913a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-set1-b7b913a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/set1.py", - "infile_hash": "63b5dc6a1f9c17099f1b10c8c45fcac1e50319ca8efbf7c283060abb", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-set1-b7b913a.stdout", - "stdout_hash": "5cedd001b9359adb6bbe66fb49cbbcdb2b13fbc5eae198660c91a996", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-set1-b7b913a.stdout b/tests/reference/asr-set1-b7b913a.stdout deleted file mode 100644 index ed54f5debe..0000000000 --- a/tests/reference/asr-set1-b7b913a.stdout +++ /dev/null @@ -1,186 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_Set: - (Function - (SymbolTable - 3 - { - a: - (Variable - 3 - a - [] - Local - () - () - Default - (Set - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Set - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_Set - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (SetConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (Set - (Integer 4) - ) - ) - () - ) - (= - (Var 3 a) - (SetConstant - [(IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - (IntegerConstant 5 (Integer 4))] - (Set - (Integer 4) - ) - ) - () - ) - (Expr - (IntrinsicScalarFunction - SetAdd - [(Var 3 a) - (IntegerConstant 9 (Integer 4))] - 0 - () - () - ) - ) - (Expr - (IntrinsicScalarFunction - SetRemove - [(Var 3 a) - (IntegerConstant 4 (Integer 4))] - 0 - () - () - ) - ) - (= - (Var 3 b) - (SetConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - )] - (Set - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 3 s) - (SetPop - (Var 3 b) - (Character 1 -2 ()) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-string_01-78629c4.json b/tests/reference/asr-string_01-78629c4.json deleted file mode 100644 index 8cf78f4a79..0000000000 --- a/tests/reference/asr-string_01-78629c4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-string_01-78629c4", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/string_01.py", - "infile_hash": "92496679f4475e3351686f6556f0e68411437beed22a447f9a65bfdf", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-string_01-78629c4.stderr", - "stderr_hash": "29aa01d7370a20ada91bdb13c569434f36a0c18309700d946d89fbf0", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-string_01-78629c4.stderr b/tests/reference/asr-string_01-78629c4.stderr deleted file mode 100644 index 4abe3b2eb9..0000000000 --- a/tests/reference/asr-string_01-78629c4.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in index, expected a single integer or slice - --> tests/errors/string_01.py:3:13 - | -3 | print(x[2, 5]) - | ^^^^ type mismatch (found: 'tuple[i32, i32]', expected: 'i32' or slice) diff --git a/tests/reference/asr-string_02-499c9ff.json b/tests/reference/asr-string_02-499c9ff.json deleted file mode 100644 index 4eaad46910..0000000000 --- a/tests/reference/asr-string_02-499c9ff.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-string_02-499c9ff", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/string_02.py", - "infile_hash": "ed6511565e893791a4bd8ea0b4750817bab13cd6dc0731332127bf58", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-string_02-499c9ff.stderr", - "stderr_hash": "85593e60baa6c6f930b7486a92e41fac9943108966abdacb7acb39ef", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-string_02-499c9ff.stderr b/tests/reference/asr-string_02-499c9ff.stderr deleted file mode 100644 index 7ca613cb8c..0000000000 --- a/tests/reference/asr-string_02-499c9ff.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/string_02.py:6:15 - | -6 | res:str = x.join(p) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-structs_01-0893e35.json b/tests/reference/asr-structs_01-0893e35.json deleted file mode 100644 index b415cd4e5b..0000000000 --- a/tests/reference/asr-structs_01-0893e35.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_01-0893e35", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_01.py", - "infile_hash": "9342dd6345fb71bbbfb1c41e643530c58493758d08774f838b1c85e0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_01-0893e35.stderr", - "stderr_hash": "6f58b337cbc9cb1832e2ecba47fdad4b64e4484b913e29f61c64dbea", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-0893e35.stderr b/tests/reference/asr-structs_01-0893e35.stderr deleted file mode 100644 index 12892d04eb..0000000000 --- a/tests/reference/asr-structs_01-0893e35.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Alignment 5 is not a positive power of 2. - --> tests/errors/structs_01.py:3:17 - | -3 | @packed(aligned=5) - | ^ diff --git a/tests/reference/asr-structs_01-66dc2c9.json b/tests/reference/asr-structs_01-66dc2c9.json deleted file mode 100644 index d82e944dc9..0000000000 --- a/tests/reference/asr-structs_01-66dc2c9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_01-66dc2c9", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/structs_01.py", - "infile_hash": "3b94e692a074b226736f068daf39c876f113277a73468bd21c01d3cc", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_01-66dc2c9.stdout", - "stdout_hash": "7996e199fb4e186baf6f87ea3e596a417bcc23ab748eaffa82c89a65", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-66dc2c9.stdout b/tests/reference/asr-structs_01-66dc2c9.stdout deleted file mode 100644 index f93e577681..0000000000 --- a/tests/reference/asr-structs_01-66dc2c9.stdout +++ /dev/null @@ -1,190 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - S: - (StructType - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - S - [] - [x - y] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main0] - [] - [(SubroutineCall - 2 main0 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - main0: - (Function - (SymbolTable - 4 - { - s: - (Variable - 4 - s - [] - Local - () - () - Default - (Struct - 2 S - ) - () - Source - Public - Required - .false. - ) - }) - main0 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 s) - (StructTypeConstructor - 2 S - [((IntegerConstant 2 (Integer 4))) - (())] - (Struct - 2 S - ) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-structs_01-be14d49.json b/tests/reference/asr-structs_01-be14d49.json deleted file mode 100644 index 72184b64bf..0000000000 --- a/tests/reference/asr-structs_01-be14d49.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_01-be14d49", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_01.py", - "infile_hash": "9f36a4abcc3a50ccc10df1f6b04998b7a20041853142c85a2e86b724", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_01-be14d49.stdout", - "stdout_hash": "218ab5e7739164434c7c772962ada9767d7294eabe2a6878facf4e76", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-be14d49.stdout b/tests/reference/asr-structs_01-be14d49.stdout deleted file mode 100644 index a368f08a0f..0000000000 --- a/tests/reference/asr-structs_01-be14d49.stdout +++ /dev/null @@ -1,535 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [y - x] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 2 g - () - [] - () - )] - () - Public - .false. - .false. - () - ), - change_struct: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - InOut - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ) - }) - change_struct - (FunctionType - [(Struct - 2 A - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 a)] - [(= - (StructInstanceMember - (Var 5 a) - 3 x - (Integer 4) - () - ) - (IntegerBinOp - (StructInstanceMember - (Var 5 a) - 3 x - (Integer 4) - () - ) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (StructInstanceMember - (Var 5 a) - 3 y - (Real 4) - () - ) - (RealBinOp - (StructInstanceMember - (Var 5 a) - 3 y - (Real 4) - () - ) - Add - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToReal - (Real 4) - (RealConstant - 1.000000 - (Real 4) - ) - ) - (Real 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - In - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Struct - 2 A - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 a)] - [(Print - () - [(StructInstanceMember - (Var 4 a) - 3 x - (Integer 4) - () - )] - () - () - ) - (Print - () - [(StructInstanceMember - (Var 4 a) - 3 y - (Real 4) - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 6 - { - x: - (Variable - 6 - x - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - change_struct] - [] - [(= - (Var 6 x) - (StructTypeConstructor - 2 A - [((Cast - (RealConstant - 3.250000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.250000 - (Real 4) - ) - )) - ((IntegerConstant 3 (Integer 4)))] - (Struct - 2 A - ) - () - ) - () - ) - (SubroutineCall - 2 f - () - [((Var 6 x))] - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 6 x) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 6 x) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 3.250000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (StructInstanceMember - (Var 6 x) - 3 x - (Integer 4) - () - ) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (StructInstanceMember - (Var 6 x) - 3 y - (Real 4) - () - ) - (Cast - (RealConstant - 5.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.500000 - (Real 4) - ) - ) - () - ) - (SubroutineCall - 2 f - () - [((Var 6 x))] - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 6 x) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 6 x) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 5.500000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (SubroutineCall - 2 change_struct - () - [((Var 6 x))] - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 6 x) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 6 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 6 x) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 6.500000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-structs_02-2ab459a.json b/tests/reference/asr-structs_02-2ab459a.json deleted file mode 100644 index 86b6a594f9..0000000000 --- a/tests/reference/asr-structs_02-2ab459a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_02-2ab459a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_02.py", - "infile_hash": "281bc75fb743f18fb6f011b278d7ab8103cc688f5856a59cb1f54895", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_02-2ab459a.stdout", - "stdout_hash": "0b6313bb78db340840b2865b32eac8165152b998c834c91c569bf78f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_02-2ab459a.stdout b/tests/reference/asr-structs_02-2ab459a.stdout deleted file mode 100644 index 035867aff5..0000000000 --- a/tests/reference/asr-structs_02-2ab459a.stdout +++ /dev/null @@ -1,403 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [x - y] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 7 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 2 g - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - In - () - () - Default - (CPtr) - () - BindC - Public - Required - .true. - ), - a1: - (Variable - 4 - a1 - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 4 - a2 - [] - Local - () - () - Default - (Pointer - (Struct - 2 A - ) - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(CPtr)] - () - BindC - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 a)] - [(= - (Var 4 a1) - (StructTypeConstructor - 2 A - [((IntegerConstant 3 (Integer 4))) - ((Cast - (RealConstant - 3.250000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.250000 - (Real 4) - ) - ))] - (Struct - 2 A - ) - () - ) - () - ) - (= - (Var 4 a2) - (GetPointer - (Var 4 a1) - (Pointer - (Struct - 2 A - ) - ) - () - ) - () - ) - (Print - () - [(Var 4 a2) - (GetPointer - (Var 4 a1) - (Pointer - (Struct - 2 A - ) - ) - () - )] - () - () - ) - (= - (Var 4 x) - (StructInstanceMember - (Var 4 a2) - 3 x - (Integer 4) - () - ) - () - ) - (= - (Var 4 y) - (StructInstanceMember - (Var 4 a2) - 3 y - (Real 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 x) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (Var 4 y) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 3.250000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 5 - { - b: - (Variable - 5 - b - [] - Local - () - () - Default - (CPtr) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(= - (Var 5 b) - (PointerNullConstant - (CPtr) - ) - () - ) - (SubroutineCall - 2 f - () - [((Var 5 b))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 8 - { - __main__global_stmts: - (ExternalSymbol - 8 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 8 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-structs_02-f95782c.json b/tests/reference/asr-structs_02-f95782c.json deleted file mode 100644 index c7ea7537c1..0000000000 --- a/tests/reference/asr-structs_02-f95782c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_02-f95782c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_02.py", - "infile_hash": "bc4446b7b96cad60bb368378e7af4a8f628bfaaecac2063a1bec5c06", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_02-f95782c.stderr", - "stderr_hash": "832411f3c9770493283e58b9017703a7d1cd178f42a19da6f8a38571", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_02-f95782c.stderr b/tests/reference/asr-structs_02-f95782c.stderr deleted file mode 100644 index e087537e57..0000000000 --- a/tests/reference/asr-structs_02-f95782c.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: `s` must be initialized with an instance of struct S - --> tests/errors/structs_02.py:8:5 - | -8 | s: S - | ^^^^ diff --git a/tests/reference/asr-structs_03-0cef911.json b/tests/reference/asr-structs_03-0cef911.json deleted file mode 100644 index e57082150f..0000000000 --- a/tests/reference/asr-structs_03-0cef911.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_03-0cef911", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_03.py", - "infile_hash": "dbd0eac675f958a27a7a4e4a7de3b04402073ecd2d483df75f51eb80", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_03-0cef911.stdout", - "stdout_hash": "b2a00a060603229dc89344c1f93407c95b95ef9980a64171d19aeb57", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_03-0cef911.stdout b/tests/reference/asr-structs_03-0cef911.stdout deleted file mode 100644 index ed733a3e3c..0000000000 --- a/tests/reference/asr-structs_03-0cef911.stdout +++ /dev/null @@ -1,384 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [x - y] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 7 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 2 g - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 4 - { - pa: - (Variable - 4 - pa - [] - In - () - () - Default - (Pointer - (Struct - 2 A - ) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Pointer - (Struct - 2 A - ) - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 pa)] - [(Print - () - [(StructInstanceMember - (Var 4 pa) - 3 x - (Integer 4) - () - )] - () - () - ) - (Print - () - [(StructInstanceMember - (Var 4 pa) - 3 y - (Real 4) - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 5 - { - x: - (Variable - 5 - x - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - xp: - (Variable - 5 - xp - [] - Local - () - () - Default - (Pointer - (Struct - 2 A - ) - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(= - (Var 5 x) - (StructTypeConstructor - 2 A - [((IntegerConstant 3 (Integer 4))) - ((Cast - (RealConstant - 3.250000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.250000 - (Real 4) - ) - ))] - (Struct - 2 A - ) - () - ) - () - ) - (= - (Var 5 xp) - (GetPointer - (Var 5 x) - (Pointer - (Struct - 2 A - ) - ) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 5 xp) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 5 xp) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 3.250000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (StructInstanceMember - (Var 5 xp) - 3 x - (Integer 4) - () - ) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (StructInstanceMember - (Var 5 xp) - 3 y - (Real 4) - () - ) - (Cast - (RealConstant - 5.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.500000 - (Real 4) - ) - ) - () - ) - (SubroutineCall - 2 f - () - [((Var 5 xp))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 8 - { - __main__global_stmts: - (ExternalSymbol - 8 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 8 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-structs_03-754fb64.json b/tests/reference/asr-structs_03-754fb64.json deleted file mode 100644 index 7050595260..0000000000 --- a/tests/reference/asr-structs_03-754fb64.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_03-754fb64", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_03.py", - "infile_hash": "19180d0a7a22141e74e61452cc6cc185f1dd1c4f4315446450ce98db", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_03-754fb64.stderr", - "stderr_hash": "c6410f9948863d922cb0a0cd36613c529ad45fdf556d393d36e2df07", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_03-754fb64.stderr b/tests/reference/asr-structs_03-754fb64.stderr deleted file mode 100644 index 2a1c1c0d91..0000000000 --- a/tests/reference/asr-structs_03-754fb64.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Member 'y' not found in struct - --> tests/errors/structs_03.py:8:14 - | -8 | s: S = S(y=2) - | ^^^ diff --git a/tests/reference/asr-structs_04-387747b.json b/tests/reference/asr-structs_04-387747b.json deleted file mode 100644 index d09bcbac44..0000000000 --- a/tests/reference/asr-structs_04-387747b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_04-387747b", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_04.py", - "infile_hash": "1e20c2ac044ab88183c50ecb481ac7c50992ed622f8bb94772c6df25", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_04-387747b.stdout", - "stdout_hash": "09d05bf16bc1779c18c3bd66defec27c181a2115e9a0e52affaaf17c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_04-387747b.stdout b/tests/reference/asr-structs_04-387747b.stdout deleted file mode 100644 index eff3d9f9de..0000000000 --- a/tests/reference/asr-structs_04-387747b.stdout +++ /dev/null @@ -1,648 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [y - x] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - B: - (StructType - (SymbolTable - 4 - { - a: - (Variable - 4 - a - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - B - [A] - [z - a] - Source - Public - .false. - .false. - [(()) - ((StructTypeConstructor - 2 A - [((Cast - (RealConstant - 0.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000000 - (Real 4) - ) - )) - ((IntegerConstant 0 (Integer 4)))] - (Struct - 2 A - ) - () - ))] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 9 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [g] - [] - [(SubroutineCall - 2 g - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 5 - { - b: - (Variable - 5 - b - [] - In - () - () - Default - (Struct - 2 B - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [(Struct - 2 B - )] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 b)] - [(Print - () - [(StructInstanceMember - (Var 5 b) - 4 z - (Integer 4) - () - ) - (StructInstanceMember - (StructInstanceMember - (Var 5 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 x - (Integer 4) - () - ) - (StructInstanceMember - (StructInstanceMember - (Var 5 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 y - (Real 4) - () - )] - () - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 5 b) - 4 z - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (StructInstanceMember - (Var 5 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (StructInstanceMember - (Var 5 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 3.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - g: - (Function - (SymbolTable - 6 - { - a1: - (Variable - 6 - a1 - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 6 - a2 - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 6 - b - [] - Local - () - () - Default - (Struct - 2 B - ) - () - Source - Public - Required - .false. - ) - }) - g - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(= - (Var 6 a1) - (StructTypeConstructor - 2 A - [((Cast - (RealConstant - 1.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.000000 - (Real 4) - ) - )) - ((IntegerConstant 1 (Integer 4)))] - (Struct - 2 A - ) - () - ) - () - ) - (= - (Var 6 a2) - (StructTypeConstructor - 2 A - [((Cast - (RealConstant - 2.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 2.000000 - (Real 4) - ) - )) - ((IntegerConstant 2 (Integer 4)))] - (Struct - 2 A - ) - () - ) - () - ) - (= - (Var 6 b) - (StructTypeConstructor - 2 B - [((IntegerConstant 1 (Integer 4))) - ((Var 6 a1))] - (Struct - 2 B - ) - () - ) - () - ) - (= - (StructInstanceMember - (Var 6 b) - 4 a - (Struct - 2 A - ) - () - ) - (Var 6 a2) - () - ) - (= - (StructInstanceMember - (Var 6 b) - 4 z - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (StructInstanceMember - (StructInstanceMember - (Var 6 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 x - (Integer 4) - () - ) - (IntegerConstant 2 (Integer 4)) - () - ) - (= - (StructInstanceMember - (StructInstanceMember - (Var 6 b) - 4 a - (Struct - 2 A - ) - () - ) - 3 y - (Real 4) - () - ) - (Cast - (RealConstant - 3.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.000000 - (Real 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 6 a1) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 6 a1) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 1.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 6 a2) - 3 x - (Integer 4) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (StructInstanceMember - (Var 6 a2) - 3 y - (Real 4) - () - ) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 2.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (SubroutineCall - 2 f - () - [((Var 6 b))] - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 10 - { - __main__global_stmts: - (ExternalSymbol - 10 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 10 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-structs_04-7b864bc.json b/tests/reference/asr-structs_04-7b864bc.json deleted file mode 100644 index c188040d2f..0000000000 --- a/tests/reference/asr-structs_04-7b864bc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_04-7b864bc", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_04.py", - "infile_hash": "5951c49d2d7f143bbe3d67b982770ceb6d709939eb2d5ed544888f16", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_04-7b864bc.stderr", - "stderr_hash": "e4e04a1a30ae38b6587c4c3ad12a7e83839c63938c025a3884f62ef8", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_04-7b864bc.stderr b/tests/reference/asr-structs_04-7b864bc.stderr deleted file mode 100644 index 906b24c606..0000000000 --- a/tests/reference/asr-structs_04-7b864bc.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: S() got multiple values for argument 'x' - --> tests/errors/structs_04.py:9:18 - | -9 | s: S = S(24, x=2) - | ^^^ diff --git a/tests/reference/asr-structs_05-fa98307.json b/tests/reference/asr-structs_05-fa98307.json deleted file mode 100644 index e493825921..0000000000 --- a/tests/reference/asr-structs_05-fa98307.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_05-fa98307", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_05.py", - "infile_hash": "ef1037b0936a63be679efd366920a94463900e80630a070ba440aa78", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_05-fa98307.stderr", - "stderr_hash": "9425960bac284eae21adb4274aa833960c505abd6bd546f896da0216", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_05-fa98307.stderr b/tests/reference/asr-structs_05-fa98307.stderr deleted file mode 100644 index ffff18de12..0000000000 --- a/tests/reference/asr-structs_05-fa98307.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/structs_05.py:2:1 - | -2 | from numpy import empty - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-structs_06-6e14537.json b/tests/reference/asr-structs_06-6e14537.json deleted file mode 100644 index 7ef7f9dd33..0000000000 --- a/tests/reference/asr-structs_06-6e14537.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_06-6e14537", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_06.py", - "infile_hash": "9f4273c5fb4469837f65003255dcdca067c5c17735d0642757fd069c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_06-6e14537.stderr", - "stderr_hash": "8e0da9c7e84854ce3d6ad79066a9fbb33d82c9fcde3af2a7baeccec8", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_06-6e14537.stderr b/tests/reference/asr-structs_06-6e14537.stderr deleted file mode 100644 index 55d07bfb5e..0000000000 --- a/tests/reference/asr-structs_06-6e14537.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Struct constructor has more arguments than the number of struct members - --> tests/errors/structs_06.py:9:12 - | -9 | s: S = S(2, 3, 4, 5) - | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_07-83694b7.json b/tests/reference/asr-structs_07-83694b7.json deleted file mode 100644 index 4c07fec19b..0000000000 --- a/tests/reference/asr-structs_07-83694b7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_07-83694b7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_07.py", - "infile_hash": "4e4f15d47dc5d9cdadd653567f6d105365b7fe20b194663c10b3802a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_07-83694b7.stderr", - "stderr_hash": "6b1e1646f11ee384e5dce1ded0d91751f7113eaea7c90da5c1bcf4ff", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_07-83694b7.stderr b/tests/reference/asr-structs_07-83694b7.stderr deleted file mode 100644 index 13f0aaf0e1..0000000000 --- a/tests/reference/asr-structs_07-83694b7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Not enough arguments to S(), expected 2 - --> tests/errors/structs_07.py:9:12 - | -9 | s: S = S(y=2) - | ^^^^^^ diff --git a/tests/reference/asr-structs_08-fa4dbf0.json b/tests/reference/asr-structs_08-fa4dbf0.json deleted file mode 100644 index 8f133e95a8..0000000000 --- a/tests/reference/asr-structs_08-fa4dbf0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_08-fa4dbf0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_08.py", - "infile_hash": "7779919c90170eb5236c4eeef19bf673996fda618ee8c600b5ecba94", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_08-fa4dbf0.stderr", - "stderr_hash": "cf488d893463c941c43080cebb56591bd17c5bed4cb7acd97353d59a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_08-fa4dbf0.stderr b/tests/reference/asr-structs_08-fa4dbf0.stderr deleted file mode 100644 index 89af7c314c..0000000000 --- a/tests/reference/asr-structs_08-fa4dbf0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Struct constructor has more arguments than the number of struct members - --> tests/errors/structs_08.py:13:29 - | -13 | test_dude3 : StringIO = StringIO(integer_asr, 3, 5, 2) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_09-f3ffe08.json b/tests/reference/asr-structs_09-f3ffe08.json deleted file mode 100644 index 0af164202d..0000000000 --- a/tests/reference/asr-structs_09-f3ffe08.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_09-f3ffe08", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_09.py", - "infile_hash": "06fb179f0c0c41124ffc960676a9f32cfe112ab4e39c6f6a7cb2a6e3", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_09-f3ffe08.stderr", - "stderr_hash": "f59ab2d213f6423e0a891e43d5a19e83d4405391b1c7bf481b4b939e", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_09-f3ffe08.stderr b/tests/reference/asr-structs_09-f3ffe08.stderr deleted file mode 100644 index c7265fdddc..0000000000 --- a/tests/reference/asr-structs_09-f3ffe08.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: read not present in StringIO dataclass - --> tests/errors/structs_09.py:13:23 - | -13 | bytes_read: i32 = fd.read() - | ^^^^^^^^^ diff --git a/tests/reference/asr-structs_10-cb8a283.json b/tests/reference/asr-structs_10-cb8a283.json deleted file mode 100644 index 6420f7ba94..0000000000 --- a/tests/reference/asr-structs_10-cb8a283.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_10-cb8a283", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/structs_10.py", - "infile_hash": "3959983b756a75ff1711fa9501d33a283a511aae48dd9922ecf7ae20", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_10-cb8a283.stderr", - "stderr_hash": "2b88127fdbc0c9e3798569cdfa4ef5745d6fce6aeba8fc3f6a1ace9f", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_10-cb8a283.stderr b/tests/reference/asr-structs_10-cb8a283.stderr deleted file mode 100644 index 757e06a54e..0000000000 --- a/tests/reference/asr-structs_10-cb8a283.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Struct member functions are not supported - --> tests/errors/structs_10.py:7:5 - 8:24 - | -7 | def print_len(self: StringIO): - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... -... - | -8 | print(self._len) - | ...^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_16-44de89a.json b/tests/reference/asr-structs_16-44de89a.json deleted file mode 100644 index 76232fcc54..0000000000 --- a/tests/reference/asr-structs_16-44de89a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-structs_16-44de89a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_16.py", - "infile_hash": "e87ea0ba10cb7fcd6ce2eb6d2e953a26dcd6a843f6cf4e891287dcb1", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-structs_16-44de89a.stdout", - "stdout_hash": "9ebf9426938d92178b3a8fdca450859753b0299d3b2b8cb48272469e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-structs_16-44de89a.stdout b/tests/reference/asr-structs_16-44de89a.stdout deleted file mode 100644 index 3e13df611d..0000000000 --- a/tests/reference/asr-structs_16-44de89a.stdout +++ /dev/null @@ -1,327 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - B: - (UnionType - (SymbolTable - 4 - { - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - B - [] - [x - y] - Source - Public - [(()) - (())] - () - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Union - 3 B - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [b - c] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_ordering] - [] - [(SubroutineCall - 2 test_ordering - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_ordering: - (Function - (SymbolTable - 5 - { - A_B: - (ExternalSymbol - 5 - A_B - 3 B - A - [] - B - Public - ), - ad: - (Variable - 5 - ad - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - bd: - (Variable - 5 - bd - [] - Local - () - () - Default - (Union - 5 A_B - ) - () - Source - Public - Required - .false. - ) - }) - test_ordering - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 bd) - (UnionTypeConstructor - 5 A_B - [] - (Union - 5 A_B - ) - () - ) - () - ) - (= - (UnionInstanceMember - (Var 5 bd) - 4 x - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 5 ad) - (StructTypeConstructor - 2 A - [((Var 5 bd)) - ((IntegerConstant 2 (Integer 4)))] - (Struct - 2 A - ) - () - ) - () - ) - (Assert - (IntegerCompare - (UnionInstanceMember - (StructInstanceMember - (Var 5 ad) - 3 b - (Union - 3 B - ) - () - ) - 4 x - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 5 ad) - 3 c - (Integer 4) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-subscript1-1acfc19.json b/tests/reference/asr-subscript1-1acfc19.json deleted file mode 100644 index acbacd1973..0000000000 --- a/tests/reference/asr-subscript1-1acfc19.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-subscript1-1acfc19", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/subscript1.py", - "infile_hash": "5d229893d3e13ea4463e8ed47eb3798be0b8c28f5ef6b6c773e87b80", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-subscript1-1acfc19.stdout", - "stdout_hash": "cf02a18790b0e93084fa3adbaebdf78297064cc0575c946d00584151", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-subscript1-1acfc19.stdout b/tests/reference/asr-subscript1-1acfc19.stdout deleted file mode 100644 index 9b615dffe7..0000000000 --- a/tests/reference/asr-subscript1-1acfc19.stdout +++ /dev/null @@ -1,335 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_subscript: - (Function - (SymbolTable - 3 - { - A: - (Variable - 3 - A - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - B: - (Variable - 3 - B - [] - Local - () - () - Default - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 2 (Integer 4)))] - FixedSizeArray - ) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_subscript - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (StringConstant - "abc" - (Character 1 3 ()) - ) - () - ) - (= - (Var 3 s) - (StringItem - (Var 3 s) - (IntegerBinOp - (IntegerConstant 0 (Integer 4)) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - () - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - () - () - () - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - () - () - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - () - () - (IntegerConstant 2 (Integer 4)) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 88 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - () - (IntegerConstant 1 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 4 (Integer 4)) - (Integer 4) - (IntegerConstant -4 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - (IntegerUnaryMinus - (IntegerConstant 89 (Integer 4)) - (Integer 4) - (IntegerConstant -89 (Integer 4)) - ) - () - (IntegerConstant 4 (Integer 4)) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 s) - (StringSection - (Var 3 s) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - () - (Character 1 -2 ()) - () - ) - () - ) - (= - (Var 3 i) - (ArrayItem - (Var 3 A) - [(() - (IntegerConstant 0 (Integer 4)) - ())] - (Integer 4) - RowMajor - () - ) - () - ) - (= - (Var 3 B) - (ArraySection - (Var 3 A) - [((IntegerConstant 1 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - ())] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - ) - (= - (Var 3 B) - (ArraySection - (Var 3 A) - [((IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)))] - (Array - (Integer 4) - [((IntegerConstant 0 (Integer 4)) - (IntegerConstant 5 (Integer 4)))] - FixedSizeArray - ) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-test_annassign_01-2f18669.json b/tests/reference/asr-test_annassign_01-2f18669.json deleted file mode 100644 index a922445397..0000000000 --- a/tests/reference/asr-test_annassign_01-2f18669.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_annassign_01-2f18669", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_annassign_01.py", - "infile_hash": "68f667b69b25d6a5f7f281a6dc7f2e2912511d8f4f20dbeab8442436", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_annassign_01-2f18669.stderr", - "stderr_hash": "f3609cdad6bdb1be4a138587d5d36d0a28b71e4e51bb1304c2d2a01f", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_01-2f18669.stderr b/tests/reference/asr-test_annassign_01-2f18669.stderr deleted file mode 100644 index 7e8898e7ff..0000000000 --- a/tests/reference/asr-test_annassign_01-2f18669.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unsupported type annotation: Optional - --> tests/errors/test_annassign_01.py:2:8 - | -2 | a: Optional[i32] = 5 - | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_02-accf6db.json b/tests/reference/asr-test_annassign_02-accf6db.json deleted file mode 100644 index 0538c63237..0000000000 --- a/tests/reference/asr-test_annassign_02-accf6db.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_annassign_02-accf6db", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_annassign_02.py", - "infile_hash": "419ee1ffc46f3b9fd99f008d4fdde20f4cc65cf82bbd234ad9fcc005", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_annassign_02-accf6db.stderr", - "stderr_hash": "3a426fad190cfcadc94dd971acc709446147d8a63658953bfbb94771", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_02-accf6db.stderr b/tests/reference/asr-test_annassign_02-accf6db.stderr deleted file mode 100644 index 1cde913460..0000000000 --- a/tests/reference/asr-test_annassign_02-accf6db.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unsupported type annotation: Pattern - --> tests/errors/test_annassign_02.py:2:15 - | -2 | hex_pat : Pattern[str] = r'-?0[xX]+' - | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_03-f8c6160.json b/tests/reference/asr-test_annassign_03-f8c6160.json deleted file mode 100644 index 43585bc3b4..0000000000 --- a/tests/reference/asr-test_annassign_03-f8c6160.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_annassign_03-f8c6160", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_annassign_03.py", - "infile_hash": "aa787a87881a62595216dd4a7710bcf598550c100dda789794eb3c07", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_annassign_03-f8c6160.stderr", - "stderr_hash": "e87d692cc8404a7e66f41d61635f318e20003991138c3db5a0794884", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_03-f8c6160.stderr b/tests/reference/asr-test_annassign_03-f8c6160.stderr deleted file mode 100644 index 5a89637eb4..0000000000 --- a/tests/reference/asr-test_annassign_03-f8c6160.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Intent annotation 'InOut' cannot be used here - --> tests/errors/test_annassign_03.py:6:13 - | -6 | lexer : InOut[LasrLexer] = LasrLexer(5) - | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json deleted file mode 100644 index b9527150ed..0000000000 --- a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_annassign_type_mismatch-7dac7be", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_annassign_type_mismatch.py", - "infile_hash": "ada18a04b70771754e17e884cfa2ec7bd5651d88850ae034049ec7b9", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_annassign_type_mismatch-7dac7be.stderr", - "stderr_hash": "26fc89f95c7dda5f1d9c3cb1af9843880cf693eb7b97125372b11f80", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr deleted file mode 100644 index 6fd7b199ea..0000000000 --- a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/test_annassign_type_mismatch.py:4:5 - | -4 | x: i32[4] = [1, 2, 3, 4] - | ^ ^^^^^^^^^^^^ type mismatch ('i32[4]' and 'list[i32]') diff --git a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json deleted file mode 100644 index 2bb48c32dd..0000000000 --- a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_annassign_type_mismatch2-fc883f7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_annassign_type_mismatch2.py", - "infile_hash": "40a5b3f96c7d228110c29dbb56eb03390c8741550408295a2e82d7b0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_annassign_type_mismatch2-fc883f7.stderr", - "stderr_hash": "873b4521e2155bc92405db41e7745a4fb5441b5d80f94467d7b1b637", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr deleted file mode 100644 index 2a4f9ccd10..0000000000 --- a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/test_annassign_type_mismatch2.py:4:5 - | -4 | x: f64[5] = [1.0, 2.0, 3.0, 4.0, 5.0] - | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('f64[5]' and 'list[f64]') diff --git a/tests/reference/asr-test_append_type_mismatch-030e9c7.json b/tests/reference/asr-test_append_type_mismatch-030e9c7.json deleted file mode 100644 index e2edd78183..0000000000 --- a/tests/reference/asr-test_append_type_mismatch-030e9c7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_append_type_mismatch-030e9c7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_append_type_mismatch.py", - "infile_hash": "d545fce3cd501b0c1bbf3f4a705a68a6f66356e4e6f9806dd0c4c9da", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_append_type_mismatch-030e9c7.stderr", - "stderr_hash": "6610c87a3c164e9cc8884eaf66397658c311199814689ebd4793c92a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr b/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr deleted file mode 100644 index a860db8a46..0000000000 --- a/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in 'append', the types must be compatible - --> tests/errors/test_append_type_mismatch.py:6:14 - | -6 | l.append('a') - | ^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_assign1-a94d41e.json b/tests/reference/asr-test_assign1-a94d41e.json deleted file mode 100644 index 35e6aa7403..0000000000 --- a/tests/reference/asr-test_assign1-a94d41e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign1-a94d41e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign1.py", - "infile_hash": "597bccf2544fb5784bec1648830e4c4ae337bf6280768569125ee0b1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign1-a94d41e.stderr", - "stderr_hash": "cb4455d360373e13730d3a9fd5e2c551bd0f6640d066ceafd8841f9b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign1-a94d41e.stderr b/tests/reference/asr-test_assign1-a94d41e.stderr deleted file mode 100644 index abd1f376fa..0000000000 --- a/tests/reference/asr-test_assign1-a94d41e.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_assign1.py:6:5 - | -6 | a = b - | ^ ^ type mismatch ('list[i32]' and 'list[str]') diff --git a/tests/reference/asr-test_assign2-fa29029.json b/tests/reference/asr-test_assign2-fa29029.json deleted file mode 100644 index 4603aee52e..0000000000 --- a/tests/reference/asr-test_assign2-fa29029.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign2-fa29029", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign2.py", - "infile_hash": "8bc6b05310146f174ce0e1810d03b78ca671a0fabf6699acda9043c8", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign2-fa29029.stderr", - "stderr_hash": "55f02e505bda066604eb94cec8bdc5081c7ec25e219f0ea46851100a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign2-fa29029.stderr b/tests/reference/asr-test_assign2-fa29029.stderr deleted file mode 100644 index 6a0fbd1522..0000000000 --- a/tests/reference/asr-test_assign2-fa29029.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_assign2.py:6:5 - | -6 | a = b - | ^ ^ type mismatch ('set[i32]' and 'set[str]') diff --git a/tests/reference/asr-test_assign3-cc6fc9d.json b/tests/reference/asr-test_assign3-cc6fc9d.json deleted file mode 100644 index 5db5f77a33..0000000000 --- a/tests/reference/asr-test_assign3-cc6fc9d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign3-cc6fc9d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign3.py", - "infile_hash": "4280362df6bea670ff1eddb1afc62ed80438c822bc204ff8759434fe", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign3-cc6fc9d.stderr", - "stderr_hash": "cff7850ce5507a70e7c730dd1ff23d16f8839dedac07d5b60a73a8b8", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign3-cc6fc9d.stderr b/tests/reference/asr-test_assign3-cc6fc9d.stderr deleted file mode 100644 index abec0f4c51..0000000000 --- a/tests/reference/asr-test_assign3-cc6fc9d.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_assign3.py:6:5 - | -6 | a = b - | ^ ^ type mismatch ('list[i32]' and 'set[i32]') diff --git a/tests/reference/asr-test_assign4-a2136e0.json b/tests/reference/asr-test_assign4-a2136e0.json deleted file mode 100644 index e09dfa9249..0000000000 --- a/tests/reference/asr-test_assign4-a2136e0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign4-a2136e0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign4.py", - "infile_hash": "9e1e5ce063f88194008db998896cebd0fabe6dcb4cbda27c17de27da", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign4-a2136e0.stderr", - "stderr_hash": "a871819fb4bd2139f16a7407208ea210276e5b12c9f13ae442132483", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign4-a2136e0.stderr b/tests/reference/asr-test_assign4-a2136e0.stderr deleted file mode 100644 index 43d32d2933..0000000000 --- a/tests/reference/asr-test_assign4-a2136e0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assigning integer to float is not supported - --> tests/errors/test_assign4.py:7:9 - | -7 | f = x - | ^ diff --git a/tests/reference/asr-test_assign5-694a98f.json b/tests/reference/asr-test_assign5-694a98f.json deleted file mode 100644 index 312c85ffed..0000000000 --- a/tests/reference/asr-test_assign5-694a98f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign5-694a98f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign5.py", - "infile_hash": "41144111ae3dad56feed42b1b148334a8faef310fbbabde10f3af8df", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign5-694a98f.stderr", - "stderr_hash": "172b2f13e9b7670cbdd718452713fb15ed4bcd19f6193d328e459fbe", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign5-694a98f.stderr b/tests/reference/asr-test_assign5-694a98f.stderr deleted file mode 100644 index 0847cb828c..0000000000 --- a/tests/reference/asr-test_assign5-694a98f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_assign5.py:6:5 - | -6 | x = y - | ^ ^ type mismatch ('list[list[i32]]' and 'list[list[str]]') diff --git a/tests/reference/asr-test_assign6-05cd64f.json b/tests/reference/asr-test_assign6-05cd64f.json deleted file mode 100644 index 4bab9d7802..0000000000 --- a/tests/reference/asr-test_assign6-05cd64f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign6-05cd64f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign6.py", - "infile_hash": "6837d07201b8680dbb63908d3ad27e4e9bfb1f1ff77b4bd6a77eddcf", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign6-05cd64f.stderr", - "stderr_hash": "5bc5e0f7454a31bb924cf1318c59e73da2446502181b92faffd9f5d4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign6-05cd64f.stderr b/tests/reference/asr-test_assign6-05cd64f.stderr deleted file mode 100644 index 3eb1a1d84e..0000000000 --- a/tests/reference/asr-test_assign6-05cd64f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'str' object does not support item assignment - --> tests/errors/test_assign6.py:4:5 - | -4 | s[0] = 'f' - | ^^^^ diff --git a/tests/reference/asr-test_assign7-beebac3.json b/tests/reference/asr-test_assign7-beebac3.json deleted file mode 100644 index e5197e2be8..0000000000 --- a/tests/reference/asr-test_assign7-beebac3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign7-beebac3", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign7.py", - "infile_hash": "e54f67638add63131760d5eadda7e3944b34addacffa27d6fb45e128", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign7-beebac3.stderr", - "stderr_hash": "109f7da7ac86c0c2add0ff034655336396cb58ebe81570c1d0ce6e81", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign7-beebac3.stderr b/tests/reference/asr-test_assign7-beebac3.stderr deleted file mode 100644 index 87c04ca904..0000000000 --- a/tests/reference/asr-test_assign7-beebac3.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'tuple[i32, i32]' object does not support item assignment - --> tests/errors/test_assign7.py:4:5 - | -4 | t[0] = 3 - | ^^^^ diff --git a/tests/reference/asr-test_assign8-4b26e63.json b/tests/reference/asr-test_assign8-4b26e63.json deleted file mode 100644 index 3b0ecbbcd1..0000000000 --- a/tests/reference/asr-test_assign8-4b26e63.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign8-4b26e63", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign8.py", - "infile_hash": "e7f5e3dd10847a04fc4634a70fb7908f4360a0b71c1f6718f7beeee9", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign8-4b26e63.stderr", - "stderr_hash": "900fcd6359806b1e7ab41b6c5c4eb252bdbab6e96404912b710a8682", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign8-4b26e63.stderr b/tests/reference/asr-test_assign8-4b26e63.stderr deleted file mode 100644 index e320bd3600..0000000000 --- a/tests/reference/asr-test_assign8-4b26e63.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_assign8.py:5:13 - | -5 | c = c32(complex(3, 4)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_assign9-51278b8.json b/tests/reference/asr-test_assign9-51278b8.json deleted file mode 100644 index 2f05c4e5e5..0000000000 --- a/tests/reference/asr-test_assign9-51278b8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_assign9-51278b8", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_assign9.py", - "infile_hash": "3aa4fda6489ce46f10fd95cd257f5d29a59629fc340d6d8ea5e983d8", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_assign9-51278b8.stderr", - "stderr_hash": "602e4fa615e929bad9586849d2a5167741930e56db6373cdca3695d0", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_assign9-51278b8.stderr b/tests/reference/asr-test_assign9-51278b8.stderr deleted file mode 100644 index f3c3e9716a..0000000000 --- a/tests/reference/asr-test_assign9-51278b8.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Assignment to an input function parameter `x` is not allowed - --> tests/errors/test_assign9.py:2:5 - | -2 | x = 2 - | ^ Hint: create a new local variable with a different name diff --git a/tests/reference/asr-test_binop1-50b63f6.json b/tests/reference/asr-test_binop1-50b63f6.json deleted file mode 100644 index 343aa48bf2..0000000000 --- a/tests/reference/asr-test_binop1-50b63f6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_binop1-50b63f6", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_binop1.py", - "infile_hash": "00f511a03b5e9def195bcd88a2412fbd88205628460356ca2523ea30", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_binop1-50b63f6.stderr", - "stderr_hash": "6883d11d4de52f03fa684252229715e39aa52c830d186f787159faaa", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_binop1-50b63f6.stderr b/tests/reference/asr-test_binop1-50b63f6.stderr deleted file mode 100644 index 67e6ee1aa1..0000000000 --- a/tests/reference/asr-test_binop1-50b63f6.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in binary operator; the types must be compatible - --> tests/errors/test_binop1.py:6:11 - | -6 | print(x+s) - | ^ ^ type mismatch (i32 and str) diff --git a/tests/reference/asr-test_binop2-e5749af.json b/tests/reference/asr-test_binop2-e5749af.json deleted file mode 100644 index 8de84da8ec..0000000000 --- a/tests/reference/asr-test_binop2-e5749af.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_binop2-e5749af", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_binop2.py", - "infile_hash": "f59bd668e0e7e0ac665c62d89eee87d8bcaa199e9f11825f38dad655", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_binop2-e5749af.stderr", - "stderr_hash": "3214693e7c1f71d8343f547e7a3ab0167b4f9310540009475d2f1c79", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_binop2-e5749af.stderr b/tests/reference/asr-test_binop2-e5749af.stderr deleted file mode 100644 index fe0d054eee..0000000000 --- a/tests/reference/asr-test_binop2-e5749af.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Division is not supported for string type - --> tests/errors/test_binop2.py:6:11 - | -6 | print(a/b) - | ^ ^ string not supported in division diff --git a/tests/reference/asr-test_binop3-a67201d.json b/tests/reference/asr-test_binop3-a67201d.json deleted file mode 100644 index b93163a529..0000000000 --- a/tests/reference/asr-test_binop3-a67201d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_binop3-a67201d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_binop3.py", - "infile_hash": "eb43132639edd47d89802b8693880ed350800a88c7c5f94eb93a9b3b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_binop3-a67201d.stderr", - "stderr_hash": "00ec81e32ad3b0d4145714c7224146e9af7fd913aa87aa633667f4f2", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_binop3-a67201d.stderr b/tests/reference/asr-test_binop3-a67201d.stderr deleted file mode 100644 index ea6ee12b1c..0000000000 --- a/tests/reference/asr-test_binop3-a67201d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_binop3.py:5:9 - | -5 | y = complex(5)+100 - | ^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_bit_length-da3a264.json b/tests/reference/asr-test_bit_length-da3a264.json deleted file mode 100644 index 56a237ac34..0000000000 --- a/tests/reference/asr-test_bit_length-da3a264.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_bit_length-da3a264", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_bit_length.py", - "infile_hash": "877db12847eccaf31564c6a969e7703f16c9e03bc9c326e72c74f1e0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_bit_length-da3a264.stderr", - "stderr_hash": "0f371300055a9e3f6c01f73b1e276d9ae8007fd507eb0c75e1bda3ef", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_bit_length-da3a264.stderr b/tests/reference/asr-test_bit_length-da3a264.stderr deleted file mode 100644 index 5820f4cd21..0000000000 --- a/tests/reference/asr-test_bit_length-da3a264.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: int.bit_length() takes no arguments - --> tests/errors/test_bit_length.py:4:11 - | -4 | print(x.bit_length(23)) - | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_bitwise_on_complex-dd9568b.json b/tests/reference/asr-test_bitwise_on_complex-dd9568b.json deleted file mode 100644 index 7fa9b4be57..0000000000 --- a/tests/reference/asr-test_bitwise_on_complex-dd9568b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_bitwise_on_complex-dd9568b", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_bitwise_on_complex.py", - "infile_hash": "48f71d8eae47a14316e9e7aba182a4a03ff8cc05ae661b8e6d41dc85", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_bitwise_on_complex-dd9568b.stderr", - "stderr_hash": "58f7acb7f7187308d38c7c97fcd9e34b2022c42be1b6583b95b379af", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr b/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr deleted file mode 100644 index 7bb1052707..0000000000 --- a/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unsupported binary operation on complex: '|' - --> tests/errors/test_bitwise_on_complex.py:8:11 - | -8 | print(c1 | c2) - | ^^^^^^^ diff --git a/tests/reference/asr-test_bitwise_on_float-2e09b30.json b/tests/reference/asr-test_bitwise_on_float-2e09b30.json deleted file mode 100644 index df6b412bad..0000000000 --- a/tests/reference/asr-test_bitwise_on_float-2e09b30.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_bitwise_on_float-2e09b30", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_bitwise_on_float.py", - "infile_hash": "50e0d4c18ad2fe0db0aedfaa5b3db792db545aeb8ef09a4cb7c4f193", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_bitwise_on_float-2e09b30.stderr", - "stderr_hash": "1e77fcf2484ec7c10436c14ac2a498db59706d30d3c294b89b6b9090", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr b/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr deleted file mode 100644 index d6733722d6..0000000000 --- a/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unsupported binary operation on floats: '<<' - --> tests/errors/test_bitwise_on_float.py:8:11 - | -8 | print(f1 << f2) - | ^^^^^^^^ diff --git a/tests/reference/asr-test_bool_binop-f856ef0.json b/tests/reference/asr-test_bool_binop-f856ef0.json deleted file mode 100644 index 358216f8de..0000000000 --- a/tests/reference/asr-test_bool_binop-f856ef0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_bool_binop-f856ef0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_bool_binop.py", - "infile_hash": "7c44fe2915b3871b3b85edf3ab129d87a75fa4b9acbb597ae801daf9", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_bool_binop-f856ef0.stderr", - "stderr_hash": "7e1f44ed79212fae132aca28b495a511f27ee327b9bf88b797502eff", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stderr b/tests/reference/asr-test_bool_binop-f856ef0.stderr deleted file mode 100644 index 725d3bd642..0000000000 --- a/tests/reference/asr-test_bool_binop-f856ef0.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_bool_binop.py:14:13 - | -14 | i = i32(True // True) - | ^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin-aa64615.json b/tests/reference/asr-test_builtin-aa64615.json deleted file mode 100644 index 475363bfce..0000000000 --- a/tests/reference/asr-test_builtin-aa64615.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin-aa64615", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin.py", - "infile_hash": "f3376f18b9927914f7cb97578b40f14d570a48c64648c32a80daef6a", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin-aa64615.stdout", - "stdout_hash": "1a601d371a9968f247d0c93a5437343b5fc47ab795d8d3fd9595eea7", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin-aa64615.stdout b/tests/reference/asr-test_builtin-aa64615.stdout deleted file mode 100644 index c2a0564804..0000000000 --- a/tests/reference/asr-test_builtin-aa64615.stdout +++ /dev/null @@ -1,2149 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_ord - test_chr - more_test] - [] - [(SubroutineCall - 2 test_ord - () - [] - () - ) - (SubroutineCall - 2 test_chr - () - [] - () - ) - (SubroutineCall - 2 more_test - () - [] - () - )] - () - Public - .false. - .false. - () - ), - more_test: - (Function - (SymbolTable - 5 - { - a: - (Variable - 5 - a - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - d: - (Variable - 5 - d - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - p: - (Variable - 5 - p - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - q: - (Variable - 5 - q - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - r: - (Variable - 5 - r - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 5 - s - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - more_test - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 p) - (IntegerConstant 97 (Integer 4)) - () - ) - (= - (Var 5 q) - (IntegerConstant 112 (Integer 4)) - () - ) - (= - (Var 5 r) - (IntegerConstant 10 (Integer 4)) - () - ) - (= - (Var 5 s) - (IntegerConstant 65 (Integer 4)) - () - ) - (Print - () - [(StringChr - (Var 5 p) - (Character 1 1 ()) - () - )] - () - () - ) - (Print - () - [(StringChr - (Var 5 q) - (Character 1 1 ()) - () - )] - () - () - ) - (Print - () - [(StringChr - (Var 5 r) - (Character 1 1 ()) - () - )] - () - () - ) - (Print - () - [(StringChr - (Var 5 s) - (Character 1 1 ()) - () - )] - () - () - ) - (= - (Var 5 a) - (StringConstant - "!" - (Character 1 1 ()) - ) - () - ) - (= - (Var 5 b) - (StringConstant - " " - (Character 1 1 ()) - ) - () - ) - (= - (Var 5 c) - (StringConstant - "Z" - (Character 1 1 ()) - ) - () - ) - (= - (Var 5 d) - (StringConstant - "g" - (Character 1 1 ()) - ) - () - ) - (Print - () - [(StringOrd - (Var 5 a) - (Integer 4) - () - )] - () - () - ) - (Print - () - [(StringOrd - (Var 5 b) - (Integer 4) - () - )] - () - () - ) - (Print - () - [(StringOrd - (Var 5 c) - (Integer 4) - () - )] - () - () - ) - (Print - () - [(StringOrd - (Var 5 d) - (Integer 4) - () - )] - () - () - )] - () - Public - .false. - .false. - () - ), - test_chr: - (Function - (SymbolTable - 4 - { - capital_a: - (Variable - 4 - capital_a - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - capital_z: - (Variable - 4 - capital_z - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - dollar: - (Variable - 4 - dollar - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - exclamation: - (Variable - 4 - exclamation - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - i: - (Variable - 4 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - left_parenthesis: - (Variable - 4 - left_parenthesis - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - nine: - (Variable - 4 - nine - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - plus: - (Variable - 4 - plus - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - right_brace: - (Variable - 4 - right_brace - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - right_bracket: - (Variable - 4 - right_bracket - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - semicolon: - (Variable - 4 - semicolon - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - small_a: - (Variable - 4 - small_a - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - small_z: - (Variable - 4 - small_z - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - zero: - (Variable - 4 - zero - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_chr - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 i) - (IntegerConstant 33 (Integer 4)) - () - ) - (= - (Var 4 exclamation) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 33 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "!" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "!" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 exclamation) - Eq - (StringConstant - "!" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 36 (Integer 4)) - () - ) - (= - (Var 4 dollar) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 36 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "$" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "$" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 dollar) - Eq - (StringConstant - "$" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 40 (Integer 4)) - () - ) - (= - (Var 4 left_parenthesis) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 40 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "(" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "(" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 left_parenthesis) - Eq - (StringConstant - "(" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 43 (Integer 4)) - () - ) - (= - (Var 4 plus) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 43 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "+" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "+" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 plus) - Eq - (StringConstant - "+" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 48 (Integer 4)) - () - ) - (= - (Var 4 zero) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 48 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "0" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "0" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 zero) - Eq - (StringConstant - "0" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 57 (Integer 4)) - () - ) - (= - (Var 4 nine) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 57 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "9" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "9" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 nine) - Eq - (StringConstant - "9" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 59 (Integer 4)) - () - ) - (= - (Var 4 semicolon) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 59 (Integer 4)) - (Character 1 1 ()) - (StringConstant - ";" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - ";" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 semicolon) - Eq - (StringConstant - ";" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 65 (Integer 4)) - () - ) - (= - (Var 4 capital_a) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 65 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "A" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "A" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 capital_a) - Eq - (StringConstant - "A" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 90 (Integer 4)) - () - ) - (= - (Var 4 capital_z) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 90 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "Z" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "Z" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 capital_z) - Eq - (StringConstant - "Z" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 93 (Integer 4)) - () - ) - (= - (Var 4 right_bracket) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 93 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "]" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "]" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 right_bracket) - Eq - (StringConstant - "]" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 97 (Integer 4)) - () - ) - (= - (Var 4 small_a) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 97 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "a" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "a" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 small_a) - Eq - (StringConstant - "a" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 122 (Integer 4)) - () - ) - (= - (Var 4 small_z) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 122 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "z" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "z" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 small_z) - Eq - (StringConstant - "z" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 i) - (IntegerConstant 125 (Integer 4)) - () - ) - (= - (Var 4 right_brace) - (StringChr - (Var 4 i) - (Character 1 1 ()) - () - ) - () - ) - (Assert - (StringCompare - (StringChr - (IntegerConstant 125 (Integer 4)) - (Character 1 1 ()) - (StringConstant - "}" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "}" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Var 4 right_brace) - Eq - (StringConstant - "}" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_ord: - (Function - (SymbolTable - 3 - { - capital_a_unicode: - (Variable - 3 - capital_a_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - capital_z_unicode: - (Variable - 3 - capital_z_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - dollar_unicode: - (Variable - 3 - dollar_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - exclamation_unicode: - (Variable - 3 - exclamation_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - left_parenthesis_unicode: - (Variable - 3 - left_parenthesis_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - nine_unicode: - (Variable - 3 - nine_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - plus_unicode: - (Variable - 3 - plus_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - right_brace_unicode: - (Variable - 3 - right_brace_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - right_bracket_unicode: - (Variable - 3 - right_bracket_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - semicolon_unicode: - (Variable - 3 - semicolon_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - small_a_unicode: - (Variable - 3 - small_a_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - small_z_unicode: - (Variable - 3 - small_z_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - zero_unicode: - (Variable - 3 - zero_unicode - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_ord - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (StringConstant - "!" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 exclamation_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "!" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 33 (Integer 4)) - ) - Eq - (IntegerConstant 33 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 exclamation_unicode) - Eq - (IntegerConstant 33 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "$" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 dollar_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "$" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 36 (Integer 4)) - ) - Eq - (IntegerConstant 36 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 dollar_unicode) - Eq - (IntegerConstant 36 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "(" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 left_parenthesis_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "(" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 40 (Integer 4)) - ) - Eq - (IntegerConstant 40 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 left_parenthesis_unicode) - Eq - (IntegerConstant 40 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "+" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 plus_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "+" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 43 (Integer 4)) - ) - Eq - (IntegerConstant 43 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 plus_unicode) - Eq - (IntegerConstant 43 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "0" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 zero_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "0" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 48 (Integer 4)) - ) - Eq - (IntegerConstant 48 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 zero_unicode) - Eq - (IntegerConstant 48 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "9" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 nine_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "9" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 57 (Integer 4)) - ) - Eq - (IntegerConstant 57 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 nine_unicode) - Eq - (IntegerConstant 57 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - ";" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 semicolon_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - ";" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 59 (Integer 4)) - ) - Eq - (IntegerConstant 59 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 semicolon_unicode) - Eq - (IntegerConstant 59 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "A" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 capital_a_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "A" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 65 (Integer 4)) - ) - Eq - (IntegerConstant 65 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 capital_a_unicode) - Eq - (IntegerConstant 65 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "Z" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 capital_z_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "Z" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 90 (Integer 4)) - ) - Eq - (IntegerConstant 90 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 capital_z_unicode) - Eq - (IntegerConstant 90 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "]" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 right_bracket_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "]" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 93 (Integer 4)) - ) - Eq - (IntegerConstant 93 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 right_bracket_unicode) - Eq - (IntegerConstant 93 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "a" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 small_a_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "a" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 97 (Integer 4)) - ) - Eq - (IntegerConstant 97 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 small_a_unicode) - Eq - (IntegerConstant 97 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "z" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 small_z_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "z" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 122 (Integer 4)) - ) - Eq - (IntegerConstant 122 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 small_z_unicode) - Eq - (IntegerConstant 122 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "}" - (Character 1 1 ()) - ) - () - ) - (= - (Var 3 right_brace_unicode) - (StringOrd - (Var 3 s) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringOrd - (StringConstant - "}" - (Character 1 1 ()) - ) - (Integer 4) - (IntegerConstant 125 (Integer 4)) - ) - Eq - (IntegerConstant 125 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 right_brace_unicode) - Eq - (IntegerConstant 125 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.json b/tests/reference/asr-test_builtin_abs-c74d2c9.json deleted file mode 100644 index ce0899d23b..0000000000 --- a/tests/reference/asr-test_builtin_abs-c74d2c9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_abs-c74d2c9", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_abs.py", - "infile_hash": "8748a0c131b21523ed4b2d019a4fb74af041845397169d44b00ee041", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin_abs-c74d2c9.stdout", - "stdout_hash": "86d0821d3e240a6645d0f7778a81076160e627a1e8a61e4b2c9056b3", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout deleted file mode 100644 index 45fc58f6b9..0000000000 --- a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout +++ /dev/null @@ -1,605 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_abs] - [] - [(SubroutineCall - 2 test_abs - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_abs: - (Function - (SymbolTable - 3 - { - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 3 - i2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - i3: - (Variable - 3 - i3 - [] - Local - () - () - Default - (Integer 1) - () - Source - Public - Required - .false. - ), - i4: - (Variable - 3 - i4 - [] - Local - () - () - Default - (Integer 2) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - x2: - (Variable - 3 - x2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - test_abs - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (RealConstant - 5.500000 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(Var 3 x)] - 0 - (Real 8) - () - ) - Eq - (RealConstant - 5.500000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 x) - (RealUnaryMinus - (RealConstant - 5.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -5.500000 - (Real 8) - ) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(Var 3 x)] - 0 - (Real 8) - () - ) - Eq - (RealConstant - 5.500000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealConstant - 5.500000 - (Real 8) - )] - 0 - (Real 8) - (RealConstant - 5.500000 - (Real 8) - ) - ) - Eq - (RealConstant - 5.500000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealUnaryMinus - (RealConstant - 5.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -5.500000 - (Real 8) - ) - )] - 0 - (Real 8) - (RealConstant - 5.500000 - (Real 8) - ) - ) - Eq - (RealConstant - 5.500000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 x2) - (RealUnaryMinus - (Cast - (RealConstant - 5.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.500000 - (Real 4) - ) - ) - (Real 4) - (RealConstant - -5.500000 - (Real 4) - ) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(Var 3 x2)] - 0 - (Real 4) - () - ) - Eq - (Cast - (RealConstant - 5.500000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.500000 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Var 3 i)] - 0 - (Integer 4) - () - ) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - )] - 0 - (Integer 4) - (IntegerConstant 1 (Integer 4)) - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 i2) - (IntegerUnaryMinus - (Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - ) - (Integer 8) - (IntegerConstant -6 (Integer 8)) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Var 3 i2)] - 0 - (Integer 8) - () - ) - Eq - (Cast - (IntegerConstant 6 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 6 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i3) - (IntegerUnaryMinus - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 7 (Integer 1)) - ) - (Integer 1) - (IntegerConstant -7 (Integer 1)) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Var 3 i3)] - 0 - (Integer 1) - () - ) - Eq - (Cast - (IntegerConstant 7 (Integer 4)) - IntegerToInteger - (Integer 1) - (IntegerConstant 7 (Integer 1)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i4) - (IntegerUnaryMinus - (Cast - (IntegerConstant 8 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 8 (Integer 2)) - ) - (Integer 2) - (IntegerConstant -8 (Integer 2)) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Var 3 i4)] - 0 - (Integer 2) - () - ) - Eq - (Cast - (IntegerConstant 8 (Integer 4)) - IntegerToInteger - (Integer 2) - (IntegerConstant 8 (Integer 2)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Cast - (Var 3 b) - LogicalToInteger - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (IntegerCompare - (IntrinsicScalarFunction - Abs - [(Cast - (Var 3 b) - LogicalToInteger - (Integer 4) - () - )] - 0 - (Integer 4) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.json b/tests/reference/asr-test_builtin_bin-52ba9fa.json deleted file mode 100644 index f617a29848..0000000000 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_bin-52ba9fa", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_bin.py", - "infile_hash": "09e09eacf697c95f358b75f6491b766781bae9a5f856c2ad5848e824", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_bin-52ba9fa.stderr", - "stderr_hash": "f96ee9f35d47046bca3a9f0e40b965bf1b0e6654a0a4da0eb7a85e30", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr deleted file mode 100644 index 06b339838a..0000000000 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_bin.py:6:12 - | -6 | assert bin(i) == "0b101" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bool-330223a.json b/tests/reference/asr-test_builtin_bool-330223a.json deleted file mode 100644 index 91858355b1..0000000000 --- a/tests/reference/asr-test_builtin_bool-330223a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_bool-330223a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_bool.py", - "infile_hash": "3a740faba0e36b55c179ab0fa08486dc3080332e79c8e38b8f25b4a4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_bool-330223a.stderr", - "stderr_hash": "5cf42029c7abd7dc2dedc535fff29c622c3871ec342b595c426b27f3", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bool-330223a.stderr b/tests/reference/asr-test_builtin_bool-330223a.stderr deleted file mode 100644 index 6061f4823c..0000000000 --- a/tests/reference/asr-test_builtin_bool-330223a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_bool.py:56:13 - | -56 | c = c32(complex(2, 3)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_float-20601dd.json b/tests/reference/asr-test_builtin_float-20601dd.json deleted file mode 100644 index 7b0de8b9c0..0000000000 --- a/tests/reference/asr-test_builtin_float-20601dd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_float-20601dd", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_float.py", - "infile_hash": "de536c0af182f8e43780193627c24f1085522e86d37316e13d337196", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin_float-20601dd.stdout", - "stdout_hash": "30bd7a1456c6e4b74a7c6310f2c49c9593924e9728cdba8151b2c15a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_float-20601dd.stdout b/tests/reference/asr-test_builtin_float-20601dd.stdout deleted file mode 100644 index cee0c2a04c..0000000000 --- a/tests/reference/asr-test_builtin_float-20601dd.stdout +++ /dev/null @@ -1,530 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_float] - [] - [(SubroutineCall - 2 test_float - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_float: - (Function - (SymbolTable - 3 - { - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - f2: - (Variable - 3 - f2 - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_float - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 i) - (IntegerConstant 34 (Integer 4)) - () - ) - (= - (Var 3 f) - (Cast - (RealConstant - 0.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000000 - (Real 4) - ) - ) - () - ) - (Assert - (RealCompare - (RealConstant - 0.000000 - (Real 8) - ) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (IntegerConstant 34 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 34.000000 - (Real 8) - ) - ) - Eq - (RealConstant - 34.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (Var 3 i) - IntegerToReal - (Real 8) - () - ) - Eq - (RealConstant - 34.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ) - () - ) - (Assert - (RealCompare - (Cast - (IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ) - IntegerToReal - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - ) - Eq - (RealUnaryMinus - (RealConstant - 4235.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (Var 3 i) - IntegerToReal - (Real 8) - () - ) - Eq - (RealUnaryMinus - (RealConstant - 4235.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (IntegerConstant 34 (Integer 4)) - IntegerToReal - (Real 8) - (RealConstant - 34.000000 - (Real 8) - ) - ) - Eq - (RealConstant - 34.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (IntegerUnaryMinus - (IntegerConstant 4235 (Integer 4)) - (Integer 4) - (IntegerConstant -4235 (Integer 4)) - ) - IntegerToReal - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - ) - Eq - (RealUnaryMinus - (RealConstant - 4235.000000 - (Real 8) - ) - (Real 8) - (RealConstant - -4235.000000 - (Real 8) - ) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (RealConstant - 0.000000 - (Real 8) - ) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (Var 3 f) - RealToReal - (Real 8) - () - ) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToReal - (Real 8) - (RealConstant - 1.000000 - (Real 8) - ) - ) - Eq - (RealConstant - 1.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (RealCompare - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToReal - (Real 8) - (RealConstant - 0.000000 - (Real 8) - ) - ) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (= - (Var 3 f2) - (Cast - (Var 3 b) - LogicalToReal - (Real 8) - () - ) - () - ) - (Assert - (RealCompare - (Var 3 f2) - Eq - (RealConstant - 1.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 b) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (RealCompare - (Cast - (Var 3 b) - LogicalToReal - (Real 8) - () - ) - Eq - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_hex-64bd268.json b/tests/reference/asr-test_builtin_hex-64bd268.json deleted file mode 100644 index 2779c11099..0000000000 --- a/tests/reference/asr-test_builtin_hex-64bd268.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_hex-64bd268", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_hex.py", - "infile_hash": "e639f0251477f50376536d317630e3c026354859576a5f1b7b10bd7d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_hex-64bd268.stderr", - "stderr_hash": "22b2ae7d0d34d2406125547149511ab5990a5f2163c186c48c5c4f05", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stderr b/tests/reference/asr-test_builtin_hex-64bd268.stderr deleted file mode 100644 index 40dc59a4e9..0000000000 --- a/tests/reference/asr-test_builtin_hex-64bd268.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_hex.py:6:12 - | -6 | assert hex(i) == "0x22" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.json b/tests/reference/asr-test_builtin_int-8f88fdc.json deleted file mode 100644 index c108171675..0000000000 --- a/tests/reference/asr-test_builtin_int-8f88fdc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_int-8f88fdc", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_int.py", - "infile_hash": "caea15e7c979280f796e815bd1548613d6b21322c43f4ed1306e1e93", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin_int-8f88fdc.stdout", - "stdout_hash": "ac7c1dc83cf2a510b118f03332645f9503a084c66a9c61ce4833d3e1", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.stdout b/tests/reference/asr-test_builtin_int-8f88fdc.stdout deleted file mode 100644 index 9ce92a9ac8..0000000000 --- a/tests/reference/asr-test_builtin_int-8f88fdc.stdout +++ /dev/null @@ -1,1010 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check_all] - [] - [(SubroutineCall - 2 check_all - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check_all: - (Function - (SymbolTable - 5 - { - - }) - check_all - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_int - test_bool_to_int] - [] - [(SubroutineCall - 2 test_int - () - [] - () - ) - (SubroutineCall - 2 test_bool_to_int - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_bool_to_int: - (Function - (SymbolTable - 4 - { - b: - (Variable - 4 - b - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_bool_to_int - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - Add - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Sub - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Print - () - [(Var 4 b)] - () - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 4 b) - (IntegerBinOp - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (IntegerBinOp - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - (Integer 4) - () - ) - Sub - (IntegerBinOp - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - Add - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 4) - () - ) - (Integer 4) - () - ) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 4 b) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_int: - (Function - (SymbolTable - 3 - { - f: - (Variable - 3 - f - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ), - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - i2: - (Variable - 3 - i2 - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - test_int - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 f) - (RealConstant - 5.678000 - (Real 8) - ) - () - ) - (= - (Var 3 i) - (IntegerConstant 4 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (IntegerConstant 0 (Integer 8)) - Eq - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (Var 3 i) - IntegerToInteger - (Integer 8) - () - ) - Eq - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i2) - (Cast - (RealConstant - 3.000000 - (Real 8) - ) - RealToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 i2) - Eq - (Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Cast - (RealConstant - 5.678000 - (Real 8) - ) - RealToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - Eq - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (Var 3 f) - RealToInteger - (Integer 8) - () - ) - Eq - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 f) - (RealUnaryMinus - (RealConstant - 183745.230000 - (Real 8) - ) - (Real 8) - (RealConstant - -183745.230000 - (Real 8) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (RealUnaryMinus - (RealConstant - 183745.230000 - (Real 8) - ) - (Real 8) - (RealConstant - -183745.230000 - (Real 8) - ) - ) - RealToInteger - (Integer 8) - (IntegerConstant -183745 (Integer 8)) - ) - Eq - (Cast - (IntegerUnaryMinus - (IntegerConstant 183745 (Integer 4)) - (Integer 4) - (IntegerConstant -183745 (Integer 4)) - ) - IntegerToInteger - (Integer 8) - (IntegerConstant -183745 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (Var 3 f) - RealToInteger - (Integer 8) - () - ) - Eq - (Cast - (IntegerUnaryMinus - (IntegerConstant 183745 (Integer 4)) - (Integer 4) - (IntegerConstant -183745 (Integer 4)) - ) - IntegerToInteger - (Integer 8) - (IntegerConstant -183745 (Integer 8)) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Cast - (RealConstant - 5.500000 - (Real 8) - ) - RealToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - Eq - (Cast - (IntegerConstant 5 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 5 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (RealUnaryMinus - (RealConstant - 5.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -5.500000 - (Real 8) - ) - ) - RealToInteger - (Integer 8) - (IntegerConstant -5 (Integer 8)) - ) - Eq - (Cast - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - IntegerToInteger - (Integer 8) - (IntegerConstant -5 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - Eq - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - Eq - (Cast - (IntegerConstant 0 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 0 (Integer 8)) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_len-55b0dec.json b/tests/reference/asr-test_builtin_len-55b0dec.json deleted file mode 100644 index e9002c539a..0000000000 --- a/tests/reference/asr-test_builtin_len-55b0dec.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_len-55b0dec", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_len.py", - "infile_hash": "fd1048585d9628ca38f6f21cdcfb3b44c355bbf6df2275a133f82a6f", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin_len-55b0dec.stdout", - "stdout_hash": "2a3e339bcf76aded62305d7667f0f17439bb96609a8106cb933d37e0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_len-55b0dec.stdout b/tests/reference/asr-test_builtin_len-55b0dec.stdout deleted file mode 100644 index daa809dca7..0000000000 --- a/tests/reference/asr-test_builtin_len-55b0dec.stdout +++ /dev/null @@ -1,691 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 6 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_len] - [] - [(SubroutineCall - 2 test_len - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_len: - (Function - (SymbolTable - 3 - { - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - l: - (Variable - 3 - l - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - l2: - (Variable - 3 - l2 - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - l3: - (Variable - 3 - l3 - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - list_len: - (Variable - 3 - list_len - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - t: - (Variable - 3 - t - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4) - (Character 1 -2 ())] - ) - () - Source - Public - Required - .false. - ), - t2: - (Variable - 3 - t2 - [] - Local - () - () - Default - (Tuple - [(Real 8) - (Logical 4) - (Logical 4) - (Character 1 -2 ()) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ), - t3: - (Variable - 3 - t3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - tmp: - (Variable - 3 - tmp - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_len - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (StringConstant - "abcd" - (Character 1 4 ()) - ) - () - ) - (Assert - (IntegerCompare - (StringLen - (Var 3 s) - (Integer 4) - () - ) - Eq - (IntegerConstant 4 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (StringConstant - "" - (Character 1 0 ()) - ) - () - ) - (Assert - (IntegerCompare - (StringLen - (Var 3 s) - (Integer 4) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StringLen - (StringConstant - "abcd" - (Character 1 4 ()) - ) - (Integer 4) - (IntegerConstant 4 (Integer 4)) - ) - Eq - (IntegerConstant 4 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (StringLen - (StringConstant - "" - (Character 1 0 ()) - ) - (Integer 4) - (IntegerConstant 0 (Integer 4)) - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 l) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (ListLen - (Var 3 l) - (Integer 4) - () - ) - Eq - (IntegerConstant 4 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 l2) - (ListConstant - [(RealConstant - 1.200000 - (Real 8) - ) - (RealConstant - 3.400000 - (Real 8) - ) - (RealConstant - 5.600000 - (Real 8) - ) - (RealConstant - 7.800000 - (Real 8) - ) - (RealConstant - 9.000000 - (Real 8) - )] - (List - (Real 8) - ) - ) - () - ) - (Assert - (IntegerCompare - (ListLen - (Var 3 l2) - (Integer 4) - () - ) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 l3) - (ListConstant - [] - (List - (Integer 4) - ) - ) - () - ) - (Assert - (IntegerCompare - (ListLen - (Var 3 l3) - (Integer 4) - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (DoLoop - () - ((Var 3 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (IntegerConstant 50 (Integer 4)) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 49 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(ListAppend - (Var 3 l3) - (Var 3 i) - )] - ) - (Assert - (IntegerCompare - (ListLen - (Var 3 l3) - (Integer 4) - () - ) - Eq - (IntegerConstant 50 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 list_len) - (ListLen - (ListConstant - [(RealConstant - 1.000000 - (Real 8) - ) - (RealConstant - 2.000000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (Integer 4) - (IntegerConstant 2 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 list_len) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 t) - (TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (StringConstant - "a" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Integer 4) - (Character 1 1 ())] - ) - ) - () - ) - (Assert - (IntegerCompare - (TupleLen - (Var 3 t) - (Integer 4) - (IntegerConstant 3 (Integer 4)) - ) - Eq - (IntegerConstant 3 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 t2) - (TupleConstant - [(RealConstant - 1.200000 - (Real 8) - ) - (LogicalConstant - .true. - (Logical 4) - ) - (LogicalConstant - .false. - (Logical 4) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (IntegerConstant 3 (Integer 4))] - (Tuple - [(Real 8) - (Logical 4) - (Logical 4) - (Character 1 1 ()) - (Integer 4)] - ) - ) - () - ) - (Assert - (IntegerCompare - (TupleLen - (Var 3 t2) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (= - (Var 3 t3) - (TupleLen - (TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4) - (Integer 4) - (Integer 4) - (Integer 4)] - ) - ) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (Var 3 t3) - Eq - (IntegerConstant 5 (Integer 4)) - (Logical 4) - () - ) - () - ) - (= - (Var 3 tmp) - (ListLen - (Var 3 l) - (Integer 4) - () - ) - () - ) - (DoLoop - () - ((Var 3 i) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (TupleLen - (Var 3 t2) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant 4 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))) - [(ListAppend - (Var 3 l) - (Var 3 i) - )] - ) - (Assert - (IntegerCompare - (ListLen - (Var 3 l) - (Integer 4) - () - ) - Eq - (IntegerBinOp - (TupleLen - (Var 3 t2) - (Integer 4) - (IntegerConstant 5 (Integer 4)) - ) - Add - (Var 3 tmp) - (Integer 4) - () - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 7 - { - __main__global_stmts: - (ExternalSymbol - 7 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 7 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_builtin_oct-20b9066.json b/tests/reference/asr-test_builtin_oct-20b9066.json deleted file mode 100644 index bb705fd111..0000000000 --- a/tests/reference/asr-test_builtin_oct-20b9066.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_oct-20b9066", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_oct.py", - "infile_hash": "c20249affa4787edf4ef56c881ebbcabdced311b5b908d9da6aceaeb", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_oct-20b9066.stderr", - "stderr_hash": "986b90db11399243e0e1a9788da3876cbd8d7eecd273e46bc9437243", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stderr b/tests/reference/asr-test_builtin_oct-20b9066.stderr deleted file mode 100644 index 8bde6da6dc..0000000000 --- a/tests/reference/asr-test_builtin_oct-20b9066.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_oct.py:6:12 - | -6 | assert oct(i) == "0o42" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json deleted file mode 100644 index 5bb87ef22b..0000000000 --- a/tests/reference/asr-test_builtin_pow-f02fcda.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_pow-f02fcda", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_pow.py", - "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_pow-f02fcda.stderr", - "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stderr b/tests/reference/asr-test_builtin_pow-f02fcda.stderr deleted file mode 100644 index e2d434b6f1..0000000000 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_pow.py:11:16 - | -11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_round-7417a21.json b/tests/reference/asr-test_builtin_round-7417a21.json deleted file mode 100644 index efcd6cc31e..0000000000 --- a/tests/reference/asr-test_builtin_round-7417a21.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_round-7417a21", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_round.py", - "infile_hash": "a4ff4032a45ce084eb524069046afb6ec44f1b24a667c84c7605f2c7", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_round-7417a21.stderr", - "stderr_hash": "a58af3b9f4312b1036b728dc70928fe9c05f87d1b96d92b5c3da881f", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_round-7417a21.stderr b/tests/reference/asr-test_builtin_round-7417a21.stderr deleted file mode 100644 index 570365512c..0000000000 --- a/tests/reference/asr-test_builtin_round-7417a21.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_round.py:6:12 - | -6 | assert round(f) == 6 - | ^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_str-580e920.json b/tests/reference/asr-test_builtin_str-580e920.json deleted file mode 100644 index b7662841c8..0000000000 --- a/tests/reference/asr-test_builtin_str-580e920.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_builtin_str-580e920", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_builtin_str.py", - "infile_hash": "9d41e81d47e010623c74c812d0c41e5d705f7925e699eb2b68f17cfc", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_builtin_str-580e920.stdout", - "stdout_hash": "757004fd20974ca9ccee145fcb6fdcc725839c3eb87ec97919c8115c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_str-580e920.stdout b/tests/reference/asr-test_builtin_str-580e920.stdout deleted file mode 100644 index 7c5852b8a4..0000000000 --- a/tests/reference/asr-test_builtin_str-580e920.stdout +++ /dev/null @@ -1,1471 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_str_int_float - str_conv_for_variables - test_str_slice_step - test_issue_883] - [] - [(SubroutineCall - 2 test_str_int_float - () - [] - () - ) - (SubroutineCall - 2 str_conv_for_variables - () - [] - () - ) - (SubroutineCall - 2 test_str_slice_step - () - [] - () - ) - (SubroutineCall - 2 test_issue_883 - () - [] - () - )] - () - Public - .false. - .false. - () - ), - str_conv_for_variables: - (Function - (SymbolTable - 4 - { - bool_t: - (Variable - 4 - bool_t - [] - Local - () - () - Default - (Logical 4) - () - Source - Public - Required - .false. - ), - str_t: - (Variable - 4 - str_t - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - xx: - (Variable - 4 - xx - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - yy: - (Variable - 4 - yy - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - str_conv_for_variables - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 x) - (IntegerConstant 123 (Integer 4)) - () - ) - (Assert - (StringCompare - (StringConstant - "123" - (Character 1 3 ()) - ) - Eq - (Cast - (Var 4 x) - IntegerToCharacter - (Character 1 -2 ()) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (IntegerConstant 12345 (Integer 4)) - () - ) - (Assert - (StringCompare - (StringConstant - "12345" - (Character 1 5 ()) - ) - Eq - (Cast - (Var 4 x) - IntegerToCharacter - (Character 1 -2 ()) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (IntegerUnaryMinus - (IntegerConstant 12 (Integer 4)) - (Integer 4) - (IntegerConstant -12 (Integer 4)) - ) - () - ) - (Assert - (StringCompare - (StringConstant - "-12" - (Character 1 3 ()) - ) - Eq - (Cast - (Var 4 x) - IntegerToCharacter - (Character 1 -2 ()) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 x) - (IntegerUnaryMinus - (IntegerConstant 121212 (Integer 4)) - (Integer 4) - (IntegerConstant -121212 (Integer 4)) - ) - () - ) - (Assert - (StringCompare - (StringConstant - "-121212" - (Character 1 7 ()) - ) - Eq - (Cast - (Var 4 x) - IntegerToCharacter - (Character 1 -2 ()) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 xx) - (Cast - (RealConstant - 12.322234 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 12.322234 - (Real 4) - ) - ) - () - ) - (Assert - (StringCompare - (Cast - (Var 4 xx) - RealToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "12.322234" - (Character 1 9 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 yy) - (RealConstant - 12.322234 - (Real 8) - ) - () - ) - (Assert - (StringCompare - (Cast - (Var 4 yy) - RealToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "12.322234" - (Character 1 9 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 bool_t) - (LogicalConstant - .true. - (Logical 4) - ) - () - ) - (Assert - (StringCompare - (Cast - (Var 4 bool_t) - LogicalToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "True" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 bool_t) - (LogicalConstant - .false. - (Logical 4) - ) - () - ) - (Assert - (StringCompare - (Cast - (Var 4 bool_t) - LogicalToCharacter - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "False" - (Character 1 5 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 4 str_t) - (StringConstant - "just a str" - (Character 1 10 ()) - ) - () - ) - (Assert - (StringCompare - (Var 4 str_t) - Eq - (Var 4 str_t) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_issue_883: - (Function - (SymbolTable - 6 - { - __explicit_iterator: - (Variable - 6 - __explicit_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __tmp_assign_for_loop: - (Variable - 6 - __tmp_assign_for_loop - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - c: - (Variable - 6 - c - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - d: - (Variable - 6 - d - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - i: - (Variable - 6 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 6 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_issue_883 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 s) - (StringConstant - "abcde" - (Character 1 5 ()) - ) - () - ) - (= - (Var 6 d) - (StringConstant - "edcba" - (Character 1 5 ()) - ) - () - ) - (= - (Var 6 i) - (IntegerConstant 0 (Integer 4)) - () - ) - (= - (Var 6 __tmp_assign_for_loop) - (StringSection - (Var 6 s) - () - () - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - () - ) - (DoLoop - () - ((Var 6 __explicit_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (StringLen - (Var 6 __tmp_assign_for_loop) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(= - (Var 6 c) - (StringItem - (Var 6 __tmp_assign_for_loop) - (IntegerBinOp - (Var 6 __explicit_iterator) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Character 1 -2 ()) - () - ) - () - ) - (Print - () - [(Var 6 c)] - () - () - ) - (Assert - (StringCompare - (Var 6 c) - Eq - (StringItem - (Var 6 d) - (IntegerBinOp - (Var 6 i) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Character 1 -2 ()) - () - ) - (Logical 4) - () - ) - () - ) - (= - (Var 6 i) - (IntegerBinOp - (Var 6 i) - Add - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - () - )] - )] - () - Public - .false. - .false. - () - ), - test_str_int_float: - (Function - (SymbolTable - 3 - { - s: - (Variable - 3 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ) - }) - test_str_int_float - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 s) - (Cast - (IntegerConstant 356 (Integer 4)) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "356" - (Character 1 3 ()) - ) - ) - () - ) - (Assert - (StringCompare - (Var 3 s) - Eq - (StringConstant - "356" - (Character 1 3 ()) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 s) - (Cast - (IntegerUnaryMinus - (IntegerConstant 567 (Integer 4)) - (Integer 4) - (IntegerConstant -567 (Integer 4)) - ) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "-567" - (Character 1 4 ()) - ) - ) - () - ) - (Assert - (StringCompare - (Var 3 s) - Eq - (StringConstant - "-567" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (Cast - (IntegerConstant 4 (Integer 4)) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "4" - (Character 1 1 ()) - ) - ) - Eq - (StringConstant - "4" - (Character 1 1 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Cast - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - ) - IntegerToCharacter - (Character 1 -2 ()) - (StringConstant - "-5" - (Character 1 2 ()) - ) - ) - Eq - (StringConstant - "-5" - (Character 1 2 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (StringConstant - "" - (Character 1 0 ()) - ) - Eq - (StringConstant - "" - (Character 1 0 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (StringConstant - "1234" - (Character 1 4 ()) - ) - Eq - (StringConstant - "1234" - (Character 1 4 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Cast - (LogicalConstant - .false. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "False" - (Character 1 5 ()) - ) - ) - Eq - (StringConstant - "False" - (Character 1 5 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (Cast - (LogicalConstant - .true. - (Logical 4) - ) - LogicalToCharacter - (Character 1 -2 ()) - (StringConstant - "True" - (Character 1 4 ()) - ) - ) - Eq - (StringConstant - "True" - (Character 1 4 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (StringConstant - "just a str" - (Character 1 10 ()) - ) - Eq - (StringConstant - "just a str" - (Character 1 10 ()) - ) - (Logical 4) - (LogicalConstant - .true. - (Logical 4) - ) - ) - () - ) - (Assert - (StringCompare - (StringSection - (Cast - (RealConstant - 12.123400 - (Real 8) - ) - RealToCharacter - (Character 1 -2 ()) - (StringConstant - "12.1234" - (Character 1 7 ()) - ) - ) - () - (IntegerConstant 7 (Integer 4)) - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "12.1234" - (Character 1 7 ()) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ), - test_str_slice_step: - (Function - (SymbolTable - 5 - { - end: - (Variable - 5 - end - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - s: - (Variable - 5 - s - [] - Local - () - () - Default - (Character 1 -2 ()) - () - Source - Public - Required - .false. - ), - start: - (Variable - 5 - start - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - step: - (Variable - 5 - step - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - test_str_slice_step - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 s) - (StringConstant - "abcdefghijk" - (Character 1 11 ()) - ) - () - ) - (= - (Var 5 start) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (Var 5 end) - (IntegerConstant 4 (Integer 4)) - () - ) - (= - (Var 5 step) - (IntegerConstant 1 (Integer 4)) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - () - () - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "abcdefghijk" - (Character 1 11 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "bcd" - (Character 1 3 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - () - (IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "a" - (Character 1 1 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - () - () - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "kjihgfedcba" - (Character 1 11 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 12 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "dgj" - (Character 1 3 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 1 (Integer 4)) - () - (IntegerConstant 3 (Integer 4)) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "behk" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 4 (Integer 4)) - () - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "efghijk" - (Character 1 7 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - () - (IntegerConstant 5 (Integer 4)) - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "abcde" - (Character 1 5 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 9 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "dg" - (Character 1 2 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerConstant 10 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "kige" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 10 (Integer 4)) - (Integer 4) - (IntegerConstant -10 (Integer 4)) - ) - () - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "" - (Character 1 0 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 9 (Integer 4)) - (Integer 4) - (IntegerConstant -9 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "if" - (Character 1 2 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 10 (Integer 4)) - (Integer 4) - (IntegerConstant -10 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "ifc" - (Character 1 3 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (Var 5 start) - (Var 5 end) - (Var 5 step) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "bcd" - (Character 1 3 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (Var 5 start) - (IntegerBinOp - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Mul - (Var 5 end) - (Integer 4) - () - ) - Sub - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - ) - (Var 5 step) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "bcde" - (Character 1 4 ()) - ) - (Logical 4) - () - ) - () - ) - (Assert - (StringCompare - (StringSection - (Var 5 s) - (Var 5 start) - (IntegerBinOp - (IntegerBinOp - (IntegerConstant 2 (Integer 4)) - Mul - (Var 5 end) - (Integer 4) - () - ) - Sub - (IntegerConstant 3 (Integer 4)) - (Integer 4) - () - ) - (IntegerUnaryMinus - (Var 5 step) - (Integer 4) - () - ) - (Character 1 -2 ()) - () - ) - Eq - (StringConstant - "" - (Character 1 0 ()) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_c_interop_01-e374f43.json b/tests/reference/asr-test_c_interop_01-e374f43.json deleted file mode 100644 index a35f2d0c2b..0000000000 --- a/tests/reference/asr-test_c_interop_01-e374f43.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_c_interop_01-e374f43", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_c_interop_01.py", - "infile_hash": "f5363d49163fefe382a94462e7c305a7938ddcc44c4595f8a0c5bc3f", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_c_interop_01-e374f43.stdout", - "stdout_hash": "54f0e7b627f6a658a8ff7c49f02434b2c7e8393c3c9553a884506837", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_c_interop_01-e374f43.stdout b/tests/reference/asr-test_c_interop_01-e374f43.stdout deleted file mode 100644 index cffa869f5b..0000000000 --- a/tests/reference/asr-test_c_interop_01-e374f43.stdout +++ /dev/null @@ -1,711 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_c_callbacks] - [] - [(SubroutineCall - 2 test_c_callbacks - () - [] - () - )] - () - Public - .false. - .false. - () - ), - _lfortran_bgt32: - (Function - (SymbolTable - 5 - { - _lpython_return_variable: - (Variable - 5 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - BindC - Public - Required - .false. - ), - i: - (Variable - 5 - i - [] - In - () - () - Default - (Integer 4) - () - BindC - Public - Required - .true. - ), - j: - (Variable - 5 - j - [] - In - () - () - Default - (Integer 4) - () - BindC - Public - Required - .true. - ) - }) - _lfortran_bgt32 - (FunctionType - [(Integer 4) - (Integer 4)] - (Integer 4) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 5 i) - (Var 5 j)] - [] - (Var 5 _lpython_return_variable) - Public - .false. - .false. - () - ), - _lfortran_bgt64: - (Function - (SymbolTable - 6 - { - _lpython_return_variable: - (Variable - 6 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 4) - () - BindC - Public - Required - .false. - ), - i: - (Variable - 6 - i - [] - In - () - () - Default - (Integer 8) - () - BindC - Public - Required - .true. - ), - j: - (Variable - 6 - j - [] - In - () - () - Default - (Integer 8) - () - BindC - Public - Required - .true. - ) - }) - _lfortran_bgt64 - (FunctionType - [(Integer 8) - (Integer 8)] - (Integer 4) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 6 i) - (Var 6 j)] - [] - (Var 6 _lpython_return_variable) - Public - .false. - .false. - () - ), - _lfortran_dsin: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 8) - () - BindC - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - In - () - () - Default - (Real 8) - () - BindC - Public - Required - .true. - ) - }) - _lfortran_dsin - (FunctionType - [(Real 8)] - (Real 8) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 3 x)] - [] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - _lfortran_ssin: - (Function - (SymbolTable - 4 - { - _lpython_return_variable: - (Variable - 4 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Real 4) - () - BindC - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - In - () - () - Default - (Real 4) - () - BindC - Public - Required - .true. - ) - }) - _lfortran_ssin - (FunctionType - [(Real 4)] - (Real 4) - BindC - Interface - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [(Var 4 x)] - [] - (Var 4 _lpython_return_variable) - Public - .false. - .false. - () - ), - test_c_callbacks: - (Function - (SymbolTable - 7 - { - pi: - (Variable - 7 - pi - [] - Local - () - () - Default - (Real 8) - () - Source - Public - Required - .false. - ) - }) - test_c_callbacks - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [_lfortran_dsin - _lfortran_ssin - _lfortran_bgt32 - _lfortran_bgt64] - [] - [(= - (Var 7 pi) - (RealConstant - 3.141593 - (Real 8) - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 2 _lfortran_dsin - () - [((Var 7 pi))] - (Real 8) - () - () - ) - Sub - (RealConstant - 0.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 2 _lfortran_dsin - () - [((RealBinOp - (Var 7 pi) - Div - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ))] - (Real 8) - () - () - ) - Sub - (RealConstant - 1.000000 - (Real 8) - ) - (Real 8) - () - )] - 0 - (Real 8) - () - ) - Lt - (RealConstant - 0.000000 - (Real 8) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 2 _lfortran_ssin - () - [((Cast - (Var 7 pi) - RealToReal - (Real 4) - () - ))] - (Real 4) - () - () - ) - Sub - (Cast - (RealConstant - 0.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000000 - (Real 4) - ) - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - Lt - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (Assert - (RealCompare - (IntrinsicScalarFunction - Abs - [(RealBinOp - (FunctionCall - 2 _lfortran_ssin - () - [((Cast - (RealBinOp - (Var 7 pi) - Div - (RealConstant - 2.000000 - (Real 8) - ) - (Real 8) - () - ) - RealToReal - (Real 4) - () - ))] - (Real 4) - () - () - ) - Sub - (Cast - (RealConstant - 1.000000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 1.000000 - (Real 4) - ) - ) - (Real 4) - () - )] - 0 - (Real 4) - () - ) - Lt - (Cast - (RealConstant - 0.000001 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.000001 - (Real 4) - ) - ) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 _lfortran_bgt32 - () - [((IntegerConstant 3 (Integer 4))) - ((IntegerConstant 4 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 _lfortran_bgt32 - () - [((IntegerConstant 4 (Integer 4))) - ((IntegerConstant 3 (Integer 4)))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 _lfortran_bgt64 - () - [((Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - )) - ((Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - ))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 0 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (FunctionCall - 2 _lfortran_bgt64 - () - [((Cast - (IntegerConstant 4 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 4 (Integer 8)) - )) - ((Cast - (IntegerConstant 3 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 3 (Integer 8)) - ))] - (Integer 4) - () - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_chr-91f4987.json b/tests/reference/asr-test_chr-91f4987.json deleted file mode 100644 index ca5829edf9..0000000000 --- a/tests/reference/asr-test_chr-91f4987.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_chr-91f4987", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_chr.py", - "infile_hash": "6520b636dd89e03d59caf9be2e7d6ec001e758ec0a92de2286b691bc", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_chr-91f4987.stderr", - "stderr_hash": "87fff5dabdc4a4c52a0f07fd59bcc25ba6a3b29a391b39d404b8e2bc", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_chr-91f4987.stderr b/tests/reference/asr-test_chr-91f4987.stderr deleted file mode 100644 index 18bb9fac87..0000000000 --- a/tests/reference/asr-test_chr-91f4987.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'f64' object cannot be interpreted as an integer - --> tests/errors/test_chr.py:3:13 - | -3 | s = chr(973.2) - | ^^^^^ diff --git a/tests/reference/asr-test_compare_01-c594bbe.json b/tests/reference/asr-test_compare_01-c594bbe.json deleted file mode 100644 index 4871c78f6e..0000000000 --- a/tests/reference/asr-test_compare_01-c594bbe.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_compare_01-c594bbe", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_compare_01.py", - "infile_hash": "8608b530e3b0ed2d0bff0ce0e137537fff92259ffded965d5f03d5dc", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_compare_01-c594bbe.stderr", - "stderr_hash": "65fb5b04ca1f56cae946ed2db3cde1380d0d9976114c340acfbbcf7b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_compare_01-c594bbe.stderr b/tests/reference/asr-test_compare_01-c594bbe.stderr deleted file mode 100644 index 868af63d50..0000000000 --- a/tests/reference/asr-test_compare_01-c594bbe.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in comparison operator, the types must be compatible - --> tests/errors/test_compare_01.py:6:11 - | -6 | print(i16(x) > f32(y)) - | ^^^^^^ ^^^^^^ type mismatch ('i16' and 'f32') diff --git a/tests/reference/asr-test_compare_02-bf2c76e.json b/tests/reference/asr-test_compare_02-bf2c76e.json deleted file mode 100644 index de5b576dce..0000000000 --- a/tests/reference/asr-test_compare_02-bf2c76e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_compare_02-bf2c76e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_compare_02.py", - "infile_hash": "16c5516272fbd5a54c9039bfe614e3813425f92826025c0ed5671341", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_compare_02-bf2c76e.stderr", - "stderr_hash": "b7fd0ded0c7519927e22a838a2b5156d7cb6b3728bb463ecb5907bfd", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_compare_02-bf2c76e.stderr b/tests/reference/asr-test_compare_02-bf2c76e.stderr deleted file mode 100644 index a8843ae5ee..0000000000 --- a/tests/reference/asr-test_compare_02-bf2c76e.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in comparison operator, the types must be compatible - --> tests/errors/test_compare_02.py:6:11 - | -6 | print(x > y) - | ^ ^ type mismatch ('i32' and 'u32') diff --git a/tests/reference/asr-test_complex_01-a6def58.json b/tests/reference/asr-test_complex_01-a6def58.json deleted file mode 100644 index 2a3e22a7fa..0000000000 --- a/tests/reference/asr-test_complex_01-a6def58.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_complex_01-a6def58", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_complex_01.py", - "infile_hash": "e580480b37e5bbfcd01d5eb412375a8a3c1ef374b5fedfb661485763", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_complex_01-a6def58.stderr", - "stderr_hash": "5e372192068e09afc8e388039c24decbd5a11c27b4143b5643bebd10", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_complex_01-a6def58.stderr b/tests/reference/asr-test_complex_01-a6def58.stderr deleted file mode 100644 index f87f59ca76..0000000000 --- a/tests/reference/asr-test_complex_01-a6def58.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_complex_01.py:17:9 - | -17 | x = complex(4.5, 6.7) - | ^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_02-782ba2d.json b/tests/reference/asr-test_complex_02-782ba2d.json deleted file mode 100644 index 3fa259e305..0000000000 --- a/tests/reference/asr-test_complex_02-782ba2d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_complex_02-782ba2d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_complex_02.py", - "infile_hash": "e6ee66d952deccec11d316a09f1d5b4bb4916ceb56a41a11dee03ae9", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_complex_02-782ba2d.stderr", - "stderr_hash": "dc3a153532aa537903852b8334a63d785edb99a11aff4e951c28b5c6", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_complex_02-782ba2d.stderr b/tests/reference/asr-test_complex_02-782ba2d.stderr deleted file mode 100644 index b61ce381bd..0000000000 --- a/tests/reference/asr-test_complex_02-782ba2d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_complex_02.py:5:13 - | -5 | x = c32(complex(3, 4)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_dict1-a45a075.json b/tests/reference/asr-test_dict1-a45a075.json deleted file mode 100644 index eeb9ffe3f7..0000000000 --- a/tests/reference/asr-test_dict1-a45a075.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict1-a45a075", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict1.py", - "infile_hash": "cfdb4968d923dac52c9637a8283f1a48ea3bdab2afde206cafaf925a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict1-a45a075.stderr", - "stderr_hash": "a9fbe4acc4f82141b1111e9aef3d3c50f27540d41ff3382fe46da8ea", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict1-a45a075.stderr b/tests/reference/asr-test_dict1-a45a075.stderr deleted file mode 100644 index 01fe7b133f..0000000000 --- a/tests/reference/asr-test_dict1-a45a075.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Key type should be 'i32' instead of 'str' - --> tests/errors/test_dict1.py:5:11 - | -5 | z = x["a"] - | ^^^ diff --git a/tests/reference/asr-test_dict10-8c0beff.json b/tests/reference/asr-test_dict10-8c0beff.json deleted file mode 100644 index 2b2342369e..0000000000 --- a/tests/reference/asr-test_dict10-8c0beff.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict10-8c0beff", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict10.py", - "infile_hash": "4cd31b5d018919c4889a0316adea871ea25d0587d04bd28d1d8e6cd4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict10-8c0beff.stderr", - "stderr_hash": "06772bed43d8fff0fb889a763afb49307005f50ce26c7a601652e258", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict10-8c0beff.stderr b/tests/reference/asr-test_dict10-8c0beff.stderr deleted file mode 100644 index 58c4edd7d3..0000000000 --- a/tests/reference/asr-test_dict10-8c0beff.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict10.py:4:8 - | -4 | d: dict[c32, f64] = {} - | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict11-2ab4e6c.json b/tests/reference/asr-test_dict11-2ab4e6c.json deleted file mode 100644 index c91886a137..0000000000 --- a/tests/reference/asr-test_dict11-2ab4e6c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict11-2ab4e6c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict11.py", - "infile_hash": "4f1af506664662506acd3ce990f1b72ff744bb873162c9fe32dd9236", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict11-2ab4e6c.stderr", - "stderr_hash": "6ef78d7738e0780fc0f9b9567390798b3d74374b95d0dd156ccbdab4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict11-2ab4e6c.stderr b/tests/reference/asr-test_dict11-2ab4e6c.stderr deleted file mode 100644 index fcc460b76f..0000000000 --- a/tests/reference/asr-test_dict11-2ab4e6c.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict11.py:4:8 - | -4 | d: dict[c64, f32] = {} - | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict12-7c74d08.json b/tests/reference/asr-test_dict12-7c74d08.json deleted file mode 100644 index 9922026e7b..0000000000 --- a/tests/reference/asr-test_dict12-7c74d08.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict12-7c74d08", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict12.py", - "infile_hash": "4a8a3f88d0c29a68083bc142a792c35b6f13d7bdf1a635f91920baeb", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict12-7c74d08.stderr", - "stderr_hash": "9243262b97e5e6a555eafbbfd93440e86e66a3536cc0fb9902a7e0d2", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict12-7c74d08.stderr b/tests/reference/asr-test_dict12-7c74d08.stderr deleted file mode 100644 index 5f9fb390f6..0000000000 --- a/tests/reference/asr-test_dict12-7c74d08.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict12.py:2:11 - | -2 | print({0.0: 1.1}) # constant dict with floating point value as key - | ^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict13-683b290.json b/tests/reference/asr-test_dict13-683b290.json deleted file mode 100644 index 3f08b12f0a..0000000000 --- a/tests/reference/asr-test_dict13-683b290.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict13-683b290", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict13.py", - "infile_hash": "ee757d46a81447cf45321822e379e83acbecd32578e300f27fc93d1b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict13-683b290.stderr", - "stderr_hash": "26039da2a42594ace7df2672a7bec3e88607caa7b45e35024b33df62", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict13-683b290.stderr b/tests/reference/asr-test_dict13-683b290.stderr deleted file mode 100644 index b22b070fa2..0000000000 --- a/tests/reference/asr-test_dict13-683b290.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_dict13.py:2:12 - | -2 | print({complex(0.0, 1.0): 1.1}) # constant dict with complex value as key - | ^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_dict2-4587f02.json b/tests/reference/asr-test_dict2-4587f02.json deleted file mode 100644 index 270d51c545..0000000000 --- a/tests/reference/asr-test_dict2-4587f02.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict2-4587f02", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict2.py", - "infile_hash": "300adb7c040d5d2035f7da25a633f6f83b5adc55b572990ad4403a5b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict2-4587f02.stderr", - "stderr_hash": "9de5d75622644a0cb98bdd3f73249772c25c293f508343b31cc34607", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict2-4587f02.stderr b/tests/reference/asr-test_dict2-4587f02.stderr deleted file mode 100644 index dde39a40a8..0000000000 --- a/tests/reference/asr-test_dict2-4587f02.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Key type should be 'str' instead of 'i32' - --> tests/errors/test_dict2.py:4:7 - | -4 | y[1] = -3 - | ^ diff --git a/tests/reference/asr-test_dict3-d28f38f.json b/tests/reference/asr-test_dict3-d28f38f.json deleted file mode 100644 index ea944408ea..0000000000 --- a/tests/reference/asr-test_dict3-d28f38f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict3-d28f38f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict3.py", - "infile_hash": "c8930919a9c47244ed4c57c1235dd2000650eb61dbfb6f413ae934e0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict3-d28f38f.stderr", - "stderr_hash": "e2cc26634c1ee7aeca96c006b3bd01205200e1a6187e01fde041c3b4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict3-d28f38f.stderr b/tests/reference/asr-test_dict3-d28f38f.stderr deleted file mode 100644 index da5a97b2ce..0000000000 --- a/tests/reference/asr-test_dict3-d28f38f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in get's key value, the types must be compatible - --> tests/errors/test_dict3.py:5:15 - | -5 | x = y.get(1) - | ^ type mismatch (found: 'i32', expected: 'str') diff --git a/tests/reference/asr-test_dict4-39489fa.json b/tests/reference/asr-test_dict4-39489fa.json deleted file mode 100644 index dbe64e91c0..0000000000 --- a/tests/reference/asr-test_dict4-39489fa.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict4-39489fa", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict4.py", - "infile_hash": "57a17d3e7e3cc326f2a93d347e449280731ace5ae21a1fb910da5ba1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict4-39489fa.stderr", - "stderr_hash": "fee0e93265feaf634ae62eded08ec63f6c37530369217731b552de61", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict4-39489fa.stderr b/tests/reference/asr-test_dict4-39489fa.stderr deleted file mode 100644 index 1b9e3847a8..0000000000 --- a/tests/reference/asr-test_dict4-39489fa.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/test_dict4.py:2:5 - | -2 | d: dict[i32, i32] = {1: "a", 2: "b"} - | ^ ^^^^^^^^^^^^^^^^ type mismatch ('dict[i32, i32]' and 'dict[i32, str]') diff --git a/tests/reference/asr-test_dict5-c436d37.json b/tests/reference/asr-test_dict5-c436d37.json deleted file mode 100644 index 4c7034730c..0000000000 --- a/tests/reference/asr-test_dict5-c436d37.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict5-c436d37", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict5.py", - "infile_hash": "4b1b45fc39df2a77ce477a006b9316550569af0309b0ac99562acf30", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict5-c436d37.stderr", - "stderr_hash": "85918b86a904812b9f151ec636dac3c770446a33ebac2f5910591ea7", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict5-c436d37.stderr b/tests/reference/asr-test_dict5-c436d37.stderr deleted file mode 100644 index c38b8997ba..0000000000 --- a/tests/reference/asr-test_dict5-c436d37.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_dict5.py:3:5 - | -3 | d = {1: "a", 2: "b"} - | ^ ^^^^^^^^^^^^^^^^ type mismatch ('dict[i32, i32]' and 'dict[i32, str]') diff --git a/tests/reference/asr-test_dict6-95e3b14.json b/tests/reference/asr-test_dict6-95e3b14.json deleted file mode 100644 index 02c62b38c2..0000000000 --- a/tests/reference/asr-test_dict6-95e3b14.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict6-95e3b14", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict6.py", - "infile_hash": "96cf7e14615e027428b3f60969ef27fd9dbb07171e9088dfbede5d06", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict6-95e3b14.stderr", - "stderr_hash": "786fd07ddc3919823741b0db9a9ff0ba898b106d677657ea5f80fd2e", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict6-95e3b14.stderr b/tests/reference/asr-test_dict6-95e3b14.stderr deleted file mode 100644 index 9da26030e6..0000000000 --- a/tests/reference/asr-test_dict6-95e3b14.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in pop's key value, the types must be compatible - --> tests/errors/test_dict6.py:5:17 - | -5 | res = d.pop("a") - | ^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_dict7-1415e14.json b/tests/reference/asr-test_dict7-1415e14.json deleted file mode 100644 index 64eb4e7eb3..0000000000 --- a/tests/reference/asr-test_dict7-1415e14.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict7-1415e14", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict7.py", - "infile_hash": "37950c687da9eedd23b6803bade370f46cb40fb89270d032722caf33", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict7-1415e14.stderr", - "stderr_hash": "a51d1d4a46839e1f4258410e979ba83a14abe8c011482e30be2336cd", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict7-1415e14.stderr b/tests/reference/asr-test_dict7-1415e14.stderr deleted file mode 100644 index 7884efa64e..0000000000 --- a/tests/reference/asr-test_dict7-1415e14.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: unhashable type in dict: 'slice' - --> tests/errors/test_dict7.py:4:11 - | -4 | print(d[1:2]) - | ^^^^^^ diff --git a/tests/reference/asr-test_dict8-d960ce0.json b/tests/reference/asr-test_dict8-d960ce0.json deleted file mode 100644 index 303c677d1d..0000000000 --- a/tests/reference/asr-test_dict8-d960ce0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict8-d960ce0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict8.py", - "infile_hash": "a27a4c687822a5d03dba00df1201fac438fd4eb20479020de3563655", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict8-d960ce0.stderr", - "stderr_hash": "c2dcf3e38154f9a69328274fafd4940b8b6296d31f442c01c88eaa0e", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict8-d960ce0.stderr b/tests/reference/asr-test_dict8-d960ce0.stderr deleted file mode 100644 index 050138ffac..0000000000 --- a/tests/reference/asr-test_dict8-d960ce0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict8.py:4:8 - | -4 | d: dict[f64, f64] = {} - | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict9-907bda7.json b/tests/reference/asr-test_dict9-907bda7.json deleted file mode 100644 index 3603e2ca62..0000000000 --- a/tests/reference/asr-test_dict9-907bda7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_dict9-907bda7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_dict9.py", - "infile_hash": "09f382db99b7d322807aa7fcb8d12673a41ea17047b8adcd5b6302b1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_dict9-907bda7.stderr", - "stderr_hash": "3278571c4f1c492f88f33ca78dcf8fb5051f9e3ca89df7557b7881f6", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_dict9-907bda7.stderr b/tests/reference/asr-test_dict9-907bda7.stderr deleted file mode 100644 index a1394398fa..0000000000 --- a/tests/reference/asr-test_dict9-907bda7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. - --> tests/errors/test_dict9.py:4:8 - | -4 | d: dict[f32, f64] = {} - | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_end_sep_keywords-2226a67.json b/tests/reference/asr-test_end_sep_keywords-2226a67.json deleted file mode 100644 index fe42925e16..0000000000 --- a/tests/reference/asr-test_end_sep_keywords-2226a67.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_end_sep_keywords-2226a67", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/test_end_sep_keywords.py", - "infile_hash": "5ea30711228d4ebb64266988c1a706a3d64f196457b939ed3bf15ecf", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_end_sep_keywords-2226a67.stdout", - "stdout_hash": "4946b03b00e3231e12fb3fc0f79a7b715cedf4e5dc74b3625a3098ae", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_end_sep_keywords-2226a67.stdout b/tests/reference/asr-test_end_sep_keywords-2226a67.stdout deleted file mode 100644 index bf7c34cdc1..0000000000 --- a/tests/reference/asr-test_end_sep_keywords-2226a67.stdout +++ /dev/null @@ -1,189 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [testEndSepKeywords] - [] - [(SubroutineCall - 2 testEndSepKeywords - () - [] - () - )] - () - Public - .false. - .false. - () - ), - testEndSepKeywords: - (Function - (SymbolTable - 3 - { - - }) - testEndSepKeywords - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(Print - () - [(StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "lmn" - (Character 1 3 ()) - ) - (StringConstant - "pqr" - (Character 1 3 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "lmn" - (Character 1 3 ()) - ) - (StringConstant - "pqr" - (Character 1 3 ()) - )] - (StringConstant - "+" - (Character 1 1 ()) - ) - () - ) - (Print - () - [(StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "lmn" - (Character 1 3 ()) - ) - (StringConstant - "pqr" - (Character 1 3 ()) - )] - () - (StringConstant - "xyz\n" - (Character 1 4 ()) - ) - ) - (Print - () - [(StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "lmn" - (Character 1 3 ()) - ) - (StringConstant - "pqr" - (Character 1 3 ()) - )] - (StringConstant - "+" - (Character 1 1 ()) - ) - (StringConstant - "xyz\n" - (Character 1 4 ()) - ) - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_for2-e5d893f.json b/tests/reference/asr-test_for2-e5d893f.json deleted file mode 100644 index 0067f33cd4..0000000000 --- a/tests/reference/asr-test_for2-e5d893f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_for2-e5d893f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_for2.py", - "infile_hash": "8a05d06e94c344432594db8536e6fed71767f109b03afea0a0b80d87", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_for2-e5d893f.stderr", - "stderr_hash": "07152b2e843a1a3ea9ab8e5c7c620d4ecc9f29ef1408d48055028b95", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_for2-e5d893f.stderr b/tests/reference/asr-test_for2-e5d893f.stderr deleted file mode 100644 index db88c88721..0000000000 --- a/tests/reference/asr-test_for2-e5d893f.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: For loop increment type should be Integer. - --> tests/errors/test_for2.py:3:5 - 4:16 - | -3 | for i in range(0.0, 1.0, 0.4): - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... -... - | -4 | print(i) - | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_func_args-a898a72.json b/tests/reference/asr-test_func_args-a898a72.json deleted file mode 100644 index 52ff1af35d..0000000000 --- a/tests/reference/asr-test_func_args-a898a72.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_func_args-a898a72", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_func_args.py", - "infile_hash": "5fae2ad01849e5ba3fca0a85455a92199a779be76b908fed30fb6b7d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_func_args-a898a72.stderr", - "stderr_hash": "b498b34cd18395e17ab982dc47abb832c01bd16ede103fad53068304", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_func_args-a898a72.stderr b/tests/reference/asr-test_func_args-a898a72.stderr deleted file mode 100644 index ec5891080a..0000000000 --- a/tests/reference/asr-test_func_args-a898a72.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Number of arguments does not match in the function call - --> tests/errors/test_func_args.py:11:11 - | -11 | ans = fib(35, 10) - | ^^^^^^^^^^^ (found: '2', expected: '1') diff --git a/tests/reference/asr-test_import_01-b859c43.json b/tests/reference/asr-test_import_01-b859c43.json deleted file mode 100644 index 4c1f0a511b..0000000000 --- a/tests/reference/asr-test_import_01-b859c43.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_import_01-b859c43", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_import_01.py", - "infile_hash": "291b8bf62b25eaad7edd1fb6e4bd22d21c1dda6e488fa68562a98e99", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_import_01-b859c43.stderr", - "stderr_hash": "ef59d49c8273cdd97e830cac94b3cc620fb24b07ce00c3394081c9c5", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_import_01-b859c43.stderr b/tests/reference/asr-test_import_01-b859c43.stderr deleted file mode 100644 index a2a50d4911..0000000000 --- a/tests/reference/asr-test_import_01-b859c43.stderr +++ /dev/null @@ -1,10 +0,0 @@ -semantic error: Type mismatch in procedure call; the types must be compatible - --> tests/errors/test_import_01.py:4:22 - | -4 | X: Const[f64] = test(5.0) - | ^^^ type mismatch (passed argument type is f64 but required type is i32) - - --> tests/errors/test_import/test_import_1.py:3:13 - | -3 | def test(x: i32) -> i32: - | ^^^ type mismatch (passed argument type is f64 but required type is i32) diff --git a/tests/reference/asr-test_import_02-55b47fa.json b/tests/reference/asr-test_import_02-55b47fa.json deleted file mode 100644 index 04b0cf247e..0000000000 --- a/tests/reference/asr-test_import_02-55b47fa.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_import_02-55b47fa", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_import_02.py", - "infile_hash": "a3326a7bd9f6acc935235e1c0ff9cf4c26eda5f4052af774a148856c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_import_02-55b47fa.stderr", - "stderr_hash": "b30859152322cc22b1593d3af229c7b28fbc8bc03eb6542fec3a3c91", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_import_02-55b47fa.stderr b/tests/reference/asr-test_import_02-55b47fa.stderr deleted file mode 100644 index 2c4a4fd389..0000000000 --- a/tests/reference/asr-test_import_02-55b47fa.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'test_import_2' located in tests/errors/test_import/test_import_2.py cannot be loaded - --> tests/errors/test_import_02.py:1:1 - | -1 | from test_import.test_import_2 import X - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -semantic error: Type mismatch in annotation-assignment, the types must be compatible - --> tests/errors/test_import/test_import_2.py:3:1 - | -3 | X: Const[i32] = 1.23 - | ^ ^^^^ type mismatch ('i32' and 'f64') diff --git a/tests/reference/asr-test_len1-839a615.json b/tests/reference/asr-test_len1-839a615.json deleted file mode 100644 index ee88e63b6e..0000000000 --- a/tests/reference/asr-test_len1-839a615.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_len1-839a615", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_len1.py", - "infile_hash": "a233dd883c545df2d1f853fc95c6ed9a68122fcfbd822cf96804a1ca", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_len1-839a615.stderr", - "stderr_hash": "50478fbc4d3bc86e9bf6cf012d810f31885d5e654423a0384557f919", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_len1-839a615.stderr b/tests/reference/asr-test_len1-839a615.stderr deleted file mode 100644 index 2a491e7a48..0000000000 --- a/tests/reference/asr-test_len1-839a615.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: len() is only supported for `str`, `set`, `dict`, `list` and `tuple` - --> tests/errors/test_len1.py:4:11 - | -4 | print(len(x)) - | ^^^^^^ diff --git a/tests/reference/asr-test_list1-73fd538.json b/tests/reference/asr-test_list1-73fd538.json deleted file mode 100644 index 33b0c94fc7..0000000000 --- a/tests/reference/asr-test_list1-73fd538.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list1-73fd538", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list1.py", - "infile_hash": "bab0faf6c848b07f8cbce0ed060c0f067f38963ce247d150559a75b4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list1-73fd538.stderr", - "stderr_hash": "8c791203aa1be4c1cb8911aaaf447a5e706cc00d17dfeba0b17c283b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list1-73fd538.stderr b/tests/reference/asr-test_list1-73fd538.stderr deleted file mode 100644 index a9f4fd03cf..0000000000 --- a/tests/reference/asr-test_list1-73fd538.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in 'remove', the types must be compatible - --> tests/errors/test_list1.py:6:14 - | -6 | a.remove('error') - | ^^^^^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_list2-10ffdd7.json b/tests/reference/asr-test_list2-10ffdd7.json deleted file mode 100644 index 0510d548d4..0000000000 --- a/tests/reference/asr-test_list2-10ffdd7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list2-10ffdd7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list2.py", - "infile_hash": "1922554710c3c0cc93710512c5634e4a06f14e5e28dc169b6eac3fe2", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list2-10ffdd7.stderr", - "stderr_hash": "be192bc4655f28313c415c7180d676e0383f0acb7e4de75a6b3d1a37", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list2-10ffdd7.stderr b/tests/reference/asr-test_list2-10ffdd7.stderr deleted file mode 100644 index 0607fb8266..0000000000 --- a/tests/reference/asr-test_list2-10ffdd7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: append() takes exactly one argument - --> tests/errors/test_list2.py:6:5 - | -6 | a.append(4, 5) - | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_list3-5f4d2a8.json b/tests/reference/asr-test_list3-5f4d2a8.json deleted file mode 100644 index 09d515e69a..0000000000 --- a/tests/reference/asr-test_list3-5f4d2a8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list3-5f4d2a8", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list3.py", - "infile_hash": "f512b77e66fe356108135243473cf9441bc532310547070a9aeef3e9", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list3-5f4d2a8.stderr", - "stderr_hash": "3e8e102841bfe5ae8524aa793b39cdf33de7e7073744a01f0049b424", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list3-5f4d2a8.stderr b/tests/reference/asr-test_list3-5f4d2a8.stderr deleted file mode 100644 index 45d1ab0536..0000000000 --- a/tests/reference/asr-test_list3-5f4d2a8.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Argument to list.pop must be an integer - --> tests/errors/test_list3.py:5:9 - | -5 | x = a.pop(2.2) - | ^^^^^^^^^^ diff --git a/tests/reference/asr-test_list4-d18a7e3.json b/tests/reference/asr-test_list4-d18a7e3.json deleted file mode 100644 index af9e9f1da7..0000000000 --- a/tests/reference/asr-test_list4-d18a7e3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list4-d18a7e3", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list4.py", - "infile_hash": "d93fc79d9b95b91ea6dd5190f2320d2c84f25ff9c108dff9d13086c1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list4-d18a7e3.stderr", - "stderr_hash": "98922e9f57ab8e9d7af05424e9fdb93a9a1722114f5abb816439b161", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list4-d18a7e3.stderr b/tests/reference/asr-test_list4-d18a7e3.stderr deleted file mode 100644 index b3b4683868..0000000000 --- a/tests/reference/asr-test_list4-d18a7e3.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in index, expected a single integer or slice - --> tests/errors/test_list4.py:7:11 - | -7 | x = a[0.2] - | ^^^ type mismatch (found: 'f64', expected: 'i32' or slice) diff --git a/tests/reference/asr-test_list_concat-41d186f.json b/tests/reference/asr-test_list_concat-41d186f.json deleted file mode 100644 index ff64ae4aac..0000000000 --- a/tests/reference/asr-test_list_concat-41d186f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list_concat-41d186f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list_concat.py", - "infile_hash": "2dbbc047f2ededbe3c1cdebe412647006e9e7a7043514ad12857b7ec", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list_concat-41d186f.stderr", - "stderr_hash": "b0a3cfa79525db1ed6aa4ed1f47b11e4852da5a59e043d32a7814ede", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list_concat-41d186f.stderr b/tests/reference/asr-test_list_concat-41d186f.stderr deleted file mode 100644 index bdfcab29af..0000000000 --- a/tests/reference/asr-test_list_concat-41d186f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in shorthand operator, the types must be compatible - --> tests/errors/test_list_concat.py:8:3 - | -8 | a += b - | ^ ^ type mismatch ('list[i32]' and 'list[f64]') diff --git a/tests/reference/asr-test_list_count-4b42498.json b/tests/reference/asr-test_list_count-4b42498.json deleted file mode 100644 index f4864b55fb..0000000000 --- a/tests/reference/asr-test_list_count-4b42498.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list_count-4b42498", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list_count.py", - "infile_hash": "01975bd7c4bba02fd811de536b218167da99b532fa955b7bf8339779", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list_count-4b42498.stderr", - "stderr_hash": "f26efcc623b68ca43ef871eb01c8e3cbd1ae464baaa491c6e4969696", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list_count-4b42498.stderr b/tests/reference/asr-test_list_count-4b42498.stderr deleted file mode 100644 index ad60a50f0e..0000000000 --- a/tests/reference/asr-test_list_count-4b42498.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in 'count', the types must be compatible - --> tests/errors/test_list_count.py:6:13 - | -6 | a.count(1.0) - | ^^^ type mismatch (found: 'f64', expected: 'i32') diff --git a/tests/reference/asr-test_list_slicing-984fbf0.json b/tests/reference/asr-test_list_slicing-984fbf0.json deleted file mode 100644 index d525b6d6c9..0000000000 --- a/tests/reference/asr-test_list_slicing-984fbf0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_list_slicing-984fbf0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_list_slicing.py", - "infile_hash": "7dfe8cfa4697e4ce8bf18e24c5b11b969e8329febc711d83d2fba746", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_list_slicing-984fbf0.stderr", - "stderr_hash": "6763533f9c1730429d50f58b653595bfeef48c4d19943c36d037d023", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_list_slicing-984fbf0.stderr b/tests/reference/asr-test_list_slicing-984fbf0.stderr deleted file mode 100644 index dc773c9f70..0000000000 --- a/tests/reference/asr-test_list_slicing-984fbf0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: slice step cannot be zero - --> tests/errors/test_list_slicing.py:6:18 - | -6 | print(l[0:10:0]) - | ^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.json b/tests/reference/asr-test_max_min-3c2fc51.json deleted file mode 100644 index 7c51d764ca..0000000000 --- a/tests/reference/asr-test_max_min-3c2fc51.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_max_min-3c2fc51", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_max_min.py", - "infile_hash": "1aba932852adf8cc5dbff4a6ff83aa5de030dba5a5721eeace90a5d4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_max_min-3c2fc51.stderr", - "stderr_hash": "bc3642925ccc0f3f61e37e0bd20fc7100fddbfb37c06a3609ff78daf", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_max_min-3c2fc51.stderr b/tests/reference/asr-test_max_min-3c2fc51.stderr deleted file mode 100644 index 15c4a4ff5a..0000000000 --- a/tests/reference/asr-test_max_min-3c2fc51.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_max_min.py:7:12 - | -7 | assert max(a, b) == b - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_03-e600a49.json b/tests/reference/asr-test_numpy_03-e600a49.json deleted file mode 100644 index 11537ffe29..0000000000 --- a/tests/reference/asr-test_numpy_03-e600a49.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_numpy_03-e600a49", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_numpy_03.py", - "infile_hash": "5c3ea7436668441c056bd576ea77cdfb49e44a5f0e95088d0f62184e", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_numpy_03-e600a49.stderr", - "stderr_hash": "934ed2ca36b7a4e431b1e4fc8dbd37edd550f7dbb5d9dca7ed49ce61", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_03-e600a49.stderr b/tests/reference/asr-test_numpy_03-e600a49.stderr deleted file mode 100644 index 74f788b4cf..0000000000 --- a/tests/reference/asr-test_numpy_03-e600a49.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/test_numpy_03.py:2:1 - | -2 | from numpy import reshape, empty, int32, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_04-ecbb614.json b/tests/reference/asr-test_numpy_04-ecbb614.json deleted file mode 100644 index a0e2dcecdb..0000000000 --- a/tests/reference/asr-test_numpy_04-ecbb614.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_numpy_04-ecbb614", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_numpy_04.py", - "infile_hash": "0fbd0a4280966dd9a917d3a005887954325fb1ea5468fd28dcae930f", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_numpy_04-ecbb614.stderr", - "stderr_hash": "8f73238d34192a66d0659b3cc8e5f8a5339755da83a50790689cf53b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stderr b/tests/reference/asr-test_numpy_04-ecbb614.stderr deleted file mode 100644 index 7bc395d1fc..0000000000 --- a/tests/reference/asr-test_numpy_04-ecbb614.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/test_numpy_04.py:2:1 - | -2 | from numpy import array - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_operator_01-0f232bf.json b/tests/reference/asr-test_operator_01-0f232bf.json deleted file mode 100644 index 9cb9b85ba8..0000000000 --- a/tests/reference/asr-test_operator_01-0f232bf.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_operator_01-0f232bf", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_operator_01.py", - "infile_hash": "fe3fc1c23c2f63265b758b4d5d757943c1462811c5bc5e7a14abb64d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_operator_01-0f232bf.stderr", - "stderr_hash": "6f529c2fc1fc5a489879c5d684c3415269794e563be85d62098aed7c", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_operator_01-0f232bf.stderr b/tests/reference/asr-test_operator_01-0f232bf.stderr deleted file mode 100644 index 1a939f05a8..0000000000 --- a/tests/reference/asr-test_operator_01-0f232bf.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unary operator '-' not supported for type struct A - --> tests/errors/test_operator_01.py:9:11 - | -9 | print(-a) - | ^^ diff --git a/tests/reference/asr-test_ord-316ce61.json b/tests/reference/asr-test_ord-316ce61.json deleted file mode 100644 index 362e582d03..0000000000 --- a/tests/reference/asr-test_ord-316ce61.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_ord-316ce61", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_ord.py", - "infile_hash": "5ea1a821ece44ef24e91e5ba66152fd1c27bb3724d2cad2e7e2d96f2", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_ord-316ce61.stderr", - "stderr_hash": "dda39c93777d64449510b35e893d516cd53ac299cd2b5f19b08464bd", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_ord-316ce61.stderr b/tests/reference/asr-test_ord-316ce61.stderr deleted file mode 100644 index 45103fea10..0000000000 --- a/tests/reference/asr-test_ord-316ce61.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: ord() is only supported for `str` of length 1 - --> tests/errors/test_ord.py:3:13 - | -3 | i = ord('ab') - | ^^^^ diff --git a/tests/reference/asr-test_pointer_types-1bf0d01.json b/tests/reference/asr-test_pointer_types-1bf0d01.json deleted file mode 100644 index a832067275..0000000000 --- a/tests/reference/asr-test_pointer_types-1bf0d01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pointer_types-1bf0d01", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pointer_types.py", - "infile_hash": "c5290af854c1f4a76252d27a2ae05f309ae55b9d6fc6ee533989cec7", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pointer_types-1bf0d01.stderr", - "stderr_hash": "3fcd692a6b79b6b3f22fc7a2957df19219fc817446aa6d46f47d049f", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pointer_types-1bf0d01.stderr b/tests/reference/asr-test_pointer_types-1bf0d01.stderr deleted file mode 100644 index 4a61aeb2e6..0000000000 --- a/tests/reference/asr-test_pointer_types-1bf0d01.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Casting not supported for different pointer types. Received target pointer type, Pointer[i16[:]] and value pointer type, Pointer[i32[:]] - --> tests/errors/test_pointer_types.py:8:5 - | -8 | yptr1 = pointer(y) - | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_pow-3f5d550.json b/tests/reference/asr-test_pow-3f5d550.json deleted file mode 100644 index 95344abe65..0000000000 --- a/tests/reference/asr-test_pow-3f5d550.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pow-3f5d550", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pow.py", - "infile_hash": "073bf734150500a8b5e46940a9b0440e7e0fe30d0e2789ca049cef17", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pow-3f5d550.stderr", - "stderr_hash": "13a950a0d1f29b9a7cf4484858b22246b086a24919ca22f6b1d410b3", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pow-3f5d550.stderr b/tests/reference/asr-test_pow-3f5d550.stderr deleted file mode 100644 index c955d6b4bc..0000000000 --- a/tests/reference/asr-test_pow-3f5d550.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_pow.py:2:11 - | -2 | print(pow(2, 2)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_pow1-581ef42.json b/tests/reference/asr-test_pow1-581ef42.json deleted file mode 100644 index 2ef657f3ac..0000000000 --- a/tests/reference/asr-test_pow1-581ef42.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pow1-581ef42", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pow1.py", - "infile_hash": "a7ce7888e7e99bc753e16822749aaae4ee63641675990b3e2a34de10", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pow1-581ef42.stderr", - "stderr_hash": "32fe0eecb3687de0e976228815c25c96f3dc3e8f6491adb21c105ee6", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pow1-581ef42.stderr b/tests/reference/asr-test_pow1-581ef42.stderr deleted file mode 100644 index f1693701de..0000000000 --- a/tests/reference/asr-test_pow1-581ef42.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_pow1.py:4:11 - | -4 | print(pow(x,3)) - | ^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_pow2-0dcbd7d.json b/tests/reference/asr-test_pow2-0dcbd7d.json deleted file mode 100644 index 129acc3859..0000000000 --- a/tests/reference/asr-test_pow2-0dcbd7d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pow2-0dcbd7d", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pow2.py", - "infile_hash": "0df16d4f512305265cb2924e18db5753a4c422da3a7624f74f71d26f", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pow2-0dcbd7d.stderr", - "stderr_hash": "54113068b55d3eab93cd04927b2fbf6a384a4a0ed64f02aa6ea18f9b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pow2-0dcbd7d.stderr b/tests/reference/asr-test_pow2-0dcbd7d.stderr deleted file mode 100644 index edc4007245..0000000000 --- a/tests/reference/asr-test_pow2-0dcbd7d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_pow2.py:12:11 - | -12 | print(pow(a, b, c, d)) - | ^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_pow3-79749ed.json b/tests/reference/asr-test_pow3-79749ed.json deleted file mode 100644 index 7c5d30d4da..0000000000 --- a/tests/reference/asr-test_pow3-79749ed.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pow3-79749ed", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pow3.py", - "infile_hash": "884bdc831e2b2d01c30a2dd841307fd5674ab65e0c3819d17e3db500", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pow3-79749ed.stderr", - "stderr_hash": "199c8dc10f23e2053ec5498131683383bb4b20bf06b05bf1c5f7d747", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pow3-79749ed.stderr b/tests/reference/asr-test_pow3-79749ed.stderr deleted file mode 100644 index 3a157a0866..0000000000 --- a/tests/reference/asr-test_pow3-79749ed.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_pow3.py:8:11 - | -8 | print(pow(x, a)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_pow4-ef60978.json b/tests/reference/asr-test_pow4-ef60978.json deleted file mode 100644 index 8cfd3c1460..0000000000 --- a/tests/reference/asr-test_pow4-ef60978.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_pow4-ef60978", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_pow4.py", - "infile_hash": "af9b11ec50a82de28afac31faa4a78bdbeb5f317537fc37860b139cd", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_pow4-ef60978.stderr", - "stderr_hash": "e4796a76ca15b125485b820d259be4ce20ed67f403953372685b98d5", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_pow4-ef60978.stderr b/tests/reference/asr-test_pow4-ef60978.stderr deleted file mode 100644 index 2dc752cd36..0000000000 --- a/tests/reference/asr-test_pow4-ef60978.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_pow4.py:10:11 - | -10 | print(pow(x, a, b)) - | ^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_print1-f1f36f1.json b/tests/reference/asr-test_print1-f1f36f1.json deleted file mode 100644 index 0c4988e3a3..0000000000 --- a/tests/reference/asr-test_print1-f1f36f1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_print1-f1f36f1", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_print1.py", - "infile_hash": "824e91278f3717dbe58ef4c18f8df06f9c7d4644ca6f3a65cccdc9e0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_print1-f1f36f1.stderr", - "stderr_hash": "da6324bcc282ecb93fe6784b206f8a9d8f04ae56341339b13de71bd4", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_print1-f1f36f1.stderr b/tests/reference/asr-test_print1-f1f36f1.stderr deleted file mode 100644 index b28bc75a72..0000000000 --- a/tests/reference/asr-test_print1-f1f36f1.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Separator is expected to be of string type - --> tests/errors/test_print1.py:2:25 - | -2 | print("a", "b", sep=2) - | ^ Expected string, found: integer diff --git a/tests/reference/asr-test_print2-64acb15.json b/tests/reference/asr-test_print2-64acb15.json deleted file mode 100644 index 050b4cc698..0000000000 --- a/tests/reference/asr-test_print2-64acb15.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_print2-64acb15", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_print2.py", - "infile_hash": "af07d17d5b3f16db024a3e893923988349c8f6c8bf1a6c5507d56a6d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_print2-64acb15.stderr", - "stderr_hash": "e92bba85b957e7034c5172981b3b27ed7b3f0ac62167d82175890bc9", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_print2-64acb15.stderr b/tests/reference/asr-test_print2-64acb15.stderr deleted file mode 100644 index 6ed1c334b1..0000000000 --- a/tests/reference/asr-test_print2-64acb15.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: End is expected to be of string type - --> tests/errors/test_print2.py:2:26 - | -2 | print("a", "b", end=1) - | ^ Expected string, found: integer diff --git a/tests/reference/asr-test_return1-2603c9e.json b/tests/reference/asr-test_return1-2603c9e.json deleted file mode 100644 index cc65ed1a6a..0000000000 --- a/tests/reference/asr-test_return1-2603c9e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_return1-2603c9e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_return1.py", - "infile_hash": "ec68add4e9e8059a274ba97c4349b3a8f1a43a381eb6ab330995681e", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_return1-2603c9e.stderr", - "stderr_hash": "6449cc5e148acf72281e7ef604decd32889ceb27b87052fe8ff8eb50", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_return1-2603c9e.stderr b/tests/reference/asr-test_return1-2603c9e.stderr deleted file mode 100644 index 82fec8d42d..0000000000 --- a/tests/reference/asr-test_return1-2603c9e.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type Mismatch in return, found ('f64' and 'i32') - --> tests/errors/test_return1.py:4:5 - | -4 | return x - | ^^^^^^^^ diff --git a/tests/reference/asr-test_return2-add829b.json b/tests/reference/asr-test_return2-add829b.json deleted file mode 100644 index abdb4461f7..0000000000 --- a/tests/reference/asr-test_return2-add829b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_return2-add829b", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_return2.py", - "infile_hash": "6423d00b6ef8b232c393994d190121f76befdc32a2e5da21d655458b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_return2-add829b.stderr", - "stderr_hash": "493f7a8431e00a1bfeb1756b0718b0a40458883c8b9eb379f0c5b536", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_return2-add829b.stderr b/tests/reference/asr-test_return2-add829b.stderr deleted file mode 100644 index a9070a952d..0000000000 --- a/tests/reference/asr-test_return2-add829b.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Return type of function is not defined - --> tests/errors/test_return2.py:4:5 - | -4 | return x - | ^^^^^^^^ diff --git a/tests/reference/asr-test_set1-11379c7.json b/tests/reference/asr-test_set1-11379c7.json deleted file mode 100644 index 417bba61b8..0000000000 --- a/tests/reference/asr-test_set1-11379c7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_set1-11379c7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_set1.py", - "infile_hash": "54179c34d3818cd0b57d582c930226ce5443a43386ae981aab02e50b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_set1-11379c7.stderr", - "stderr_hash": "64dea3d94817d0666cf71481546f7ec61639f47a3b696fe96ae287c6", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_set1-11379c7.stderr b/tests/reference/asr-test_set1-11379c7.stderr deleted file mode 100644 index f5851bc83d..0000000000 --- a/tests/reference/asr-test_set1-11379c7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Argument to set.add must be of same type as set's element type - --> tests/errors/test_set1.py:6:5 - | -6 | a.add('err') - | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set2-d91a6f0.json b/tests/reference/asr-test_set2-d91a6f0.json deleted file mode 100644 index 4c1d7ad258..0000000000 --- a/tests/reference/asr-test_set2-d91a6f0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_set2-d91a6f0", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_set2.py", - "infile_hash": "2d561d934090bedc052b2ef17bc3ac9b59ed94298fd39cbea2c9ba15", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_set2-d91a6f0.stderr", - "stderr_hash": "36a3e507b04f030fc4e281ffe82947765ef640b6c558030957bd3e90", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_set2-d91a6f0.stderr b/tests/reference/asr-test_set2-d91a6f0.stderr deleted file mode 100644 index 29a2683c11..0000000000 --- a/tests/reference/asr-test_set2-d91a6f0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Call to set.remove must have exactly one argument - --> tests/errors/test_set2.py:6:5 - | -6 | a.remove('error', 'error2') - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set3-f9bbffb.json b/tests/reference/asr-test_set3-f9bbffb.json deleted file mode 100644 index 877113068e..0000000000 --- a/tests/reference/asr-test_set3-f9bbffb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_set3-f9bbffb", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_set3.py", - "infile_hash": "c4e83ae667bdaa458fd271a51e15d6c5f9a666f006e31de27a897571", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_set3-f9bbffb.stderr", - "stderr_hash": "1ec6cfef0827e97a905c5927de43b74452777394b1f5110e94e5cf97", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_set3-f9bbffb.stderr b/tests/reference/asr-test_set3-f9bbffb.stderr deleted file mode 100644 index ecc3bf6177..0000000000 --- a/tests/reference/asr-test_set3-f9bbffb.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: pop() takes no arguments (1 given) - --> tests/errors/test_set3.py:5:9 - | -5 | i = s.pop(3) - | ^^^^^^^^ diff --git a/tests/reference/asr-test_set4-53fea39.json b/tests/reference/asr-test_set4-53fea39.json deleted file mode 100644 index aad37eb089..0000000000 --- a/tests/reference/asr-test_set4-53fea39.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_set4-53fea39", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_set4.py", - "infile_hash": "3d78c7ad82aa32c3a4cc5f1a7d44e53b81639194f55672ddc99b4d2d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_set4-53fea39.stderr", - "stderr_hash": "d9646bd3609c55ff39f57ca435fedc7dabed530caf28caddc9e58a06", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_set4-53fea39.stderr b/tests/reference/asr-test_set4-53fea39.stderr deleted file mode 100644 index 9ce2e3863c..0000000000 --- a/tests/reference/asr-test_set4-53fea39.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Call to set.add must have exactly one argument - --> tests/errors/test_set4.py:6:5 - | -6 | a.add(3, 4) - | ^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set_indexing-a1c21b8.json b/tests/reference/asr-test_set_indexing-a1c21b8.json deleted file mode 100644 index 6bb6e96be3..0000000000 --- a/tests/reference/asr-test_set_indexing-a1c21b8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_set_indexing-a1c21b8", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_set_indexing.py", - "infile_hash": "24f02fc93b8ed20f1c9ea7ae862faa087d070ec288577b90b90b3bc5", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_set_indexing-a1c21b8.stderr", - "stderr_hash": "fe69096aca9c3be072acac0e28081e5378f30d4ba335176abc76c555", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_set_indexing-a1c21b8.stderr b/tests/reference/asr-test_set_indexing-a1c21b8.stderr deleted file mode 100644 index 1a7be88156..0000000000 --- a/tests/reference/asr-test_set_indexing-a1c21b8.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: 'set' object is not subscriptable - --> tests/errors/test_set_indexing.py:7:9 - | -7 | a = s[0] - | ^^^^ diff --git a/tests/reference/asr-test_str_capitalize-9f8dfa9.json b/tests/reference/asr-test_str_capitalize-9f8dfa9.json deleted file mode 100644 index 88a959a54d..0000000000 --- a/tests/reference/asr-test_str_capitalize-9f8dfa9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_capitalize-9f8dfa9", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_capitalize.py", - "infile_hash": "692d46b579b69174d3f9bc7091d1b79d6e003fd14bc669a6f93dcb80", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_capitalize-9f8dfa9.stderr", - "stderr_hash": "7dea3deffeee54e7f479d4c0dbcd7b5aab3b1a28e4a568adfb52cf51", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr b/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr deleted file mode 100644 index c04687d572..0000000000 --- a/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: str.capitalize() takes no arguments - --> tests/errors/test_str_capitalize.py:4:9 - | -4 | s = s.capitalize(23) - | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_str_indexing-b200a4e.json b/tests/reference/asr-test_str_indexing-b200a4e.json deleted file mode 100644 index 1193d8bad7..0000000000 --- a/tests/reference/asr-test_str_indexing-b200a4e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_indexing-b200a4e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_indexing.py", - "infile_hash": "d237030704fd7f04d4cad59083ca0d663561f9be6f3407e3ed04ed78", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_indexing-b200a4e.stderr", - "stderr_hash": "eddc45a6ba83dc10551fd9685b6ea1096828ae29f6b9cce07cfe5de1", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_indexing-b200a4e.stderr b/tests/reference/asr-test_str_indexing-b200a4e.stderr deleted file mode 100644 index fb521217df..0000000000 --- a/tests/reference/asr-test_str_indexing-b200a4e.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in index, expected a single integer or slice - --> tests/errors/test_str_indexing.py:4:13 - | -4 | print(s[1.2]) - | ^^^ type mismatch (found: 'f64', expected: 'i32' or slice) diff --git a/tests/reference/asr-test_str_slicing-eca1381.json b/tests/reference/asr-test_str_slicing-eca1381.json deleted file mode 100644 index 684a869d6a..0000000000 --- a/tests/reference/asr-test_str_slicing-eca1381.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_slicing-eca1381", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_slicing.py", - "infile_hash": "24041d5ae8086e162ce7fa574ad5877102af8f718ad33bea7006260d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_slicing-eca1381.stderr", - "stderr_hash": "7374319e4378d1cc717e1bab3f68f207cb90c40c168d5700c77d189b", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing-eca1381.stderr b/tests/reference/asr-test_str_slicing-eca1381.stderr deleted file mode 100644 index d50b2ffd94..0000000000 --- a/tests/reference/asr-test_str_slicing-eca1381.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: slice indices must be integers or None - --> tests/errors/test_str_slicing.py:4:15 - | -4 | print(s[1:2.2]) - | ^^^ diff --git a/tests/reference/asr-test_str_slicing2-2f07e9a.json b/tests/reference/asr-test_str_slicing2-2f07e9a.json deleted file mode 100644 index dc63e9a7b0..0000000000 --- a/tests/reference/asr-test_str_slicing2-2f07e9a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_slicing2-2f07e9a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_slicing2.py", - "infile_hash": "eb9027d2b6ec0aba9cc78aeedc1b0b36972ff36b076fecf547eeb014", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_slicing2-2f07e9a.stderr", - "stderr_hash": "48a9286126c2333bdf5237358bd4ad27acac4a16a78069c9bd36d089", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing2-2f07e9a.stderr b/tests/reference/asr-test_str_slicing2-2f07e9a.stderr deleted file mode 100644 index 94a5f03259..0000000000 --- a/tests/reference/asr-test_str_slicing2-2f07e9a.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: slice indices must be integers or None - --> tests/errors/test_str_slicing2.py:4:13 - | -4 | print(s[1.5:3]) - | ^^^ diff --git a/tests/reference/asr-test_str_slicing3-fe6a03c.json b/tests/reference/asr-test_str_slicing3-fe6a03c.json deleted file mode 100644 index d1fe49fdfe..0000000000 --- a/tests/reference/asr-test_str_slicing3-fe6a03c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_slicing3-fe6a03c", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_slicing3.py", - "infile_hash": "b223abc3ec96fe91876fa188259f151d61383687776e8975df45b139", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_slicing3-fe6a03c.stderr", - "stderr_hash": "5f7553d1509bed25d5137abc4fc2cb1d2cb983a1fab81d8d178ed197", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing3-fe6a03c.stderr b/tests/reference/asr-test_str_slicing3-fe6a03c.stderr deleted file mode 100644 index b1180c30ae..0000000000 --- a/tests/reference/asr-test_str_slicing3-fe6a03c.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: slice indices must be integers or None - --> tests/errors/test_str_slicing3.py:4:17 - | -4 | print(s[1:3:0.5]) - | ^^^ diff --git a/tests/reference/asr-test_str_slicing4-a0c7a69.json b/tests/reference/asr-test_str_slicing4-a0c7a69.json deleted file mode 100644 index ceff8659bb..0000000000 --- a/tests/reference/asr-test_str_slicing4-a0c7a69.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_slicing4-a0c7a69", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_slicing4.py", - "infile_hash": "7bd3e8d21550f50244ee88e383dbd42cde33f03c516cfcaaeaaadd71", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_slicing4-a0c7a69.stderr", - "stderr_hash": "a5dd047df86649936606a0b134d10e76c6aacb224319be4aefd64bfe", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing4-a0c7a69.stderr b/tests/reference/asr-test_str_slicing4-a0c7a69.stderr deleted file mode 100644 index 8709b99ee8..0000000000 --- a/tests/reference/asr-test_str_slicing4-a0c7a69.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: slice step cannot be zero - --> tests/errors/test_str_slicing4.py:4:17 - | -4 | print(s[0:1:0]) - | ^ diff --git a/tests/reference/asr-test_str_to_int-61553e7.json b/tests/reference/asr-test_str_to_int-61553e7.json deleted file mode 100644 index ac1093b9c8..0000000000 --- a/tests/reference/asr-test_str_to_int-61553e7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_str_to_int-61553e7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_str_to_int.py", - "infile_hash": "da0ed82ada98ef2757178c4997af53abc82f4761a0e683a613216c64", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_str_to_int-61553e7.stderr", - "stderr_hash": "1998e37d9abe044f164c73ea1e000ce748ed43af5ea14c2eb4715f11", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_str_to_int-61553e7.stderr b/tests/reference/asr-test_str_to_int-61553e7.stderr deleted file mode 100644 index 785d95ba7f..0000000000 --- a/tests/reference/asr-test_str_to_int-61553e7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: invalid literal for int() with base 10: '3abc' - --> tests/errors/test_str_to_int.py:2:15 - | -2 | print(int('3abc')) - | ^^^^^^ diff --git a/tests/reference/asr-test_tuple1-7abe88f.json b/tests/reference/asr-test_tuple1-7abe88f.json deleted file mode 100644 index e308970eea..0000000000 --- a/tests/reference/asr-test_tuple1-7abe88f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_tuple1-7abe88f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_tuple1.py", - "infile_hash": "4716ea56ce9d57a0d88ffeb9fca4e09204f7a2c1166a5315c4d1245c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_tuple1-7abe88f.stderr", - "stderr_hash": "56df3d46c63077fcdd09c3b54b63e6e096d7d39b2f8cfb61dab0930a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple1-7abe88f.stderr b/tests/reference/asr-test_tuple1-7abe88f.stderr deleted file mode 100644 index c66cc64946..0000000000 --- a/tests/reference/asr-test_tuple1-7abe88f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in assignment, the types must be compatible - --> tests/errors/test_tuple1.py:3:3 - | -3 | t = (1, 2) - | ^ ^^^^^^ type mismatch ('tuple[i32, str]' and 'tuple[i32, i32]') diff --git a/tests/reference/asr-test_tuple2-b046610.json b/tests/reference/asr-test_tuple2-b046610.json deleted file mode 100644 index 051ed20bfb..0000000000 --- a/tests/reference/asr-test_tuple2-b046610.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_tuple2-b046610", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_tuple2.py", - "infile_hash": "84aa4ecdd21f5d633975d08f6927a7d336c47a31c2fd2bc42cae1c7b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_tuple2-b046610.stderr", - "stderr_hash": "1e22bbde9c9fdc171314f1158dcac6bf6373d94e00c9878f66d7b667", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple2-b046610.stderr b/tests/reference/asr-test_tuple2-b046610.stderr deleted file mode 100644 index e99518093e..0000000000 --- a/tests/reference/asr-test_tuple2-b046610.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Runtime Indexing with tuple[i32, i32, i32] is not possible. - --> tests/errors/test_tuple2.py:4:11 - | -4 | print(t[x]) - | ^^^^ diff --git a/tests/reference/asr-test_tuple3-19fa47f.json b/tests/reference/asr-test_tuple3-19fa47f.json deleted file mode 100644 index 0a703f17d4..0000000000 --- a/tests/reference/asr-test_tuple3-19fa47f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_tuple3-19fa47f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_tuple3.py", - "infile_hash": "cfa12cc4d8456bfd45e77cc49c5e8d2417181a1443cdaaf8b15c0528", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_tuple3-19fa47f.stderr", - "stderr_hash": "780d951c4bfa3476ee84d16d9a89c5a9255691b270bfb312d974608e", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple3-19fa47f.stderr b/tests/reference/asr-test_tuple3-19fa47f.stderr deleted file mode 100644 index fe438fb382..0000000000 --- a/tests/reference/asr-test_tuple3-19fa47f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Tuple index out of bounds - --> tests/errors/test_tuple3.py:3:11 - | -3 | print(t[-4]) - | ^^^^^ diff --git a/tests/reference/asr-test_type_mismatch_01-09e8af3.json b/tests/reference/asr-test_type_mismatch_01-09e8af3.json deleted file mode 100644 index ce2513c935..0000000000 --- a/tests/reference/asr-test_type_mismatch_01-09e8af3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_type_mismatch_01-09e8af3", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_type_mismatch_01.py", - "infile_hash": "58baa8f4a5094bfa977527f92814a375ceea1f9a99c08e43bdd18ad4", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_type_mismatch_01-09e8af3.stderr", - "stderr_hash": "78ff11b22438e133b740e778063db612841fb15ef00f8599bdf8602c", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr b/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr deleted file mode 100644 index 3dc100fad6..0000000000 --- a/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in shorthand operator, the types must be compatible - --> tests/errors/test_type_mismatch_01.py:6:5 - | -6 | a /= b - | ^ ^ type mismatch ('i32' and 'f64') diff --git a/tests/reference/asr-test_unary_op_03-e799eae.json b/tests/reference/asr-test_unary_op_03-e799eae.json deleted file mode 100644 index e3cad84dd5..0000000000 --- a/tests/reference/asr-test_unary_op_03-e799eae.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_unary_op_03-e799eae", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_unary_op_03.py", - "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-test_unary_op_03-e799eae.stdout", - "stdout_hash": "4511db7e0936003a81bcb4c6b4c1cbc60070f29a9fd7dd04e8d3d137", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-test_unary_op_03-e799eae.stdout b/tests/reference/asr-test_unary_op_03-e799eae.stdout deleted file mode 100644 index e4cdc4204f..0000000000 --- a/tests/reference/asr-test_unary_op_03-e799eae.stdout +++ /dev/null @@ -1,191 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - i: - (Variable - 3 - i - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - res: - (Variable - 3 - res - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 i) - (IntegerConstant 5 (Integer 4)) - () - ) - (= - (Var 3 res) - (IntegerBitNot - (Var 3 i) - (Integer 4) - () - ) - () - ) - (Assert - (IntegerCompare - (Var 3 res) - Eq - (IntegerUnaryMinus - (IntegerConstant 6 (Integer 4)) - (Integer 4) - (IntegerConstant -6 (Integer 4)) - ) - (Logical 4) - () - ) - () - ) - (= - (Var 3 i) - (IntegerUnaryMinus - (IntegerConstant 235346 (Integer 4)) - (Integer 4) - (IntegerConstant -235346 (Integer 4)) - ) - () - ) - (Assert - (IntegerCompare - (IntegerBitNot - (Var 3 i) - (Integer 4) - () - ) - Eq - (IntegerConstant 235345 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/asr-test_unsupported_type-0d813dd.json b/tests/reference/asr-test_unsupported_type-0d813dd.json deleted file mode 100644 index 357b39f378..0000000000 --- a/tests/reference/asr-test_unsupported_type-0d813dd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_unsupported_type-0d813dd", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_unsupported_type.py", - "infile_hash": "ff3af4fffe097c4ecd6ab673301b37806aefdd77c661d5b4afbbfc5d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_unsupported_type-0d813dd.stderr", - "stderr_hash": "1675de57db132a5a4a589070d7c54ff23a57532bd967ccb416ff8c2a", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_unsupported_type-0d813dd.stderr b/tests/reference/asr-test_unsupported_type-0d813dd.stderr deleted file mode 100644 index 2ea17a3b18..0000000000 --- a/tests/reference/asr-test_unsupported_type-0d813dd.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Unsupported type annotation: i128 - --> tests/errors/test_unsupported_type.py:2:8 - | -2 | i: i128 - | ^^^^ diff --git a/tests/reference/asr-test_zero_division-3dd84e8.json b/tests/reference/asr-test_zero_division-3dd84e8.json deleted file mode 100644 index 129e181bef..0000000000 --- a/tests/reference/asr-test_zero_division-3dd84e8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_zero_division-3dd84e8", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_zero_division.py", - "infile_hash": "cef09721d9ea9f3846f213e1b1718f2aac2edba08d555af776293504", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_zero_division-3dd84e8.stderr", - "stderr_hash": "9403e36c7ace95241bf1d59a108732b298fbee5425c44455fb81ac77", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division-3dd84e8.stderr b/tests/reference/asr-test_zero_division-3dd84e8.stderr deleted file mode 100644 index 7403437c96..0000000000 --- a/tests/reference/asr-test_zero_division-3dd84e8.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: integer division by zero is not allowed - --> tests/errors/test_zero_division.py:4:16 - | -4 | print(i // 0) - | ^ integer division by zero diff --git a/tests/reference/asr-test_zero_division2-d84989f.json b/tests/reference/asr-test_zero_division2-d84989f.json deleted file mode 100644 index b9a7de7d1e..0000000000 --- a/tests/reference/asr-test_zero_division2-d84989f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_zero_division2-d84989f", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_zero_division2.py", - "infile_hash": "0ddca188fc2e8d665c5af0d438e34ed8afe255611320caa3a27ed483", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_zero_division2-d84989f.stderr", - "stderr_hash": "09fcb9f6244ddf2c2d14cd76ec91274cffd240e24e2b2f1c0697c8b5", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division2-d84989f.stderr b/tests/reference/asr-test_zero_division2-d84989f.stderr deleted file mode 100644 index 8dc523a2a5..0000000000 --- a/tests/reference/asr-test_zero_division2-d84989f.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: float floor division by zero is not allowed - --> tests/errors/test_zero_division2.py:4:16 - | -4 | print(v // 0.0) - | ^^^ float floor division by zero diff --git a/tests/reference/asr-test_zero_division3-29efb9e.json b/tests/reference/asr-test_zero_division3-29efb9e.json deleted file mode 100644 index 0c4f4b3d5d..0000000000 --- a/tests/reference/asr-test_zero_division3-29efb9e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_zero_division3-29efb9e", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_zero_division3.py", - "infile_hash": "41a589085cd6154cb97f8ed0febadf7c0741f083daa7c9dbbbdde9ca", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_zero_division3-29efb9e.stderr", - "stderr_hash": "061f891a72cebaa335b5db060b27e04f21f6a09d150f78f1a572c135", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division3-29efb9e.stderr b/tests/reference/asr-test_zero_division3-29efb9e.stderr deleted file mode 100644 index 519946bb81..0000000000 --- a/tests/reference/asr-test_zero_division3-29efb9e.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: division by zero is not allowed - --> tests/errors/test_zero_division3.py:3:13 - | -3 | print(i/0) - | ^ division by zero diff --git a/tests/reference/asr-test_zero_division4-bf4af64.json b/tests/reference/asr-test_zero_division4-bf4af64.json deleted file mode 100644 index e1f6ce6bc0..0000000000 --- a/tests/reference/asr-test_zero_division4-bf4af64.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-test_zero_division4-bf4af64", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/test_zero_division4.py", - "infile_hash": "87b6a224572c853741dd70f25b05b257d214bd3269a7e71af117057c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_zero_division4-bf4af64.stderr", - "stderr_hash": "1d16ac2d95ab997ff9b94f4028d8741121e41471445179d185264884", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division4-bf4af64.stderr b/tests/reference/asr-test_zero_division4-bf4af64.stderr deleted file mode 100644 index bdf0d76816..0000000000 --- a/tests/reference/asr-test_zero_division4-bf4af64.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: division by zero is not allowed - --> tests/errors/test_zero_division4.py:5:13 - | -5 | print(f/0.0) - | ^^^ division by zero diff --git a/tests/reference/asr-tuple1-09972ab.json b/tests/reference/asr-tuple1-09972ab.json deleted file mode 100644 index a8e83fae28..0000000000 --- a/tests/reference/asr-tuple1-09972ab.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-tuple1-09972ab", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/tuple1.py", - "infile_hash": "0ad9c210f19f9e560890c7a67ed06f4a710bbc8535c0097c35736028", - "outfile": null, - "outfile_hash": null, - "stdout": "asr-tuple1-09972ab.stdout", - "stdout_hash": "fcbdc7bd437d77534509c9da987f7b735c1bd319de51956b28924f73", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr-tuple1-09972ab.stdout b/tests/reference/asr-tuple1-09972ab.stdout deleted file mode 100644 index d4bcbe5dad..0000000000 --- a/tests/reference/asr-tuple1-09972ab.stdout +++ /dev/null @@ -1,587 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - test_Tuple: - (Function - (SymbolTable - 3 - { - a1: - (Variable - 3 - a1 - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ), - a11: - (Variable - 3 - a11 - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ), - a2: - (Variable - 3 - a2 - [] - Local - () - () - Default - (Tuple - [(Character 1 -2 ()) - (Character 1 -2 ()) - (Character 1 -2 ())] - ) - () - Source - Public - Required - .false. - ), - a3: - (Variable - 3 - a3 - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4) - (Real 4) - (Character 1 -2 ())] - ) - () - Source - Public - Required - .false. - ), - a4: - (Variable - 3 - a4 - [] - Local - () - () - Default - (Tuple - [(Tuple - [(Integer 4) - (Integer 4) - (Integer 4)] - ) - (Tuple - [(Integer 4) - (Integer 4) - (Integer 4)] - )] - ) - () - Source - Public - Required - .false. - ), - a5: - (Variable - 3 - 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 - 3 - b0 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 3 - b1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - b11: - (Variable - 3 - b11 - [] - Local - () - () - Default - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - Source - Public - Required - .false. - ), - float_mem: - (Variable - 3 - float_mem - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - float_mem1: - (Variable - 3 - float_mem1 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ), - float_mem2: - (Variable - 3 - float_mem2 - [] - Local - () - () - Default - (Real 4) - () - Source - Public - Required - .false. - ) - }) - test_Tuple - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a1) - (TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4) - (Integer 4)] - ) - ) - () - ) - (= - (Var 3 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 3 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 3 float_mem) - (Cast - (RealConstant - 0.450000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 0.450000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 a3) - (TupleConstant - [(IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - ) - (Var 3 float_mem) - (StringConstant - "d" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Integer 4) - (Real 4) - (Character 1 1 ())] - ) - ) - () - ) - (= - (Var 3 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 3 float_mem1) - (Cast - (RealConstant - 3.400000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 3.400000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 float_mem2) - (Cast - (RealConstant - 5.600000 - (Real 8) - ) - RealToReal - (Real 4) - (RealConstant - 5.600000 - (Real 4) - ) - ) - () - ) - (= - (Var 3 a5) - (TupleConstant - [(TupleConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (Var 3 float_mem1)] - (Tuple - [(Character 1 1 ()) - (Character 1 1 ()) - (Real 4)] - ) - ) - (TupleConstant - [(StringConstant - "c" - (Character 1 1 ()) - ) - (IntegerConstant 3 (Integer 4)) - (Var 3 float_mem2)] - (Tuple - [(Character 1 1 ()) - (Integer 4) - (Real 4)] - ) - )] - (Tuple - [(Tuple - [(Character 1 1 ()) - (Character 1 1 ()) - (Real 4)] - ) - (Tuple - [(Character 1 1 ()) - (Integer 4) - (Real 4)] - )] - ) - ) - () - ) - (= - (Var 3 b0) - (TupleItem - (Var 3 a1) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - ) - () - ) - (= - (TupleConstant - [(Var 3 b0) - (Var 3 b1)] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(TupleItem - (Var 3 a1) - (IntegerConstant 2 (Integer 4)) - (Integer 4) - () - ) - (TupleItem - (Var 3 a1) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - )] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - ) - (= - (Var 3 a11) - (TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - ) - (= - (Var 3 b11) - (TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - ) - (Assert - (TupleCompare - (Var 3 a11) - Eq - (Var 3 b11) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 4 - { - - }) - main_program - [] - [] - ) - }) - [] -) diff --git a/tests/reference/asr-type_mismatch-61052c7.json b/tests/reference/asr-type_mismatch-61052c7.json deleted file mode 100644 index 80ce9f69b3..0000000000 --- a/tests/reference/asr-type_mismatch-61052c7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-type_mismatch-61052c7", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/type_mismatch.py", - "infile_hash": "45ee4815e13c9fc4d58572a2f4ec01f5546e1f67878a2913bda89e5c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-type_mismatch-61052c7.stderr", - "stderr_hash": "8c0de9edb133ff8cfa5c0e7c6b2a8d425c5d84a5ec98844eb367040c", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-type_mismatch-61052c7.stderr b/tests/reference/asr-type_mismatch-61052c7.stderr deleted file mode 100644 index 6a402fb67c..0000000000 --- a/tests/reference/asr-type_mismatch-61052c7.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Type mismatch in shorthand operator, the types must be compatible - --> tests/errors/type_mismatch.py:8:5 - | -8 | a *= b - | ^ ^ type mismatch ('i32' and 'f32') diff --git a/tests/reference/asr-unsigned_01-892b178.json b/tests/reference/asr-unsigned_01-892b178.json deleted file mode 100644 index 0a797a2c11..0000000000 --- a/tests/reference/asr-unsigned_01-892b178.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-unsigned_01-892b178", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/unsigned_01.py", - "infile_hash": "c176f4ec65c0b5ca7c2c95b2e35d65f22b4cef342baad15c2dd5ef24", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-unsigned_01-892b178.stderr", - "stderr_hash": "54c7cfbd16c73cbe802a3492cd9c9e8d2fb25035192d229232c377b2", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_01-892b178.stderr b/tests/reference/asr-unsigned_01-892b178.stderr deleted file mode 100644 index c3526cf36e..0000000000 --- a/tests/reference/asr-unsigned_01-892b178.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: Cannot cast negative value to unsigned integer - --> tests/errors/unsigned_01.py:3:10 - | -3 | i: u16 = u16(-5) - | ^^^^^^^ diff --git a/tests/reference/asr-unsigned_02-6563e58.json b/tests/reference/asr-unsigned_02-6563e58.json deleted file mode 100644 index 40e7b2a0f0..0000000000 --- a/tests/reference/asr-unsigned_02-6563e58.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-unsigned_02-6563e58", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/unsigned_02.py", - "infile_hash": "7892abcbe7cecdbddc7362fd0940986bf64458880ccd198c16dd2a6e", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-unsigned_02-6563e58.stderr", - "stderr_hash": "93f2cf309dfa7f13d56df9184615fde6a832b79510d8541f95ad5a70", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_02-6563e58.stderr b/tests/reference/asr-unsigned_02-6563e58.stderr deleted file mode 100644 index d00c5647fd..0000000000 --- a/tests/reference/asr-unsigned_02-6563e58.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: The result of the unary minus `-` operation is negative, thus out of range for u16 - --> tests/errors/unsigned_02.py:3:10 - | -3 | i: u16 = -u16(5) - | ^^^^^^^ use -i32(u) for signed result diff --git a/tests/reference/asr-unsigned_03-f785652.json b/tests/reference/asr-unsigned_03-f785652.json deleted file mode 100644 index 6929c59a27..0000000000 --- a/tests/reference/asr-unsigned_03-f785652.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-unsigned_03-f785652", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/unsigned_03.py", - "infile_hash": "72dd2c6e17b137b6b9f66deeaab0af4ebe3044cb16009e0fab25f05a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-unsigned_03-f785652.stderr", - "stderr_hash": "d90013a25d9aaa91fbbf2b1193cd06be94a4e716f0fe99771cde5601", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_03-f785652.stderr b/tests/reference/asr-unsigned_03-f785652.stderr deleted file mode 100644 index a68ae96697..0000000000 --- a/tests/reference/asr-unsigned_03-f785652.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: The result of the unary minus `-` operation is negative, thus out of range for u64 - --> tests/errors/unsigned_03.py:3:7 - | -3 | print(-u64(u32(10))) - | ^^^^^^^^^^^^^ use -i64(u) for signed result diff --git a/tests/reference/asr-unsigned_04-c856d3a.json b/tests/reference/asr-unsigned_04-c856d3a.json deleted file mode 100644 index 3753e9ae30..0000000000 --- a/tests/reference/asr-unsigned_04-c856d3a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-unsigned_04-c856d3a", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/errors/unsigned_04.py", - "infile_hash": "d1c2f82e9578ce3f2364f4bbd3177bc0ae72357c644953418eaffe4c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-unsigned_04-c856d3a.stderr", - "stderr_hash": "3dcdf2e97f8c5f2816bed266587c7c3743f666cf2a4602f65e8ec9b8", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_04-c856d3a.stderr b/tests/reference/asr-unsigned_04-c856d3a.stderr deleted file mode 100644 index 8547a0848c..0000000000 --- a/tests/reference/asr-unsigned_04-c856d3a.stderr +++ /dev/null @@ -1,5 +0,0 @@ -semantic error: The result of the bitnot ~ operation is negative, thus out of range for u16 - --> tests/errors/unsigned_04.py:4:5 - | -4 | i = ~i - | ^^ use ~i32(u) for signed result or bitnot_u16(u) for unsigned result diff --git a/tests/reference/asr-vec_01-66ac423.json b/tests/reference/asr-vec_01-66ac423.json deleted file mode 100644 index abd51bc145..0000000000 --- a/tests/reference/asr-vec_01-66ac423.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr-vec_01-66ac423", - "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/vec_01.py", - "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-vec_01-66ac423.stderr", - "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/asr-vec_01-66ac423.stderr b/tests/reference/asr-vec_01-66ac423.stderr deleted file mode 100644 index 0371022cc6..0000000000 --- a/tests/reference/asr-vec_01-66ac423.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/vec_01.py:2:1 - | -2 | from numpy import empty, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr_json-modules_02-53952e6.json b/tests/reference/asr_json-modules_02-53952e6.json deleted file mode 100644 index 9948a65e7c..0000000000 --- a/tests/reference/asr_json-modules_02-53952e6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "asr_json-modules_02-53952e6", - "cmd": "lpython --show-asr --json --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/modules_02.py", - "infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44", - "outfile": null, - "outfile_hash": null, - "stdout": "asr_json-modules_02-53952e6.stdout", - "stdout_hash": "c97d528fedb41f6d0e8bfa0cee1c0c9333844130b7694cb0cd5e2c4c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/asr_json-modules_02-53952e6.stdout b/tests/reference/asr_json-modules_02-53952e6.stdout deleted file mode 100644 index f04f24c482..0000000000 --- a/tests/reference/asr_json-modules_02-53952e6.stdout +++ /dev/null @@ -1,1000 +0,0 @@ -{ - "node": "TranslationUnit", - "fields": { - "symtab": { - "node": "SymbolTable1", - "fields": { - "__main__": { - "node": "Module", - "fields": { - "symtab": { - "node": "SymbolTable2", - "fields": { - "__main__global_stmts": { - "node": "Function", - "fields": { - "symtab": { - "node": "SymbolTable8", - "fields": {} - }, - "name": "__main__global_stmts", - "function_signature": { - "node": "FunctionType", - "fields": { - "arg_types": [], - "return_var_type": [], - "abi": "Source", - "deftype": "Implementation", - "bindc_name": [], - "elemental": false, - "pure": false, - "module": false, - "inline": false, - "static": false, - "restrictions": [], - "is_restriction": false - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - }, - "dependencies": [ - "main0" - ], - "args": [], - "body": [ - { - "node": "SubroutineCall", - "fields": { - "name": "main0 (SymbolTable2)", - "original_name": [], - "args": [], - "dt": [] - }, - "loc": { - "first": 119, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 10, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - } - ], - "return_var": [], - "access": "Public", - "deterministic": false, - "side_effect_free": false, - "module_file": [] - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - }, - "f": { - "node": "ExternalSymbol", - "fields": { - "parent_symtab": 2, - "name": "f", - "external": "f (SymbolTable3)", - "module_name": "modules_02b", - "scope_names": [], - "original_name": "f", - "access": "Public" - }, - "loc": { - "first": 24, - "last": 24, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 25, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 1, - "last_column": 25 - } - }, - "main0": { - "node": "Function", - "fields": { - "symtab": { - "node": "SymbolTable7", - "fields": { - "x": { - "node": "Variable", - "fields": { - "parent_symtab": 7, - "name": "x", - "dependencies": [], - "intent": "Local", - "symbolic_value": [], - "value": [], - "storage": "Default", - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 71, - "last": 73, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 5, - "first_column": 8, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 5, - "last_column": 10 - } - }, - "type_declaration": [], - "abi": "Source", - "access": "Public", - "presence": "Required", - "value_attr": false - }, - "loc": { - "first": 68, - "last": 73, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 5, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 5, - "last_column": 10 - } - } - } - }, - "name": "main0", - "function_signature": { - "node": "FunctionType", - "fields": { - "arg_types": [], - "return_var_type": [], - "abi": "Source", - "deftype": "Implementation", - "bindc_name": [], - "elemental": false, - "pure": false, - "module": false, - "inline": false, - "static": false, - "restrictions": [], - "is_restriction": false - }, - "loc": { - "first": 51, - "last": 116, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 4, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 8, - "last_column": 7 - } - }, - "dependencies": [ - "f" - ], - "args": [], - "body": [ - { - "node": "Assignment", - "fields": { - "target": { - "node": "Var", - "fields": { - "v": "x (SymbolTable7)" - }, - "loc": { - "first": 79, - "last": 79, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 5 - } - }, - "value": { - "node": "IntegerBinOp", - "fields": { - "left": { - "node": "IntegerBinOp", - "fields": { - "left": { - "node": "IntegerConstant", - "fields": { - "n": 2, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - } - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - }, - "op": "Add", - "right": { - "node": "IntegerConstant", - "fields": { - "n": 3, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 86, - "last": 86, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 12, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 12 - } - } - }, - "loc": { - "first": 86, - "last": 86, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 12, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 12 - } - }, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - }, - "value": { - "node": "IntegerConstant", - "fields": { - "n": 5, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - } - }, - "loc": { - "first": 84, - "last": 86, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 12 - } - } - }, - "loc": { - "first": 84, - "last": 86, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 12 - } - }, - "op": "Mul", - "right": { - "node": "IntegerConstant", - "fields": { - "n": 5, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 89, - "last": 89, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 15, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 15 - } - } - }, - "loc": { - "first": 89, - "last": 89, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 15, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 15 - } - }, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - }, - "value": { - "node": "IntegerConstant", - "fields": { - "n": 25, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 84, - "last": 84, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 10, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 10 - } - } - }, - "loc": { - "first": 83, - "last": 89, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 9, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 15 - } - } - }, - "loc": { - "first": 83, - "last": 89, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 9, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 15 - } - }, - "overloaded": [] - }, - "loc": { - "first": 79, - "last": 89, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 6, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 6, - "last_column": 15 - } - }, - { - "node": "Assert", - "fields": { - "test": { - "node": "IntegerCompare", - "fields": { - "left": { - "node": "Var", - "fields": { - "v": "x (SymbolTable7)" - }, - "loc": { - "first": 102, - "last": 102, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 12, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 12 - } - }, - "op": "Eq", - "right": { - "node": "IntegerConstant", - "fields": { - "n": 25, - "type": { - "node": "Integer", - "fields": { - "kind": 4 - }, - "loc": { - "first": 107, - "last": 108, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 17, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 18 - } - } - }, - "loc": { - "first": 107, - "last": 108, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 17, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 18 - } - }, - "type": { - "node": "Logical", - "fields": { - "kind": 4 - }, - "loc": { - "first": 102, - "last": 108, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 12, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 18 - } - }, - "value": [] - }, - "loc": { - "first": 102, - "last": 108, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 12, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 18 - } - }, - "msg": [] - }, - "loc": { - "first": 95, - "last": 108, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 7, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 7, - "last_column": 18 - } - }, - { - "node": "SubroutineCall", - "fields": { - "name": "f (SymbolTable2)", - "original_name": [], - "args": [], - "dt": [] - }, - "loc": { - "first": 114, - "last": 116, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 8, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 8, - "last_column": 7 - } - } - ], - "return_var": [], - "access": "Public", - "deterministic": false, - "side_effect_free": false, - "module_file": [] - }, - "loc": { - "first": 51, - "last": 116, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 4, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 8, - "last_column": 7 - } - } - } - }, - "name": "__main__", - "dependencies": [ - "modules_02b" - ], - "loaded_from_mod": false, - "intrinsic": false - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - }, - "main_program": { - "node": "Program", - "fields": { - "symtab": { - "node": "SymbolTable9", - "fields": { - "__main__global_stmts": { - "node": "ExternalSymbol", - "fields": { - "parent_symtab": 9, - "name": "__main__global_stmts", - "external": "__main__global_stmts (SymbolTable2)", - "module_name": "__main__", - "scope_names": [], - "original_name": "__main__global_stmts", - "access": "Public" - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - } - } - }, - "name": "main_program", - "dependencies": [ - "__main__" - ], - "body": [ - { - "node": "SubroutineCall", - "fields": { - "name": "__main__global_stmts (SymbolTable9)", - "original_name": "__main__global_stmts (SymbolTable2)", - "args": [], - "dt": [] - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - } - ] - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } - }, - "modules_02b": { - "node": "Module", - "fields": { - "symtab": { - "node": "SymbolTable3", - "fields": { - "f": { - "node": "Function", - "fields": { - "symtab": { - "node": "SymbolTable6", - "fields": {} - }, - "name": "f", - "function_signature": { - "node": "FunctionType", - "fields": { - "arg_types": [], - "return_var_type": [], - "abi": "Source", - "deftype": "Implementation", - "bindc_name": [], - "elemental": false, - "pure": false, - "module": false, - "inline": false, - "static": false, - "restrictions": [], - "is_restriction": false - }, - "loc": { - "first": 154, - "last": 186, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 3, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 16 - } - }, - "dependencies": [ - "g" - ], - "args": [], - "body": [ - { - "node": "SubroutineCall", - "fields": { - "name": "g (SymbolTable3)", - "original_name": [], - "args": [], - "dt": [] - }, - "loc": { - "first": 167, - "last": 169, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 4, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 4, - "last_column": 7 - } - }, - { - "node": "Print", - "fields": { - "fmt": [], - "values": [ - { - "node": "StringConstant", - "fields": { - "s": "f()", - "type": { - "node": "Character", - "fields": { - "kind": 1, - "len": 3, - "len_expr": [] - }, - "loc": { - "first": 181, - "last": 185, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 5, - "first_column": 11, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 15 - } - } - }, - "loc": { - "first": 181, - "last": 185, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 5, - "first_column": 11, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 15 - } - } - ], - "separator": [], - "end": [] - }, - "loc": { - "first": 175, - "last": 186, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 5, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 16 - } - } - ], - "return_var": [], - "access": "Public", - "deterministic": false, - "side_effect_free": false, - "module_file": [] - }, - "loc": { - "first": 154, - "last": 186, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 3, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 16 - } - }, - "g": { - "node": "ExternalSymbol", - "fields": { - "parent_symtab": 3, - "name": "g", - "external": "g (SymbolTable4)", - "module_name": "modules_02c", - "scope_names": [], - "original_name": "g", - "access": "Public" - }, - "loc": { - "first": 151, - "last": 151, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 1, - "first_column": 25, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 1, - "last_column": 25 - } - } - } - }, - "name": "modules_02b", - "dependencies": [ - "modules_02c" - ], - "loaded_from_mod": false, - "intrinsic": false - }, - "loc": { - "first": 127, - "last": 186, - "first_filename": "tests/../integration_tests/modules_02b.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02b.py", - "last_line": 5, - "last_column": 16 - } - }, - "modules_02c": { - "node": "Module", - "fields": { - "symtab": { - "node": "SymbolTable4", - "fields": { - "g": { - "node": "Function", - "fields": { - "symtab": { - "node": "SymbolTable5", - "fields": {} - }, - "name": "g", - "function_signature": { - "node": "FunctionType", - "fields": { - "arg_types": [], - "return_var_type": [], - "abi": "Source", - "deftype": "Implementation", - "bindc_name": [], - "elemental": false, - "pure": false, - "module": false, - "inline": false, - "static": false, - "restrictions": [], - "is_restriction": false - }, - "loc": { - "first": 188, - "last": 212, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 16 - } - }, - "dependencies": [], - "args": [], - "body": [ - { - "node": "Print", - "fields": { - "fmt": [], - "values": [ - { - "node": "StringConstant", - "fields": { - "s": "g()", - "type": { - "node": "Character", - "fields": { - "kind": 1, - "len": 3, - "len_expr": [] - }, - "loc": { - "first": 207, - "last": 211, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 2, - "first_column": 11, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 15 - } - } - }, - "loc": { - "first": 207, - "last": 211, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 2, - "first_column": 11, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 15 - } - } - ], - "separator": [], - "end": [] - }, - "loc": { - "first": 201, - "last": 212, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 2, - "first_column": 5, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 16 - } - } - ], - "return_var": [], - "access": "Public", - "deterministic": false, - "side_effect_free": false, - "module_file": [] - }, - "loc": { - "first": 188, - "last": 212, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 16 - } - } - } - }, - "name": "modules_02c", - "dependencies": [], - "loaded_from_mod": false, - "intrinsic": false - }, - "loc": { - "first": 188, - "last": 212, - "first_filename": "tests/../integration_tests/modules_02c.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02c.py", - "last_line": 2, - "last_column": 16 - } - } - } - }, - "items": [] - }, - "loc": { - "first": 0, - "last": 125, - "first_filename": "tests/../integration_tests/modules_02.py", - "first_line": 1, - "first_column": 1, - "last_filename": "tests/../integration_tests/modules_02.py", - "last_line": 10, - "last_column": 7 - } -} diff --git a/tests/reference/ast-assert1-b0154ee.json b/tests/reference/ast-assert1-b0154ee.json deleted file mode 100644 index 8158218cc4..0000000000 --- a/tests/reference/ast-assert1-b0154ee.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-assert1-b0154ee", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/assert1.py", - "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-assert1-b0154ee.stdout", - "stdout_hash": "f5e00f32dc7ae2feda2e3c495b42ae3f193a79baf8b42e313373aa4b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-assert1-b0154ee.stdout b/tests/reference/ast-assert1-b0154ee.stdout deleted file mode 100644 index d147d125e1..0000000000 --- a/tests/reference/ast-assert1-b0154ee.stdout +++ /dev/null @@ -1,70 +0,0 @@ -(Module - [(FunctionDef - test_assert - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (Assert - (Compare - (Name - a - Load - ) - Eq - [(ConstantInt - 5 - () - )] - ) - (ConstantStr - "a is not 5" - () - ) - ) - (Assert - (Compare - (Name - a - Load - ) - NotEq - [(ConstantInt - 10 - () - )] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-assign1-2a4c9ed.json b/tests/reference/ast-assign1-2a4c9ed.json deleted file mode 100644 index 49bfe84ecb..0000000000 --- a/tests/reference/ast-assign1-2a4c9ed.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-assign1-2a4c9ed", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/assign1.py", - "infile_hash": "3b82a73e457bd65e85828b72d56596ca927e7c661e333691f154912b", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-assign1-2a4c9ed.stdout", - "stdout_hash": "96e9236f069321ffb388a891be45a46f55c581bd96d509685be54f86", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-assign1-2a4c9ed.stdout b/tests/reference/ast-assign1-2a4c9ed.stdout deleted file mode 100644 index 54b54de3e8..0000000000 --- a/tests/reference/ast-assign1-2a4c9ed.stdout +++ /dev/null @@ -1,151 +0,0 @@ -(Module - [(FunctionDef - test_augassign - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - r - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - s - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - r - Store - )] - (ConstantInt - 0 - () - ) - () - ) - (AugAssign - (Name - r - Store - ) - Add - (ConstantInt - 4 - () - ) - ) - (Assign - [(Name - s - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (AugAssign - (Name - r - Store - ) - Mult - (Name - s - Load - ) - ) - (AugAssign - (Name - r - Store - ) - Sub - (ConstantInt - 2 - () - ) - ) - (Assign - [(Name - s - Store - )] - (ConstantInt - 10 - () - ) - () - ) - (AugAssign - (Name - r - Store - ) - Div - (Name - s - Load - ) - ) - (AnnAssign - (Name - a - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantStr - "" - () - ) - () - ) - (AugAssign - (Name - a - Store - ) - Add - (ConstantStr - "test" - () - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-complex1-800b4bb.json b/tests/reference/ast-complex1-800b4bb.json deleted file mode 100644 index e71d8dddfa..0000000000 --- a/tests/reference/ast-complex1-800b4bb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-complex1-800b4bb", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/complex1.py", - "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-complex1-800b4bb.stdout", - "stdout_hash": "30482dce2a68624ef71ed52e4c4ce4122e1f2efddcef40bee2a3b10e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-complex1-800b4bb.stdout b/tests/reference/ast-complex1-800b4bb.stdout deleted file mode 100644 index 8044437ea0..0000000000 --- a/tests/reference/ast-complex1-800b4bb.stdout +++ /dev/null @@ -1,686 +0,0 @@ -(Module - [(ImportFrom - lpython - [(c32 - ()) - (c64 - ())] - 0 - ) - (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 - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantFloat - 3.400000 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantFloat - 5.000000 - () - ) - (ConstantFloat - 4.300000 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantInt - 1 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c1 - Store - )] - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantInt - 3 - () - ) - (ConstantInt - 4 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c2 - Store - )] - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantFloat - 4.500000 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - c3 - Store - )] - (Call - (Name - complex - Load - ) - [(ConstantFloat - 3.000000 - () - ) - (ConstantFloat - 4.000000 - () - )] - [] - ) - () - ) - (Assign - [(Name - b - Store - )] - (Compare - (Name - c1 - Load - ) - NotEq - [(Name - c2 - Load - )] - ) - () - ) - (Assign - [(Name - b - Store - )] - (Compare - (Call - (Name - c64 - Load - ) - [(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 - )] - (Call - (Name - c32 - Load - ) - [(BinOp - (Call - (Name - complex - Load - ) - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - Pow - (Call - (Name - complex - Load - ) - [(ConstantFloat - 3.345340 - () - ) - (ConstantFloat - 4.867868 - () - )] - [] - ) - )] - [] - ) - () - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - c32 - Load - ) - [(BinOp - (Call - (Name - complex - Load - ) - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - Mult - (Call - (Name - complex - Load - ) - [(ConstantInt - 3 - () - ) - (ConstantInt - 4 - () - )] - [] - ) - )] - [] - ) - () - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - c32 - Load - ) - [(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 - (Call - (Name - c64 - Load - ) - [(ConstantInt - 2 - () - )] - [] - ) - Add - (ConstantComplex - 0.000000 - 3.000000 - () - ) - ) - () - ) - (Assign - [(Name - y - Store - )] - (BinOp - (Call - (Name - c64 - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - Add - (ConstantComplex - 0.000000 - 5.000000 - () - ) - ) - () - ) - (Assign - [(Name - z - Store - )] - (Call - (Name - c32 - Load - ) - [(BinOp - (Name - x - Load - ) - Add - (Name - y - Load - ) - )] - [] - ) - () - ) - (Assign - [(Name - z - Store - )] - (Call - (Name - c32 - Load - ) - [(BinOp - (Name - x - Load - ) - Sub - (Name - y - Load - ) - )] - [] - ) - () - ) - (Assign - [(Name - z - Store - )] - (Call - (Name - c32 - Load - ) - [(BinOp - (Call - (Name - c64 - Load - ) - [(ConstantInt - 2 - () - )] - [] - ) - Mult - (Name - x - Load - ) - )] - [] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-constants1-91cb6ff.json b/tests/reference/ast-constants1-91cb6ff.json deleted file mode 100644 index f84e32ca40..0000000000 --- a/tests/reference/ast-constants1-91cb6ff.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-constants1-91cb6ff", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/constants1.py", - "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-constants1-91cb6ff.stdout", - "stdout_hash": "8c7b5384e18cfcea4b080c39a4d367fc8a57a6785ad936454005d6b1", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-constants1-91cb6ff.stdout b/tests/reference/ast-constants1-91cb6ff.stdout deleted file mode 100644 index 086dd9ff27..0000000000 --- a/tests/reference/ast-constants1-91cb6ff.stdout +++ /dev/null @@ -1,1820 +0,0 @@ -(Module - [(ImportFrom - lpython - [(f32 - ()) - (i32 - ()) - (i64 - ()) - (f64 - ())] - 0 - ) - (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 - ) - [(Call - (Name - i32 - Load - ) - [(ConstantBool - .false. - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - abs - Load - ) - [(Call - (Name - i32 - Load - ) - [(ConstantBool - .true. - () - )] - [] - )] - [] - ) - () - ) - (AnnAssign - (Name - b - Store - ) - (Name - f32 - Load - ) - () - 1 - ) - (Assign - [(Name - b - Store - )] - (Call - (Name - f32 - Load - ) - [(Call - (Name - abs - Load - ) - [(ConstantFloat - 3.450000 - () - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - b - Store - )] - (Call - (Name - f32 - Load - ) - [(Call - (Name - abs - Load - ) - [(UnaryOp - USub - (ConstantFloat - 5346.340000 - () - ) - )] - [] - )] - [] - ) - () - ) - (Assign - [(Name - b - Store - )] - (Call - (Name - f32 - Load - ) - [(Call - (Name - abs - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantFloat - 3.450000 - () - ) - (ConstantFloat - 5.600000 - () - )] - [] - )] - [] - )] - [] - ) - () - )] - [] - () - () - ) - (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.400000 - () - )] - Load - ) - (Tuple - [(ConstantStr - "c" - () - ) - (ConstantInt - 3 - () - ) - (ConstantFloat - 5.600000 - () - )] - 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.300000 - () - )] - [] - ) - () - ) - (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 - ) - [(ConstantFloat - 5.600000 - () - )] - [] - ) - () - ) - (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.560000 - () - )] - [] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - int - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - int - Load - ) - [(UnaryOp - USub - (ConstantFloat - 5.000010 - () - ) - )] - [] - ) - () - ) - (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.560000 - () - )] - [] - ) - () - ) - (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-dictionary1-1a7e00a.json b/tests/reference/ast-dictionary1-1a7e00a.json deleted file mode 100644 index ba29488d33..0000000000 --- a/tests/reference/ast-dictionary1-1a7e00a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-dictionary1-1a7e00a", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/dictionary1.py", - "infile_hash": "f164e8dbe52a04e4fd541d6ff6edae2994d683074087d8785a1759e4", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-dictionary1-1a7e00a.stdout", - "stdout_hash": "c347af8c0abbed4664f354dc24c1bd061218c0584aef27889fbf1745", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-dictionary1-1a7e00a.stdout b/tests/reference/ast-dictionary1-1a7e00a.stdout deleted file mode 100644 index d300e7a74d..0000000000 --- a/tests/reference/ast-dictionary1-1a7e00a.stdout +++ /dev/null @@ -1,618 +0,0 @@ -(Module - [(FunctionDef - test_Dict - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (Dict - [(ConstantInt - 1 - () - ) - (ConstantInt - 3 - () - )] - [(ConstantInt - 2 - () - ) - (ConstantInt - 4 - () - )] - ) - () - ) - (AnnAssign - (Name - y - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - str - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - )] - ) - () - ) - (AnnAssign - (Name - z - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - z - Store - )] - (Subscript - (Name - y - Load - ) - (ConstantStr - "a" - () - ) - Load - ) - () - ) - (Assign - [(Name - z - Store - )] - (Subscript - (Name - y - Load - ) - (ConstantStr - "b" - () - ) - Load - ) - () - ) - (Assign - [(Name - z - Store - )] - (Subscript - (Name - x - Load - ) - (ConstantInt - 1 - () - ) - Load - ) - () - )] - [] - () - () - ) - (FunctionDef - test_dict_insert - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - y - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - str - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - )] - ) - () - ) - (Assign - [(Subscript - (Name - y - Load - ) - (ConstantStr - "c" - () - ) - Store - )] - (UnaryOp - USub - (ConstantInt - 3 - () - ) - ) - () - )] - [] - () - () - ) - (FunctionDef - test_dict_get - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - y - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - str - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - )] - ) - () - ) - (AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - y - Load - ) - get - Load - ) - [(ConstantStr - "a" - () - )] - [] - ) - () - ) - (Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - y - Load - ) - get - Load - ) - [(ConstantStr - "a" - () - ) - (ConstantInt - 0 - () - )] - [] - ) - () - )] - [] - () - () - ) - (FunctionDef - test_dict_pop - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - y - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - str - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - ) - () - ) - (AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - y - Load - ) - pop - Load - ) - [(ConstantStr - "a" - () - )] - [] - ) - () - )] - [] - () - () - ) - (FunctionDef - f - ([] - [(x - (Subscript - (Name - InOut - Load - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - Load - ) - ())] - [] - [] - [] - [] - []) - [(Assign - [(Subscript - (Name - x - Load - ) - (ConstantInt - 2 - () - ) - Store - )] - (ConstantInt - 4 - () - ) - () - )] - [] - () - () - ) - (FunctionDef - test_issue_204 - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Expr - (Call - (Name - f - Load - ) - [(Name - x - Load - )] - [] - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.json b/tests/reference/ast-doconcurrentloop_01-ed7017b.json deleted file mode 100644 index f535d23ee8..0000000000 --- a/tests/reference/ast-doconcurrentloop_01-ed7017b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-doconcurrentloop_01-ed7017b", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/doconcurrentloop_01.py", - "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-doconcurrentloop_01-ed7017b.stdout", - "stdout_hash": "3967d9e6602dfb4fd3fdab3718811979d4745dc0a97060f9b281e0e9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout b/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout deleted file mode 100644 index 7b22ef73a0..0000000000 --- a/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout +++ /dev/null @@ -1,437 +0,0 @@ -(Module - [(ImportFrom - lpython - [(f32 - ()) - (i32 - ())] - 0 - ) - (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 - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 10.000000 - () - )] - [] - ) - () - ) - (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 - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 5.000000 - () - )] - [] - ) - () - ) - (Assign - [(Subscript - (Name - b - Load - ) - (Name - i - Load - ) - Store - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 5.000000 - () - )] - [] - ) - () - )] - [] - "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-ellipsis1-4f6c4dd.json b/tests/reference/ast-ellipsis1-4f6c4dd.json deleted file mode 100644 index 1e53be9f78..0000000000 --- a/tests/reference/ast-ellipsis1-4f6c4dd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-ellipsis1-4f6c4dd", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/parser/ellipsis1.py", - "infile_hash": "24df29cba718c679016f3758a2eccafbeb9cfebd56265fd8da16bee1", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-ellipsis1-4f6c4dd.stdout", - "stdout_hash": "6d6aef7896c1a43a27f489cb283c508b2bf1238ff6ad0c807b58b9e7", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-ellipsis1-4f6c4dd.stdout b/tests/reference/ast-ellipsis1-4f6c4dd.stdout deleted file mode 100644 index f2c9284c1a..0000000000 --- a/tests/reference/ast-ellipsis1-4f6c4dd.stdout +++ /dev/null @@ -1,427 +0,0 @@ -(Module - [(Import - [(numpy - np)] - ) - (ImportFrom - typing - [(Callable - ())] - 0 - ) - (Assign - [(Name - array - Store - )] - (Call - (Attribute - (Attribute - (Name - np - Load - ) - random - Load - ) - rand - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - array - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (ConstantInt - 0 - () - )] - Load - ) - Load - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - array - Load - ) - (Tuple - [(Name - Ellipsis - Load - ) - (ConstantInt - 0 - () - )] - Load - ) - Load - )] - [] - ) - ) - (FunctionDef - inject - ([] - [(get_next_item - (Subscript - (Name - Callable - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (Name - str - Load - )] - Load - ) - Load - ) - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - ) - (FunctionDef - foo - ([] - [(x - (ConstantEllipsis - () - ) - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - ) - (ClassDef - flow - [] - [] - [(FunctionDef - __understand__ - ([] - [(self - () - ()) - (name - (Name - str - Load - ) - ()) - (value - (ConstantEllipsis - () - ) - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - )] - [] - ) - (FunctionDef - foo - ([] - [(x - () - ())] - [] - [] - [] - [] - [(ConstantEllipsis - () - )]) - [(Return - (Name - x - Load - ) - )] - [] - () - () - ) - (FunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (ClassDef - Todo - [] - [] - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (Assign - [(Name - x - Store - )] - (List - [(ConstantInt - 1 - () - ) - (List - [(ConstantInt - 2 - () - ) - (List - [(ConstantEllipsis - () - )] - Load - ) - (ConstantInt - 3 - () - )] - Load - )] - Load - ) - () - ) - (Assign - [(Name - l - Store - )] - (List - [(ConstantEllipsis - () - ) - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - () - ) - (If - (Compare - (Name - x - Load - ) - Is - [(ConstantEllipsis - () - )] - ) - [(Pass)] - [] - ) - (FunctionDef - partial - ([] - [(func - (Subscript - (Name - Callable - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (Name - str - Load - )] - Load - ) - Load - ) - ())] - [(args - () - ())] - [] - [] - [] - []) - [(Pass)] - [] - (Subscript - (Name - Callable - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (Name - str - Load - )] - Load - ) - Load - ) - () - ) - (ClassDef - xyz - [] - [] - [(AnnAssign - (Name - abc - Store - ) - (Name - str - Load - ) - (ConstantEllipsis - () - ) - 1 - ) - (FunctionDef - __init__ - ([] - [(self - () - ()) - (name - (Name - str - Load - ) - ())] - [] - [] - [] - [] - [(ConstantEllipsis - () - )]) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - )] - [] - )] - [] -) diff --git a/tests/reference/ast-expr1-1e8f7b1.json b/tests/reference/ast-expr1-1e8f7b1.json deleted file mode 100644 index 004b2a39e0..0000000000 --- a/tests/reference/ast-expr1-1e8f7b1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr1-1e8f7b1", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr1.py", - "infile_hash": "a0c9e93e40f29b7d4541f8c513de490a892abf78a34700478d1827dd", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr1-1e8f7b1.stdout", - "stdout_hash": "8de807242a73633d63f3e92bed88eacdd9f283f479d9adf11fefb1fd", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr1-1e8f7b1.stdout b/tests/reference/ast-expr1-1e8f7b1.stdout deleted file mode 100644 index c123e471ca..0000000000 --- a/tests/reference/ast-expr1-1e8f7b1.stdout +++ /dev/null @@ -1,124 +0,0 @@ -(Module - [(FunctionDef - test_namedexpr - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - y - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (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 - () - ) - () - )] - [] - ) - (While - (NamedExpr - (Name - a - Store - ) - (ConstantInt - 1 - () - ) - ) - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )] - [] - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr10-a8d646d.json b/tests/reference/ast-expr10-a8d646d.json deleted file mode 100644 index 8f0222f7aa..0000000000 --- a/tests/reference/ast-expr10-a8d646d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr10-a8d646d", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr10.py", - "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr10-a8d646d.stdout", - "stdout_hash": "b807dc54b7741e61fd091d70d83c68d7c58c2c38fd5a22b279217916", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr10-a8d646d.stdout b/tests/reference/ast-expr10-a8d646d.stdout deleted file mode 100644 index 53ef4ebca1..0000000000 --- a/tests/reference/ast-expr10-a8d646d.stdout +++ /dev/null @@ -1,434 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ()) - (f32 - ()) - (c32 - ())] - 0 - ) - (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 - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 1.000000 - () - )] - [] - ) - ) - () - ) - (Assign - [(Name - f - Store - )] - (UnaryOp - USub - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 183745.534000 - () - )] - [] - ) - ) - () - ) - (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 - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - [] - )] - [] - ) - ) - () - ) - (Assign - [(Name - c - Store - )] - (UnaryOp - USub - (Call - (Name - c32 - Load - ) - [(Call - (Name - complex - Load - ) - [(ConstantInt - 3 - () - ) - (ConstantFloat - 65.000000 - () - )] - [] - )] - [] - ) - ) - () - ) - (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-expr11-1d29f78.json b/tests/reference/ast-expr11-1d29f78.json deleted file mode 100644 index d3ebc1ed40..0000000000 --- a/tests/reference/ast-expr11-1d29f78.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr11-1d29f78", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr11.py", - "infile_hash": "940f2d32759315dfb8d54ea50819f2bfef9737e486615703609fd47a", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr11-1d29f78.stdout", - "stdout_hash": "60719c0d166865f8157e6479a6bd6fc7d300b2d2eff48d8b1553fc8c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr11-1d29f78.stdout b/tests/reference/ast-expr11-1d29f78.stdout deleted file mode 100644 index be341c23d1..0000000000 --- a/tests/reference/ast-expr11-1d29f78.stdout +++ /dev/null @@ -1,149 +0,0 @@ -(Module - [(FunctionDef - test_StrOp_repeat - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - s - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantStr - "a" - () - ) - Mult - (ConstantInt - 2 - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantStr - "a" - () - ) - Mult - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantStr - "test" - () - ) - Mult - (ConstantInt - 5 - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantInt - 4 - () - ) - Mult - (ConstantStr - "bb" - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (UnaryOp - USub - (ConstantInt - 40 - () - ) - ) - Mult - (ConstantStr - "bb" - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (BinOp - (ConstantInt - 3 - () - ) - Mult - (ConstantStr - "a" - () - ) - ) - Mult - (ConstantInt - 3 - () - ) - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr12-adaecda.json b/tests/reference/ast-expr12-adaecda.json deleted file mode 100644 index 6fa2133b08..0000000000 --- a/tests/reference/ast-expr12-adaecda.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr12-adaecda", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr12.py", - "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr12-adaecda.stdout", - "stdout_hash": "b4fdb14f66196f4692126efb3b349707d3f862d6c045b61125af41cb", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr12-adaecda.stdout b/tests/reference/ast-expr12-adaecda.stdout deleted file mode 100644 index 38eaedd025..0000000000 --- a/tests/reference/ast-expr12-adaecda.stdout +++ /dev/null @@ -1,149 +0,0 @@ -(Module - [(FunctionDef - test - ([] - [(a - (Name - i32 - Load - ) - ()) - (b - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(Return - (BinOp - (Name - a - Load - ) - Pow - (Name - b - Load - ) - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - check - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - test - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - () - ) - (Return - (Name - a - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - main0 - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (Call - (Name - check - Load - ) - [] - [] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - main0 - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-expr13-c35ace1.json b/tests/reference/ast-expr13-c35ace1.json deleted file mode 100644 index 8da96d5109..0000000000 --- a/tests/reference/ast-expr13-c35ace1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr13-c35ace1", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr13.py", - "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr13-c35ace1.stdout", - "stdout_hash": "e92fa43a3f8dd1bdf555b71e6f5a263a5a5c10a8f63582fb57d04ce6", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr13-c35ace1.stdout b/tests/reference/ast-expr13-c35ace1.stdout deleted file mode 100644 index 3fd56b3af2..0000000000 --- a/tests/reference/ast-expr13-c35ace1.stdout +++ /dev/null @@ -1,374 +0,0 @@ -(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.600000 - () - ) - GtE - [(ConstantFloat - 5.599990 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Compare - (ConstantFloat - 3.300000 - () - ) - Eq - [(ConstantFloat - 3.300000 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Compare - (ConstantFloat - 3.300000 - () - ) - NotEq - [(ConstantFloat - 3.400000 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Compare - (Call - (Name - complex - Load - ) - [(ConstantInt - 3 - () - ) - (ConstantInt - 4 - () - )] - [] - ) - Eq - [(Call - (Name - complex - Load - ) - [(ConstantFloat - 3.000000 - () - ) - (ConstantFloat - 4.000000 - () - )] - [] - )] - ) - () - ) - (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-expr2-6642d4a.json b/tests/reference/ast-expr2-6642d4a.json deleted file mode 100644 index 779b2b5411..0000000000 --- a/tests/reference/ast-expr2-6642d4a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr2-6642d4a", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr2.py", - "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr2-6642d4a.stdout", - "stdout_hash": "cf996ecb8e3abdced429c59eedcbd9943bf59bbf22dcfd79ef94f799", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr2-6642d4a.stdout b/tests/reference/ast-expr2-6642d4a.stdout deleted file mode 100644 index 73a7f49c76..0000000000 --- a/tests/reference/ast-expr2-6642d4a.stdout +++ /dev/null @@ -1,184 +0,0 @@ -(Module - [(FunctionDef - test_boolOp - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (AnnAssign - (Name - b - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantBool - .false. - () - ) - () - ) - (Assign - [(Name - b - Store - )] - (ConstantBool - .true. - () - ) - () - ) - (Assign - [(Name - a - Store - )] - (BoolOp - And - [(Name - a - Load - ) - (Name - b - Load - )] - ) - () - ) - (Assign - [(Name - b - Store - )] - (BoolOp - Or - [(Name - a - Load - ) - (ConstantBool - .true. - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (BoolOp - Or - [(Name - a - Load - ) - (Name - b - Load - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (BoolOp - And - [(Name - a - Load - ) - (Compare - (Name - b - Load - ) - Eq - [(Name - b - Load - )] - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (BoolOp - And - [(Name - a - Load - ) - (Compare - (Name - b - Load - ) - NotEq - [(Name - b - Load - )] - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (BoolOp - Or - [(Name - b - Load - ) - (Name - b - Load - )] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr4-49316cb.json b/tests/reference/ast-expr4-49316cb.json deleted file mode 100644 index f60410170c..0000000000 --- a/tests/reference/ast-expr4-49316cb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr4-49316cb", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr4.py", - "infile_hash": "5cba7a5d589f54fc31463e48903d5b46604fb64e3e64ba215339047c", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr4-49316cb.stdout", - "stdout_hash": "8f1ed7fd76dff70c8cca71bda8f528f3e12bda9bb716e3e32ed58657", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr4-49316cb.stdout b/tests/reference/ast-expr4-49316cb.stdout deleted file mode 100644 index e74c2e02ca..0000000000 --- a/tests/reference/ast-expr4-49316cb.stdout +++ /dev/null @@ -1,72 +0,0 @@ -(Module - [(FunctionDef - test_del - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - b - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantInt - 4 - () - ) - () - ) - (Assign - [(Name - b - Store - )] - (ConstantInt - 20 - () - ) - () - ) - (Delete - [(Name - a - Del - ) - (Name - b - Del - )] - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr5-bbc6e71.json b/tests/reference/ast-expr5-bbc6e71.json deleted file mode 100644 index 93662179fd..0000000000 --- a/tests/reference/ast-expr5-bbc6e71.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr5-bbc6e71", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr5.py", - "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr5-bbc6e71.stdout", - "stdout_hash": "f856520f5cd00933d05c95de857ee6527c9a5ed476070c6d13857a40", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr5-bbc6e71.stdout b/tests/reference/ast-expr5-bbc6e71.stdout deleted file mode 100644 index c87b636101..0000000000 --- a/tests/reference/ast-expr5-bbc6e71.stdout +++ /dev/null @@ -1,89 +0,0 @@ -(Module - [(FunctionDef - test_StrOp_concat - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - s - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantStr - "3" - () - ) - Add - (ConstantStr - "4" - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (ConstantStr - "a " - () - ) - Add - (ConstantStr - "test" - () - ) - ) - () - ) - (Assign - [(Name - s - Store - )] - (BinOp - (BinOp - (ConstantStr - "test" - () - ) - Add - (ConstantStr - "test" - () - ) - ) - Add - (ConstantStr - "test" - () - ) - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr6-0b12a67.json b/tests/reference/ast-expr6-0b12a67.json deleted file mode 100644 index 5b9e9c3ec4..0000000000 --- a/tests/reference/ast-expr6-0b12a67.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr6-0b12a67", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr6.py", - "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr6-0b12a67.stdout", - "stdout_hash": "52edb5a692f7bc13f8c9642228f19a7e93960271cd3513a26a97df5d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr6-0b12a67.stdout b/tests/reference/ast-expr6-0b12a67.stdout deleted file mode 100644 index 860f7cd954..0000000000 --- a/tests/reference/ast-expr6-0b12a67.stdout +++ /dev/null @@ -1,119 +0,0 @@ -(Module - [(FunctionDef - test_ifexp - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - b - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - c - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantInt - 2 - () - ) - () - ) - (Assign - [(Name - b - Store - )] - (IfExp - (Compare - (Name - a - Load - ) - Eq - [(ConstantInt - 2 - () - )] - ) - (ConstantInt - 6 - () - ) - (ConstantInt - 8 - () - ) - ) - () - ) - (Assign - [(Name - c - Store - )] - (IfExp - (Compare - (Name - b - Load - ) - Gt - [(ConstantInt - 5 - () - )] - ) - (ConstantBool - .true. - () - ) - (ConstantBool - .false. - () - ) - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-expr7-fe52776.json b/tests/reference/ast-expr7-fe52776.json deleted file mode 100644 index f24345a89e..0000000000 --- a/tests/reference/ast-expr7-fe52776.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr7-fe52776", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr7.py", - "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr7-fe52776.stdout", - "stdout_hash": "5bf8b877e7cfee7d365d1c03622cced374fd006625e861154c8edc1b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr7-fe52776.stdout b/tests/reference/ast-expr7-fe52776.stdout deleted file mode 100644 index 29e6e4a147..0000000000 --- a/tests/reference/ast-expr7-fe52776.stdout +++ /dev/null @@ -1,204 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ())] - 0 - ) - (FunctionDef - test_pow - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - i32 - Load - ) - [(Call - (Name - pow - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - )] - [] - )] - [] - ) - () - )] - [] - () - () - ) - (FunctionDef - test_pow_1 - ([] - [(a - (Name - i32 - Load - ) - ()) - (b - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - res - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - res - Store - )] - (Call - (Name - i32 - Load - ) - [(Call - (Name - pow - Load - ) - [(Name - a - Load - ) - (Name - b - Load - )] - [] - )] - [] - ) - () - ) - (Return - (Name - res - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - main0 - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - test_pow - Load - ) - [] - [] - ) - ) - (AnnAssign - (Name - c - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - c - Store - )] - (Call - (Name - test_pow_1 - Load - ) - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - main0 - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-expr8-7db6b28.json b/tests/reference/ast-expr8-7db6b28.json deleted file mode 100644 index cdac33386b..0000000000 --- a/tests/reference/ast-expr8-7db6b28.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr8-7db6b28", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr8.py", - "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr8-7db6b28.stdout", - "stdout_hash": "b739c4d505f4e1c1a01c7ceaf6230f3a489bd9285a056bfda3a995c2", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr8-7db6b28.stdout b/tests/reference/ast-expr8-7db6b28.stdout deleted file mode 100644 index ea6c8d1606..0000000000 --- a/tests/reference/ast-expr8-7db6b28.stdout +++ /dev/null @@ -1,352 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ()) - (f32 - ())] - 0 - ) - (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 - )] - (Call - (Name - f32 - Load - ) - [(BinOp - (ConstantFloat - 2.000000 - () - ) - Pow - (ConstantFloat - 3.500000 - () - ) - )] - [] - ) - () - ) - (Assign - [(Name - x - Store - )] - (BinOp - (ConstantInt - 54 - () - ) - Sub - (ConstantInt - 100 - () - ) - ) - () - ) - (Assign - [(Name - x2 - Store - )] - (Call - (Name - f32 - Load - ) - [(BinOp - (BinOp - (ConstantFloat - 3.454000 - () - ) - Sub - (ConstantFloat - 765.430000 - () - ) - ) - Add - (ConstantFloat - 534.600000 - () - ) - )] - [] - ) - () - ) - (Assign - [(Name - x2 - Store - )] - (Call - (Name - f32 - Load - ) - [(BinOp - (ConstantFloat - 5346.565000 - () - ) - Mult - (ConstantFloat - 3.450000 - () - ) - )] - [] - ) - () - ) - (Assign - [(Name - x2 - Store - )] - (Call - (Name - f32 - Load - ) - [(BinOp - (ConstantFloat - 5346.565000 - () - ) - Pow - (ConstantFloat - 3.450000 - () - ) - )] - [] - ) - () - ) - (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 - )] - (Call - (Name - i32 - Load - ) - [(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-expr9-d184496.json b/tests/reference/ast-expr9-d184496.json deleted file mode 100644 index bc5e3f36d2..0000000000 --- a/tests/reference/ast-expr9-d184496.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr9-d184496", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr9.py", - "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr9-d184496.stdout", - "stdout_hash": "75772c0465dba8aaa9f5cebf3c35558b77827a9b29570828744d84d9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr9-d184496.stdout b/tests/reference/ast-expr9-d184496.stdout deleted file mode 100644 index bae64591f4..0000000000 --- a/tests/reference/ast-expr9-d184496.stdout +++ /dev/null @@ -1,231 +0,0 @@ -(Module - [(FunctionDef - test_return_1 - ([] - [(a - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (Return - (Name - x - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - test_return_2 - ([] - [(a - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (ConstantStr - "test" - () - ) - () - ) - (Return - (Name - x - Load - ) - )] - [] - (Name - str - Load - ) - () - ) - (FunctionDef - test_return_3 - ([] - [(a - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(Return - (Name - a - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - main0 - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - i - Store - )] - (Call - (Name - test_return_1 - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - () - ) - (AnnAssign - (Name - s - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - s - Store - )] - (Call - (Name - test_return_2 - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - () - ) - (Assign - [(Name - i - Store - )] - (Call - (Name - test_return_3 - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - main0 - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-expr_01-d0927f9.json b/tests/reference/ast-expr_01-d0927f9.json deleted file mode 100644 index 45b1c2df0e..0000000000 --- a/tests/reference/ast-expr_01-d0927f9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-expr_01-d0927f9", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/expr_01.py", - "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-expr_01-d0927f9.stdout", - "stdout_hash": "ba3af72a124b03f3aa21ae8a31d25ef05ee2f442dcf6b9759a659c98", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-expr_01-d0927f9.stdout b/tests/reference/ast-expr_01-d0927f9.stdout deleted file mode 100644 index 2fa44042d3..0000000000 --- a/tests/reference/ast-expr_01-d0927f9.stdout +++ /dev/null @@ -1,112 +0,0 @@ -(Module - [(FunctionDef - main0 - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - x2 - Store - ) - (Name - i64 - Load - ) - () - 1 - ) - (AnnAssign - (Name - y - Store - ) - (Name - f32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - y2 - Store - ) - (Name - f64 - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (BinOp - (BinOp - (ConstantInt - 2 - () - ) - Add - (ConstantInt - 3 - () - ) - ) - Mult - (ConstantInt - 5 - () - ) - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - x - Load - )] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - main0 - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-global1-b2690cf.json b/tests/reference/ast-global1-b2690cf.json deleted file mode 100644 index a5a57d4dcb..0000000000 --- a/tests/reference/ast-global1-b2690cf.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-global1-b2690cf", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/parser/global1.py", - "infile_hash": "cdbcc3f545f865cfc6e412f53fc6fd7cccdbc0d33b66e45460f3e916", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-global1-b2690cf.stdout", - "stdout_hash": "b0b999497a27625582a6dedfa024dba012a6ac1103ac427c49cc7d9d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-global1-b2690cf.stdout b/tests/reference/ast-global1-b2690cf.stdout deleted file mode 100644 index 9011e976ad..0000000000 --- a/tests/reference/ast-global1-b2690cf.stdout +++ /dev/null @@ -1,219 +0,0 @@ -(Module - [(Assign - [(Name - x - Store - )] - (ConstantStr - "global " - () - ) - () - ) - (FunctionDef - outer - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - x - Store - )] - (ConstantStr - "local" - () - ) - () - ) - (FunctionDef - inner - ([] - [] - [] - [] - [] - [] - []) - [(Nonlocal - [x] - ) - (Assign - [(Name - x - Store - )] - (ConstantStr - "nonlocal" - () - ) - () - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "nonlocal" - () - )] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - inner - Load - ) - [] - [] - ) - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "nonlocal" - () - )] - ) - () - )] - [] - () - () - ) - (FunctionDef - test_1 - ([] - [] - [] - [] - [] - [] - []) - [(Global - [x] - ) - (Assign - [(Name - y - Store - )] - (ConstantStr - "local" - () - ) - () - ) - (Assign - [(Name - x - Store - )] - (BinOp - (Name - x - Load - ) - Mult - (ConstantInt - 2 - () - ) - ) - () - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "global global " - () - )] - ) - () - ) - (Assert - (Compare - (Name - y - Load - ) - Eq - [(ConstantStr - "local" - () - )] - ) - () - )] - [] - () - () - ) - (FunctionDef - check - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - test_1 - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Name - outer - Load - ) - [] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - check - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-global_scope1-1d68a6c.json b/tests/reference/ast-global_scope1-1d68a6c.json deleted file mode 100644 index 44e3204dee..0000000000 --- a/tests/reference/ast-global_scope1-1d68a6c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-global_scope1-1d68a6c", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/global_scope1.py", - "infile_hash": "e7b33a2680429ee47d15af5af7c31ac24cc802d18d5566b568fc8ef4", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-global_scope1-1d68a6c.stdout", - "stdout_hash": "3311aec1626b395dc1c35208afdb7e3ddab90ac70a8a43f4f3e31325", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-global_scope1-1d68a6c.stdout b/tests/reference/ast-global_scope1-1d68a6c.stdout deleted file mode 100644 index 7d099d64fc..0000000000 --- a/tests/reference/ast-global_scope1-1d68a6c.stdout +++ /dev/null @@ -1,26 +0,0 @@ -(Module - [(AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - i - Store - )] - (ConstantInt - 5 - () - ) - () - )] - [] -) diff --git a/tests/reference/ast-list1-9ce2da0.json b/tests/reference/ast-list1-9ce2da0.json deleted file mode 100644 index af1c5005eb..0000000000 --- a/tests/reference/ast-list1-9ce2da0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-list1-9ce2da0", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/list1.py", - "infile_hash": "9d6b3f1a83a585d5a7a5e50ff5e1ddd15705fce268208d0cc2749514", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-list1-9ce2da0.stdout", - "stdout_hash": "fea2e7f56f26d3848224a3ca52219f76e456b2f4066e1156c22896f5", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-list1-9ce2da0.stdout b/tests/reference/ast-list1-9ce2da0.stdout deleted file mode 100644 index cb4dd75a96..0000000000 --- a/tests/reference/ast-list1-9ce2da0.stdout +++ /dev/null @@ -1,539 +0,0 @@ -(Module - [(FunctionDef - test_List - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Subscript - (Name - list - Load - ) - (Name - i32 - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - () - ) - (Assign - [(Name - a - Store - )] - (List - [(UnaryOp - USub - (ConstantInt - 3 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - )] - Load - ) - () - ) - (AnnAssign - (Name - b - Store - ) - (Subscript - (Name - list - Load - ) - (Name - str - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - b - Store - )] - (List - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (ConstantStr - "c" - () - )] - Load - ) - () - ) - (AnnAssign - (Name - c - Store - ) - (Subscript - (Name - list - Load - ) - (Subscript - (Name - list - Load - ) - (Name - i32 - Load - ) - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - c - Store - )] - (List - [(List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - (List - [(ConstantInt - 4 - () - ) - (ConstantInt - 5 - () - ) - (ConstantInt - 6 - () - )] - Load - )] - Load - ) - () - ) - (AnnAssign - (Name - d - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - d - Store - )] - (Subscript - (Name - a - Load - ) - (ConstantInt - 2 - () - ) - Load - ) - () - ) - (AnnAssign - (Name - e - Store - ) - (Subscript - (Name - list - Load - ) - (Subscript - (Name - list - Load - ) - (Name - str - Load - ) - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - e - Store - )] - (List - [(List - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (ConstantStr - "c" - () - )] - Load - ) - (List - [(ConstantStr - "d" - () - ) - (ConstantStr - "e" - () - )] - Load - )] - Load - ) - () - ) - (Expr - (Call - (Attribute - (Name - a - Load - ) - append - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - a - Load - ) - remove - Load - ) - [(ConstantInt - 1 - () - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - a - Load - ) - insert - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 13 - () - )] - [] - ) - ) - (Assign - [(Name - a - Store - )] - (Subscript - (Name - a - Load - ) - (Slice - (ConstantInt - 0 - () - ) - (ConstantInt - 2 - () - ) - () - ) - Load - ) - () - ) - (Assign - [(Name - d - Store - )] - (Call - (Attribute - (Name - a - Load - ) - pop - Load - ) - [] - [] - ) - () - ) - (Assign - [(Name - d - Store - )] - (Call - (Attribute - (Name - a - Load - ) - pop - Load - ) - [(ConstantInt - 2 - () - )] - [] - ) - () - ) - (AugAssign - (Name - a - Store - ) - Add - (List - [(ConstantInt - 4 - () - ) - (ConstantInt - 5 - () - )] - Load - ) - ) - (Assign - [(Name - a - Store - )] - (BinOp - (List - [(ConstantInt - 6 - () - ) - (ConstantInt - 7 - () - )] - Load - ) - Add - (Name - a - Load - ) - ) - () - ) - (AnnAssign - (Name - a11 - Store - ) - (Subscript - (Name - list - Load - ) - (Name - i32 - Load - ) - Load - ) - () - 1 - ) - (AnnAssign - (Name - b11 - Store - ) - (Subscript - (Name - list - Load - ) - (Name - i32 - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - a11 - Store - )] - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - () - ) - (Assign - [(Name - b11 - Store - )] - (List - [(ConstantInt - 3 - () - ) - (ConstantInt - 4 - () - )] - Load - ) - () - ) - (Assert - (Compare - (Name - a11 - Load - ) - Eq - [(Name - b11 - Load - )] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-loop1-194a137.json b/tests/reference/ast-loop1-194a137.json deleted file mode 100644 index 44f8695ff2..0000000000 --- a/tests/reference/ast-loop1-194a137.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-loop1-194a137", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/loop1.py", - "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-loop1-194a137.stdout", - "stdout_hash": "f4a9db8f60a56098bbd7f524f0e0a64fdad95cbe3ca44412879489e3", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-loop1-194a137.stdout b/tests/reference/ast-loop1-194a137.stdout deleted file mode 100644 index 4618763828..0000000000 --- a/tests/reference/ast-loop1-194a137.stdout +++ /dev/null @@ -1,480 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ()) - (i64 - ())] - 0 - ) - (FunctionDef - test_factorial_1 - ([] - [(x - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(If - (Compare - (Name - x - Load - ) - Lt - [(ConstantInt - 0 - () - )] - ) - [(Return - (ConstantInt - 0 - () - ) - )] - [] - ) - (AnnAssign - (Name - result - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - result - Store - )] - (ConstantInt - 1 - () - ) - () - ) - (While - (Compare - (Name - x - Load - ) - Gt - [(ConstantInt - 0 - () - )] - ) - [(Assign - [(Name - result - Store - )] - (BinOp - (Name - result - Load - ) - Mult - (Name - x - Load - ) - ) - () - ) - (AugAssign - (Name - x - Store - ) - Sub - (ConstantInt - 1 - () - ) - )] - [] - ) - (Return - (Name - result - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - test_factorial_2 - ([] - [(x - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - result - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - result - Store - )] - (ConstantInt - 1 - () - ) - () - ) - (AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 1 - () - ) - (BinOp - (Name - x - Load - ) - Add - (ConstantInt - 1 - () - ) - )] - [] - ) - [(Assign - [(Name - result - Store - )] - (BinOp - (Name - result - Load - ) - Mult - (Name - i - Load - ) - ) - () - )] - [] - () - ) - (Return - (Name - result - Load - ) - )] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - test_factorial_3 - ([] - [(x - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - result - Store - ) - (Name - i64 - Load - ) - () - 1 - ) - (Assign - [(Name - result - Store - )] - (Call - (Name - i64 - Load - ) - [(ConstantInt - 0 - () - )] - [] - ) - () - ) - (If - (Compare - (Name - x - Load - ) - Lt - [(ConstantInt - 0 - () - )] - ) - [(Return - (Name - result - Load - ) - )] - [] - ) - (Assign - [(Name - result - Store - )] - (Call - (Name - i64 - Load - ) - [(ConstantInt - 1 - () - )] - [] - ) - () - ) - (While - (Compare - (Name - x - Load - ) - Gt - [(ConstantInt - 0 - () - )] - ) - [(Assign - [(Name - result - Store - )] - (BinOp - (Name - result - Load - ) - Mult - (Call - (Name - i64 - Load - ) - [(Name - x - Load - )] - [] - ) - ) - () - ) - (AugAssign - (Name - x - Store - ) - Sub - (ConstantInt - 1 - () - ) - )] - [] - ) - (Return - (Name - result - Load - ) - )] - [] - (Name - i64 - Load - ) - () - ) - (FunctionDef - main0 - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - i - Store - )] - (Call - (Name - test_factorial_1 - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - () - ) - (Assign - [(Name - i - Store - )] - (Call - (Name - test_factorial_2 - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - () - ) - (AnnAssign - (Name - j - Store - ) - (Name - i64 - Load - ) - () - 1 - ) - (Assign - [(Name - j - Store - )] - (Call - (Name - test_factorial_3 - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - main0 - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast-loop3-f7e0393.json b/tests/reference/ast-loop3-f7e0393.json deleted file mode 100644 index 1dc5625553..0000000000 --- a/tests/reference/ast-loop3-f7e0393.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-loop3-f7e0393", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/loop3.py", - "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-loop3-f7e0393.stdout", - "stdout_hash": "edf8630a987fb8f9e62d064eb7c1d37f08f896b1453a141fd4db15cf", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-loop3-f7e0393.stdout b/tests/reference/ast-loop3-f7e0393.stdout deleted file mode 100644 index 956b2b5e86..0000000000 --- a/tests/reference/ast-loop3-f7e0393.stdout +++ /dev/null @@ -1,54 +0,0 @@ -(Module - [(FunctionDef - test_pass - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (ConstantInt - 1 - () - ) - () - ) - (While - (Compare - (Name - a - Load - ) - Gt - [(ConstantInt - 0 - () - )] - ) - [(Pass)] - [] - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-set1-ebd6ee0.json b/tests/reference/ast-set1-ebd6ee0.json deleted file mode 100644 index a04c792797..0000000000 --- a/tests/reference/ast-set1-ebd6ee0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-set1-ebd6ee0", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/set1.py", - "infile_hash": "63b5dc6a1f9c17099f1b10c8c45fcac1e50319ca8efbf7c283060abb", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-set1-ebd6ee0.stdout", - "stdout_hash": "f2003da3359a1713befbdd7bd1c789dcec22ac91a6d1f5b25cac1c77", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-set1-ebd6ee0.stdout b/tests/reference/ast-set1-ebd6ee0.stdout deleted file mode 100644 index d8617e4d12..0000000000 --- a/tests/reference/ast-set1-ebd6ee0.stdout +++ /dev/null @@ -1,190 +0,0 @@ -(Module - [(FunctionDef - test_Set - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - a - Store - ) - (Subscript - (Name - set - Load - ) - (Name - i32 - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - a - Store - )] - (Set - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Set - [(ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - (ConstantInt - 4 - () - ) - (ConstantInt - 5 - () - ) - (ConstantInt - 5 - () - )] - ) - () - ) - (Expr - (Call - (Attribute - (Name - a - Load - ) - add - Load - ) - [(ConstantInt - 9 - () - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - a - Load - ) - remove - Load - ) - [(ConstantInt - 4 - () - )] - [] - ) - ) - (AnnAssign - (Name - b - Store - ) - (Subscript - (Name - set - Load - ) - (Name - str - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - b - Store - )] - (Set - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (ConstantStr - "c" - () - )] - ) - () - ) - (AnnAssign - (Name - s - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - s - Store - )] - (Call - (Attribute - (Name - b - Load - ) - pop - Load - ) - [] - [] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-subscript1-bd5584b.json b/tests/reference/ast-subscript1-bd5584b.json deleted file mode 100644 index 2c3b5acfa5..0000000000 --- a/tests/reference/ast-subscript1-bd5584b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-subscript1-bd5584b", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/subscript1.py", - "infile_hash": "5d229893d3e13ea4463e8ed47eb3798be0b8c28f5ef6b6c773e87b80", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-subscript1-bd5584b.stdout", - "stdout_hash": "452c89181fdd389e48053af79eb944114e567a8a2e2d3b04c73721bd", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-subscript1-bd5584b.stdout b/tests/reference/ast-subscript1-bd5584b.stdout deleted file mode 100644 index 89a8bf37c6..0000000000 --- a/tests/reference/ast-subscript1-bd5584b.stdout +++ /dev/null @@ -1,415 +0,0 @@ -(Module - [(FunctionDef - test_subscript - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - s - Store - ) - (Name - str - Load - ) - () - 1 - ) - (Assign - [(Name - s - Store - )] - (ConstantStr - "abc" - () - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - () - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - () - () - () - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - () - () - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - () - () - (ConstantInt - 2 - () - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 88 - () - ) - (ConstantInt - 1 - () - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - () - (ConstantInt - 1 - () - ) - (UnaryOp - USub - (ConstantInt - 4 - () - ) - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - (UnaryOp - USub - (ConstantInt - 89 - () - ) - ) - () - (ConstantInt - 4 - () - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - (UnaryOp - USub - (ConstantInt - 3 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 3 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 3 - () - ) - ) - ) - Load - ) - () - ) - (Assign - [(Name - s - Store - )] - (Subscript - (Name - s - Load - ) - (Slice - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - () - ) - Load - ) - () - ) - (AnnAssign - (Name - A - Store - ) - (Subscript - (Name - i32 - Load - ) - (ConstantInt - 5 - () - ) - Load - ) - () - 1 - ) - (AnnAssign - (Name - B - Store - ) - (Subscript - (Name - i32 - Load - ) - (ConstantInt - 2 - () - ) - Load - ) - () - 1 - ) - (AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - i - Store - )] - (Subscript - (Name - A - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - () - ) - (Assign - [(Name - B - Store - )] - (Subscript - (Name - A - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 3 - () - ) - () - ) - Load - ) - () - ) - (Assign - [(Name - B - Store - )] - (Subscript - (Name - A - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - ) - Load - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast-tuple1-2fb5396.json b/tests/reference/ast-tuple1-2fb5396.json deleted file mode 100644 index feb6e53223..0000000000 --- a/tests/reference/ast-tuple1-2fb5396.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast-tuple1-2fb5396", - "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", - "infile": "tests/tuple1.py", - "infile_hash": "0ad9c210f19f9e560890c7a67ed06f4a710bbc8535c0097c35736028", - "outfile": null, - "outfile_hash": null, - "stdout": "ast-tuple1-2fb5396.stdout", - "stdout_hash": "b8f815cc5c9d9732bca16340aca88fd5b4453cf499a305fb0b036316", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast-tuple1-2fb5396.stdout b/tests/reference/ast-tuple1-2fb5396.stdout deleted file mode 100644 index e50cc5b28c..0000000000 --- a/tests/reference/ast-tuple1-2fb5396.stdout +++ /dev/null @@ -1,702 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ()) - (f32 - ())] - 0 - ) - (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 - ) - (AnnAssign - (Name - float_mem - Store - ) - (Name - f32 - Load - ) - () - 1 - ) - (Assign - [(Name - float_mem - Store - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 0.450000 - () - )] - [] - ) - () - ) - (Assign - [(Name - a3 - Store - )] - (Tuple - [(UnaryOp - USub - (ConstantInt - 2 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (Name - float_mem - Load - ) - (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 - ) - (AnnAssign - (Name - float_mem1 - Store - ) - (Name - f32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - float_mem2 - Store - ) - (Name - f32 - Load - ) - () - 1 - ) - (Assign - [(Name - float_mem1 - Store - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 3.400000 - () - )] - [] - ) - () - ) - (Assign - [(Name - float_mem2 - Store - )] - (Call - (Name - f32 - Load - ) - [(ConstantFloat - 5.600000 - () - )] - [] - ) - () - ) - (Assign - [(Name - a5 - Store - )] - (Tuple - [(Tuple - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (Name - float_mem1 - Load - )] - Load - ) - (Tuple - [(ConstantStr - "c" - () - ) - (ConstantInt - 3 - () - ) - (Name - float_mem2 - Load - )] - 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 - ) - () - ) - (AnnAssign - (Name - a11 - Store - ) - (Subscript - (Name - tuple - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (AnnAssign - (Name - b11 - Store - ) - (Subscript - (Name - tuple - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - a11 - Store - )] - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - () - ) - (Assign - [(Name - b11 - Store - )] - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - () - ) - (Assert - (Compare - (Name - a11 - Load - ) - Eq - [(Name - b11 - Load - )] - ) - () - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-async1-b3d07ed.json b/tests/reference/ast_new-async1-b3d07ed.json deleted file mode 100644 index 78595a5beb..0000000000 --- a/tests/reference/ast_new-async1-b3d07ed.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-async1-b3d07ed", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/async1.py", - "infile_hash": "7c5dba5bb5fe728a9452de16f8164730885146b2d93e49be8642d96a", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-async1-b3d07ed.stdout", - "stdout_hash": "1f809509a8c0637d93e82cf35a231a0f5e001a0b4bb2cfb37cc962ad", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-async1-b3d07ed.stdout b/tests/reference/ast_new-async1-b3d07ed.stdout deleted file mode 100644 index bf824f2524..0000000000 --- a/tests/reference/ast_new-async1-b3d07ed.stdout +++ /dev/null @@ -1,752 +0,0 @@ -(Module - [(AsyncFunctionDef - func - ([] - [(param1 - () - ()) - (param2 - () - ())] - [] - [] - [] - [] - []) - [(Expr - (Await - (Call - (Attribute - (Name - asyncio - Load - ) - sleep - Load - ) - [(ConstantInt - 1 - () - )] - [] - ) - ) - ) - (Expr - (Call - (Name - do_something - Load - ) - [] - [] - ) - ) - (AsyncFor - (Name - x - Store - ) - (Name - y - Load - ) - [(Expr - (Call - (Name - do_something - Load - ) - [(Name - x - Load - )] - [] - ) - )] - [] - () - ) - (AsyncWith - [((Call - (Name - open - Load - ) - [(ConstantStr - "examples/expr2.py" - () - ) - (ConstantStr - "r" - () - )] - [] - ) - (Name - file - Store - ))] - [(Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - file - Load - ) - read - Load - ) - [] - [] - ) - () - )] - () - )] - [] - () - () - ) - (AsyncFunctionDef - test_01 - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - results - Store - )] - (Await - (Call - (Attribute - (Name - tasks - Load - ) - gather - Load - ) - [(Starred - (ListComp - (Call - (Attribute - (Name - ag - Load - ) - aclose - Load - ) - [] - [] - ) - [((Name - ag - Store - ) - (Name - closing_agens - Load - ) - [] - 0)] - ) - Load - )] - [(return_exceptions - (ConstantBool - .true. - () - ))] - ) - ) - () - ) - (With - [((Await - (Name - lock - Load - ) - ) - ())] - [(Pass)] - () - ) - (AugAssign - (Name - data - Store - ) - Add - (Await - (Call - (Attribute - (Attribute - (Name - self - Load - ) - loop - Load - ) - sock_recv - Load - ) - [(Name - sock - Load - ) - (Name - DATA_SIZE - Load - )] - [] - ) - ) - ) - (Return - (Await - (Call - (Attribute - (Name - self - Load - ) - run_in_executor - Load - ) - [(ConstantNone - () - ) - (Name - getaddr_func - Load - ) - (Name - host - Load - ) - (Name - port - Load - ) - (Name - family - Load - ) - (Name - type - Load - ) - (Name - proto - Load - ) - (Name - flags - Load - )] - [] - ) - ) - )] - [] - () - () - ) - (AsyncFunctionDef - test_02 - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - items - Store - )] - (ListComp - (Await - (Call - (Attribute - (Name - q - Load - ) - get - Load - ) - [] - [] - ) - ) - [((Name - _ - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 3 - () - )] - [] - ) - [] - 0)] - ) - () - ) - (Expr - (SetComp - (Await - (Name - c - Load - ) - ) - [((Name - c - Store - ) - (List - [(Call - (Name - f - Load - ) - [(ConstantInt - 1 - () - )] - [] - ) - (Call - (Name - f - Load - ) - [(ConstantInt - 41 - () - )] - [] - )] - Load - ) - [] - 0)] - ) - ) - (Expr - (DictComp - (Name - i - Load - ) - (Await - (Name - c - Load - ) - ) - [((Tuple - [(Name - i - Store - ) - (Name - c - Store - )] - Store - ) - (Call - (Name - enumerate - Load - ) - [(List - [(Call - (Name - f - Load - ) - [(ConstantInt - 1 - () - )] - [] - ) - (Call - (Name - f - Load - ) - [(ConstantInt - 41 - () - )] - [] - )] - Load - )] - [] - ) - [] - 0)] - ) - ) - (Expr - (ListComp - (Name - s - Load - ) - [((Name - c - Store - ) - (List - [(Call - (Name - f - Load - ) - [(ConstantStr - "" - () - )] - [] - ) - (Call - (Name - f - Load - ) - [(ConstantStr - "abc" - () - )] - [] - ) - (Call - (Name - f - Load - ) - [(ConstantStr - "" - () - )] - [] - ) - (Call - (Name - f - Load - ) - [(List - [(ConstantStr - "de" - () - ) - (ConstantStr - "fg" - () - )] - Load - )] - [] - )] - Load - ) - [] - 0) - ((Name - s - Store - ) - (Await - (Name - c - Load - ) - ) - [] - 0)] - ) - ) - (Return - (GeneratorExp - (BinOp - (Name - i - Load - ) - Mult - (ConstantInt - 2 - () - ) - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(Name - n - Load - )] - [] - ) - [(Await - (Call - (Name - wrap - Load - ) - [(Name - i - Load - )] - [] - ) - )] - 0)] - ) - )] - [] - () - () - ) - (AsyncFunctionDef - t - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Attribute - (Name - results - Load - ) - append - Load - ) - [(Await - (Call - (Name - anext - Load - ) - [(Name - g - Load - )] - [] - ) - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - self - Load - ) - assertIn - Load - ) - [(ConstantStr - "..." - () - ) - (Call - (Name - repr - Load - ) - [(Await - (Call - (Attribute - (Name - asyncio - Load - ) - wait_for - Load - ) - [(Call - (Name - func - Load - ) - [] - [] - )] - [(timeout - (ConstantInt - 10 - () - ))] - ) - )] - [] - )] - [] - ) - ) - (Assign - [(Name - x - Store - )] - (UnaryOp - USub - (Await - (Call - (Name - bar - Load - ) - [] - [] - ) - ) - ) - () - ) - (Return - (BinOp - (BinOp - (BinOp - (BinOp - (Await - (Call - (Name - bar - Load - ) - [] - [] - ) - ) - Add - (Await - (Call - (Call - (Name - wrap - Load - ) - [] - [] - ) - [] - [] - ) - ) - ) - Add - (Await - (Call - (Call - (Call - (Subscript - (Name - db - Load - ) - (ConstantStr - "b" - () - ) - Load - ) - [] - [] - ) - [] - [] - ) - [] - [] - ) - ) - ) - Add - (BinOp - (Await - (Call - (Name - bar - Load - ) - [] - [] - ) - ) - Mult - (ConstantInt - 1000 - () - ) - ) - ) - Add - (Await - (Call - (Call - (Attribute - (Name - DB - Load - ) - b - Load - ) - [] - [] - ) - [] - [] - ) - ) - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-boolOp1-478328f.json b/tests/reference/ast_new-boolOp1-478328f.json deleted file mode 100644 index 561331afd8..0000000000 --- a/tests/reference/ast_new-boolOp1-478328f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-boolOp1-478328f", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/boolOp1.py", - "infile_hash": "d3c477215f26d7a7e09c7de32d3e716585796d1674cba2ea692fe161", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-boolOp1-478328f.stdout", - "stdout_hash": "e17703190ca113a29b38292421ba27f4d2d8e235a51115e9d3a2710f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-boolOp1-478328f.stdout b/tests/reference/ast_new-boolOp1-478328f.stdout deleted file mode 100644 index 665f42a764..0000000000 --- a/tests/reference/ast_new-boolOp1-478328f.stdout +++ /dev/null @@ -1,206 +0,0 @@ -(Module - [(Expr - (BoolOp - And - [(Name - a - Load - ) - (Name - b - Load - )] - ) - ) - (Expr - (BoolOp - Or - [(BoolOp - And - [(Name - a - Load - ) - (Name - b - Load - )] - ) - (Name - c - Load - )] - ) - ) - (Expr - (BoolOp - Or - [(Name - a - Load - ) - (Name - b - Load - )] - ) - ) - (Expr - (BoolOp - Or - [(Name - a - Load - ) - (BoolOp - And - [(Name - b - Load - ) - (Name - c - Load - )] - )] - ) - ) - (Expr - (BoolOp - Or - [(BoolOp - And - [(BoolOp - And - [(Name - a - Load - ) - (Name - b - Load - )] - ) - (Name - c - Load - )] - ) - (BoolOp - Or - [(BoolOp - Or - [(Name - x - Load - ) - (BoolOp - And - [(Name - y - Load - ) - (BoolOp - Or - [(Name - z - Load - ) - (Name - i - Load - )] - )] - )] - ) - (Name - j - Load - )] - )] - ) - ) - (Expr - (BoolOp - And - [(BoolOp - Or - [(BoolOp - And - [(BoolOp - And - [(Name - a - Load - ) - (BoolOp - And - [(Name - b - Load - ) - (BoolOp - Or - [(Name - c - Load - ) - (Name - d - Load - )] - )] - )] - ) - (BoolOp - And - [(Name - e - Load - ) - (Name - f - Load - )] - )] - ) - (Name - x - Load - )] - ) - (Name - y - Load - )] - ) - ) - (Expr - (BoolOp - Or - [(BoolOp - Or - [(Name - a - Load - ) - (BoolOp - And - [(Name - b - Load - ) - (Name - c - Load - )] - )] - ) - (Name - z - Load - )] - ) - )] - [] -) diff --git a/tests/reference/ast_new-class_def1-fe69291.json b/tests/reference/ast_new-class_def1-fe69291.json deleted file mode 100644 index 77bc5ba91c..0000000000 --- a/tests/reference/ast_new-class_def1-fe69291.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-class_def1-fe69291", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/class_def1.py", - "infile_hash": "e904e820fab9d596d2675abf65e19fc2b5fb6ecf950a902a0ec537fb", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-class_def1-fe69291.stdout", - "stdout_hash": "9802c1d135072a26d8cc97d779d5c89b93317138aa7903dde7d42fb0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-class_def1-fe69291.stdout b/tests/reference/ast_new-class_def1-fe69291.stdout deleted file mode 100644 index 8f8913cfba..0000000000 --- a/tests/reference/ast_new-class_def1-fe69291.stdout +++ /dev/null @@ -1,500 +0,0 @@ -(Module - [(ClassDef - Person - [] - [] - [(FunctionDef - __init__ - ([] - [(self - () - ()) - (name - () - ()) - (age - () - ())] - [] - [] - [] - [] - []) - [(Assign - [(Attribute - (Name - self - Load - ) - name - Store - )] - (Name - name - Load - ) - () - ) - (Assign - [(Attribute - (Name - self - Load - ) - age - Store - )] - (Name - age - Load - ) - () - )] - [] - () - () - ) - (FunctionDef - print_name - ([] - [(self - () - ())] - [] - [] - [] - [] - []) - [(Pass) - (Expr - (Call - (Name - print - Load - ) - [(BinOp - (ConstantStr - "Hello my name is " - () - ) - Add - (Attribute - (Name - self - Load - ) - name - Load - ) - )] - [] - ) - )] - [] - () - () - )] - [] - ) - (ClassDef - Dog - [] - [] - [(FunctionDef - __init__ - ([] - [(self - () - ()) - (name - () - ())] - [] - [] - [] - [] - []) - [(Assign - [(Attribute - (Name - self - Load - ) - name - Store - )] - (Name - name - Load - ) - () - ) - (Assign - [(Attribute - (Name - self - Load - ) - tricks - Store - )] - (List - [] - Load - ) - () - )] - [] - () - () - ) - (FunctionDef - add_trick - ([] - [(self - () - ()) - (trick - () - ())] - [] - [] - [] - [] - []) - [(Expr - (Call - (Attribute - (Attribute - (Name - self - Load - ) - tricks - Load - ) - append - Load - ) - [(Name - trick - Load - )] - [] - ) - )] - [] - () - () - )] - [] - ) - (ClassDef - Mapping - [] - [] - [(FunctionDef - __init__ - ([] - [(self - () - ()) - (iterable - () - ())] - [] - [] - [] - [] - []) - [(Assign - [(Attribute - (Name - self - Load - ) - items_list - Store - )] - (List - [] - Load - ) - () - ) - (Expr - (Call - (Attribute - (Name - self - Load - ) - __update - Load - ) - [(Name - iterable - Load - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - update - ([] - [(self - () - ()) - (iterable - () - ())] - [] - [] - [] - [] - []) - [(For - (Name - item - Store - ) - (Name - iterable - Load - ) - [(Expr - (Call - (Attribute - (Attribute - (Name - self - Load - ) - items_list - Load - ) - append - Load - ) - [(Name - item - Load - )] - [] - ) - )] - [] - () - )] - [] - () - () - ) - (Assign - [(Name - __update - Store - )] - (Name - update - Load - ) - () - )] - [] - ) - (ClassDef - MappingSubclass - [(Name - Mapping - Load - )] - [] - [(FunctionDef - update - ([] - [(self - () - ()) - (keys - () - ()) - (values - () - ())] - [] - [] - [] - [] - []) - [(For - (Name - item - Store - ) - (Call - (Name - zip - Load - ) - [(Name - keys - Load - ) - (Name - values - Load - )] - [] - ) - [(Expr - (Call - (Attribute - (Attribute - (Name - self - Load - ) - items_list - Load - ) - append - Load - ) - [(Name - item - Load - )] - [] - ) - )] - [] - () - )] - [] - () - () - )] - [] - ) - (FunctionDef - check - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - p - Store - )] - (Call - (Name - Person - Load - ) - [(ConstantStr - "John" - () - ) - (ConstantInt - 36 - () - )] - [] - ) - () - ) - (Assign - [(Name - d - Store - )] - (Call - (Name - Dog - Load - ) - [(ConstantStr - "Fido" - () - )] - [] - ) - () - ) - (Expr - (Call - (Attribute - (Name - d - Load - ) - add_trick - Load - ) - [(ConstantStr - "roll over" - () - )] - [] - ) - ) - (Assign - [(Name - m - Store - )] - (Call - (Name - Mapping - Load - ) - [(ConstantStr - "x" - () - )] - [] - ) - () - ) - (Expr - (Call - (Attribute - (Name - m - Load - ) - update - Load - ) - [(ConstantStr - "y" - () - )] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - check - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast_new-class_def2-c6db986.json b/tests/reference/ast_new-class_def2-c6db986.json deleted file mode 100644 index e03cb049fb..0000000000 --- a/tests/reference/ast_new-class_def2-c6db986.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-class_def2-c6db986", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/class_def2.py", - "infile_hash": "e7ad3c230a50dbe235499e6cc7ca8a93c59142bbc91b640edbd072af", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-class_def2-c6db986.stdout", - "stdout_hash": "25cb94d2ea083f3e06cf057b1c074808a51365717dca131ce67f06f6", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-class_def2-c6db986.stdout b/tests/reference/ast_new-class_def2-c6db986.stdout deleted file mode 100644 index 3412c6b551..0000000000 --- a/tests/reference/ast_new-class_def2-c6db986.stdout +++ /dev/null @@ -1,201 +0,0 @@ -(Module - [(ClassDef - _DTypeDict - [(Name - _DTypeDictBase - Load - )] - [(total - (ConstantBool - .false. - () - ))] - [(Pass)] - [] - ) - (ClassDef - test_01 - [] - [] - [(Pass)] - [] - ) - (ClassDef - test_02 - [(Name - x - Load - ) - (Name - y - Load - )] - [] - [(Pass)] - [] - ) - (ClassDef - test_03 - [(Name - x - Load - )] - [(y - (ConstantInt - 1 - () - )) - (z - (ConstantStr - "123" - () - ))] - [(Pass)] - [] - ) - (ClassDef - test_04 - [(ConstantInt - 100 - () - )] - [(() - (Name - x - Load - ))] - [(Pass)] - [] - ) - (ClassDef - test_05 - [(Starred - (Name - x - Load - ) - Load - )] - [(() - (Name - y - Load - ))] - [(Pass)] - [] - ) - (ClassDef - test_06 - [(Starred - (Name - x - Load - ) - Load - ) - (Name - y - Load - )] - [] - [(Pass)] - [] - ) - (ClassDef - test_07 - [(Starred - (Name - x - Load - ) - Load - ) - (Starred - (Name - y - Load - ) - Load - )] - [] - [(Pass)] - [] - ) - (ClassDef - test_08 - [] - [(() - (Name - x - Load - )) - (() - (Name - y - Load - ))] - [(Pass)] - [] - ) - (ClassDef - test_08 - [(Name - x - Load - )] - [] - [(Pass)] - [] - ) - (ClassDef - sub - [(Attribute - (Name - np - Load - ) - ndarray - Load - )] - [] - [(Pass)] - [] - ) - (ClassDef - name - [] - [] - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (ClassDef - MMatrix - [(Name - MaskedArray - Load - ) - (Attribute - (Name - np - Load - ) - matrix - Load - )] - [] - [(Expr - (ConstantEllipsis - () - ) - )] - [] - )] - [(TypeIgnore - 0 - "[misc]" - )] -) diff --git a/tests/reference/ast_new-comment2-f0984d5.json b/tests/reference/ast_new-comment2-f0984d5.json deleted file mode 100644 index 1309f6159f..0000000000 --- a/tests/reference/ast_new-comment2-f0984d5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-comment2-f0984d5", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/tokens/comment2.py", - "infile_hash": "b62404a5d774f0b18fcad6fb1dac8733334ce3593a77d34bcbb05019", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-comment2-f0984d5.stdout", - "stdout_hash": "4dd8b313619df81c518cdfbddd523b3486b2ad5406ff720dde825af9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-comment2-f0984d5.stdout b/tests/reference/ast_new-comment2-f0984d5.stdout deleted file mode 100644 index 9a9e90f873..0000000000 --- a/tests/reference/ast_new-comment2-f0984d5.stdout +++ /dev/null @@ -1,150 +0,0 @@ -(Module - [(FunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(If - (Name - foo - Load - ) - [(If - (Name - bar - Load - ) - [(Pass)] - [] - )] - [(Pass)] - ) - (Return - () - )] - [] - () - () - ) - (FunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - print - Load - ) - [] - [] - ) - )] - [] - () - () - ) - (FunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - print - Load - ) - [] - [] - ) - )] - [] - () - () - ) - (FunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - print - Load - ) - [] - [] - ) - ) - (Pass)] - [] - () - () - ) - (FunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(If - (Name - foo - Load - ) - [(Pass) - (Pass) - (If - (Name - bar - Load - ) - [(Pass)] - [] - ) - (Pass)] - [] - ) - (Pass)] - [] - () - () - ) - (Assign - [(Name - x - Store - )] - (List - [(Name - a - Load - )] - Load - ) - () - )] - [] -) diff --git a/tests/reference/ast_new-comprehension1-69cf2af.json b/tests/reference/ast_new-comprehension1-69cf2af.json deleted file mode 100644 index 1e1b460b96..0000000000 --- a/tests/reference/ast_new-comprehension1-69cf2af.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-comprehension1-69cf2af", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/comprehension1.py", - "infile_hash": "2e5d7d233befce4f5cbf334234537fe4f11e8b6e8d057974579aed89", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-comprehension1-69cf2af.stdout", - "stdout_hash": "dd4d6e66646c90be9ebc7070964a2f42ca21d5c782bfddbf89ce854b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-comprehension1-69cf2af.stdout b/tests/reference/ast_new-comprehension1-69cf2af.stdout deleted file mode 100644 index 83f9d88428..0000000000 --- a/tests/reference/ast_new-comprehension1-69cf2af.stdout +++ /dev/null @@ -1,1363 +0,0 @@ -(Module - [(Assign - [(Name - fruits - Store - )] - (ListComp - (Name - f - Load - ) - [((Name - f - Store - ) - (Name - fruit_list - Load - ) - [(Call - (Attribute - (Name - f - Load - ) - startswith - Load - ) - [(ConstantStr - "a" - () - )] - [] - )] - 0)] - ) - () - ) - (Assign - [(Name - fruit_list - Store - )] - (ListComp - (Name - fruit - Load - ) - [((Name - fruit - Store - ) - (Name - fruits - Load - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - sum_cord - Store - )] - (ListComp - (BinOp - (Name - x - Load - ) - Add - (Name - y - Load - ) - ) - [((Tuple - [(Name - x - Store - ) - (Name - y - Store - )] - Store - ) - (Name - points - Load - ) - [(BoolOp - And - [(Compare - (Name - x - Load - ) - Gt - [(ConstantInt - 0 - () - )] - ) - (Compare - (Name - y - Load - ) - Gt - [(ConstantInt - 0 - () - )] - )] - )] - 0)] - ) - () - ) - (Assign - [(Name - transform_1 - Store - )] - (ListComp - (BinOp - (BinOp - (ConstantInt - 2 - () - ) - Mult - (Name - x - Load - ) - ) - Add - (ConstantInt - 6 - () - ) - ) - [((Name - x - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - distance_orig - Store - )] - (ListComp - (BinOp - (BinOp - (BinOp - (Name - x - Load - ) - Pow - (ConstantInt - 2 - () - ) - ) - Add - (BinOp - (Name - y - Load - ) - Pow - (ConstantInt - 2 - () - ) - ) - ) - Add - (BinOp - (Name - z - Load - ) - Pow - (ConstantInt - 2 - () - ) - ) - ) - [((Tuple - [(Name - x - Store - ) - (Name - y - Store - ) - (Name - z - Store - )] - Store - ) - (Name - points - Load - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - odd_elements - Store - )] - (ListComp - (Name - i - Load - ) - [((Name - i - Store - ) - (Name - main_list - Load - ) - [(BinOp - (Name - i - Load - ) - BitAnd - (ConstantInt - 1 - () - ) - )] - 0)] - ) - () - ) - (Assign - [(Name - first_ten_elements - Store - )] - (ListComp - (Name - i - Load - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - another_ten_elements - Store - )] - (ListComp - (Name - i - Load - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - comp - Store - )] - (ListComp - (BinOp - (Name - i - Load - ) - Pow - (ConstantInt - 2 - () - ) - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(BoolOp - And - [(Compare - (Name - i - Load - ) - NotIn - [(List - [(ConstantInt - 3 - () - ) - (ConstantInt - 5 - () - ) - (ConstantInt - 7 - () - )] - Load - )] - ) - (Compare - (Name - i - Load - ) - In - [(Name - list3 - Load - )] - )] - )] - 0)] - ) - () - ) - (Assign - [(Name - items - Store - )] - (ListComp - (Name - name - Load - ) - [((Tuple - [(Name - name - Store - ) - (Name - value - Store - )] - Store - ) - (Call - (Attribute - (Call - (Name - vars - Load - ) - [(Name - argparse - Load - )] - [] - ) - items - Load - ) - [] - [] - ) - [(UnaryOp - Not - (BoolOp - Or - [(Call - (Attribute - (Name - name - Load - ) - startswith - Load - ) - [(ConstantStr - "_" - () - )] - [] - ) - (Compare - (Name - name - Load - ) - Eq - [(ConstantStr - "ngettext" - () - )] - )] - ) - ) - (UnaryOp - Not - (Call - (Attribute - (Name - inspect - Load - ) - ismodule - Load - ) - [(Name - value - Load - )] - [] - ) - )] - 0)] - ) - () - ) - (Expr - (ListComp - (ConstantInt - 0 - () - ) - [((Subscript - (Name - tgt - Load - ) - (ConstantInt - 0 - () - ) - Store - ) - (Call - (Name - source - Load - ) - [] - [] - ) - [] - 1)] - ) - ) - (Assign - [(Name - prm_tup - Store - )] - (Call - (Name - tuple - Load - ) - [(GeneratorExp - (Call - (Name - next - Load - ) - [(Name - parameters - Load - )] - [] - ) - [((Name - _ - Store - ) - (Attribute - (Name - i - Load - ) - __parameters__ - Load - ) - [] - 0)] - )] - [] - ) - () - ) - (Assign - [(Name - args - Store - )] - (Call - (Attribute - (ConstantStr - ", " - () - ) - join - Load - ) - [(GeneratorExp - (Call - (Name - _to_str - Load - ) - [(Name - i - Load - )] - [] - ) - [((Name - i - Store - ) - (Attribute - (Name - self - Load - ) - __args__ - Load - ) - [] - 0)] - )] - [] - ) - () - ) - (Assign - [(Name - rest - Store - )] - (Call - (Name - tuple - Load - ) - [(GeneratorExp - (Name - i - Load - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(Attribute - (Name - a - Load - ) - ndim - Load - )] - [] - ) - [(Compare - (Name - i - Load - ) - NotIn - [(Name - axis - Load - )] - )] - 0)] - )] - [] - ) - () - ) - (Expr - (GeneratorExp - (Call - (Name - sstr - Load - ) - [(Name - x - Load - )] - [] - ) - [((List - [(Name - x - Store - )] - Store - ) - (Attribute - (Attribute - (Name - self - Load - ) - _module - Load - ) - gens - Load - ) - [] - 0)] - ) - ) - (Expr - (Call - (Name - func - Load - ) - [(Starred - (ListComp - (List - [(BinOp - (Name - x - Load - ) - Mult - (Name - y - Load - ) - )] - Load - ) - [((List - [(Name - x - Store - )] - Store - ) - (Attribute - (Attribute - (Name - self - Load - ) - _module - Load - ) - gens - Load - ) - [] - 0) - ((List - [(Name - y - Store - )] - Store - ) - (Attribute - (Attribute - (Name - J - Load - ) - _module - Load - ) - gens - Load - ) - [] - 0)] - ) - Load - )] - [] - ) - ) - (Expr - (GeneratorExp - (Name - x - Load - ) - [((List - [(Name - a - Store - ) - (Name - b - Store - )] - Store - ) - (Name - y - Load - ) - [] - 0)] - ) - ) - (Expr - (GeneratorExp - (Name - x - Load - ) - [((List - [(Name - a - Store - ) - (Tuple - [(Name - b - Store - ) - (Name - c - Store - )] - Store - )] - Store - ) - (Name - y - Load - ) - [] - 0)] - ) - ) - (Expr - (GeneratorExp - (Name - x - Load - ) - [((List - [(Tuple - [(Name - b - Store - ) - (Name - c - Store - )] - Store - )] - Store - ) - (Name - y - Load - ) - [] - 0)] - ) - ) - (Expr - (GeneratorExp - (Name - x - Load - ) - [((List - [] - Store - ) - (Name - y - Load - ) - [] - 0)] - ) - ) - (Expr - (GeneratorExp - (Subscript - (Name - string - Load - ) - (Name - i - Load - ) - Load - ) - [((Name - i - Store - ) - (Call - (Name - range - Load - ) - [(BinOp - (Call - (Name - len - Load - ) - [(Name - string - Load - )] - [] - ) - Sub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - )] - [] - ) - [] - 0)] - ) - ) - (Assign - [(Name - k - Store - )] - (GeneratorExp - (BinOp - (Name - j - Load - ) - Add - (Name - k - Load - ) - ) - [((Tuple - [(Name - j - Store - ) - (Name - k - Store - )] - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(Compare - (Name - j - Load - ) - Gt - [(ConstantInt - 0 - () - )] - )] - 0)] - ) - () - ) - (Expr - (GeneratorExp - (BinOp - (BinOp - (Name - left - Load - ) - Add - (Name - size - Load - ) - ) - Add - (Name - right - Load - ) - ) - [((Tuple - [(Name - size - Store - ) - (Tuple - [(Name - left - Store - ) - (Name - right - Store - )] - Store - )] - Store - ) - (Call - (Name - zip - Load - ) - [(Attribute - (Name - array - Load - ) - shape - Load - ) - (Name - pad_width - Load - )] - [] - ) - [] - 0)] - ) - ) - (Assign - [(Name - viter - Store - )] - (GeneratorExp - (Tuple - [(Name - i - Load - ) - (Name - j - Load - )] - Load - ) - [((Tuple - [(Tuple - [(Name - i - Store - ) - (Name - _ - Store - )] - Store - ) - (Tuple - [(Name - j - Store - ) - (Name - _ - Store - )] - Store - )] - Store - ) - (Call - (Name - zip - Load - ) - [(Subscript - (Name - newargs - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - ) - (Subscript - (Name - args - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - )] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - newSet - Store - )] - (SetComp - (BinOp - (Name - element - Load - ) - Mult - (ConstantInt - 3 - () - ) - ) - [((Name - element - Store - ) - (Name - myList - Load - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - newSet - Store - )] - (SetComp - (BinOp - (Name - element - Load - ) - Mult - (ConstantInt - 3 - () - ) - ) - [((Name - element - Store - ) - (Name - myList - Load - ) - [(Compare - (BinOp - (Name - element - Load - ) - Mod - (ConstantInt - 2 - () - ) - ) - Eq - [(ConstantInt - 0 - () - )] - )] - 0)] - ) - () - ) - (Expr - (DictComp - (Name - x - Load - ) - (BinOp - (Name - x - Load - ) - Pow - (ConstantInt - 3 - () - ) - ) - [((Name - x - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(Compare - (BinOp - (BinOp - (Name - x - Load - ) - Pow - (ConstantInt - 3 - () - ) - ) - Mod - (ConstantInt - 4 - () - ) - ) - Eq - [(ConstantInt - 0 - () - )] - )] - 0)] - ) - ) - (Assign - [(Name - square_dict - Store - )] - (DictComp - (Name - num - Load - ) - (BinOp - (Name - num - Load - ) - Mult - (Name - num - Load - ) - ) - [((Name - num - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 1 - () - ) - (ConstantInt - 11 - () - )] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - error_names - Store - )] - (ListComp - (Subscript - (Call - (Attribute - (Name - test_full_name - Load - ) - split - Load - ) - [(ConstantStr - " " - () - )] - [] - ) - (ConstantInt - 0 - () - ) - Load - ) - [((Tuple - [(Name - test_full_name - Store - ) - (Starred - (Name - _ - Store - ) - Store - )] - Store - ) - (Name - errors - Load - ) - [] - 0)] - ) - () - )] - [] -) diff --git a/tests/reference/ast_new-conditional_expr1-07ccb9e.json b/tests/reference/ast_new-conditional_expr1-07ccb9e.json deleted file mode 100644 index e90a4839bd..0000000000 --- a/tests/reference/ast_new-conditional_expr1-07ccb9e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-conditional_expr1-07ccb9e", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/conditional_expr1.py", - "infile_hash": "5846a6c58bf238c4276f733b5fc9876a948ed63558444210d9f79c55", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-conditional_expr1-07ccb9e.stdout", - "stdout_hash": "92adfc3fb76aa117fdee246478837474332ec5de543e164920e3ec40", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout b/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout deleted file mode 100644 index 74739c7294..0000000000 --- a/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout +++ /dev/null @@ -1,1069 +0,0 @@ -(Module - [(Assign - [(Name - b - Store - )] - (IfExp - (Compare - (Name - a - Load - ) - Eq - [(ConstantInt - 2 - () - )] - ) - (ConstantInt - 6 - () - ) - (ConstantInt - 8 - () - ) - ) - () - ) - (Expr - (IfExp - (ConstantBool - .true. - () - ) - (ConstantStr - "true" - () - ) - (ConstantStr - "false" - () - ) - ) - ) - (Assign - [(Name - result - Store - )] - (IfExp - (UnaryOp - Not - (Compare - (Name - a - Load - ) - Gt - [(Name - b - Load - )] - ) - ) - (Name - x - Load - ) - (Name - y - Load - ) - ) - () - ) - (Expr - (IfExp - (Compare - (Name - a - Load - ) - Gt - [(Name - b - Load - )] - ) - (Call - (Name - print - Load - ) - [(Name - a - Load - ) - (ConstantStr - "is greater" - () - )] - [] - ) - (Call - (Name - print - Load - ) - [(Name - b - Load - ) - (ConstantStr - "is Greater" - () - )] - [] - ) - ) - ) - (Expr - (Call - (Name - x - Load - ) - [(IfExp - (ConstantBool - .true. - () - ) - (ConstantStr - "True" - () - ) - (ConstantStr - "False" - () - ) - )] - [] - ) - ) - (Assign - [(Name - test - Store - )] - (IfExp - (Name - a - Load - ) - (Call - (Name - x - Load - ) - [(ConstantInt - 123 - () - )] - [] - ) - (Attribute - (Name - b - Load - ) - c - Load - ) - ) - () - ) - (Assign - [(Name - res - Store - )] - (Call - (Attribute - (Name - test - Load - ) - x - Load - ) - [(IfExp - (Compare - (Name - z - Load - ) - Is - [(ConstantNone - () - )] - ) - (ConstantStr - "" - () - ) - (Name - var - Load - ) - )] - [] - ) - () - ) - (Assign - [(Name - size - Store - )] - (BinOp - (Call - (Name - sum - Load - ) - [(GeneratorExp - (IfExp - (Compare - (Call - (Name - ord - Load - ) - [(Name - c - Load - )] - [] - ) - Gt - [(ConstantInt - 65535 - () - )] - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 1 - () - ) - ) - [((Name - c - Store - ) - (Name - init - Load - ) - [] - 0)] - )] - [] - ) - Add - (ConstantInt - 1 - () - ) - ) - () - ) - (Expr - (Tuple - [(Name - x - Load - ) - (Name - y - Load - ) - (IfExp - (Name - a - Load - ) - (ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - )] - Load - ) - ) - (AugAssign - (Name - x - Store - ) - Add - (IfExp - (Name - true - Load - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (ConstantInt - 1 - () - ) - ) - ) - (Expr - (Call - (IfExp - (Compare - (Name - tktype - Load - ) - In - [(Name - whentrue - Load - )] - ) - (Attribute - (Name - self - Load - ) - assertTrue - Load - ) - (Attribute - (Name - self - Load - ) - assertFalse - Load - ) - ) - [(Call - (Name - func - Load - ) - [] - [] - )] - [] - ) - ) - (Assign - [(Name - x - Store - )] - (SetComp - (IfExp - (Compare - (Call - (Name - len - Load - ) - [(Attribute - (Name - f - Load - ) - parts - Load - )] - [] - ) - Gt - [(ConstantInt - 1 - () - )] - ) - (Subscript - (Attribute - (Name - f - Load - ) - parts - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - (Attribute - (Call - (Attribute - (Name - f - Load - ) - with_suffix - Load - ) - [(ConstantStr - "" - () - )] - [] - ) - name - Load - ) - ) - [((Name - f - Store - ) - (Call - (Name - always_iterable - Load - ) - [(Attribute - (Name - dist - Load - ) - files - Load - )] - [] - ) - [(Compare - (Attribute - (Name - f - Load - ) - suffix - Load - ) - Eq - [(ConstantStr - ".py" - () - )] - )] - 0)] - ) - () - ) - (Assign - [(Name - return_value - Store - )] - (DictComp - (Name - key - Load - ) - (IfExp - (UnaryOp - Not - (Call - (Name - isinstance - Load - ) - [(Name - value - Load - ) - (Name - str - Load - )] - [] - ) - ) - (Name - value - Load - ) - (Call - (Name - eval - Load - ) - [(Name - value - Load - ) - (Name - globals - Load - ) - (Name - locals - Load - )] - [] - ) - ) - [((Tuple - [(Name - key - Store - ) - (Name - value - Store - )] - Store - ) - (Call - (Attribute - (Name - ann - Load - ) - items - Load - ) - [] - [] - ) - [] - 0)] - ) - () - ) - (Assign - [(Name - kwonly_sig - Store - )] - (BinOp - (Name - msg - Load - ) - Mod - (Tuple - [(IfExp - (Compare - (Name - given - Load - ) - NotEq - [(ConstantInt - 1 - () - )] - ) - (ConstantStr - "s" - () - ) - (ConstantStr - "" - () - ) - ) - (Name - kwonly_given - Load - ) - (IfExp - (Compare - (Name - kwonly_given - Load - ) - NotEq - [(ConstantInt - 1 - () - )] - ) - (ConstantStr - "s" - () - ) - (ConstantStr - "" - () - ) - )] - Load - ) - ) - () - ) - (Expr - (Call - (Attribute - (Name - struct - Load - ) - pack_into - Load - ) - [(Call - (Attribute - (ConstantStr - "" - () - ) - join - Load - ) - [(Name - _formats - Load - )] - [] - ) - (Attribute - (Attribute - (Name - self - Load - ) - shm - Load - ) - buf - Load - ) - (Attribute - (Name - self - Load - ) - _offset_data_start - Load - ) - (Starred - (GeneratorExp - (IfExp - (Call - (Name - isinstance - Load - ) - [(Name - v - Load - ) - (Name - str - Load - )] - [] - ) - (Call - (Attribute - (Name - v - Load - ) - encode - Load - ) - [(Name - _enc - Load - )] - [] - ) - (Name - v - Load - ) - ) - [((Name - v - Store - ) - (Name - sequence - Load - ) - [] - 0)] - ) - Load - )] - [] - ) - ) - (For - (Name - name - Store - ) - (IfExp - (Compare - (Name - entries - Load - ) - Is - [(ConstantNone - () - )] - ) - (Name - dirs - Load - ) - (Call - (Name - zip - Load - ) - [(Name - dirs - Load - ) - (Name - entries - Load - )] - [] - ) - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - ) - (If - (IfExp - (Compare - (Name - n - Load - ) - Eq - [(ConstantInt - 0 - () - )] - ) - (BoolOp - Or - [(Name - root - Load - ) - (Name - drv - Load - )] - ) - (Compare - (Call - (Name - cf - Load - ) - [(Subscript - (Name - abs_parts - Load - ) - (Slice - () - (Name - n - Load - ) - () - ) - Load - )] - [] - ) - NotEq - [(Call - (Name - cf - Load - ) - [(Name - to_abs_parts - Load - )] - [] - )] - ) - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (Assign - [(Tuple - [(Name - x - Store - ) - (Name - y - Store - )] - Store - )] - (Tuple - [(Name - thing - Load - ) - (IfExp - (Call - (Name - isinstance - Load - ) - [(Name - name - Load - ) - (Name - str - Load - )] - [] - ) - (Name - name - Load - ) - (ConstantNone - () - ) - )] - Load - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(BinOp - (ConstantStr - "%*d%s " - () - ) - Mod - (Tuple - [(Name - offset_width - Load - ) - (Name - start - Load - ) - (IfExp - (Compare - (Name - start - Load - ) - In - [(Name - labels - Load - )] - ) - (ConstantStr - ":" - () - ) - (ConstantStr - "." - () - ) - )] - Load - ) - )] - [(end - (BinOp - (ConstantStr - " " - () - ) - Mult - (BinOp - (Name - level - Load - ) - Sub - (ConstantInt - 1 - () - ) - ) - ))] - ) - ) - (Assign - [(Name - Signals - Store - )] - (Dict - [(Name - C - Load - ) - (Name - P - Load - )] - [(IfExp - (Name - C - Load - ) - (Call - (Name - tuple - Load - ) - [(Call - (Attribute - (Attribute - (Call - (Attribute - (Name - C - Load - ) - getcontext - Load - ) - [] - [] - ) - flags - Load - ) - keys - Load - ) - [] - [] - )] - [] - ) - (ConstantNone - () - ) - ) - (Call - (Name - tuple - Load - ) - [(Call - (Attribute - (Attribute - (Call - (Attribute - (Name - P - Load - ) - getcontext - Load - ) - [] - [] - ) - flags - Load - ) - keys - Load - ) - [] - [] - )] - [] - )] - ) - () - ) - (Assign - [(Name - chunks - Store - )] - (ListComp - (IfExp - (Name - cond2 - Load - ) - (IfExp - (Name - cond1 - Load - ) - (ConstantBytes - "b'z'" - () - ) - (ConstantBytes - "b'y'" - () - ) - ) - (Name - x - Load - ) - ) - [((Name - word - Store - ) - (Name - words - Load - ) - [] - 0)] - ) - () - )] - [] -) diff --git a/tests/reference/ast_new-dictionary1-445e718.json b/tests/reference/ast_new-dictionary1-445e718.json deleted file mode 100644 index 5d739b9a9b..0000000000 --- a/tests/reference/ast_new-dictionary1-445e718.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-dictionary1-445e718", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/dictionary1.py", - "infile_hash": "68922e77dbabe06c271463150653684880d3c28d88caa44109b2e202", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-dictionary1-445e718.stdout", - "stdout_hash": "dfae0ace6e4267478ecfd053f2be4a56fddf1f635099b4f6695d250b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-dictionary1-445e718.stdout b/tests/reference/ast_new-dictionary1-445e718.stdout deleted file mode 100644 index f468f9e1f4..0000000000 --- a/tests/reference/ast_new-dictionary1-445e718.stdout +++ /dev/null @@ -1,299 +0,0 @@ -(Module - [(FunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - x - Store - )] - (Dict - [] - [] - ) - () - ) - (Assign - [(Name - dict - Store - )] - (Dict - [(ConstantStr - "brand" - () - ) - (ConstantStr - "electric" - () - ) - (ConstantStr - "year" - () - ) - (ConstantStr - "colors" - () - )] - [(ConstantStr - "Ford" - () - ) - (ConstantBool - .false. - () - ) - (ConstantInt - 1964 - () - ) - (List - [(ConstantStr - "red" - () - ) - (ConstantStr - "white" - () - )] - Load - )] - ) - () - ) - (Assign - [(Name - num - Store - )] - (Dict - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - [(ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - ) - () - ) - (AnnAssign - (Name - y - Store - ) - (Subscript - (Name - dict - Load - ) - (Tuple - [(Name - str - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - )] - ) - () - ) - (Assign - [(Name - y - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - (UnaryOp - USub - (ConstantInt - 2 - () - ) - )] - ) - () - ) - (Assign - [(Subscript - (Name - y - Load - ) - (ConstantStr - "a" - () - ) - Store - )] - (ConstantInt - 123 - () - ) - () - ) - (Assign - [(Name - a - Store - )] - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - ) - () - ) - (Assign - [(Name - x - Store - )] - (Dict - [(ConstantStr - "markdown2.tpl" - () - )] - [(ConstantStr - " Text\n " - () - )] - ) - () - ) - (Assign - [(Name - x - Store - )] - (Dict - [(ConstantNone - () - ) - (Name - y - Load - ) - (ConstantNone - () - ) - (ConstantNone - () - )] - [(Name - x - Load - ) - (ConstantStr - "Text" - () - ) - (Name - z - Load - ) - (ConstantStr - "None" - () - )] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - test - Load - ) - [] - [] - ) - )] - [(TypeIgnore - 0 - "" - )] -) diff --git a/tests/reference/ast_new-ellipsis2-3a9750b.json b/tests/reference/ast_new-ellipsis2-3a9750b.json deleted file mode 100644 index 90701cb0d6..0000000000 --- a/tests/reference/ast_new-ellipsis2-3a9750b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-ellipsis2-3a9750b", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/ellipsis2.py", - "infile_hash": "2e6669bafe4247887d3cd6d9f479ef9c02de96d2a018df4a716ae259", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-ellipsis2-3a9750b.stdout", - "stdout_hash": "c31c7abbb37cfb16b2e919f083ffc3839162529f9e18e82dc3a1ed7c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-ellipsis2-3a9750b.stdout b/tests/reference/ast_new-ellipsis2-3a9750b.stdout deleted file mode 100644 index a86c90395c..0000000000 --- a/tests/reference/ast_new-ellipsis2-3a9750b.stdout +++ /dev/null @@ -1,336 +0,0 @@ -(Module - [(Import - [(numpy - np)] - ) - (ImportFrom - typing - [(Callable - ())] - 0 - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantEllipsis - () - )] - [] - ) - ) - (Assign - [(Name - array - Store - )] - (Call - (Attribute - (Attribute - (Name - np - Load - ) - random - Load - ) - rand - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - array - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (ConstantInt - 0 - () - )] - Load - ) - Load - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - array - Load - ) - (Tuple - [(Name - Ellipsis - Load - ) - (ConstantInt - 0 - () - )] - Load - ) - Load - )] - [] - ) - ) - (FunctionDef - test1 - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - test2 - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - x - Store - )] - (List - [(ConstantInt - 1 - () - ) - (List - [(ConstantInt - 2 - () - ) - (List - [(ConstantEllipsis - () - )] - Load - ) - (ConstantInt - 3 - () - )] - Load - )] - Load - ) - () - ) - (Assign - [(Name - l - Store - )] - (List - [(ConstantEllipsis - () - ) - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - () - ) - (Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - ) - (Assign - [(Name - array - Store - )] - (Call - (Attribute - (Attribute - (Name - np - Load - ) - random - Load - ) - rand - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 2 - () - )] - [] - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - array - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (ConstantInt - 0 - () - )] - Load - ) - Load - )] - [] - ) - ) - (FunctionDef - foo - ([] - [(x - (ConstantEllipsis - () - ) - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - ) - (FunctionDef - inject - ([] - [(get_next_item - (Subscript - (Name - Callable - Load - ) - (Tuple - [(ConstantEllipsis - () - ) - (Name - str - Load - )] - Load - ) - Load - ) - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (ConstantNone - () - ) - () - )] - [] -) diff --git a/tests/reference/ast_new-for1-887432e.json b/tests/reference/ast_new-for1-887432e.json deleted file mode 100644 index 3e2c929fae..0000000000 --- a/tests/reference/ast_new-for1-887432e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-for1-887432e", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/for1.py", - "infile_hash": "8f9e8ef938c302e9ec566be988c563e0378002ac96687c46d7d9c137", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-for1-887432e.stdout", - "stdout_hash": "f9f49679cca12cff7db1a7828457e033b55aae6dd408b3a4326d1d7e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-for1-887432e.stdout b/tests/reference/ast_new-for1-887432e.stdout deleted file mode 100644 index ac3f1c279f..0000000000 --- a/tests/reference/ast_new-for1-887432e.stdout +++ /dev/null @@ -1,485 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ())] - 0 - ) - (For - (Name - x - Store - ) - (Name - fruits - Load - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - x - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - x - Store - ) - (Name - fruits - Load - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - x - Load - )] - [] - ) - ) - (If - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "banana" - () - )] - ) - [(Break)] - [] - )] - [] - () - ) - (For - (Name - x - Store - ) - (ConstantStr - "banana" - () - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - x - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 6 - () - )] - [] - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - i - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 2 - () - ) - (ConstantInt - 30 - () - ) - (ConstantInt - 3 - () - )] - [] - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - i - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(If - (Compare - (Name - i - Load - ) - Eq - [(ConstantInt - 3 - () - )] - ) - [(Continue)] - [] - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - i - Load - )] - [] - ) - )] - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Finally Completed!" - () - )] - [] - ) - )] - () - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(For - (Name - j - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - i - Load - ) - (Name - j - Load - )] - [] - ) - )] - [] - () - )] - [] - () - ) - (AnnAssign - (Name - sum - Store - ) - (Name - i32 - Load - ) - (ConstantInt - 0 - () - ) - 1 - ) - (For - (Name - j - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(AugAssign - (Name - sum - Store - ) - Add - (Name - j - Load - ) - )] - [] - () - ) - (For - (Tuple - [(Name - _ - Store - ) - (Name - x - Store - )] - Store - ) - (Name - y - Load - ) - [(Pass)] - [] - () - ) - (For - (Tuple - [(Name - x - Store - ) - (Name - y - Store - )] - Store - ) - (Name - z - Load - ) - [(Pass)] - [] - () - ) - (For - (Tuple - [(Name - i - Store - ) - (Name - a - Store - )] - Store - ) - (Call - (Name - enumerate - Load - ) - [(List - [(ConstantInt - 4 - () - ) - (ConstantInt - 5 - () - ) - (ConstantInt - 6 - () - ) - (ConstantInt - 7 - () - )] - Load - )] - [] - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - i - Load - ) - (ConstantStr - ": " - () - ) - (Name - a - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(Pass)] - [] - "int" - ) - (For - (Name - j - Store - ) - (Name - k - Load - ) - [(Pass)] - [] - "List[str]" - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(Pass)] - [(Pass)] - "int" - )] - [] -) diff --git a/tests/reference/ast_new-for2-af08901.json b/tests/reference/ast_new-for2-af08901.json deleted file mode 100644 index ff9c17f689..0000000000 --- a/tests/reference/ast_new-for2-af08901.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-for2-af08901", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/for2.py", - "infile_hash": "32c45d5c5edc44504a3fa5d24c6c1660977d2ceceeef311ee5a37410", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-for2-af08901.stdout", - "stdout_hash": "ac6e50517c5d609747b66c75e15bfa69ada7f0f41ebeb943da9b3167", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-for2-af08901.stdout b/tests/reference/ast_new-for2-af08901.stdout deleted file mode 100644 index c495f51677..0000000000 --- a/tests/reference/ast_new-for2-af08901.stdout +++ /dev/null @@ -1,504 +0,0 @@ -(Module - [(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" - ) - (AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(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 - ) - (Compare - (Name - a - Load - ) - In - [(Name - list1 - Load - )] - ) - [(Pass)] - [] - () - ) - (For - (Name - item - Store - ) - (Name - list1 - Load - ) - [(If - (Compare - (Name - item - Load - ) - In - [(Name - list2 - Load - )] - ) - [(Pass)] - [] - )] - [] - () - ) - (If - (BoolOp - Or - [(BoolOp - And - [(Compare - (Name - a - Load - ) - In - [(Name - list1 - Load - )] - ) - (Compare - (Name - b - Load - ) - NotIn - [(Name - list2 - Load - )] - )] - ) - (Compare - (Name - c - Load - ) - In - [(Name - list3 - Load - )] - )] - ) - [(Pass)] - [] - ) - (For - (Name - f - Store - ) - (Tuple - [(Name - a - Load - ) - (Name - b - Load - ) - (Name - c - Load - ) - (Name - d - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (For - (Name - x - Store - ) - (Tuple - [(Name - a - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (For - (Name - x - Store - ) - (Tuple - [(Name - a - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (For - (Name - x - Store - ) - (Tuple - [(Name - a - Load - ) - (Name - b - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (AsyncFunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(AsyncFor - (Name - x - Store - ) - (Tuple - [(Name - a - Load - ) - (Name - b - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (AsyncFor - (Name - x - Store - ) - (Tuple - [(Name - a - Load - )] - Load - ) - [(Pass)] - [] - () - )] - [] - () - () - ) - (For - (Name - a - Store - ) - (Tuple - [(Name - b - Load - ) - (Name - c - Load - )] - Load - ) - [(Expr - (BinOp - (Name - a - Load - ) - Pow - (ConstantInt - 2 - () - ) - ) - ) - (Pass)] - [] - () - ) - (AsyncFor - (Name - a - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 5 - () - )] - [] - ) - [(Expr - (Call - (Name - print - Load - ) - [(Name - a - Load - )] - [] - ) - )] - [] - () - ) - (For - (Name - like_function - Store - ) - (Tuple - [(Attribute - (Name - np - Load - ) - zeros_like - Load - ) - (Attribute - (Name - np - Load - ) - ones_like - Load - ) - (Attribute - (Name - np - Load - ) - empty_like - Load - )] - Load - ) - [(Pass)] - [] - () - ) - (For - (Tuple - [(Name - a - Store - )] - Store - ) - (Name - t - Load - ) - [(Pass)] - [] - () - )] - [] -) diff --git a/tests/reference/ast_new-function_def1-1a872df.json b/tests/reference/ast_new-function_def1-1a872df.json deleted file mode 100644 index ff54698350..0000000000 --- a/tests/reference/ast_new-function_def1-1a872df.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-function_def1-1a872df", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/function_def1.py", - "infile_hash": "1afa1fb49c292eabdb1a8798f8b0642d878f3a67f8f069ab0bac4574", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-function_def1-1a872df.stdout", - "stdout_hash": "0110165ec922436f3a1dcf21de9d64353f410bb4b5dab943df168d79", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def1-1a872df.stdout b/tests/reference/ast_new-function_def1-1a872df.stdout deleted file mode 100644 index 982d9d5371..0000000000 --- a/tests/reference/ast_new-function_def1-1a872df.stdout +++ /dev/null @@ -1,558 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ()) - (overload - ())] - 0 - ) - (FunctionDef - greet - ([] - [(name - () - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantStr - "\n This function greets to\n the person passed in as\n a parameter\n " - () - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(BinOp - (BinOp - (ConstantStr - "Hello, " - () - ) - Add - (Name - name - Load - ) - ) - Add - (ConstantStr - ". Good morning!" - () - ) - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - absolute_value - ([] - [(num - () - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantStr - "This function returns the absolute\n value of the entered number" - () - ) - ) - (If - (Compare - (Name - num - Load - ) - GtE - [(ConstantInt - 0 - () - )] - ) - [(Return - (Name - num - Load - ) - )] - [(Return - (UnaryOp - USub - (Name - num - Load - ) - ) - )] - )] - [] - () - () - ) - (FunctionDef - combine - ([] - [(fname - () - ()) - (lname - () - ())] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - print - Load - ) - [(BinOp - (BinOp - (Name - fname - Load - ) - Add - (ConstantStr - " " - () - ) - ) - Add - (Name - lname - Load - ) - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - tri_recursion - ([] - [(k - () - ())] - [] - [] - [] - [] - []) - [(If - (Compare - (Name - k - Load - ) - Gt - [(ConstantInt - 0 - () - )] - ) - [(Assign - [(Name - result - Store - )] - (BinOp - (Name - k - Load - ) - Add - (Call - (Name - tri_recursion - Load - ) - [(BinOp - (Name - k - Load - ) - Sub - (ConstantInt - 1 - () - ) - )] - [] - ) - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - result - Load - )] - [] - ) - )] - [(Assign - [(Name - result - Store - )] - (ConstantInt - 0 - () - ) - () - )] - ) - (Return - (Name - result - Load - ) - )] - [] - () - () - ) - (FunctionDef - test - ([] - [(a - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - []) - [(Return - (BinOp - (Name - a - Load - ) - Add - (ConstantInt - 10 - () - ) - ) - )] - [(Name - overload - Load - )] - (Name - i32 - Load - ) - () - ) - (FunctionDef - test - ([] - [(a - (Name - i64 - Load - ) - ())] - [] - [] - [] - [] - []) - [(Return - (BinOp - (Name - a - Load - ) - Add - (ConstantInt - 10 - () - ) - ) - )] - [(Name - overload - Load - )] - (Name - i64 - Load - ) - () - ) - (FunctionDef - test - ([] - [(a - (Name - bool - Load - ) - ())] - [] - [] - [] - [] - []) - [(If - (Name - a - Load - ) - [(Return - (ConstantInt - 10 - () - ) - )] - [] - ) - (Return - (UnaryOp - USub - (ConstantInt - 10 - () - ) - ) - )] - [(Name - overload - Load - )] - (Name - i32 - Load - ) - () - ) - (FunctionDef - check - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - greet - Load - ) - [(ConstantStr - "Xyz" - () - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(Call - (Name - absolute_value - Load - ) - [(ConstantInt - 2 - () - )] - [] - )] - [] - ) - ) - (Expr - (Call - (Name - combine - Load - ) - [(ConstantStr - "LPython" - () - ) - (ConstantStr - "Compiler" - () - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Recursion Example Results: " - () - )] - [] - ) - ) - (Expr - (Call - (Name - tri_recursion - Load - ) - [(ConstantInt - 6 - () - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(Call - (Name - test - Load - ) - [(ConstantInt - 15 - () - )] - [] - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(Call - (Name - test - Load - ) - [(ConstantBool - .true. - () - )] - [] - )] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - check - Load - ) - [] - [] - ) - ) - (FunctionDef - print_args - ([] - [] - [(args - () - ())] - [] - [] - [] - []) - [(Expr - (Call - (Name - print - Load - ) - [(Name - args - Load - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - print_kwargs - ([] - [] - [] - [] - [] - [(kwargs - () - ())] - []) - [(Expr - (Call - (Name - print - Load - ) - [(Name - kwargs - Load - )] - [] - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-function_def2-52c4587.json b/tests/reference/ast_new-function_def2-52c4587.json deleted file mode 100644 index 6a84a1afa5..0000000000 --- a/tests/reference/ast_new-function_def2-52c4587.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-function_def2-52c4587", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/function_def2.py", - "infile_hash": "7530fc0c8839061b935134cf72ca1ed46d0f2e5ec1b7053ef68b011b", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-function_def2-52c4587.stdout", - "stdout_hash": "701f1ddbc26053b77201943dc8be23c2cb86b979a207ebf11d5c0772", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def2-52c4587.stdout b/tests/reference/ast_new-function_def2-52c4587.stdout deleted file mode 100644 index 6102745649..0000000000 --- a/tests/reference/ast_new-function_def2-52c4587.stdout +++ /dev/null @@ -1,1315 +0,0 @@ -(Module - [(FunctionDef - test_01 - ([] - [] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_02 - ([] - [] - [(x - (Name - i32 - Load - ) - ())] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_03 - ([] - [] - [(x - () - ())] - [(y - () - ()) - (z - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_04 - ([] - [] - [(x - () - ())] - [(y - () - ()) - (z - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [(args - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_05 - ([] - [] - [(x - () - ())] - [] - [] - [(args - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_06 - ([] - [] - [] - [] - [] - [(args - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_07 - ([] - [(x - (Name - i32 - Load - ) - ()) - (y - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_08 - ([] - [(x - () - ())] - [(y - () - ())] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_09 - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_10 - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [(args - (Name - i32 - Load - ) - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_11 - ([] - [(x - () - ())] - [(y - () - ())] - [] - [] - [(args - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_12 - ([] - [(x - () - ())] - [] - [] - [] - [(args - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_13 - ([] - [(x - (Name - i32 - Load - ) - ()) - (y - (Name - i32 - Load - ) - ())] - [] - [] - [] - [] - [(ConstantInt - 1 - () - ) - (ConstantInt - 1 - () - )]) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_14 - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [(args - (Name - i32 - Load - ) - ())] - []) - [(Pass)] - [] - (Name - i32 - Load - ) - () - ) - (FunctionDef - test_15 - ([(a - () - ())] - [] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_16 - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_17 - ([(a - () - ())] - [] - [(b - () - ())] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_18 - ([(a - (Name - i32 - Load - ) - ())] - [] - [(b - (Name - i64 - Load - ) - ())] - [(c - (Name - i32 - Load - ) - ()) - (d - (Name - i32 - Load - ) - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_19 - ([(a - () - ())] - [] - [(b - () - ())] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_20 - ([(a - () - ())] - [] - [] - [] - [] - [(b - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_21 - ([(a - () - ())] - [] - [(b - () - ())] - [] - [] - [(c - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_22 - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_23 - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [] - [] - [] - [(d - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_24 - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [] - [] - [(e - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_25 - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [(e - () - ())] - [(ConstantNone - () - )] - [(f - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_26 - ([] - [] - [] - [(a - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_27 - ([] - [] - [] - [(a - () - ())] - [(ConstantNone - () - )] - [(b - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_28 - ([] - [(a - () - ())] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_29 - ([] - [(a - () - ())] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [(c - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_30 - ([(a - () - ())] - [] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_31 - ([(a - () - ())] - [(b - () - ())] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_32 - ([(a - () - ())] - [] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_33 - ([(a - () - ())] - [(b - () - ())] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - [(Pass)] - [] - () - () - ) - (Expr - (Call - (Name - test - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Name - x - Load - )] - [(y - (ConstantInt - 1 - () - )) - (z - (ConstantStr - "123" - () - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(ConstantInt - 100 - () - )] - [(() - (Name - x - Load - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - x - Load - ) - Load - )] - [(() - (Name - y - Load - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - x - Load - ) - Load - ) - (Name - y - Load - )] - [] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - x - Load - ) - Load - ) - (Starred - (Name - y - Load - ) - Load - )] - [] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [] - [(() - (Name - x - Load - )) - (() - (Name - y - Load - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - x - Load - ) - Load - )] - [(y - (ConstantInt - 1 - () - )) - (z - (ConstantInt - 2 - () - )) - (() - (Name - a - Load - )) - (b - (ConstantInt - 1 - () - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - x - Load - ) - Load - )] - [(() - (Name - a - Load - )) - (b - (ConstantStr - "1" - () - ))] - ) - ) - (Expr - (Call - (Name - test - Load - ) - [(Starred - (Name - y - Load - ) - Load - )] - [(x - (ConstantInt - 1 - () - )) - (z - (ConstantInt - 2 - () - )) - (() - (Name - a - Load - )) - (b - (ConstantStr - "1" - () - ))] - ) - ) - (Expr - (Call - (Attribute - (Name - lp - Load - ) - test - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - lp - Load - ) - test - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - lp - Load - ) - test - Load - ) - [(Name - x - Load - )] - [(y - (ConstantInt - 1 - () - )) - (z - (ConstantStr - "123" - () - ))] - ) - ) - (Expr - (Subscript - (Call - (Name - test - Load - ) - [] - [] - ) - (ConstantStr - "version" - () - ) - Load - ) - ) - (Expr - (Subscript - (Call - (Name - test - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - (ConstantStr - "version" - () - ) - Load - ) - ) - (Expr - (Subscript - (Call - (Name - test - Load - ) - [(Name - x - Load - ) - (Starred - (Name - y - Load - ) - Load - )] - [] - ) - (Slice - () - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (Subscript - (Call - (Name - test - Load - ) - [] - [] - ) - (ConstantInt - 1 - () - ) - Load - ) - (ConstantInt - 1 - () - ) - Load - ) - ) - (Expr - (Call - (Subscript - (Name - x - Load - ) - (ConstantStr - "numpystr" - () - ) - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Subscript - (Name - x - Load - ) - (ConstantStr - "int" - () - ) - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Subscript - (Name - x - Load - ) - (Name - func - Load - ) - Load - ) - [(Starred - (Name - args - Load - ) - Load - )] - [(() - (Name - kwargs - Load - ))] - ) - ) - (Expr - (Call - (Subscript - (Name - test - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - [(Starred - (Subscript - (Name - test - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - ) - Load - )] - [] - ) - ) - (Expr - (Call - (BinOp - (Name - obj - Load - ) - Mult - (Attribute - (Attribute - (Name - self - Load - ) - _arr - Load - ) - ndim - Load - ) - ) - [(Starred - (Attribute - (Attribute - (Name - self - Load - ) - _arr - Load - ) - shape - Load - ) - Load - )] - [] - ) - ) - (Expr - (Call - (Name - traverse - Load - ) - [(Tuple - [(Name - index - Load - ) - (Name - value - Load - )] - Load - ) - (Name - visit - Load - ) - (Starred - (Name - args - Load - ) - Load - )] - [(result - (Name - result - Load - )) - (() - (Name - kwargs - Load - ))] - ) - )] - [] -) diff --git a/tests/reference/ast_new-function_def3-f66064a.json b/tests/reference/ast_new-function_def3-f66064a.json deleted file mode 100644 index ef5687d117..0000000000 --- a/tests/reference/ast_new-function_def3-f66064a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-function_def3-f66064a", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/function_def3.py", - "infile_hash": "eb7900aec51ff71ffb02799ef3191ea93aa8dc68a4d12bcab18135be", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-function_def3-f66064a.stdout", - "stdout_hash": "5e5db40257c0c509b0496cf33a9ed0d4d7da8b4c16428b4c2fb264b0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def3-f66064a.stdout b/tests/reference/ast_new-function_def3-f66064a.stdout deleted file mode 100644 index c9869c9776..0000000000 --- a/tests/reference/ast_new-function_def3-f66064a.stdout +++ /dev/null @@ -1,538 +0,0 @@ -(Module - [(FunctionDef - main0 - ([] - [(i - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - example - ([] - [(text - () - ()) - (width - () - ()) - (fill_char - () - ())] - [] - [] - [] - [] - [(ConstantInt - 80 - () - ) - (ConstantStr - "-" - () - )]) - [(Return - () - )] - [] - () - "(...) -> str" - ) - (Expr - (Call - (Name - example - Load - ) - [(Name - text - Load - )] - [(width - (ConstantInt - 80 - () - )) - (fill_char - (ConstantStr - "-" - () - ))] - ) - ) - (FunctionDef - test_1 - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_2 - ([] - [(y - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - func - ([] - [(a - () - "str") - (b - () - "int") - (c - (Name - str - Load - ) - "str")] - [] - [] - [] - [] - [(ConstantInt - 80 - () - ) - (ConstantStr - "-" - () - )]) - [(Pass)] - [] - () - () - ) - (FunctionDef - abc - ([] - [(a - () - ()) - (b - () - "int") - (c - () - "list[str]")] - [] - [] - [] - [] - [(List - [(ConstantStr - "-" - () - )] - Load - )]) - [(Return - () - )] - [] - () - "(...) -> str" - ) - (FunctionDef - test_01 - ([] - [(a - () - "int") - (b - () - ())] - [] - [] - [] - [] - [(ConstantInt - 0 - () - )]) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_02 - ([] - [(a - () - "int") - (b - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - quantiles - ([(dist - () - ())] - [] - [] - [(n - () - ())] - [(ConstantNone - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - quantiles - ([(dist - () - ())] - [] - [] - [(n - () - ()) - (method - () - ())] - [(ConstantInt - 4 - () - ) - (ConstantStr - "exclusive" - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - func - ([(self - () - ()) - (param1 - () - ()) - (param2 - () - ())] - [(param3 - () - ())] - [] - [(param4 - () - ()) - (param5 - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - func - ([(self - () - ()) - (param1 - () - ()) - (param2 - () - ())] - [(param3 - () - ())] - [] - [(param4 - () - ()) - (param5 - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - [(ConstantInt - 7 - () - )]) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - func - ([(self - () - ()) - (param1 - () - ()) - (param2 - () - ())] - [(param3 - () - ()) - (param3_1 - () - ())] - [] - [(param4 - () - ()) - (param5 - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - [(ConstantInt - 2 - () - )]) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - add - ([] - [(a - () - ()) - (b - () - ())] - [] - [(c - () - ()) - (d - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - func - ([] - [] - [] - [(param4 - () - ()) - (param5 - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - func - ([] - [] - [] - [(param4 - () - ()) - (param5 - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (AsyncFunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - a - Store - )] - (Name - b - Load - ) - () - ) - (Return - (Tuple - [(Name - a - Load - )] - Load - ) - )] - [] - () - () - ) - (FunctionDef - dtype - ([] - [(self - () - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - (Name - _DType_co - Load - ) - () - )] - [(TypeIgnore - 0 - "[misc]" - ) - (TypeIgnore - 0 - "" - )] -) diff --git a/tests/reference/ast_new-global1-38edfbd.json b/tests/reference/ast_new-global1-38edfbd.json deleted file mode 100644 index e064ef2044..0000000000 --- a/tests/reference/ast_new-global1-38edfbd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-global1-38edfbd", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/global1.py", - "infile_hash": "cdbcc3f545f865cfc6e412f53fc6fd7cccdbc0d33b66e45460f3e916", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-global1-38edfbd.stdout", - "stdout_hash": "b0b999497a27625582a6dedfa024dba012a6ac1103ac427c49cc7d9d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-global1-38edfbd.stdout b/tests/reference/ast_new-global1-38edfbd.stdout deleted file mode 100644 index 9011e976ad..0000000000 --- a/tests/reference/ast_new-global1-38edfbd.stdout +++ /dev/null @@ -1,219 +0,0 @@ -(Module - [(Assign - [(Name - x - Store - )] - (ConstantStr - "global " - () - ) - () - ) - (FunctionDef - outer - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - x - Store - )] - (ConstantStr - "local" - () - ) - () - ) - (FunctionDef - inner - ([] - [] - [] - [] - [] - [] - []) - [(Nonlocal - [x] - ) - (Assign - [(Name - x - Store - )] - (ConstantStr - "nonlocal" - () - ) - () - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "nonlocal" - () - )] - ) - () - )] - [] - () - () - ) - (Expr - (Call - (Name - inner - Load - ) - [] - [] - ) - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "nonlocal" - () - )] - ) - () - )] - [] - () - () - ) - (FunctionDef - test_1 - ([] - [] - [] - [] - [] - [] - []) - [(Global - [x] - ) - (Assign - [(Name - y - Store - )] - (ConstantStr - "local" - () - ) - () - ) - (Assign - [(Name - x - Store - )] - (BinOp - (Name - x - Load - ) - Mult - (ConstantInt - 2 - () - ) - ) - () - ) - (Assert - (Compare - (Name - x - Load - ) - Eq - [(ConstantStr - "global global " - () - )] - ) - () - ) - (Assert - (Compare - (Name - y - Load - ) - Eq - [(ConstantStr - "local" - () - )] - ) - () - )] - [] - () - () - ) - (FunctionDef - check - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Call - (Name - test_1 - Load - ) - [] - [] - ) - ) - (Expr - (Call - (Name - outer - Load - ) - [] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - check - Load - ) - [] - [] - ) - )] - [] -) diff --git a/tests/reference/ast_new-if1-db43586.json b/tests/reference/ast_new-if1-db43586.json deleted file mode 100644 index 61c6c14427..0000000000 --- a/tests/reference/ast_new-if1-db43586.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-if1-db43586", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/if1.py", - "infile_hash": "22ff1df9592cea862ebc5a2a03f872b87d7ef6cf7101670e8fc566da", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-if1-db43586.stdout", - "stdout_hash": "c21dfca87b12c05bb7230f342ad43cdee10fd7a574dcd2733d8736c8", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-if1-db43586.stdout b/tests/reference/ast_new-if1-db43586.stdout deleted file mode 100644 index 47f33b7a1f..0000000000 --- a/tests/reference/ast_new-if1-db43586.stdout +++ /dev/null @@ -1,458 +0,0 @@ -(Module - [(Assign - [(Name - x - Store - )] - (ConstantInt - 10 - () - ) - () - ) - (Assign - [(Name - y - Store - )] - (ConstantInt - 14 - () - ) - () - ) - (Assign - [(Name - z - Store - )] - (ConstantInt - 12 - () - ) - () - ) - (If - (BoolOp - And - [(Compare - (Name - x - Load - ) - GtE - [(Name - y - Load - )] - ) - (Compare - (Name - x - Load - ) - GtE - [(Name - z - Load - )] - )] - ) - [(Assign - [(Name - largest - Store - )] - (Name - x - Load - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Largest: " - () - ) - (Name - x - Load - )] - [] - ) - )] - [(If - (BoolOp - And - [(Compare - (Name - y - Load - ) - GtE - [(Name - x - Load - )] - ) - (Compare - (Name - y - Load - ) - GtE - [(Name - z - Load - )] - )] - ) - [(Assign - [(Name - largest - Store - )] - (Name - y - Load - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Largest: " - () - ) - (Name - y - Load - )] - [] - ) - )] - [(Assign - [(Name - largest - Store - )] - (Name - z - Load - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Largest: " - () - ) - (Name - z - Load - )] - [] - ) - )] - )] - ) - (If - (Compare - (Name - y - Load - ) - Gt - [(ConstantInt - 10 - () - )] - ) - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Above ten," - () - )] - [] - ) - ) - (If - (Compare - (Name - y - Load - ) - Gt - [(ConstantInt - 20 - () - )] - ) - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "and also above 20!" - () - )] - [] - ) - )] - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "but not above 20." - () - )] - [] - ) - )] - )] - [] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - ) - (AugAssign - (Name - a - Store - ) - Add - (Name - b - Load - ) - )] - [] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - ) - (AugAssign - (Name - a - Store - ) - Add - (Name - b - Load - ) - )] - [] - ) - (If - (Name - b - Load - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [(Assign - [(Name - a - Store - )] - (Name - b - Load - ) - () - )] - ) - (If - (Name - b - Load - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [(Assign - [(Name - a - Store - )] - (Name - b - Load - ) - () - )] - ) - (If - (Name - b - Load - ) - [(Pass)] - [(Assign - [(Name - a - Store - )] - (Name - b - Load - ) - () - )] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Pass)] - [] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Pass)] - [] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Assign - [(Name - x - Store - )] - (BinOp - (Name - a - Load - ) - Add - (Name - b - Load - ) - ) - () - ) - (Break)] - [] - ) - (If - (Compare - (Name - a - Load - ) - Eq - [(Name - b - Load - )] - ) - [(Assign - [(Name - x - Store - )] - (BinOp - (Name - a - Load - ) - Add - (Name - b - Load - ) - ) - () - ) - (Break)] - [] - )] - [] -) diff --git a/tests/reference/ast_new-if2-c3b6022.json b/tests/reference/ast_new-if2-c3b6022.json deleted file mode 100644 index f9c4d553f4..0000000000 --- a/tests/reference/ast_new-if2-c3b6022.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-if2-c3b6022", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/if2.py", - "infile_hash": "8568c759d82b43b471520eb7eb42d2ccbdfea5ceb59bd27671342206", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-if2-c3b6022.stdout", - "stdout_hash": "cef89f96f75c68381a475911818e03cbcb78bff27d91b5d356fc667b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-if2-c3b6022.stdout b/tests/reference/ast_new-if2-c3b6022.stdout deleted file mode 100644 index 584a5f9094..0000000000 --- a/tests/reference/ast_new-if2-c3b6022.stdout +++ /dev/null @@ -1,364 +0,0 @@ -(Module - [(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)] - [] - ) - (If - (Compare - (Name - field - Load - ) - In - [(List - [(ConstantStr - "vararg" - () - ) - (ConstantStr - "kwarg" - () - )] - Load - )] - ) - [(If - (Compare - (Name - value - Load - ) - Is - [(ConstantNone - () - )] - ) - [(Pass)] - [] - )] - [] - ) - (If - (Compare - (Name - a - Load - ) - In - [(Name - list1 - Load - )] - ) - [(Pass)] - [] - ) - (If - (BoolOp - Or - [(BoolOp - Or - [(Compare - (Attribute - (Name - x - Load - ) - shape - Load - ) - Eq - [(Tuple - [] - Load - )] - ) - (Compare - (Attribute - (Name - y - Load - ) - shape - Load - ) - Eq - [(Tuple - [] - Load - )] - )] - ) - (Compare - (Subscript - (Attribute - (Name - x - Load - ) - shape - Load - ) - (ConstantInt - 1 - () - ) - Load - ) - NotEq - [(Subscript - (Attribute - (Name - y - Load - ) - shape - Load - ) - (ConstantInt - 0 - () - ) - Load - )] - )] - ) - [(Assert - (Compare - (Subscript - (Name - arr - Load - ) - (Tuple - [] - Load - ) - Load - ) - Is - [(Name - ArrayLike - Load - )] - ) - () - ) - (Pass)] - [] - ) - (AsyncFor - (Tuple - [(Name - i1 - Store - ) - (Name - i2 - Store - )] - Store - ) - (Call - (Name - AsyncIter - Load - ) - [] - [] - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - )] - [] -) diff --git a/tests/reference/ast_new-import1-f643fd3.json b/tests/reference/ast_new-import1-f643fd3.json deleted file mode 100644 index 2d9ee2fae2..0000000000 --- a/tests/reference/ast_new-import1-f643fd3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-import1-f643fd3", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/import1.py", - "infile_hash": "be84cf9989667702a391da31494811cc4a2a0a2f7a6be764bcedc4bf", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-import1-f643fd3.stdout", - "stdout_hash": "ac5f443b72953c6b307da4cdd6d5c3976c3db1591a9703223614dd72", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-import1-f643fd3.stdout b/tests/reference/ast_new-import1-f643fd3.stdout deleted file mode 100644 index 16c491648c..0000000000 --- a/tests/reference/ast_new-import1-f643fd3.stdout +++ /dev/null @@ -1,185 +0,0 @@ -(Module - [(Import - [(os - ())] - ) - (Import - [(random - r)] - ) - (Import - [(random - r) - (abc - a)] - ) - (Import - [(x.y.z - ())] - ) - (Import - [(x.y.z - xyz)] - ) - (ImportFrom - lpython - [(i8 - ()) - (i16 - ()) - (i32 - ()) - (i64 - ()) - (f32 - ()) - (f64 - ()) - (c32 - ()) - (c64 - ()) - (overload - ()) - (ccall - ()) - (TypeVar - ())] - 0 - ) - (ImportFrom - __future__ - [(division - ())] - 0 - ) - (ImportFrom - math - [(* - ())] - 0 - ) - (ImportFrom - math - [(sin - ()) - (cos - ()) - (tan - ())] - 0 - ) - (ImportFrom - math - [(sin - ()) - (cos - ())] - 0 - ) - (ImportFrom - math - [(factorial - fact)] - 0 - ) - (ImportFrom - x.y - [(z - ())] - 0 - ) - (ImportFrom - () - [(a - ())] - 1 - ) - (ImportFrom - a.b - [(a - ())] - 1 - ) - (ImportFrom - a.b - [(* - ())] - 1 - ) - (ImportFrom - abc - [(a - ())] - 1 - ) - (ImportFrom - abc - [(a - ()) - (b - ()) - (c - ())] - 1 - ) - (ImportFrom - x - [(a - ()) - (b - ()) - (c - ()) - (d - ())] - 0 - ) - (ImportFrom - x - [(a - ()) - (b - ()) - (c - ()) - (d - ())] - 0 - ) - (ImportFrom - x - [(a - ()) - (b - ()) - (c - ()) - (d - ())] - 0 - ) - (ImportFrom - x - [(a - ()) - (b - ())] - 0 - ) - (ImportFrom - x - [(a - ()) - (b - ())] - 0 - ) - (ImportFrom - x - [(a - ())] - 0 - )] - [] -) diff --git a/tests/reference/ast_new-lambda1-260d046.json b/tests/reference/ast_new-lambda1-260d046.json deleted file mode 100644 index 5acaaa551c..0000000000 --- a/tests/reference/ast_new-lambda1-260d046.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-lambda1-260d046", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/lambda1.py", - "infile_hash": "0d9e4ba965ad635b7081019955a0f6d3d54b4f04f17239c454364d83", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-lambda1-260d046.stdout", - "stdout_hash": "9efeee85a5a565024e5487cec1f868ce923dba161bfb2e7a0d24431f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-lambda1-260d046.stdout b/tests/reference/ast_new-lambda1-260d046.stdout deleted file mode 100644 index 0757477c6b..0000000000 --- a/tests/reference/ast_new-lambda1-260d046.stdout +++ /dev/null @@ -1,1093 +0,0 @@ -(Module - [(If - (Compare - (Name - x - Load - ) - Is - [(ConstantInt - 0 - () - )] - ) - [(Assign - [(Name - x - Store - )] - (Lambda - ([] - [(a - () - ())] - [] - [] - [] - [] - []) - (ConstantStr - "``{a}```" - () - ) - ) - () - )] - [(Assign - [(Name - y - Store - )] - (Lambda - ([] - [(b - () - ()) - (c - () - ())] - [] - [] - [] - [] - []) - (Call - (Name - x - Load - ) - [(Name - a - Load - )] - [] - ) - ) - () - )] - ) - (Assign - [(Name - x - Store - )] - (Call - (Name - sorted - Load - ) - [(Name - x - Load - )] - [(key - (Lambda - ([] - [(f - () - ())] - [] - [] - [] - [] - []) - (Subscript - (Name - f - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - ))] - ) - () - ) - (Assign - [(Name - add - Store - )] - (Lambda - ([] - [(x - () - ()) - (y - () - ())] - [] - [] - [] - [] - []) - (BinOp - (Call - (Attribute - (Name - np - Load - ) - add - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - Mod - (ConstantInt - 5 - () - ) - ) - ) - () - ) - (Expr - (Call - (Attribute - (Name - var - Load - ) - sort - Load - ) - [] - [(key - (Lambda - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - (Subscript - (Name - x - Load - ) - (ConstantInt - 2 - () - ) - Load - ) - ))] - ) - ) - (FunctionDef - __lt__ - ([] - [(self - () - ()) - (other - () - ())] - [] - [] - [] - [] - []) - [(Return - (Call - (Attribute - (Name - self - Load - ) - _compare - Load - ) - [(Name - other - Load - ) - (Lambda - ([] - [(s - () - ()) - (o - () - ())] - [] - [] - [] - [] - []) - (Compare - (Name - s - Load - ) - Lt - [(Name - o - Load - )] - ) - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - formatargspec - ([] - [(args - () - ()) - (varargs - () - ()) - (varkw - () - ()) - (defaults - () - ()) - (formatarg - () - ()) - (formatvarargs - () - ()) - (formatvarkw - () - ()) - (formatvalue - () - ()) - (join - () - ())] - [] - [] - [] - [] - [(ConstantInt - 0 - () - ) - (ConstantInt - 0 - () - ) - (ConstantInt - 0 - () - ) - (Name - str - Load - ) - (Lambda - ([] - [(name - () - ())] - [] - [] - [] - [] - []) - (BinOp - (ConstantStr - "*" - () - ) - Add - (Name - name - Load - ) - ) - ) - (Lambda - ([] - [(name - () - ())] - [] - [] - [] - [] - []) - (BinOp - (ConstantStr - "**" - () - ) - Add - (Name - name - Load - ) - ) - ) - (Lambda - ([] - [(value - () - ())] - [] - [] - [] - [] - []) - (BinOp - (ConstantStr - "=" - () - ) - Add - (Call - (Name - repr - Load - ) - [(Name - value - Load - )] - [] - ) - ) - ) - (Name - joinseq - Load - )]) - [(Pass)] - [] - () - () - ) - (FunctionDef - __init__ - ([] - [(self - () - ()) - (float_conv - () - ()) - (int_conv - () - ()) - (float_to_float - () - ()) - (float_to_str - () - ()) - (title - () - ())] - [] - [] - [] - [] - [(Name - float - Load - ) - (Name - int - Load - ) - (Name - float - Load - ) - (Lambda - ([] - [(v - () - ())] - [] - [] - [] - [] - []) - (BinOp - (ConstantStr - "%24.16e" - () - ) - Mod - (Name - v - Load - ) - ) - ) - (ConstantStr - "Python floating point numbe" - () - )]) - [(Pass)] - [] - () - () - ) - (FunctionDef - test_deprecated - ([] - [(self - () - ()) - (func - () - ())] - [] - [] - [] - [] - []) - [(Expr - (Call - (Attribute - (Name - self - Load - ) - assert_deprecated - Load - ) - [(Lambda - ([] - [] - [] - [] - [] - [] - []) - (Call - (Name - func - Load - ) - [(List - [(ConstantFloat - 0.000000 - () - ) - (ConstantFloat - 1.000000 - () - )] - Load - ) - (ConstantFloat - 0.000000 - () - )] - [(interpolation - (ConstantStr - "linear" - () - ))] - ) - )] - [] - ) - ) - (Expr - (Call - (Attribute - (Name - self - Load - ) - assert_deprecated - Load - ) - [(Lambda - ([] - [] - [] - [] - [] - [] - []) - (Call - (Name - func - Load - ) - [(List - [(ConstantFloat - 0.000000 - () - ) - (ConstantFloat - 1.000000 - () - )] - Load - ) - (ConstantFloat - 0.000000 - () - )] - [(interpolation - (ConstantStr - "nearest" - () - ))] - ) - )] - [] - ) - )] - [] - () - () - ) - (FunctionDef - indirect - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Return - (Lambda - ([] - [] - [] - [] - [] - [] - []) - (Name - x - Load - ) - ) - )] - [] - () - () - ) - (FunctionDef - _discovered_machar - ([] - [(ftype - () - ())] - [] - [] - [] - [] - []) - [(Assign - [(Name - params - Store - )] - (Subscript - (Name - _MACHAR_PARAMS - Load - ) - (Name - ftype - Load - ) - Load - ) - () - ) - (Return - (Call - (Name - MachAr - Load - ) - [(Lambda - ([] - [(v - () - ())] - [] - [] - [] - [] - []) - (Call - (Name - array - Load - ) - [(List - [(Name - v - Load - )] - Load - ) - (Name - ftype - Load - )] - [] - ) - ) - (Lambda - ([] - [(v - () - ())] - [] - [] - [] - [] - []) - (Subscript - (Call - (Name - _fr0 - Load - ) - [(Call - (Attribute - (Name - v - Load - ) - astype - Load - ) - [(Subscript - (Name - params - Load - ) - (ConstantStr - "itype" - () - ) - Load - )] - [] - )] - [] - ) - (ConstantInt - 0 - () - ) - Load - ) - ) - (Lambda - ([] - [(v - () - ())] - [] - [] - [] - [] - []) - (Call - (Name - array - Load - ) - [(Subscript - (Call - (Name - _fr0 - Load - ) - [(Name - v - Load - )] - [] - ) - (ConstantInt - 0 - () - ) - Load - ) - (Name - ftype - Load - )] - [] - ) - ) - (Lambda - ([] - [(v - () - ())] - [] - [] - [] - [] - []) - (BinOp - (Subscript - (Name - params - Load - ) - (ConstantStr - "fmt" - () - ) - Load - ) - Mod - (Call - (Name - array - Load - ) - [(Subscript - (Call - (Name - _fr0 - Load - ) - [(Name - v - Load - )] - [] - ) - (ConstantInt - 0 - () - ) - Load - ) - (Name - ftype - Load - )] - [] - ) - ) - ) - (Subscript - (Name - params - Load - ) - (ConstantStr - "title" - () - ) - Load - )] - [] - ) - )] - [] - () - () - ) - (Expr - (Call - (Name - assert_raises - Load - ) - [(Name - IndexError - Load - ) - (Lambda - ([] - [] - [] - [] - [] - [] - []) - (Subscript - (Name - a - Load - ) - (Slice - () - (ConstantInt - 4 - () - ) - () - ) - Load - ) - )] - [] - ) - ) - (Expr - (Call - (Name - assert_equal - Load - ) - [(Call - (Attribute - (Name - np - Load - ) - array2string - Load - ) - [(Name - x - Load - )] - [(formatter - (Dict - [(ConstantStr - "int" - () - )] - [(Lambda - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - (Call - (Name - oct - Load - ) - [(Name - x - Load - )] - [] - ) - )] - ))] - ) - (Name - x_oct - Load - )] - [] - ) - ) - (Expr - (Call - (Name - assert_equal - Load - ) - [(Call - (Attribute - (Name - np - Load - ) - array2string - Load - ) - [(Name - a - Load - )] - [(separator - (ConstantStr - ", " - () - )) - (formatter - (Dict - [(ConstantStr - "datetime" - () - )] - [(Lambda - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - (BinOp - (ConstantStr - "'%s'" - () - ) - Mod - (Call - (Attribute - (Name - np - Load - ) - datetime_as_string - Load - ) - [(Name - x - Load - )] - [(timezone - (ConstantStr - "UTC" - () - ))] - ) - ) - )] - ))] - ) - (ConstantStr - "['2011-03-16T13:55Z', '1920-01-01T03:12Z']" - () - )] - [] - ) - ) - (Expr - (Call - (Name - assert_raises_fpe - Load - ) - [(ConstantStr - "underflow" - () - ) - (Lambda - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - (BinOp - (Name - a - Load - ) - Div - (Name - b - Load - ) - ) - ) - (Name - sy16 - Load - ) - (Name - by16 - Load - )] - [] - ) - ) - (Assign - [(Name - MyArr - Store - )] - (Call - (Name - type - Load - ) - [(ConstantStr - "MyArr" - () - ) - (Dict - [(Name - protocol - Load - ) - (ConstantStr - "__float__" - () - )] - [(Call - (Name - getattr - Load - ) - [(Name - blueprint - Load - ) - (Name - protocol - Load - )] - [] - ) - (Lambda - ([] - [(_ - () - ())] - [] - [] - [] - [] - []) - (ConstantFloat - 0.500000 - () - ) - )] - )] - [] - ) - () - )] - [] -) diff --git a/tests/reference/ast_new-lambda2-d84336e.json b/tests/reference/ast_new-lambda2-d84336e.json deleted file mode 100644 index 42cda2aa2a..0000000000 --- a/tests/reference/ast_new-lambda2-d84336e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-lambda2-d84336e", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/lambda2.py", - "infile_hash": "f115bc76bd599a545ebe065ec72d392374a97a52e434c079ec05e606", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-lambda2-d84336e.stdout", - "stdout_hash": "b16a532dd4c0c68c374093e9f11bbc4b3f97736a10aa82634c0cbce9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-lambda2-d84336e.stdout b/tests/reference/ast_new-lambda2-d84336e.stdout deleted file mode 100644 index 096851e48d..0000000000 --- a/tests/reference/ast_new-lambda2-d84336e.stdout +++ /dev/null @@ -1,968 +0,0 @@ -(Module - [(Expr - (Call - (Name - verify_matching_signatures - Load - ) - [(Lambda - ([] - [(x - () - ())] - [] - [] - [] - [] - [(ConstantInt - 0 - () - )]) - (ConstantInt - 0 - () - ) - ) - (Lambda - ([] - [(x - () - ())] - [] - [] - [] - [] - [(ConstantInt - 0 - () - )]) - (ConstantInt - 0 - () - ) - )] - [] - ) - ) - (Assign - [(Name - input_func - Store - )] - (Lambda - ([] - [(prompt - () - ())] - [] - [] - [] - [] - [(ConstantStr - "" - () - )]) - (Call - (Name - next - Load - ) - [(Name - gen - Load - )] - [] - ) - ) - () - ) - (Assign - [(Subscript - (Name - cast - Load - ) - (Name - key - Load - ) - Store - )] - (Lambda - ([] - [(x - () - ()) - (k - () - ())] - [] - [] - [] - [] - [(Name - key - Load - )]) - (Call - (Attribute - (Call - (Name - array - Load - ) - [(Name - x - Load - )] - [(copy - (ConstantBool - .false. - () - ))] - ) - astype - Load - ) - [(Name - k - Load - )] - [] - ) - ) - () - ) - (Assign - [(Name - x - Store - )] - (Lambda - ([] - [(func - () - ()) - (attr - () - ())] - [] - [] - [] - [] - [(Attribute - (Name - self - Load - ) - _try_call - Load - ) - (Name - attr - Load - )]) - (Call - (Name - func - Load - ) - [(Name - attr - Load - )] - [] - ) - ) - () - ) - (Assign - [(Name - fpos32 - Store - )] - (Lambda - ([] - [(x - () - ())] - [] - [] - [] - [(k - () - ())] - []) - (Call - (Attribute - (Name - np - Load - ) - format_float_positional - Load - ) - [(Call - (Attribute - (Name - np - Load - ) - float32 - Load - ) - [(Name - x - Load - )] - [] - )] - [(() - (Name - k - Load - ))] - ) - ) - () - ) - (Assign - [(Name - m - Store - )] - (Lambda - ([] - [(self - () - ())] - [(args - () - ())] - [] - [] - [(kw - () - ())] - []) - (Call - (Name - func - Load - ) - [(Name - self - Load - ) - (Starred - (Name - args - Load - ) - Load - )] - [(() - (Name - kw - Load - ))] - ) - ) - () - ) - (Expr - (Call - (Attribute - (Name - stack - Load - ) - push - Load - ) - [(Lambda - ([] - [] - [(exc - () - ())] - [] - [] - [] - []) - (Subscript - (Dict - [] - [] - ) - (ConstantInt - 1 - () - ) - Load - ) - )] - [] - ) - ) - (Expr - (Lambda - ([] - [] - [(x - () - ())] - [(y - () - ()) - (z - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [] - [(x - () - ())] - [(y - () - ()) - (z - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [] - [(x - () - ())] - [] - [] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [] - [] - [] - [] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ()) - (y - () - ())] - [] - [] - [] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [(y - () - ())] - [] - [] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [(y - () - ())] - [] - [] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [] - [] - [] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(x - () - ())] - [(y - () - ())] - [(z - () - ())] - [(ConstantNone - () - )] - [(args - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [] - [] - [] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [(b - () - ())] - [] - [] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [(b - () - ())] - [(c - () - ()) - (d - () - ())] - [(ConstantNone - () - ) - (ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [(b - () - ())] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [] - [] - [] - [(b - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [(b - () - ())] - [] - [] - [(c - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [] - [] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [] - [] - [] - [(d - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [] - [] - [(e - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ()) - (c - () - ())] - [(d - () - ())] - [(e - () - ())] - [(ConstantNone - () - )] - [(f - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [] - [] - [(a - () - ())] - [(ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [] - [] - [(a - () - ())] - [(ConstantNone - () - )] - [(b - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(a - () - ())] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([] - [(a - () - ())] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [(c - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [] - [(b - () - ())] - [(ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ())] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - (Name - test - Load - ) - ) - ) - (Expr - (Lambda - ([(a - () - ())] - [(b - () - ())] - [] - [(c - () - ())] - [(ConstantNone - () - )] - [(d - () - ())] - []) - (Name - test - Load - ) - ) - )] - [] -) diff --git a/tests/reference/ast_new-match_stmt1-9e84d24.json b/tests/reference/ast_new-match_stmt1-9e84d24.json deleted file mode 100644 index 6e096f25ea..0000000000 --- a/tests/reference/ast_new-match_stmt1-9e84d24.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-match_stmt1-9e84d24", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/match_stmt1.py", - "infile_hash": "59820be702cda5062ce26ffbf5abe667a01d0e37f8a0658aa458d65f", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-match_stmt1-9e84d24.stdout", - "stdout_hash": "8e43bb4b05ebab0df9520dac9908702af0d2e7f63ddb42bf93baf0a0", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-match_stmt1-9e84d24.stdout b/tests/reference/ast_new-match_stmt1-9e84d24.stdout deleted file mode 100644 index f368aa9399..0000000000 --- a/tests/reference/ast_new-match_stmt1-9e84d24.stdout +++ /dev/null @@ -1,2245 +0,0 @@ -(Module - [(Match - (ConstantInt - 0 - () - ) - [((MatchValue - (ConstantInt - 0 - () - ) - ) - (ConstantBool - .false. - () - ) - [(Assign - [(Name - x - Store - )] - (ConstantBool - .false. - () - ) - () - )]) - ((MatchValue - (ConstantInt - 0 - () - ) - ) - (ConstantBool - .true. - () - ) - [(Assign - [(Name - x - Store - )] - (ConstantBool - .true. - () - ) - () - )]) - ((MatchAs - () - x - ) - (Name - x - Load - ) - [(Assign - [(Name - z - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchAs - (MatchAs - () - _ - ) - y - ) - (BoolOp - And - [(Compare - (Name - y - Load - ) - Eq - [(Name - x - Load - )] - ) - (Name - y - Load - )] - ) - [(Assign - [(Name - z - Store - )] - (ConstantInt - 1 - () - ) - () - )])] - ) - (Match - (Name - match - Load - ) - [((MatchAs - () - case - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Call - (Name - match - Load - ) - [] - [] - ) - [((MatchClass - (Name - case - Load - ) - [] - [] - [] - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Name - case - Load - ) - [((MatchAs - () - match - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Name - x - Load - ) - [((MatchAs - (MatchValue - (Attribute - (Name - A - Load - ) - y - Load - ) - ) - z - ) - () - [(Pass)]) - ((MatchAs - (MatchValue - (ConstantInt - 0 - () - ) - ) - z - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchAs - (MatchSequence - [(MatchAs - () - p - ) - (MatchAs - () - q - )] - ) - x - ) - () - [(Assign - [(Name - out - Store - )] - (Call - (Name - locals - Load - ) - [] - [] - ) - () - )]) - ((MatchValue - (Attribute - (Name - A - Load - ) - B - Load - ) - ) - () - [(Assign - [(Name - z - Store - )] - (ConstantInt - 2 - () - ) - () - )]) - ((MatchValue - (Attribute - (Attribute - (Attribute - (Name - A - Load - ) - B - Load - ) - C - Load - ) - D - Load - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (ConstantInt - 0 - () - ) - [((MatchOr - [(MatchAs - (MatchValue - (ConstantInt - 0 - () - ) - ) - z - ) - (MatchAs - (MatchValue - (ConstantInt - 1 - () - ) - ) - z - ) - (MatchAs - (MatchValue - (ConstantInt - 2 - () - ) - ) - z - )] - ) - (Compare - (Name - z - Load - ) - Eq - [(BinOp - (Name - x - Load - ) - Mod - (ConstantInt - 2 - () - ) - )] - ) - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchSequence - [(MatchAs - (MatchAs - (MatchSequence - [(MatchAs - (MatchAs - () - a - ) - b - ) - (MatchAs - (MatchAs - () - c - ) - d - )] - ) - e - ) - w - ) - (MatchAs - (MatchAs - (MatchSequence - [(MatchAs - (MatchAs - () - f - ) - g - ) - (MatchAs - () - h - )] - ) - i - ) - z - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchOr - [(MatchValue - (ConstantInt - 0 - () - ) - ) - (MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchValue - (ConstantInt - 3 - () - ) - )] - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantBool - .true. - () - ) - () - )]) - ((MatchOr - [(MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchOr - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - ) - (MatchSingleton - (ConstantBool - .false. - () - ) - )] - )] - () - ) - (MatchMapping - [(ConstantInt - 1 - () - )] - [(MatchSequence - [(MatchSequence - [] - )] - )] - () - ) - (MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - )] - () - ) - (MatchSequence - [] - ) - (MatchValue - (ConstantStr - "X" - () - ) - ) - (MatchMapping - [] - [] - () - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )]) - ((MatchOr - [(MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchOr - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - ) - (MatchSingleton - (ConstantBool - .false. - () - ) - )] - )] - () - ) - (MatchMapping - [(ConstantInt - 1 - () - )] - [(MatchSequence - [(MatchSequence - [] - )] - )] - () - ) - (MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - )] - () - ) - (MatchSequence - [] - ) - (MatchValue - (ConstantStr - "X" - () - ) - ) - (MatchMapping - [] - [] - () - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )]) - ((MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - )] - () - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchMapping - [(ConstantInt - 0 - () - ) - (ConstantInt - 1 - () - )] - [(MatchSequence - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - ) - (MatchMapping - [] - [] - () - )] - ) - (MatchSequence - [(MatchSequence - [] - )] - )] - () - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )]) - ((MatchMapping - [] - [] - z - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )]) - ((MatchMapping - [(ConstantInt - 1 - () - )] - [(MatchValue - (ConstantInt - 2 - () - ) - )] - z - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )])] - ) - (Match - (Tuple - [(ConstantInt - 0 - () - ) - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - [((MatchSequence - [(MatchValue - (ConstantInt - 0 - () - ) - ) - (MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchStar - x - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchSequence - [(MatchStar - _ - ) - (MatchAs - () - _ - )] - ) - () - [(Assign - [(Name - z - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchMapping - [(ConstantInt - 0 - () - )] - [(MatchAs - (MatchOr - [(MatchValue - (ConstantInt - 0 - () - ) - ) - (MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - )] - ) - z - )] - () - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Name - x - Load - ) - [((MatchSequence - [] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 2 - () - ) - () - )]) - ((MatchSequence - [] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchValue - (UnaryOp - USub - (ConstantFloat - 1.500000 - () - ) - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchValue - (UnaryOp - USub - (ConstantComplex - 0.000000 - 0.000000 - () - ) - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchValue - (BinOp - (UnaryOp - USub - (ConstantInt - 0 - () - ) - ) - Add - (ConstantComplex - 0.000000 - 0.000000 - () - ) - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchValue - (ConstantBytes - "b'x'" - () - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 4 - () - ) - () - )])] - ) - (Match - (Tuple - [(Name - x - Load - )] - Load - ) - [((MatchSequence - [(MatchAs - () - y - )] - ) - () - [(Assign - [(Name - z - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchSequence - [(MatchStar - x - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Tuple - [(Name - w - Load - ) - (Name - x - Load - )] - Load - ) - [((MatchSequence - [(MatchAs - () - y - ) - (MatchAs - () - z - )] - ) - () - [(Assign - [(Name - v - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Tuple - [(ConstantInt - 0 - () - ) - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - [((MatchSequence - [(MatchValue - (ConstantInt - 0 - () - ) - ) - (MatchStar - x - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchSequence - [(MatchValue - (ConstantInt - 0 - () - ) - ) - (MatchStar - x - ) - (MatchValue - (ConstantInt - 1 - () - ) - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )]) - ((MatchSequence - [(MatchStar - x - ) - (MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchValue - (ConstantInt - 2 - () - ) - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 2 - () - ) - () - )]) - ((MatchSequence - [(MatchStar - x - )] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 2 - () - ) - () - )])] - ) - (Match - (Tuple - [(NamedExpr - (Name - w - Store - ) - (Name - x - Load - ) - )] - Load - ) - [((MatchSequence - [(MatchAs - (MatchAs - () - y - ) - v - )] - ) - () - [(Assign - [(Name - z - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchClass - (Name - bool - Load - ) - [(MatchAs - () - z - )] - [] - [] - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchClass - (Name - Point - Load - ) - [(MatchValue - (ConstantInt - 1 - () - ) - )] - [y] - [(MatchAs - () - var - )] - ) - () - [(Assign - [(Name - x - Store - )] - (Name - var - Load - ) - () - )]) - ((MatchClass - (Name - Point - Load - ) - [] - [x - y] - [(MatchValue - (ConstantInt - 1 - () - ) - ) - (MatchAs - () - var - )] - ) - () - [(Assign - [(Name - x - Store - )] - (Name - var - Load - ) - () - )]) - ((MatchSequence - [(MatchClass - (Name - Point - Load - ) - [(MatchAs - () - x - ) - (MatchAs - () - y - )] - [] - [] - )] - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantStr - "string" - () - ) - () - )]) - ((MatchClass - (Name - Point - Load - ) - [(MatchClass - (Name - int - Load - ) - [(MatchAs - () - xx - )] - [] - [] - )] - [y] - [(MatchValue - (ConstantStr - "hello" - () - ) - )] - ) - () - [(Assign - [(Name - out - Store - )] - (Call - (Name - locals - Load - ) - [] - [] - ) - () - )])] - ) - (Match - (Tuple - [(ConstantEllipsis - () - ) - (ConstantEllipsis - () - )] - Load - ) - [((MatchSequence - [(MatchAs - () - a - ) - (MatchAs - () - b - )] - ) - () - [(Assign - [(Name - out - Store - )] - (Call - (Name - locals - Load - ) - [] - [] - ) - () - )])] - ) - (Match - (Dict - [(ConstantStr - "k" - () - ) - (ConstantStr - "l" - () - )] - [(ConstantEllipsis - () - ) - (ConstantEllipsis - () - )] - ) - [((MatchMapping - [(ConstantStr - "k" - () - ) - (ConstantStr - "l" - () - )] - [(MatchAs - () - a - ) - (MatchAs - () - b - )] - () - ) - () - [(Assign - [(Name - out - Store - )] - (Call - (Name - locals - Load - ) - [] - [] - ) - () - )])] - ) - (Match - (Name - x - Load - ) - [((MatchSingleton - (ConstantBool - .false. - () - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 0 - () - ) - () - )]) - ((MatchSingleton - (ConstantBool - .true. - () - ) - ) - () - [(Assign - [(Name - y - Store - )] - (ConstantInt - 1 - () - ) - () - )])] - ) - (FunctionDef - t - ([] - [] - [] - [] - [] - [] - []) - [(Match - (Name - status - Load - ) - [((MatchValue - (ConstantInt - 400 - () - ) - ) - () - [(Return - (ConstantStr - "Bad request" - () - ) - )]) - ((MatchOr - [(MatchValue - (ConstantInt - 401 - () - ) - ) - (MatchValue - (ConstantInt - 403 - () - ) - ) - (MatchValue - (ConstantInt - 404 - () - ) - )] - ) - () - [(Return - (ConstantStr - "Not allowed" - () - ) - )]) - ((MatchValue - (ConstantInt - 418 - () - ) - ) - () - [(Return - (ConstantStr - "I'm a teapot" - () - ) - )])] - )] - [] - () - () - ) - (FunctionDef - _get_slots - ([] - [(cls - () - ())] - [] - [] - [] - [] - []) - [(Match - (Name - x - Load - ) - [((MatchSingleton - (ConstantNone - () - ) - ) - () - [(Return - () - )]) - ((MatchClass - (Name - str - Load - ) - [(MatchAs - () - slot - )] - [] - [] - ) - () - [(Expr - (Yield - (Name - slot - Load - ) - ) - )]) - ((MatchAs - () - iterable - ) - (UnaryOp - Not - (Call - (Name - hasattr - Load - ) - [(Name - iterable - Load - ) - (ConstantStr - "__next__" - () - )] - [] - ) - ) - [(Expr - (YieldFrom - (Name - iterable - Load - ) - ) - )]) - ((MatchAs - () - _ - ) - () - [(Raise - (Call - (Name - TypeError - Load - ) - [(JoinedStr - [(ConstantStr - "Slots of '" - () - ) - (FormattedValue - (Name - cls.__name__ - Load - ) - -1 - () - ) - (ConstantStr - "' cannot be determined" - () - )] - )] - [] - ) - () - )])] - )] - [] - () - () - ) - (FunctionDef - check_mapping_then_sequence - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Match - (Name - x - Load - ) - [((MatchSequence - [(MatchStar - _ - )] - ) - () - [(Return - (ConstantStr - "seq" - () - ) - )]) - ((MatchMapping - [] - [] - () - ) - () - [(Return - (ConstantStr - "map" - () - ) - )])] - )] - [(Name - staticmethod - Load - )] - () - () - ) - (FunctionDef - file_handler_v1 - ([] - [(command - () - ())] - [] - [] - [] - [] - []) - [(Match - (Call - (Attribute - (Name - command - Load - ) - split - Load - ) - [] - [] - ) - [((MatchSequence - [(MatchValue - (ConstantStr - "show" - () - ) - )] - ) - () - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "List all files and directories: " - () - )] - [] - ) - )]) - ((MatchSequence - [(MatchValue - (ConstantStr - "remove" - () - ) - ) - (MatchStar - files - )] - ) - () - [(Expr - (Call - (Name - print - Load - ) - [(Call - (Attribute - (ConstantStr - "Removing files: {}" - () - ) - format - Load - ) - [(Name - files - Load - )] - [] - )] - [] - ) - )]) - ((MatchAs - () - _ - ) - () - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Command not recognized" - () - )] - [] - ) - )])] - )] - [] - () - () - ) - (Match - (Tuple - [] - Load - ) - [((MatchSequence - [] - ) - () - [(Assign - [(Name - x - Store - )] - (ConstantInt - 0 - () - ) - () - )])] - ) - (Match - (Tuple - [] - Load - ) - [((MatchSequence - [] - ) - () - [(Pass)])] - ) - (FunctionDef - case - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (FunctionDef - match - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (For - (Name - match - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(Pass)] - [] - () - ) - (For - (Name - case - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 10 - () - )] - [] - ) - [(Pass)] - [] - () - ) - (ClassDef - match - [] - [] - [(Pass)] - [] - ) - (ClassDef - case - [] - [] - [(Pass)] - [] - ) - (AnnAssign - (Name - match - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (AnnAssign - (Name - case - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (Assign - [(Name - match - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (Assign - [(Name - case - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (Assign - [(Name - match - Store - )] - (Dict - [(ConstantInt - 2 - () - )] - [(ConstantInt - 3 - () - )] - ) - () - ) - (Assign - [(Name - match - Store - )] - (Subscript - (Name - A - Load - ) - (Tuple - [(ConstantInt - 1 - () - ) - (Slice - () - () - () - )] - Load - ) - Load - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Subscript - (Name - match - Load - ) - (Slice - (ConstantInt - 2 - () - ) - (ConstantInt - 8 - () - ) - () - ) - Load - )] - [] - ) - ) - (Assign - [(Name - match - Store - )] - (ConstantInt - 5 - () - ) - () - ) - (Assign - [(Name - a - Store - )] - (Dict - [(Name - match - Load - )] - [(ConstantInt - 3 - () - )] - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - a - Load - )] - [] - ) - ) - (Assign - [(Name - case - Store - )] - (Dict - [(ConstantStr - "ok" - () - )] - [(ConstantInt - 5 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Dict - [(Subscript - (Name - case - Load - ) - (ConstantStr - "ok" - () - ) - Load - )] - [(ConstantInt - 6 - () - )] - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - a - Load - )] - [] - ) - ) - (Assign - [(Name - match - Store - )] - (Dict - [(ConstantInt - 2 - () - )] - [(ConstantInt - 3 - () - )] - ) - () - ) - (Expr - (Subscript - (Name - match - Load - ) - (Slice - (ConstantInt - 2 - () - ) - (ConstantInt - 8 - () - ) - () - ) - Load - ) - )] - [] -) diff --git a/tests/reference/ast_new-slice1-9c440e3.json b/tests/reference/ast_new-slice1-9c440e3.json deleted file mode 100644 index 5efa42035d..0000000000 --- a/tests/reference/ast_new-slice1-9c440e3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-slice1-9c440e3", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/slice1.py", - "infile_hash": "b682e6a952b39d1b9310299340035aed5d4c6916814c1293d0aa9977", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-slice1-9c440e3.stdout", - "stdout_hash": "f2c5ce2eeecd08f73104a45cfb87a2bcabc55ca3a65e3c751c207beb", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-slice1-9c440e3.stdout b/tests/reference/ast_new-slice1-9c440e3.stdout deleted file mode 100644 index 2a2e4db3a5..0000000000 --- a/tests/reference/ast_new-slice1-9c440e3.stdout +++ /dev/null @@ -1,291 +0,0 @@ -(Module - [(Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - (ConstantInt - 2 - () - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - () - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - () - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - () - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - (ConstantInt - 2 - () - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - ) - ) - (Expr - (Subscript - (ConstantStr - "LPython" - () - ) - (Slice - () - () - () - ) - Load - ) - ) - (Assign - [(Name - List - Store - )] - (List - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (ConstantStr - "c" - () - ) - (ConstantStr - "d" - () - )] - Load - ) - () - ) - (Assign - [(Name - List - Store - )] - (List - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - ) - (ConstantStr - "c" - () - ) - (ConstantStr - "d" - () - )] - Load - ) - () - ) - (Expr - (Subscript - (Name - List - Load - ) - (Slice - () - () - (UnaryOp - USub - (ConstantInt - 2 - () - ) - ) - ) - Load - ) - )] - [] -) diff --git a/tests/reference/ast_new-statements1-e081093.json b/tests/reference/ast_new-statements1-e081093.json deleted file mode 100644 index 5676cb70c4..0000000000 --- a/tests/reference/ast_new-statements1-e081093.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-statements1-e081093", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/statements1.py", - "infile_hash": "98dd16a7e41cfca5cce2fd716fa5888ad5b970cd368e6171f1e66306", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-statements1-e081093.stdout", - "stdout_hash": "9425fb51c6f0e2ed284e0ba59bb2efee1a86541d77150d20c02fd5fc", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-statements1-e081093.stdout b/tests/reference/ast_new-statements1-e081093.stdout deleted file mode 100644 index 421e1c8067..0000000000 --- a/tests/reference/ast_new-statements1-e081093.stdout +++ /dev/null @@ -1,1695 +0,0 @@ -(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 - ) - () - ) - (Assign - [(Name - obj - Store - )] - (Tuple - [(Name - obj - Load - )] - Load - ) - () - ) - (AugAssign - (Name - x - Store - ) - Add - (ConstantInt - 1 - () - ) - ) - (AugAssign - (Name - x - Store - ) - Add - (Tuple - [(Name - y - Load - ) - (Name - z - Load - )] - Load - ) - ) - (AugAssign - (Name - x - Store - ) - Add - (Tuple - [(Tuple - [(Name - y - Load - ) - (Name - z - Load - )] - Load - )] - Load - ) - ) - (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 - (ConstantInt - 32768 - () - ) - ) - (Expr - (ConstantInt - 12 - () - ) - ) - (Expr - (ConstantInt - 23440334322333 - () - ) - ) - (Expr - (ConstantFloat - 123.000000 - () - ) - ) - (Expr - (ConstantFloat - 123.450000 - () - ) - ) - (Expr - (ConstantFloat - 123400000000.000000 - () - ) - ) - (Expr - (BinOp - (ConstantInt - 12 - () - ) - Add - (ConstantComplex - 0.000000 - 3.000000 - () - ) - ) - ) - (Expr - (BinOp - (ConstantFloat - 0.120000 - () - ) - Add - (ConstantComplex - 0.000000 - 0.001000 - () - ) - ) - ) - (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 - )] - ) - ) - (Expr - (Compare - (ConstantStr - "hello" - () - ) - In - [(Name - x - Load - )] - ) - ) - (Expr - (Compare - (ConstantStr - "a" - () - ) - In - [(Call - (Attribute - (Name - a - Load - ) - func - Load - ) - [] - [] - )] - ) - ) - (Expr - (Compare - (ConstantStr - "lo" - () - ) - In - [(ConstantStr - "hello" - () - )] - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (ConstantInt - 1 - () - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (Tuple - [(ConstantInt - 1 - () - )] - Load - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (Slice - () - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - () - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - a - Load - ) - b - Load - ) - (Slice - () - () - () - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - y - Load - ) - z - Load - ) - (Slice - (ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - y - Load - ) - z - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - (ConstantInt - 3 - () - ) - ) - Load - ) - ) - (Expr - (Subscript - (Attribute - (Name - y - Load - ) - z - Load - ) - (Slice - (ConstantInt - 1 - () - ) - () - () - ) - 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 - () - )] - ) - () - ) - (Assign - [(Name - a - Store - )] - (Set - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - ) - () - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - (Compare - (Name - x - Load - ) - Eq - [(Name - y - Load - )] - ) - 1 - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - output - Store - )] - (Compare - (Name - x - Load - ) - Eq - [(Name - y - Load - )] - ) - () - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - (Compare - (Name - x - Load - ) - Gt - [(Name - y - Load - )] - ) - 1 - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - output - Store - )] - (Compare - (Name - x - Load - ) - Gt - [(Name - y - Load - )] - ) - () - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - (Compare - (List - [(Name - x - Load - )] - Load - ) - NotIn - [(List - [(Name - y - Load - )] - Load - )] - ) - 1 - ) - (AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - output - Store - )] - (Compare - (List - [(Name - x - Load - )] - Load - ) - NotIn - [(List - [(Name - y - Load - )] - Load - )] - ) - () - ) - (FunctionDef - comparison_return - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - [(Return - (Compare - (Name - a - Load - ) - Gt - [(Name - b - Load - )] - ) - )] - [] - () - () - ) - (FunctionDef - comparison_return - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - [(Return - (Compare - (List - [(Name - a - Load - )] - Load - ) - In - [(List - [(Name - b - Load - )] - Load - )] - ) - )] - [] - () - () - ) - (FunctionDef - comparison_return - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - output - Store - ) - (Name - bool - Load - ) - () - 1 - ) - (Assign - [(Name - output - Store - )] - (Compare - (List - [(Name - a - Load - )] - Load - ) - NotIn - [(List - [(Name - b - Load - )] - Load - )] - ) - () - ) - (Return - (Name - output - Load - ) - )] - [] - () - () - ) - (FunctionDef - comparison_return - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - [(Assign - [(Name - output - Store - )] - (Compare - (List - [(Name - a - Load - )] - Load - ) - NotIn - [(List - [(Name - b - Load - )] - Load - )] - ) - () - ) - (Return - (Name - output - Load - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-statements2-c4cdc5f.json b/tests/reference/ast_new-statements2-c4cdc5f.json deleted file mode 100644 index efb47d87e7..0000000000 --- a/tests/reference/ast_new-statements2-c4cdc5f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-statements2-c4cdc5f", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/statements2.py", - "infile_hash": "8c96f6788e951a113e775f497394a372018d04b4f7f910d304471017", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-statements2-c4cdc5f.stdout", - "stdout_hash": "d79c678d3b5de63e5d424a2015595bfc3a686fc5c7ba0802aed6f3af", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-statements2-c4cdc5f.stdout b/tests/reference/ast_new-statements2-c4cdc5f.stdout deleted file mode 100644 index c18d65316e..0000000000 --- a/tests/reference/ast_new-statements2-c4cdc5f.stdout +++ /dev/null @@ -1,507 +0,0 @@ -(Module - [(Expr - (Call - (Call - (Call - (Name - getattr - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - [(Name - a - Load - ) - (Name - b - Load - )] - [] - ) - [(ConstantInt - 5 - () - )] - [(a - (Name - a - Load - )) - (b - (ConstantInt - 0 - () - ))] - ) - ) - (Expr - (Call - (Call - (Name - func - Load - ) - [(Name - a - Load - ) - (Name - _op - Load - )] - [] - ) - [(Name - s - Load - )] - [] - ) - ) - (Expr - (Call - (Call - (Name - test - Load - ) - [] - [] - ) - [] - [] - ) - ) - (Assign - [(Name - a - Store - )] - (Subscript - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - (ConstantInt - 0 - () - ) - Load - ) - () - ) - (Assign - [(Tuple - [(Name - a - Store - ) - (Name - b - Store - )] - Store - )] - (Subscript - (BinOp - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - Add - (List - [(ConstantInt - 0 - () - ) - (ConstantInt - 0 - () - )] - Load - ) - ) - (Slice - () - (ConstantInt - 2 - () - ) - () - ) - Load - ) - () - ) - (Assign - [(Tuple - [(Name - a - Store - ) - (Name - b - Store - )] - Store - )] - (Subscript - (BinOp - (Call - (Attribute - (Name - c - Load - ) - d - Load - ) - [] - [] - ) - Add - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 0 - () - )] - Load - ) - ) - (Slice - () - () - () - ) - Load - ) - () - ) - (Expr - (Subscript - (Dict - [(ConstantStr - "a" - () - ) - (ConstantStr - "b" - () - )] - [(Name - a - Load - ) - (Name - b - Load - )] - ) - (Name - val - Load - ) - Load - ) - ) - (If - (Compare - (Subscript - (Subscript - (Name - args - Load - ) - (Name - i - Load - ) - Load - ) - (Slice - () - (ConstantInt - 1 - () - ) - () - ) - Load - ) - In - [(List - [(ConstantStr - "" - () - ) - (ConstantStr - "." - () - )] - Load - )] - ) - [(Pass)] - [] - ) - (Assign - [(Name - x - Store - )] - (List - [(Subscript - (ListComp - (BinOp - (UnaryOp - USub - (Name - c - Load - ) - ) - Mod - (Name - self - Load - ) - ) - [((Name - c - Store - ) - (Call - (Name - reversed - Load - ) - [(Attribute - (Attribute - (Name - T - Load - ) - rep - Load - ) - rep - Load - )] - [] - ) - [] - 0)] - ) - (Slice - () - (UnaryOp - USub - (ConstantInt - 1 - () - ) - ) - () - ) - Load - )] - Load - ) - () - ) - (Expr - (Subscript - (ListComp - (Name - x - Load - ) - [((Name - x - Store - ) - (Name - G - Load - ) - [(Call - (Attribute - (Attribute - (Name - self - Load - ) - ring - Load - ) - is_unit - Load - ) - [(Subscript - (Name - x - Load - ) - (ConstantInt - 0 - () - ) - Load - )] - [] - )] - 0)] - ) - (ConstantInt - 0 - () - ) - Load - ) - ) - (If - (Compare - (Name - x - Load - ) - NotIn - [(Name - z - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (If - (Compare - (Name - x - Load - ) - NotIn - [(Name - z - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (If - (Compare - (Name - x - Load - ) - NotIn - [(Name - z - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (If - (Compare - (Name - x - Load - ) - NotIn - [(Name - z - Load - )] - ) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - ) - (FunctionDef - imatmul - ([] - [(a - () - ()) - (b - () - ())] - [] - [] - [] - [] - []) - [(Expr - (ConstantStr - "Same as a @= b." - () - ) - ) - (AugAssign - (Name - a - Store - ) - MatMult - (Name - b - Load - ) - ) - (Return - (Name - a - Load - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-string1-96b90b3.json b/tests/reference/ast_new-string1-96b90b3.json deleted file mode 100644 index 49a78caf38..0000000000 --- a/tests/reference/ast_new-string1-96b90b3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-string1-96b90b3", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/string1.py", - "infile_hash": "278e24162e6d88441f13d84bab068f1862b4fa490bf95e145fb71318", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-string1-96b90b3.stdout", - "stdout_hash": "51806e5893017a386c0ce7a4f3260c7605cabd5ea4e6a16aa300d8c2", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-string1-96b90b3.stdout b/tests/reference/ast_new-string1-96b90b3.stdout deleted file mode 100644 index cc011f29f2..0000000000 --- a/tests/reference/ast_new-string1-96b90b3.stdout +++ /dev/null @@ -1,520 +0,0 @@ -(Module - [(Expr - (JoinedStr - [(ConstantStr - "Hello, " - () - ) - (FormattedValue - (Name - first_name - Load - ) - -1 - () - ) - (ConstantStr - " " - () - ) - (FormattedValue - (Name - last_name - Load - ) - -1 - () - ) - (ConstantStr - ". You are " - () - ) - (FormattedValue - (Name - age - Load - ) - -1 - () - ) - (ConstantStr - " years old." - () - )] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(JoinedStr - [(FormattedValue - (Name - __file__ - Load - ) - -1 - () - ) - (ConstantStr - " executed in " - () - ) - (FormattedValue - (Name - elapsed - Load - ) - -1 - () - ) - (ConstantStr - " seconds." - () - )] - )] - [] - ) - ) - (Expr - (ConstantStr - "\nsometext\nanotherline\n" - () - ) - ) - (Expr - (ConstantBytes - "b'Some text goes here.'" - () - ) - ) - (Expr - (ConstantBytes - "b'\nMultiple texts goes here.\n'" - () - ) - ) - (Expr - (ConstantStr - "\nText\n" - () - ) - ) - (Expr - (ConstantStr - "Text" - () - ) - ) - (Expr - (ConstantStr - "a\\tb\\nA\\tB" - () - ) - ) - (Expr - (ConstantStr - "1,2,3 # comment" - "u" - ) - ) - (Expr - (ConstantStr - "Text" - "u" - ) - ) - (Expr - (ConstantStr - "Text" - () - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "\nText " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - ) - (ConstantStr - "\n" - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - id - Load - ) - -1 - () - )] - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (ConstantBytes - "b'\nText\n'" - () - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (ConstantBytes - "b'\nText\n'" - () - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (ConstantBytes - "b'Text'" - () - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "\\N" - () - ) - (FormattedValue - (Name - AMPERSAND - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text" - () - ) - (FormattedValue - (Name - a - Load - ) - -1 - () - ) - (ConstantStr - ", " - () - ) - (FormattedValue - (Name - b - Load - ) - -1 - () - ) - (ConstantStr - "Text " - () - ) - (FormattedValue - (Name - a - Load - ) - -1 - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text" - () - ) - (FormattedValue - (Name - a - Load - ) - -1 - () - ) - (ConstantStr - ", " - () - ) - (FormattedValue - (Name - b - Load - ) - -1 - () - ) - (ConstantStr - "Text" - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text" - () - ) - (FormattedValue - (Name - b - Load - ) - -1 - () - ) - (ConstantStr - ", Text" - () - )] - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text " - () - ) - (FormattedValue - (Name - a - Load - ) - -1 - () - ) - (ConstantStr - "Text" - () - )] - ) - ) - (Expr - (ConstantStr - "TextText" - () - ) - ) - (Expr - (ConstantStr - "TextText" - () - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "Text" - () - ) - (FormattedValue - (Name - a - Load - ) - -1 - () - ) - (ConstantStr - " Text" - () - )] - ) - ) - (Expr - (ConstantBytes - "b'TextText'" - () - ) - ) - (Expr - (ConstantStr - "\\n" - () - ) - ) - (Expr - (ConstantStr - "\nText\n123\\n\\t\n" - () - ) - ) - (Expr - (ConstantBytes - "b'\\n'" - () - ) - ) - (Expr - (JoinedStr - [(ConstantStr - "\\n" - () - )] - ) - ) - (Expr - (ConstantBytes - "b'\n'" - () - ) - ) - (Expr - (ConstantBytes - "b'\n\n\\n'" - () - ) - )] - [] -) diff --git a/tests/reference/ast_new-string2-44323ea.json b/tests/reference/ast_new-string2-44323ea.json deleted file mode 100644 index 3bcc6c58df..0000000000 --- a/tests/reference/ast_new-string2-44323ea.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-string2-44323ea", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/string2.py", - "infile_hash": "58397718a6e0dc5cc453081e82ad1b2ca378639dfb516c3f28d34323", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-string2-44323ea.stdout", - "stdout_hash": "52d1edc0e332527fc6e077ed895f9d01a6eb79b3fb43405319864a1c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-string2-44323ea.stdout b/tests/reference/ast_new-string2-44323ea.stdout deleted file mode 100644 index d72c5709ff..0000000000 --- a/tests/reference/ast_new-string2-44323ea.stdout +++ /dev/null @@ -1,118 +0,0 @@ -(Module - [(Expr - (ConstantStr - "\"\\" - () - ) - ) - (Expr - (ConstantStr - "\n\\" - () - ) - ) - (Expr - (ConstantStr - "\\" - () - ) - ) - (Expr - (ConstantStr - " \\" - () - ) - ) - (Expr - (ConstantStr - "\\ " - () - ) - ) - (Expr - (ConstantStr - "" - () - ) - ) - (Expr - (ConstantStr - "\\|" - () - ) - ) - (Expr - (ConstantStr - "I said 'Wow' " - () - ) - ) - (Expr - (ConstantStr - "I said \"hi\" " - () - ) - ) - (Expr - (ConstantStr - "I said \\\"hi\" " - () - ) - ) - (Expr - (ConstantStr - "I said '\\'hi\\hey' " - () - ) - ) - (Expr - (ConstantStr - "ab" - () - ) - ) - (Expr - (ConstantStr - "ab" - () - ) - ) - (Expr - (ConstantStr - "Text\\\\" - () - ) - ) - (Expr - (ConstantStr - "" - () - ) - ) - (Expr - (Call - (Name - x - Load - ) - [(ConstantStr - "class a:\n def test():\n return r\"\\LaTeX\"\n" - () - )] - [] - ) - ) - (Expr - (ConstantStr - "\n \"\\\\\"\n" - () - ) - ) - (Expr - (ConstantStr - "\n '\\'\n" - () - ) - )] - [] -) diff --git a/tests/reference/ast_new-string3-37f35a0.json b/tests/reference/ast_new-string3-37f35a0.json deleted file mode 100644 index bd16a6a8a7..0000000000 --- a/tests/reference/ast_new-string3-37f35a0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-string3-37f35a0", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/string3.py", - "infile_hash": "61a3cd7139d6c429a037d74fe12b8f8305cabe9b91218082851dd7ca", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-string3-37f35a0.stdout", - "stdout_hash": "9d8ca937b551799ff4908f347ff6685917d0bfc41977c5316af4e108", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-string3-37f35a0.stdout b/tests/reference/ast_new-string3-37f35a0.stdout deleted file mode 100644 index 6d104153f6..0000000000 --- a/tests/reference/ast_new-string3-37f35a0.stdout +++ /dev/null @@ -1,129 +0,0 @@ -(Module - [(Expr - (ConstantStr - "\n" - () - ) - ) - (Expr - (ConstantStr - "\r" - () - ) - ) - (Expr - (ConstantStr - "\t" - () - ) - ) - (Expr - (ConstantStr - "'" - () - ) - ) - (Expr - (ConstantStr - "\"" - () - ) - ) - (Expr - (ConstantStr - "\\" - () - ) - ) - (Expr - (ConstantStr - "\n\r\t'\"\\" - () - ) - ) - (Expr - (ConstantStr - "\n" - () - ) - ) - (Expr - (ConstantStr - "\r" - () - ) - ) - (Expr - (ConstantStr - "\t" - () - ) - ) - (Expr - (ConstantStr - "'" - () - ) - ) - (Expr - (ConstantStr - "\"" - () - ) - ) - (Expr - (ConstantStr - "\\" - () - ) - ) - (Expr - (ConstantStr - "\n\r\t'\"\\" - () - ) - ) - (Expr - (ConstantStr - "hi\n" - () - ) - ) - (Expr - (ConstantStr - "hi\r\n\t" - () - ) - ) - (Expr - (ConstantStr - "1234\n\t\\jdlasf\t" - () - ) - ) - (Expr - (ConstantStr - "Hi this is a \"test case\"." - () - ) - ) - (Expr - (ConstantStr - "\nThis is \n\nabcd123\nThis is \r\nefgh\n" - () - ) - ) - (Expr - (ConstantStr - "This is \n\n" - () - ) - ) - (Expr - (ConstantStr - "hi dsjfklad" - () - ) - )] - [] -) diff --git a/tests/reference/ast_new-try1-a9a22cf.json b/tests/reference/ast_new-try1-a9a22cf.json deleted file mode 100644 index a252588d6f..0000000000 --- a/tests/reference/ast_new-try1-a9a22cf.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-try1-a9a22cf", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/try1.py", - "infile_hash": "a7fac6105109bebf6a38bd317f4bbf5876e2dd62a341c71232791619", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-try1-a9a22cf.stdout", - "stdout_hash": "2d208d18296ba0b82463ef7c49b2dedaed5d5600b0956f27084b454e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-try1-a9a22cf.stdout b/tests/reference/ast_new-try1-a9a22cf.stdout deleted file mode 100644 index 8e8c909961..0000000000 --- a/tests/reference/ast_new-try1-a9a22cf.stdout +++ /dev/null @@ -1,301 +0,0 @@ -(Module - [(For - (Name - i - Store - ) - (Call - (Name - range - Load - ) - [(ConstantInt - 3 - () - ) - (ConstantInt - 0 - () - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - )] - [] - ) - [(Try - [(Expr - (Call - (Name - print - Load - ) - [] - [] - ) - )] - [(ExceptHandler - (Name - IOError - Load - ) - () - [(If - (Compare - (Name - i - Load - ) - Eq - [(ConstantInt - 1 - () - )] - ) - [(Raise - () - () - )] - [] - ) - (Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "retry" - () - )] - [] - ) - )] - )] - [(Break)] - [] - )] - [] - () - ) - (Try - [(Pass)] - [(ExceptHandler - (Name - ValueError - Load - ) - () - [(Pass)] - ) - (ExceptHandler - (Name - TypeError - Load - ) - () - [(Pass)] - ) - (ExceptHandler - (Name - ZeroDivisionError - Load - ) - () - [(Pass)] - ) - (ExceptHandler - () - () - [(Pass)] - )] - [] - [] - ) - (Try - [(Assign - [(Name - a - Store - )] - (ConstantInt - 1 - () - ) - () - ) - (If - (Compare - (Name - a - Load - ) - LtE - [(ConstantInt - 0 - () - )] - ) - [(Raise - (Call - (Name - ValueError - Load - ) - [(ConstantStr - "That is not a positive number!" - () - )] - [] - ) - () - )] - [] - )] - [(ExceptHandler - (Name - ValueError - Load - ) - ve - [(Expr - (Call - (Name - print - Load - ) - [(Name - ve - Load - )] - [] - ) - )] - )] - [] - [] - ) - (Try - [(Raise - (Name - KeyboardInterrupt - Load - ) - () - )] - [] - [] - [(Expr - (Call - (Name - print - Load - ) - [(ConstantStr - "Goodbye, world!" - () - )] - [] - ) - )] - ) - (Try - [(Expr - (ConstantEllipsis - () - ) - )] - [(ExceptHandler - (Name - Exception - Load - ) - e - [(Expr - (ConstantEllipsis - () - ) - )] - )] - [] - [] - ) - (Try - [(Expr - (ConstantEllipsis - () - ) - )] - [(ExceptHandler - () - () - [(Expr - (ConstantEllipsis - () - ) - )] - )] - [(Expr - (ConstantEllipsis - () - ) - )] - [(Expr - (ConstantEllipsis - () - ) - )] - ) - (Try - [(Expr - (Call - (Attribute - (Name - shutil - Load - ) - rmtree - Load - ) - [(Call - (Attribute - (Attribute - (Name - os - Load - ) - path - Load - ) - join - Load - ) - [(Name - asv_build_cache - Load - ) - (Name - c - Load - )] - [] - )] - [] - ) - )] - [(ExceptHandler - (Name - OSError - Load - ) - () - [(Pass)] - )] - [] - [] - )] - [] -) diff --git a/tests/reference/ast_new-tuple1-29c08af.json b/tests/reference/ast_new-tuple1-29c08af.json deleted file mode 100644 index c23dd5efe2..0000000000 --- a/tests/reference/ast_new-tuple1-29c08af.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-tuple1-29c08af", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/tuple1.py", - "infile_hash": "a598d163f33a7eb37376592c8018780cb4024618f4a8024bd728ff15", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-tuple1-29c08af.stdout", - "stdout_hash": "ba3dcb7011c5466eb869001acbc2c1a89c60f15e59dcdf8e7974baab", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-tuple1-29c08af.stdout b/tests/reference/ast_new-tuple1-29c08af.stdout deleted file mode 100644 index 7b546c6ad3..0000000000 --- a/tests/reference/ast_new-tuple1-29c08af.stdout +++ /dev/null @@ -1,650 +0,0 @@ -(Module - [(Assign - [(Name - a - Store - )] - (BinOp - (Tuple - [(ConstantInt - 1 - () - )] - Load - ) - Add - (ConstantInt - 4 - () - ) - ) - () - ) - (Assign - [(Name - a - Store - )] - (BinOp - (BinOp - (ConstantInt - 3 - () - ) - Mult - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - ) - Add - (ConstantInt - 4 - () - ) - ) - () - ) - (Expr - (Call - (Name - f - Load - ) - [(Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - )] - [] - ) - ) - (Expr - (Call - (Name - f - Load - ) - [(Tuple - [(Name - x - Load - )] - Load - )] - [] - ) - ) - (Assign - [(Name - a - Store - )] - (Call - (Name - len - Load - ) - [(Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - )] - [] - ) - () - ) - (Assign - [(Name - a4 - Store - )] - (Tuple - [(Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - (Tuple - [(ConstantInt - 4 - () - ) - (ConstantInt - 5 - () - ) - (ConstantInt - 6 - () - )] - Load - )] - Load - ) - () - ) - (Expr - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - ) - (Expr - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - ) - (Expr - (BinOp - (Tuple - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - )] - Load - ) - Mult - (ConstantInt - 3 - () - ) - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(BinOp - (ConstantStr - "%s%s%s" - () - ) - Mod - (Tuple - [(Name - a - Load - ) - (Name - b - Load - ) - (Name - c - Load - )] - Load - ) - )] - [] - ) - ) - (Expr - (Call - (Name - print - Load - ) - [(BinOp - (ConstantStr - "%s%s%s" - () - ) - Mod - (Tuple - [(BinOp - (ConstantInt - 10 - () - ) - Add - (Name - x - Load - ) - ) - (Name - y - Load - ) - (BinOp - (Name - z - Load - ) - Add - (ConstantInt - 20 - () - ) - )] - Load - ) - )] - [] - ) - ) - (If - (Compare - (Attribute - (Name - sys - Load - ) - version_info - Load - ) - GtE - [(Tuple - [(ConstantInt - 3 - () - ) - (ConstantInt - 9 - () - )] - Load - )] - ) - [(Pass)] - [] - ) - (Assign - [(Name - NDArray - Store - )] - (Call - (Name - _GenericAlias - Load - ) - [(Attribute - (Name - np - Load - ) - ndarray - Load - ) - (Tuple - [(Name - Any - Load - ) - (Name - _DType - Load - )] - Load - )] - [] - ) - () - ) - (FunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(Pass)] - [(Call - (Attribute - (Attribute - (Name - pytest - Load - ) - mark - Load - ) - parametrize - Load - ) - [(ConstantStr - "shape" - () - ) - (List - [(ConstantInt - 5 - () - ) - (Tuple - [(ConstantInt - 3 - () - ) - (ConstantInt - 3 - () - ) - (ConstantInt - 3 - () - )] - Load - )] - Load - )] - [] - )] - () - () - ) - (Assign - [(Name - _promotion_table - Store - )] - (Dict - [(Tuple - [(Name - int8 - Load - ) - (Name - int8 - Load - )] - Load - )] - [(Name - int8 - Load - )] - ) - () - ) - (Expr - (Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - ) - ) - (Expr - (Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - ) - ) - (Expr - (Tuple - [(Call - (Name - assert_ - Load - ) - [(Call - (Attribute - (Name - np - Load - ) - isnan - Load - ) - [(Name - div - Load - )] - [] - )] - [] - ) - (BinOp - (ConstantStr - "dt: %s, rem: %s" - () - ) - Mod - (Tuple - [(Name - dt - Load - ) - (Name - rem - Load - )] - Load - ) - )] - Load - ) - ) - (Expr - (Call - (Name - sum - Load - ) - [(ListComp - (Subscript - (Tuple - [(ConstantInt - 1 - () - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - )] - Load - ) - (BinOp - (Name - i - Load - ) - Mod - (ConstantInt - 2 - () - ) - ) - Load - ) - [((Name - i - Store - ) - (Name - x - Load - ) - [] - 0)] - )] - [] - ) - ) - (Expr - (Call - (Name - sum - Load - ) - [(ListComp - (Subscript - (Tuple - [(ConstantInt - 1 - () - ) - (UnaryOp - USub - (ConstantInt - 1 - () - ) - )] - Load - ) - (BinOp - (Name - i - Load - ) - Mod - (ConstantInt - 2 - () - ) - ) - Load - ) - [((Name - i - Store - ) - (Name - x - Load - ) - [] - 0)] - )] - [] - ) - ) - (Assign - [(Name - a - Store - )] - (Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - ) - () - ) - (AnnAssign - (Name - t - Store - ) - (Subscript - (Name - tuple - Load - ) - (Tuple - [(Name - i32 - Load - ) - (Name - i32 - Load - )] - Load - ) - Load - ) - (Tuple - [(ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - 1 - )] - [(TypeIgnore - 0 - "" - )] -) diff --git a/tests/reference/ast_new-type_comment1-710ea6c.json b/tests/reference/ast_new-type_comment1-710ea6c.json deleted file mode 100644 index 5cabf43401..0000000000 --- a/tests/reference/ast_new-type_comment1-710ea6c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-type_comment1-710ea6c", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/type_comment1.py", - "infile_hash": "068e12017f2d2c484023dba5e6d127d0ef53e3e4148ce40452c1284b", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-type_comment1-710ea6c.stdout", - "stdout_hash": "ef1c4024c790cdf5ef3262c9b94f127a5d546dcc24932b87d98ed980", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-type_comment1-710ea6c.stdout b/tests/reference/ast_new-type_comment1-710ea6c.stdout deleted file mode 100644 index f388bf722c..0000000000 --- a/tests/reference/ast_new-type_comment1-710ea6c.stdout +++ /dev/null @@ -1,175 +0,0 @@ -(Module - [(Import - [(pytest - ())] - ) - (FunctionDef - ndarray_func - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Return - (Name - x - Load - ) - )] - [] - () - "(np.ndarray) -> np.ndarray" - ) - (FunctionDef - test - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Return - (Name - x - Load - ) - )] - [(Name - decorator1 - Load - ) - (Name - decorator2 - Load - ) - (Name - decorator3 - Load - )] - () - "(np.ndarray) -> np.ndarray" - ) - (FunctionDef - test - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - ) - (FunctionDef - main - ([] - [] - [] - [] - [] - [] - []) - [(Pass)] - [] - () - () - ) - (Expr - (Call - (Name - x - Load - ) - [(Name - x - Load - ) - (Name - y - Load - )] - [] - ) - ) - (ImportFrom - sympy.simplify - [(collect - ()) - (powsimp - ()) - (separatevars - ()) - (simplify - ())] - 0 - ) - (Expr - (Await - (Call - (Name - test - Load - ) - [(Name - x - Load - ) - (Name - y - Load - ) - (Name - z - Load - )] - [] - ) - ) - )] - [(TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - ) - (TypeIgnore - 0 - "" - )] -) diff --git a/tests/reference/ast_new-unicode-d3199dc.json b/tests/reference/ast_new-unicode-d3199dc.json deleted file mode 100644 index 953033c69f..0000000000 --- a/tests/reference/ast_new-unicode-d3199dc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-unicode-d3199dc", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/unicode.py", - "infile_hash": "6b3cd163f80b29c927ea2538095688bb9d903c15b5e4a782dc821db5", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-unicode-d3199dc.stdout", - "stdout_hash": "094e93359015843e391595911489ad12bf6abeb7fdc92649bb97ca3a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-unicode-d3199dc.stdout b/tests/reference/ast_new-unicode-d3199dc.stdout deleted file mode 100644 index 25bedb5aa2..0000000000 --- a/tests/reference/ast_new-unicode-d3199dc.stdout +++ /dev/null @@ -1,96 +0,0 @@ -(Module - [(FunctionDef - test_frompyfunc_name - ([] - [(self - () - ())] - [] - [] - [] - [] - []) - [(FunctionDef - cassé - ([] - [(x - () - ())] - [] - [] - [] - [] - []) - [(Return - (Name - x - Load - ) - )] - [] - () - () - )] - [] - () - () - ) - (Assign - [(Name - ℙƴtℌøἤ - Store - )] - (ConstantInt - 1 - () - ) - () - ) - (Expr - (Call - (Name - print - Load - ) - [(Name - ℙƴtℌøἤ - Load - )] - [] - ) - ) - (If - (Compare - (Name - 诶 - Load - ) - NotEq - [(ConstantInt - 2 - () - )] - ) - [(Pass)] - [] - ) - (FunctionDef - क१ - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (ConstantEllipsis - () - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/ast_new-while1-a4c6382.json b/tests/reference/ast_new-while1-a4c6382.json deleted file mode 100644 index b007957ac4..0000000000 --- a/tests/reference/ast_new-while1-a4c6382.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-while1-a4c6382", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/while1.py", - "infile_hash": "d013884f95378177c308b9e8cc762e1f1a57ff5b49ea7aae5461901e", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-while1-a4c6382.stdout", - "stdout_hash": "90f2e03370e7ea2eb4cfc10b32b6c7b24b4abb61491c46e5e23b8629", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-while1-a4c6382.stdout b/tests/reference/ast_new-while1-a4c6382.stdout deleted file mode 100644 index 4bbcf5b705..0000000000 --- a/tests/reference/ast_new-while1-a4c6382.stdout +++ /dev/null @@ -1,84 +0,0 @@ -(Module - [(ImportFrom - lpython - [(i32 - ())] - 0 - ) - (AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - (ConstantInt - 10 - () - ) - 1 - ) - (While - (Compare - (Name - i - Load - ) - Lt - [(ConstantInt - 3 - () - )] - ) - [(Pass)] - [] - ) - (While - (Compare - (Name - i - Load - ) - Lt - [(ConstantInt - 6 - () - )] - ) - [(Pass)] - [(Pass)] - ) - (While - (Compare - (Name - i - Load - ) - Lt - [(ConstantInt - 3 - () - )] - ) - [(Pass)] - [] - ) - (While - (Compare - (Name - i - Load - ) - Lt - [(ConstantInt - 6 - () - )] - ) - [(Pass)] - [(Pass)] - )] - [] -) diff --git a/tests/reference/ast_new-with1-6c88c0f.json b/tests/reference/ast_new-with1-6c88c0f.json deleted file mode 100644 index 379e083532..0000000000 --- a/tests/reference/ast_new-with1-6c88c0f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-with1-6c88c0f", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/with1.py", - "infile_hash": "76c56f94e39ec49c634bd827a4b1e6c14e8da599466c733c44d55b1e", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-with1-6c88c0f.stdout", - "stdout_hash": "da9e18ca666189ea27993cfac36f5193654225e29453bd37b5df0a17", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-with1-6c88c0f.stdout b/tests/reference/ast_new-with1-6c88c0f.stdout deleted file mode 100644 index d1cef145af..0000000000 --- a/tests/reference/ast_new-with1-6c88c0f.stdout +++ /dev/null @@ -1,331 +0,0 @@ -(Module - [(With - [((Call - (Name - A - Load - ) - [] - [] - ) - (Name - a - Store - )) - ((Call - (Name - B - Load - ) - [] - [] - ) - (Name - b - Store - ))] - [(Expr - (Call - (Name - f - Load - ) - [(Name - a - Load - ) - (Name - b - Load - )] - [] - ) - )] - () - ) - (With - [((Call - (Name - A - Load - ) - [] - [] - ) - (Name - a - Store - )) - ((Call - (Name - B - Load - ) - [(Name - a - Load - )] - [] - ) - (Name - b - Store - )) - ((Call - (Name - C - Load - ) - [(Name - a - Load - ) - (Name - b - Load - )] - [] - ) - (Name - c - Store - ))] - [(Expr - (Call - (Name - f - Load - ) - [(Name - a - Load - ) - (Name - c - Load - )] - [] - ) - )] - () - ) - (With - [((Call - (Name - open - Load - ) - [(ConstantStr - "examples/expr2.py" - () - ) - (ConstantStr - "r" - () - )] - [] - ) - (Name - file - Store - ))] - [(Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - file - Load - ) - read - Load - ) - [] - [] - ) - () - )] - () - ) - (With - [((Call - (Name - open - Load - ) - [(ConstantEllipsis - () - )] - [] - ) - (Name - f - Store - ))] - [(Expr - (ConstantEllipsis - () - ) - )] - () - ) - (With - [((Call - (Name - open - Load - ) - [(ConstantStr - "examples/expr2.py" - () - ) - (ConstantStr - "r" - () - )] - [] - ) - (Name - file - Store - ))] - [(Assign - [(Name - x - Store - )] - (Call - (Attribute - (Name - file - Load - ) - read - Load - ) - [] - [] - ) - () - )] - () - ) - (With - [((Name - a - Load - ) - ()) - ((Name - b - Load - ) - ()) - ((Name - c - Load - ) - (Name - y - Store - )) - ((Name - z - Load - ) - ())] - [(Pass)] - () - ) - (With - [((Call - (Name - tag - Load - ) - [(ConstantStr - "x" - () - )] - [] - ) - ())] - [(Pass)] - () - ) - (With - [((Name - t - Load - ) - (Name - x - Store - )) - ((Call - (Name - y - Load - ) - [] - [] - ) - ())] - [(Expr - (ConstantEllipsis - () - ) - )] - () - ) - (With - [((Name - a - Load - ) - (Name - b - Store - )) - ((Call - (Name - c - Load - ) - [] - [] - ) - ()) - ((Call - (Name - d - Load - ) - [] - [] - ) - ()) - ((Name - e - Load - ) - (Name - f - Store - )) - ((Name - g - Load - ) - (Name - x - Store - ))] - [(Pass)] - () - )] - [] -) diff --git a/tests/reference/ast_new-yield-4c41668.json b/tests/reference/ast_new-yield-4c41668.json deleted file mode 100644 index 84c7e07ded..0000000000 --- a/tests/reference/ast_new-yield-4c41668.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "ast_new-yield-4c41668", - "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", - "infile": "tests/parser/yield.py", - "infile_hash": "8be8f045d190dbc958c308128da40d7e8b590f0320166d10b545722b", - "outfile": null, - "outfile_hash": null, - "stdout": "ast_new-yield-4c41668.stdout", - "stdout_hash": "86dec82fdfba5c8c8fe63c0a67dac680041e208fb7f372bf1744ce7d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/ast_new-yield-4c41668.stdout b/tests/reference/ast_new-yield-4c41668.stdout deleted file mode 100644 index f6007b5793..0000000000 --- a/tests/reference/ast_new-yield-4c41668.stdout +++ /dev/null @@ -1,346 +0,0 @@ -(Module - [(FunctionDef - func - ([] - [] - [] - [] - [] - [] - []) - [(AnnAssign - (Name - x - Store - ) - (Subscript - (Name - list - Load - ) - (Name - i32 - Load - ) - Load - ) - () - 1 - ) - (Assign - [(Name - x - Store - )] - (List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - ) - () - ) - (AnnAssign - (Name - i - Store - ) - (Name - i32 - Load - ) - () - 1 - ) - (For - (Name - i - Store - ) - (Name - x - Load - ) - [(Expr - (Yield - (Name - i - Load - ) - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Name - x - Load - ) - [(Expr - (Yield - (Name - i - Load - ) - ) - )] - [] - () - ) - (For - (Name - i - Store - ) - (Name - x - Load - ) - [(Expr - (Yield - (Tuple - [] - Load - ) - ) - )] - [] - () - ) - (For - (Name - _ - Store - ) - (Name - x - Load - ) - [(Expr - (Yield - () - ) - )] - [] - () - ) - (Expr - (Yield - (Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - ) - ) - ) - (Expr - (Yield - (Tuple - [(Name - x - Load - ) - (Name - y - Load - )] - Load - ) - ) - )] - [] - () - () - ) - (FunctionDef - iterable1 - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (Yield - (ConstantInt - 1 - () - ) - ) - ) - (Expr - (Yield - (ConstantInt - 2 - () - ) - ) - )] - [] - () - () - ) - (FunctionDef - iterable2 - ([] - [] - [] - [] - [] - [] - []) - [(Expr - (YieldFrom - (Call - (Name - iterable1 - Load - ) - [] - [] - ) - ) - ) - (Expr - (Yield - (ConstantInt - 3 - () - ) - ) - )] - [] - () - () - ) - (Assert - (Compare - (Call - (Name - list - Load - ) - [(Call - (Name - iterable2 - Load - ) - [] - [] - )] - [] - ) - Eq - [(List - [(ConstantInt - 1 - () - ) - (ConstantInt - 2 - () - ) - (ConstantInt - 3 - () - )] - Load - )] - ) - () - ) - (FunctionDef - test_02 - ([] - [] - [] - [] - [] - [] - []) - [(Assign - [(Name - x - Store - )] - (Yield - (ConstantInt - 123 - () - ) - ) - () - ) - (Assign - [(Name - generator - Store - )] - (Call - (Name - type - Load - ) - [(Call - (Lambda - ([] - [] - [] - [] - [] - [] - []) - (Yield - () - ) - ) - [] - [] - )] - [] - ) - () - ) - (Return - (YieldFrom - (Call - (Attribute - (Name - awaitable - Load - ) - __await__ - Load - ) - [] - [] - ) - ) - )] - [] - () - () - )] - [] -) diff --git a/tests/reference/c-c_interop1-e215531.json b/tests/reference/c-c_interop1-e215531.json deleted file mode 100644 index 9cd8533dac..0000000000 --- a/tests/reference/c-c_interop1-e215531.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-c_interop1-e215531", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/c_interop1.py", - "infile_hash": "aeb797508318740ae58a14cf663910a8fa077c574eaf79b9f54656ef", - "outfile": null, - "outfile_hash": null, - "stdout": "c-c_interop1-e215531.stdout", - "stdout_hash": "9d9dd1715b625024203f8b4de330a936a806c5e8031ae7b643c23e71", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-c_interop1-e215531.stdout b/tests/reference/c-c_interop1-e215531.stdout deleted file mode 100644 index 60c6da2270..0000000000 --- a/tests/reference/c-c_interop1-e215531.stdout +++ /dev/null @@ -1,33 +0,0 @@ -#include - -#include -#include -#include -#include -#include - - - - -// 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.00000000000000000e+00; - return _lpython_return_variable; -} - -void l(double a, float b, int64_t c, int32_t d) -{ - printf("%s\n", "OK"); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - return 0; -} diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json deleted file mode 100644 index c0fcdfcb2c..0000000000 --- a/tests/reference/c-expr7-bb2692a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-expr7-bb2692a", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/expr7.py", - "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "c-expr7-bb2692a.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/c-expr7-bb2692a.stderr b/tests/reference/c-expr7-bb2692a.stderr deleted file mode 100644 index d1b84ec030..0000000000 --- a/tests/reference/c-expr7-bb2692a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr7.py:4:13 - | -4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/c-expr_01-28f449f.json b/tests/reference/c-expr_01-28f449f.json deleted file mode 100644 index e26f28894a..0000000000 --- a/tests/reference/c-expr_01-28f449f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-expr_01-28f449f", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/expr_01.py", - "infile_hash": "230a65e2cddb76f58d56747325caf24b8a1f6277810186581948c514", - "outfile": null, - "outfile_hash": null, - "stdout": "c-expr_01-28f449f.stdout", - "stdout_hash": "182f1a13f6ba0679a3107a8a9cc181130651a9f5d2f2acf7c382e431", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-expr_01-28f449f.stdout b/tests/reference/c-expr_01-28f449f.stdout deleted file mode 100644 index 817a7c4225..0000000000 --- a/tests/reference/c-expr_01-28f449f.stdout +++ /dev/null @@ -1,54 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y); -inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y); -void main0(); -void __main__global_stmts(); - - - -// Implementations -inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = x + y; - return _lpython_return_variable; -} - -inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = x&y; - return _lpython_return_variable; -} - -void main0() -{ - int32_t x; - int32_t y; - int32_t z; - x = (2 + 3)*5; - y = add(x, 2)*2; - ASSERT(x == 25); - ASSERT(y == 54); - z = and_op(x, y); - ASSERT(z == 16); -} - -void __main__global_stmts() -{ - main0(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-expr_11-c452314.json b/tests/reference/c-expr_11-c452314.json deleted file mode 100644 index b6c5580a8a..0000000000 --- a/tests/reference/c-expr_11-c452314.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-expr_11-c452314", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/expr_11.py", - "infile_hash": "d5027dd0f515c653c66202e02cc961bfbe09e628e069ce57b5f5ffe2", - "outfile": null, - "outfile_hash": null, - "stdout": "c-expr_11-c452314.stdout", - "stdout_hash": "2d6fe10d9189c578a5a20e042153115de54220d02a56baedc15efc31", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-expr_11-c452314.stdout b/tests/reference/c-expr_11-c452314.stdout deleted file mode 100644 index 9edc21adfe..0000000000 --- a/tests/reference/c-expr_11-c452314.stdout +++ /dev/null @@ -1,35 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -void f(); -void __main__global_stmts(); - - - -// Implementations -void f() -{ - bool b; - int32_t i; - i = 3; - b = (bool)(i); - ASSERT(b); - printf("%d\n", b); -} - -void __main__global_stmts() -{ - f(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-expr_12-93c7780.json b/tests/reference/c-expr_12-93c7780.json deleted file mode 100644 index 58f7ee190c..0000000000 --- a/tests/reference/c-expr_12-93c7780.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-expr_12-93c7780", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/expr_12.py", - "infile_hash": "00534ea8d2143408735ea96d7a26888e53563758c1b14569daf0f962", - "outfile": null, - "outfile_hash": null, - "stdout": "c-expr_12-93c7780.stdout", - "stdout_hash": "4cbfe2f301edb2e5df13058ec0ff1415277851ee8ffcdda264b2f239", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-expr_12-93c7780.stdout b/tests/reference/c-expr_12-93c7780.stdout deleted file mode 100644 index b8a29576cb..0000000000 --- a/tests/reference/c-expr_12-93c7780.stdout +++ /dev/null @@ -1,70 +0,0 @@ -#include - -#include -#include -#include -#include -#include - - -struct dimension_descriptor -{ - int32_t lower_bound, length; -}; - -struct i16 -{ - int16_t *data; - struct dimension_descriptor dims[32]; - int32_t n_dims; - bool is_allocated; -}; - -void g(struct i16* *x, struct i16* y); -void check(struct i16* *ptr); -void f(); -void __main__global_stmts(); - - - -// Implementations -void g(struct i16* *x, struct i16* y) -{ - y->data[(0 - y->dims[0].lower_bound)] = 1; - y->data[(1 - y->dims[0].lower_bound)] = 2; - (*x) = y; - printf("%d%s%d\n", (*x)->data[(0 - (*x)->dims[0].lower_bound)], " ", (*x)->data[(1 - (*x)->dims[0].lower_bound)]); -} - -void check(struct i16* *ptr) -{ - ASSERT((*ptr)->data[(0 - (*ptr)->dims[0].lower_bound)] == 1); - ASSERT((*ptr)->data[(1 - (*ptr)->dims[0].lower_bound)] == 2); -} - -void f() -{ - struct i16 y_value; - struct i16* y = &y_value; - int16_t y_data[2]; - y->data = y_data; - y->n_dims = 1; - y->dims[0].lower_bound = 0; - y->dims[0].length = 2; - struct i16 yptr1_value; - struct i16* yptr1 = &yptr1_value; - g(&yptr1, y); - check(&yptr1); -} - -void __main__global_stmts() -{ - f(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-func_static_01-fc146ec.json b/tests/reference/c-func_static_01-fc146ec.json deleted file mode 100644 index 237ebd35cc..0000000000 --- a/tests/reference/c-func_static_01-fc146ec.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-func_static_01-fc146ec", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/func_static_01.py", - "infile_hash": "073b018c3b06cdbf34c603363c53e12bf471a80c457aecc676316c29", - "outfile": null, - "outfile_hash": null, - "stdout": "c-func_static_01-fc146ec.stdout", - "stdout_hash": "ba4195c88f493b5e4d007ced548cd22bb7b12a7ba6a21df7526018bb", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-func_static_01-fc146ec.stdout b/tests/reference/c-func_static_01-fc146ec.stdout deleted file mode 100644 index 38379130dc..0000000000 --- a/tests/reference/c-func_static_01-fc146ec.stdout +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -static int64_t fib(int64_t n); -void main0(); -void __main__global_stmts(); - - - -// Implementations -static int64_t fib(int64_t n) -{ - int64_t _lpython_return_variable; - if (n < 2) { - _lpython_return_variable = n; - return _lpython_return_variable; - } - _lpython_return_variable = fib(n - 1) + fib(n - 2); - return _lpython_return_variable; -} - -void main0() -{ - int64_t ans; - int64_t x; - x = 5; - ans = fib(x); - ASSERT(ans == 5); -} - -void __main__global_stmts() -{ - main0(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-import_order_01-3ebf3c3.json b/tests/reference/c-import_order_01-3ebf3c3.json deleted file mode 100644 index 8a602aa1fc..0000000000 --- a/tests/reference/c-import_order_01-3ebf3c3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-import_order_01-3ebf3c3", - "cmd": "lpython --no-color --disable-main --show-c {infile}", - "infile": "tests/../integration_tests/import_order_01.py", - "infile_hash": "b6f67090973a5fce0778dbdd86fdb12272a8da5bbae2f50051df34e5", - "outfile": null, - "outfile_hash": null, - "stdout": "c-import_order_01-3ebf3c3.stdout", - "stdout_hash": "f3e4798c2ffb4df885977927d38d89b0354c812264ae40b4e7103ced", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-import_order_01-3ebf3c3.stdout b/tests/reference/c-import_order_01-3ebf3c3.stdout deleted file mode 100644 index 3a50069788..0000000000 --- a/tests/reference/c-import_order_01-3ebf3c3.stdout +++ /dev/null @@ -1,27 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -int32_t f(); - - - -// Implementations -int32_t f() -{ - int32_t _lpython_return_variable; - _lpython_return_variable = 42; - return _lpython_return_variable; -} - -void main1() -{ - int32_t a; - a = f(); - printf("%d\n", a); -} - diff --git a/tests/reference/c-loop1-3e341c7.json b/tests/reference/c-loop1-3e341c7.json deleted file mode 100644 index 35b5b1707a..0000000000 --- a/tests/reference/c-loop1-3e341c7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-loop1-3e341c7", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/loop1.py", - "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", - "outfile": null, - "outfile_hash": null, - "stdout": "c-loop1-3e341c7.stdout", - "stdout_hash": "c83616df972c7b3f966dab1ae3c339147a426324bd33890a9d13144e", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-loop1-3e341c7.stdout b/tests/reference/c-loop1-3e341c7.stdout deleted file mode 100644 index e1cd5ce5d1..0000000000 --- a/tests/reference/c-loop1-3e341c7.stdout +++ /dev/null @@ -1,85 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -int32_t test_factorial_1(int32_t x); -int32_t test_factorial_2(int32_t x); -int64_t test_factorial_3(int32_t x); -void main0(); -void __main__global_stmts(); - - - -// Implementations -int32_t test_factorial_1(int32_t x) -{ - int32_t _lpython_return_variable; - int32_t result; - if (x < 0) { - _lpython_return_variable = 0; - return _lpython_return_variable; - } - result = 1; - while (x > 0) { - result = result*x; - x = x - 1; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -int32_t test_factorial_2(int32_t x) -{ - int32_t _lpython_return_variable; - int32_t i; - int32_t result; - result = 1; - for (i=1; i<=x + 1 - 1; i++) { - result = result*i; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -int64_t test_factorial_3(int32_t x) -{ - int64_t _lpython_return_variable; - int64_t result; - result = 0; - if (x < 0) { - _lpython_return_variable = result; - return _lpython_return_variable; - } - result = 1; - while (x > 0) { - result = result*x; - x = x - 1; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -void main0() -{ - int32_t i; - int64_t j; - i = test_factorial_1(4); - i = test_factorial_2(4); - j = test_factorial_3(5); -} - -void __main__global_stmts() -{ - main0(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-loop4-eec10d3.json b/tests/reference/c-loop4-eec10d3.json deleted file mode 100644 index 3ee5448d4f..0000000000 --- a/tests/reference/c-loop4-eec10d3.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-loop4-eec10d3", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/loop4.py", - "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", - "outfile": null, - "outfile_hash": null, - "stdout": "c-loop4-eec10d3.stdout", - "stdout_hash": "8eea5321c1fd80c9bce62d443a5bc4709a5a9cfcb95fc38c8f369ce4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-loop4-eec10d3.stdout b/tests/reference/c-loop4-eec10d3.stdout deleted file mode 100644 index d273d2a9c5..0000000000 --- a/tests/reference/c-loop4-eec10d3.stdout +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -void test_for(); -void __main__global_stmts(); - - - -// Implementations -void test_for() -{ - int32_t i; - for (i=0; i<=10 - 1; i++) { - if (i == 0) { - continue; - } - if (i > 5) { - break; - } - if (i == 3) { - exit(0); - } - } -} - -void __main__global_stmts() -{ - test_for(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-print_01-4d44628.json b/tests/reference/c-print_01-4d44628.json deleted file mode 100644 index c19acd876f..0000000000 --- a/tests/reference/c-print_01-4d44628.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-print_01-4d44628", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/print_01.py", - "infile_hash": "4755131262f8eb382c206da769880635ad00787824c37f788d1c3d44", - "outfile": null, - "outfile_hash": null, - "stdout": "c-print_01-4d44628.stdout", - "stdout_hash": "618b140a8c12a6798b60e01373d930af2a8d6df85b5aed54227b3462", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-print_01-4d44628.stdout b/tests/reference/c-print_01-4d44628.stdout deleted file mode 100644 index 63b74c8211..0000000000 --- a/tests/reference/c-print_01-4d44628.stdout +++ /dev/null @@ -1,40 +0,0 @@ - -#include -#include -#include -#include -#include - -void f(); -void __main__global_stmts(); - - - -// Implementations -void f() -{ - char * x = NULL; - char * y = NULL; - printf("%s\n", "Hello World!"); - _lfortran_strcpy(&x, ",", 1); - _lfortran_strcpy(&y, "!!", 1); - printf("%s%s%s\n", "a", x, "b"); - _lfortran_strcpy(&x, "-+-+-", 1); - printf("%s%s%s%s%s\n", "a", x, "b", x, "c"); - printf("%s%s%s%s%s%s", "d", "=", "e", "=", "f", "+\n"); - printf("%s%s%s%s%s%s", "x", "*\n", "y", "*\n", "z", y); - printf("%s%s%s\n", "1", ":", "2"); - printf("%s%s%s\n", "LCompilers", " ", "LPython"); -} - -void __main__global_stmts() -{ - f(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-test_import_02-d2c54c4.json b/tests/reference/c-test_import_02-d2c54c4.json deleted file mode 100644 index dce151ed72..0000000000 --- a/tests/reference/c-test_import_02-d2c54c4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-test_import_02-d2c54c4", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/test_import_02.py", - "infile_hash": "cf2059987c7470ee617df897ed0d19906a9a8a94f05a5612570fce91", - "outfile": null, - "outfile_hash": null, - "stdout": "c-test_import_02-d2c54c4.stdout", - "stdout_hash": "dc4de2618a3ad2e6c3f4eaa2b203104e51758040bb1f2ab14d85ba3a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-test_import_02-d2c54c4.stdout b/tests/reference/c-test_import_02-d2c54c4.stdout deleted file mode 100644 index 0fdceff8c0..0000000000 --- a/tests/reference/c-test_import_02-d2c54c4.stdout +++ /dev/null @@ -1,53 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -int32_t add(int32_t x, int32_t y); -int32_t multiply(int32_t x, int32_t y); -void f(); -void __main__global_stmts(); - - - -// Implementations -const double μ = 1.45136923488338110e+00; -int32_t add(int32_t x, int32_t y) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = x + y; - return _lpython_return_variable; -} - -const double e = 2.71828182845904509e+00; -int32_t multiply(int32_t x, int32_t y) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = x*y; - return _lpython_return_variable; -} - -void f() -{ - printf("%lf\n", e); - printf("%lf\n", μ); - printf("%d\n", add(10, 20)); - printf("%d\n", multiply(10, 20)); - ASSERT(add(10, 20) == 30); - ASSERT(multiply(10, 20) == 200); -} - -void __main__global_stmts() -{ - f(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-test_issue_518-fbbd299.json b/tests/reference/c-test_issue_518-fbbd299.json deleted file mode 100644 index 329271b124..0000000000 --- a/tests/reference/c-test_issue_518-fbbd299.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-test_issue_518-fbbd299", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/test_issue_518.py", - "infile_hash": "9cf223e018e0affc76044dff23cb75157fbdca458be3ae68871da8db", - "outfile": null, - "outfile_hash": null, - "stdout": "c-test_issue_518-fbbd299.stdout", - "stdout_hash": "2140b84aa94533cf8a3cc994b6eefa42b22cb03615c99967a9e3b1e9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-test_issue_518-fbbd299.stdout b/tests/reference/c-test_issue_518-fbbd299.stdout deleted file mode 100644 index b5733123da..0000000000 --- a/tests/reference/c-test_issue_518-fbbd299.stdout +++ /dev/null @@ -1,55 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -int64_t fib(int64_t n); -void main0(); -void _xx_lcompilers_changed_main_xx(); -void __main__global_stmts(); - - - -// Implementations -int64_t fib(int64_t n) -{ - int64_t _lpython_return_variable; - if (n < 2) { - _lpython_return_variable = n; - return _lpython_return_variable; - } else { - _lpython_return_variable = fib(n - 1) + fib(n - 2); - return _lpython_return_variable; - } - return _lpython_return_variable; -} - -void main0() -{ - int64_t ans; - ans = fib(15); - ASSERT(ans == 610); -} - -void _xx_lcompilers_changed_main_xx() -{ - int64_t ans; - ans = fib(10); - ASSERT(ans == 55); -} - -void __main__global_stmts() -{ - main0(); - _xx_lcompilers_changed_main_xx(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/c-variable_decl_03-fa1823b.json b/tests/reference/c-variable_decl_03-fa1823b.json deleted file mode 100644 index 1060de968b..0000000000 --- a/tests/reference/c-variable_decl_03-fa1823b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "c-variable_decl_03-fa1823b", - "cmd": "lpython --no-color --show-c {infile}", - "infile": "tests/../integration_tests/variable_decl_03.py", - "infile_hash": "1e6bd54d3ca0db90eec540b68eff063ae2186d623cf0d64335b09cfe", - "outfile": null, - "outfile_hash": null, - "stdout": "c-variable_decl_03-fa1823b.stdout", - "stdout_hash": "b8397cdd7e8998d29574393db30b5638aedd2ecd34a596b8b1c29f7f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/c-variable_decl_03-fa1823b.stdout b/tests/reference/c-variable_decl_03-fa1823b.stdout deleted file mode 100644 index 7c25386e04..0000000000 --- a/tests/reference/c-variable_decl_03-fa1823b.stdout +++ /dev/null @@ -1,52 +0,0 @@ - -#include -#include -#include -#include -#include - -double _lcompilers_abs_f64(double x); -double f(); -void _xx_lcompilers_changed_main_xx(); -void __main__global_stmts(); - - - -// Implementations -double _lcompilers_abs_f64(double x) -{ - double _lcompilers_abs_f64; - if (x >= 0.00000000000000000e+00) { - _lcompilers_abs_f64 = x; - } else { - _lcompilers_abs_f64 = -x; - } - return _lcompilers_abs_f64; -} - -double f() -{ - double _lpython_return_variable; - _lpython_return_variable = 5.50000000000000000e+00; - return _lpython_return_variable; -} - -void _xx_lcompilers_changed_main_xx() -{ - double t1; - t1 = f()* 1.00000000000000000e+06; - printf("%lf\n", t1); - ASSERT(_lcompilers_abs_f64(t1 - 5.50000000000000000e+00* 1.00000000000000000e+06) <= 9.99999999999999955e-07); -} - -void __main__global_stmts() -{ - _xx_lcompilers_changed_main_xx(); -} - -int main(int argc, char* argv[]) -{ - _lpython_set_argv(argc, argv); - __main__global_stmts(); - return 0; -} diff --git a/tests/reference/cpp-assert1-ba60925.json b/tests/reference/cpp-assert1-ba60925.json deleted file mode 100644 index 9e0008db37..0000000000 --- a/tests/reference/cpp-assert1-ba60925.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-assert1-ba60925", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/assert1.py", - "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-assert1-ba60925.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-assert1-ba60925.stdout b/tests/reference/cpp-assert1-ba60925.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-assert1-ba60925.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.json b/tests/reference/cpp-doconcurrentloop_01-4e9f274.json deleted file mode 100644 index 740a0bcf97..0000000000 --- a/tests/reference/cpp-doconcurrentloop_01-4e9f274.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-doconcurrentloop_01-4e9f274", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/doconcurrentloop_01.py", - "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-doconcurrentloop_01-4e9f274.stdout", - "stdout_hash": "cef4c9a2fa79bd4f12c0842cc4cae9d0be7f1891b5c66ee6b229bb9f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout b/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout deleted file mode 100644 index ec2ad044bb..0000000000 --- a/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - - -struct dimension_descriptor -{ - int32_t lower_bound, length; -}; - -struct f32_10000_1 -{ - Kokkos::View* data; - dimension_descriptor dims[1]; - bool is_allocated; - - f32_10000_1(Kokkos::View* data_): data{data_} {}; -}; - -// Forward declarations -void __main__global_stmts(); -void main0(); - -template -void triad(T0* a, T1* b, float scalar, T2* c); -namespace { -} - -// Implementations - -template -void triad(T0* a, T1* b, float scalar, T2* c) -{ - int32_t N; - int32_t i; - N = a->data->extent(0); - Kokkos::parallel_for(Kokkos::RangePolicy(0, N - 1+1), KOKKOS_LAMBDA(const long i) { - c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); - }); -} - -void main0() -{ - Kokkos::View a_data("a_data", 10000); - f32_10000_1 a_value(&a_data); - f32_10000_1* a = &a_value; - a->dims[0].lower_bound = 0; - a->dims[0].length = 10000; - Kokkos::View b_data("b_data", 10000); - f32_10000_1 b_value(&b_data); - f32_10000_1* b = &b_value; - b->dims[0].lower_bound = 0; - b->dims[0].length = 10000; - Kokkos::View c_data("c_data", 10000); - f32_10000_1 c_value(&c_data); - f32_10000_1* c = &c_value; - c->dims[0].lower_bound = 0; - c->dims[0].length = 10000; - int32_t i; - int32_t nsize; - float scalar; - scalar = 1.00000000000000000e+01; - nsize = a->data->extent(0); - Kokkos::parallel_for(Kokkos::RangePolicy(0, nsize - 1+1), KOKKOS_LAMBDA(const long i) { - a->data->operator[](i - a->dims[0].lower_bound) = 5.00000000000000000e+00; - b->data->operator[](i - b->dims[0].lower_bound) = 5.00000000000000000e+00; - }); - triad(a, b, scalar, c); - std::cout << "End Stream Triad" << std::endl; -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr12-fd2ea87.json b/tests/reference/cpp-expr12-fd2ea87.json deleted file mode 100644 index abfda3e82e..0000000000 --- a/tests/reference/cpp-expr12-fd2ea87.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr12-fd2ea87", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr12.py", - "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr12-fd2ea87.stdout", - "stdout_hash": "3fd932aa8477bf21939c1376aa02973ffaa27249dded08685a4f8a27", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr12-fd2ea87.stdout b/tests/reference/cpp-expr12-fd2ea87.stdout deleted file mode 100644 index 55b3be2423..0000000000 --- a/tests/reference/cpp-expr12-fd2ea87.stdout +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -int32_t check(); -void main0(); -int32_t test(int32_t a, int32_t b); -namespace { -} - -// Implementations -int32_t test(int32_t a, int32_t b) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = std::pow(a, b); - return _lpython_return_variable; -} - -int32_t check() -{ - int32_t _lpython_return_variable; - int32_t a; - a = test(2, 2); - _lpython_return_variable = a; - return _lpython_return_variable; -} - -void main0() -{ - int32_t x; - x = check(); -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr15-1661c0d.json b/tests/reference/cpp-expr15-1661c0d.json deleted file mode 100644 index 812a9c4978..0000000000 --- a/tests/reference/cpp-expr15-1661c0d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr15-1661c0d", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr15.py", - "infile_hash": "f3fa7c8efa999392edc0a94ff9c7820ed0c3f1e849c77655151b8d72", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-expr15-1661c0d.stderr", - "stderr_hash": "abb193cadddd4745a52610eabc746e5facafefb220f85ba3310a7498", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr15-1661c0d.stderr b/tests/reference/cpp-expr15-1661c0d.stderr deleted file mode 100644 index 9b4deb20d2..0000000000 --- a/tests/reference/cpp-expr15-1661c0d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr15.py:11:9 - | -11 | x = complex(2, 2) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-expr2-09c05ad.json b/tests/reference/cpp-expr2-09c05ad.json deleted file mode 100644 index 7f2a65d8fe..0000000000 --- a/tests/reference/cpp-expr2-09c05ad.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr2-09c05ad", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr2.py", - "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr2-09c05ad.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr2-09c05ad.stdout b/tests/reference/cpp-expr2-09c05ad.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-expr2-09c05ad.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr5-1de0e30.json b/tests/reference/cpp-expr5-1de0e30.json deleted file mode 100644 index 0db3289f22..0000000000 --- a/tests/reference/cpp-expr5-1de0e30.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr5-1de0e30", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr5.py", - "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr5-1de0e30.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr5-1de0e30.stdout b/tests/reference/cpp-expr5-1de0e30.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-expr5-1de0e30.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr6-f337f4f.json b/tests/reference/cpp-expr6-f337f4f.json deleted file mode 100644 index 8115193f00..0000000000 --- a/tests/reference/cpp-expr6-f337f4f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr6-f337f4f", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr6.py", - "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr6-f337f4f.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr6-f337f4f.stdout b/tests/reference/cpp-expr6-f337f4f.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-expr6-f337f4f.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr7-529bd53.json b/tests/reference/cpp-expr7-529bd53.json deleted file mode 100644 index be1428115b..0000000000 --- a/tests/reference/cpp-expr7-529bd53.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr7-529bd53", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr7.py", - "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-expr7-529bd53.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr7-529bd53.stderr b/tests/reference/cpp-expr7-529bd53.stderr deleted file mode 100644 index d1b84ec030..0000000000 --- a/tests/reference/cpp-expr7-529bd53.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr7.py:4:13 - | -4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-expr8-704cece.json b/tests/reference/cpp-expr8-704cece.json deleted file mode 100644 index 5478fb2f70..0000000000 --- a/tests/reference/cpp-expr8-704cece.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr8-704cece", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr8.py", - "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-expr8-704cece.stderr", - "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr8-704cece.stderr b/tests/reference/cpp-expr8-704cece.stderr deleted file mode 100644 index 6e9d8d0f32..0000000000 --- a/tests/reference/cpp-expr8-704cece.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr8.py:22:13 - | -22 | x = i32(b1//b1) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-expr9-48868e9.json b/tests/reference/cpp-expr9-48868e9.json deleted file mode 100644 index ec3d6312dc..0000000000 --- a/tests/reference/cpp-expr9-48868e9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr9-48868e9", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/expr9.py", - "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr9-48868e9.stdout", - "stdout_hash": "8322420a1f1df346d89982ca461b6d08b67c2dab936e74d2a5f544f7", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr9-48868e9.stdout b/tests/reference/cpp-expr9-48868e9.stdout deleted file mode 100644 index 25c5d422e9..0000000000 --- a/tests/reference/cpp-expr9-48868e9.stdout +++ /dev/null @@ -1,82 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void main0(); -int32_t test_return_1(int32_t a); -std::string test_return_2(int32_t a); -int32_t test_return_3(int32_t a); -namespace { -} - -// Implementations -int32_t test_return_1(int32_t a) -{ - int32_t _lpython_return_variable; - int32_t x; - x = 5; - _lpython_return_variable = x; - return _lpython_return_variable; -} - -std::string test_return_2(int32_t a) -{ - std::string _lpython_return_variable; - std::string x; - x = "test"; - _lpython_return_variable = x; - return _lpython_return_variable; -} - -int32_t test_return_3(int32_t a) -{ - int32_t _lpython_return_variable; - _lpython_return_variable = a; - return _lpython_return_variable; -} - -void main0() -{ - int32_t i; - std::string s; - i = test_return_1(4); - s = test_return_2(4); - i = test_return_3(4); -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-expr_11-422c839.json b/tests/reference/cpp-expr_11-422c839.json deleted file mode 100644 index ab8387e398..0000000000 --- a/tests/reference/cpp-expr_11-422c839.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-expr_11-422c839", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/../integration_tests/expr_11.py", - "infile_hash": "d5027dd0f515c653c66202e02cc961bfbe09e628e069ce57b5f5ffe2", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-expr_11-422c839.stdout", - "stdout_hash": "c015d4446b89b36b010a37f5651e19ef8615ca00148c4ff51f8c5e3d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-expr_11-422c839.stdout b/tests/reference/cpp-expr_11-422c839.stdout deleted file mode 100644 index 82be5bfb91..0000000000 --- a/tests/reference/cpp-expr_11-422c839.stdout +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void f(); -namespace { -} - -// Implementations -void f() -{ - bool b; - int32_t i; - i = 3; - b = (bool)(i); - assert (b); - std::cout << b << std::endl; -} - -void __main__global_stmts() -{ - f(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-loop1-0a8cf3b.json b/tests/reference/cpp-loop1-0a8cf3b.json deleted file mode 100644 index 83fab1323b..0000000000 --- a/tests/reference/cpp-loop1-0a8cf3b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-loop1-0a8cf3b", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/loop1.py", - "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-loop1-0a8cf3b.stdout", - "stdout_hash": "47940a3d90ec65bad62ffb4a582149a8ed514e48071a45bb7eb3fe5b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-loop1-0a8cf3b.stdout b/tests/reference/cpp-loop1-0a8cf3b.stdout deleted file mode 100644 index 1b5b8dc1ff..0000000000 --- a/tests/reference/cpp-loop1-0a8cf3b.stdout +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void main0(); -int32_t test_factorial_1(int32_t x); -int32_t test_factorial_2(int32_t x); -int64_t test_factorial_3(int32_t x); -namespace { -} - -// Implementations -int32_t test_factorial_1(int32_t x) -{ - int32_t _lpython_return_variable; - int32_t result; - if (x < 0) { - _lpython_return_variable = 0; - return _lpython_return_variable; - } - result = 1; - while (x > 0) { - result = result*x; - x = x - 1; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -int32_t test_factorial_2(int32_t x) -{ - int32_t _lpython_return_variable; - int32_t i; - int32_t result; - result = 1; - for (i=1; i<=x + 1 - 1; i++) { - result = result*i; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -int64_t test_factorial_3(int32_t x) -{ - int64_t _lpython_return_variable; - int64_t result; - result = 0; - if (x < 0) { - _lpython_return_variable = result; - return _lpython_return_variable; - } - result = 1; - while (x > 0) { - result = result*x; - x = x - 1; - } - _lpython_return_variable = result; - return _lpython_return_variable; -} - -void main0() -{ - int32_t i; - int64_t j; - i = test_factorial_1(4); - i = test_factorial_2(4); - j = test_factorial_3(5); -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-loop3-6020091.json b/tests/reference/cpp-loop3-6020091.json deleted file mode 100644 index 8705b64cc5..0000000000 --- a/tests/reference/cpp-loop3-6020091.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-loop3-6020091", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/loop3.py", - "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-loop3-6020091.stdout", - "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-loop3-6020091.stdout b/tests/reference/cpp-loop3-6020091.stdout deleted file mode 100644 index ea744708f9..0000000000 --- a/tests/reference/cpp-loop3-6020091.stdout +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -namespace { -} - -// Implementations -namespace { - -void main2() { -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-loop4-cdb2174.json b/tests/reference/cpp-loop4-cdb2174.json deleted file mode 100644 index d5637d4b89..0000000000 --- a/tests/reference/cpp-loop4-cdb2174.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-loop4-cdb2174", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/loop4.py", - "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-loop4-cdb2174.stdout", - "stdout_hash": "a7a82cd77e9ab3cc7ed092234263ce57db724e0352d8bad31d090fcb", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-loop4-cdb2174.stdout b/tests/reference/cpp-loop4-cdb2174.stdout deleted file mode 100644 index 60b9ac1969..0000000000 --- a/tests/reference/cpp-loop4-cdb2174.stdout +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void test_for(); -namespace { -} - -// Implementations -void test_for() -{ - int32_t i; - for (i=0; i<=10 - 1; i++) { - if (i == 0) { - continue; - } - if (i > 5) { - break; - } - if (i == 3) { - exit(0); - } - } -} - -void __main__global_stmts() -{ - test_for(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-print_01-026ef17.json b/tests/reference/cpp-print_01-026ef17.json deleted file mode 100644 index c254ecab8d..0000000000 --- a/tests/reference/cpp-print_01-026ef17.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-print_01-026ef17", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/../integration_tests/print_01.py", - "infile_hash": "4755131262f8eb382c206da769880635ad00787824c37f788d1c3d44", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-print_01-026ef17.stdout", - "stdout_hash": "27da0159fcbc074b4527f6dc2ad9fbde547b888311fc5b92083eb0b9", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-print_01-026ef17.stdout b/tests/reference/cpp-print_01-026ef17.stdout deleted file mode 100644 index e8b8a9aba5..0000000000 --- a/tests/reference/cpp-print_01-026ef17.stdout +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void f(); -namespace { -} - -// Implementations -void f() -{ - std::string x; - std::string y; - std::cout << "Hello World!" << std::endl; - x = ","; - y = "!!"; - std::cout << "a" << x << "b" << std::endl; - x = "-+-+-"; - std::cout << "a" << x << "b" << x << "c" << std::endl; - std::cout << "d" << "=" << "e" << "=" << "f" << "+\n"; - std::cout << "x" << "*\n" << "y" << "*\n" << "z" << y; - std::cout << "1" << ":" << "2" << std::endl; - std::cout << "LCompilers" << " " << "LPython" << std::endl; -} - -void __main__global_stmts() -{ - f(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json deleted file mode 100644 index 346ddf6b70..0000000000 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-test_builtin_pow-56b3f92", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/../integration_tests/test_builtin_pow.py", - "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-test_builtin_pow-56b3f92.stderr", - "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr deleted file mode 100644 index e2d434b6f1..0000000000 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_pow.py:11:16 - | -11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-test_list_repeat2-698d7f4.json b/tests/reference/cpp-test_list_repeat2-698d7f4.json deleted file mode 100644 index dda23b2b21..0000000000 --- a/tests/reference/cpp-test_list_repeat2-698d7f4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-test_list_repeat2-698d7f4", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/../integration_tests/test_list_repeat2.py", - "infile_hash": "3f1fa9fd655b76efa451a83734ddc61af0a917090588ef53afe30b04", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-test_list_repeat2-698d7f4.stdout", - "stdout_hash": "b3979f6c5ea575cbbb0ae75fe566f811f6bb92aca2e698e6d0564326", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-test_list_repeat2-698d7f4.stdout b/tests/reference/cpp-test_list_repeat2-698d7f4.stdout deleted file mode 100644 index ec53d18482..0000000000 --- a/tests/reference/cpp-test_list_repeat2-698d7f4.stdout +++ /dev/null @@ -1,256 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - - -struct dimension_descriptor -{ - int32_t lower_bound, length; -}; - -struct list_r32 { - int32_t capacity; - int32_t current_end_point; - float* data; -}; - -inline bool compare_list_r32_(struct list_r32 a, struct list_r32 b); -inline bool compare_r32(float a, float b); -inline void print_list_r32_(struct list_r32 a); -inline void print_r32(float a); -inline void list_init_r32(struct list_r32* x, int32_t capacity); -inline void list_deepcopy_r32(struct list_r32* src, struct list_r32* dest); -inline void resize_if_needed_r32(struct list_r32* x); -inline void list_append_r32(struct list_r32* x, float element); -inline void list_insert_r32(struct list_r32* x, int pos, float element); -inline int list_find_item_r32(struct list_r32* x, float element); -inline void list_remove_r32(struct list_r32* x, float element); -inline void list_clear_r32(struct list_r32* x); -inline struct list_r32* list_concat_r32(struct list_r32* left, struct list_r32* right); -inline struct list_r32* list_repeat_r32(struct list_r32* x, int32_t freq); -inline struct list_r32* list_section_r32(struct list_r32* x, int32_t idx1, int32_t idx2, int32_t step, bool i1_present, bool i2_present); - -// Forward declarations -void __main__global_stmts(); -float add_list(struct list_r32 x); -struct list_r32 create_list(int32_t n); -void main0(); -namespace { -} - -// Implementations -struct list_r32 create_list(int32_t n) -{ - struct list_r32 _lpython_return_variable; - int32_t i; - struct list_r32 x; - struct list_r32 constname0; - list_init_r32(&constname0, 1); - constname0.data[0] = 0.00000000000000000e+00; - constname0.current_end_point = 1; - list_deepcopy_r32(&(*list_repeat_r32(&constname0, n)), &x); - - for (i=0; i<=n - 1; i++) { - x.data[i] = (float)(i); - } - list_deepcopy_r32(&x, &_lpython_return_variable); - - return _lpython_return_variable; -} - -float add_list(struct list_r32 x) -{ - float _lpython_return_variable; - int32_t i; - float sum; - sum = 0.00000000000000000e+00; - for (i=0; i<=x.current_end_point - 1; i++) { - sum = sum + x.data[i]; - } - _lpython_return_variable = sum; - return _lpython_return_variable; -} - -void main0() -{ - struct list_r32 x; - struct list_r32 constname01 = create_list(10); - list_deepcopy_r32(&constname01, &x); - - std::cout << add_list(x) << std::endl; -} - -void __main__global_stmts() -{ - main0(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} - -bool compare_r32(float a, float b) { - return a == b; -} - -bool compare_list_r32_(struct list_r32 a, struct list_r32 b) { - if (a.current_end_point != b.current_end_point) - return false; - for (int i=0; icapacity = capacity; - x->current_end_point = 0; - x->data = (float*) malloc(capacity * sizeof(float)); -} - -void list_deepcopy_r32(struct list_r32* src, struct list_r32* dest) { - dest->capacity = src->capacity; - dest->current_end_point = src->current_end_point; - dest->data = (float*) malloc(src->capacity * sizeof(float)); - memcpy(dest->data, src->data, src->capacity * sizeof(float)); -} - -void resize_if_needed_r32(struct list_r32* x) { - if (x->capacity == x->current_end_point) { - x->capacity = 2 * x->capacity + 1; - x->data = (float*) realloc(x->data, x->capacity * sizeof(float)); - } -} - -void list_append_r32(struct list_r32* x, float element) { - resize_if_needed_r32(x); - x->data[x->current_end_point] = element; - x->current_end_point += 1; -} - -void list_insert_r32(struct list_r32* x, int pos, float element) { - resize_if_needed_r32(x); - int pos_ptr = pos; - float tmp_ptr = x->data[pos]; - float tmp; - while (x->current_end_point > pos_ptr) { - tmp = x->data[pos_ptr + 1]; - x->data[pos_ptr + 1] = tmp_ptr; - tmp_ptr = tmp; - pos_ptr++; - } - - x->data[pos] = element; - x->current_end_point += 1; -} - -int list_find_item_r32(struct list_r32* x, float element) { - int el_pos = 0; - while (x->current_end_point > el_pos) { - if (compare_r32(x->data[el_pos], element)) return el_pos; - el_pos++; - } - return -1; -} - -void list_remove_r32(struct list_r32* x, float element) { - int el_pos = list_find_item_r32(x, element); - while (x->current_end_point > el_pos) { - int tmp = el_pos + 1; - x->data[el_pos] = x->data[tmp]; - el_pos = tmp; - } - x->current_end_point -= 1; -} - -void list_clear_r32(struct list_r32* x) { - free(x->data); - x->capacity = 4; - x->current_end_point = 0; - x->data = (float*) malloc(x->capacity * sizeof(float)); -} - -struct list_r32* list_concat_r32(struct list_r32* left, struct list_r32* right) { - struct list_r32 *result = (struct list_r32*)malloc(sizeof(struct list_r32)); - list_init_r32(result, left->current_end_point + right->current_end_point); - memcpy(result->data, left->data, left->current_end_point * sizeof(float)); - memcpy(result->data + left->current_end_point, right->data, right->current_end_point * sizeof(float)); - result->current_end_point = left->current_end_point + right->current_end_point; - return result; -} - -struct list_r32* list_repeat_r32(struct list_r32* x, int32_t freq) { - struct list_r32 *result = (struct list_r32*)malloc(sizeof(struct list_r32)); - list_init_r32(result, x->current_end_point * freq); - for (int i=0; idata[i*x->current_end_point], x->data, x->current_end_point * sizeof(float)); - } - result->current_end_point = x->current_end_point * freq; - return result; -} - -struct list_r32* list_section_r32(struct list_r32* x, int32_t idx1, int32_t idx2, int32_t step, bool i1_present, bool i2_present) { - int s_len = x->current_end_point; - if (step == 0) { - printf("slice step cannot be zero"); - exit(1); - } - idx1 = idx1 < 0 ? idx1 + s_len : idx1; - idx2 = idx2 < 0 ? idx2 + s_len : idx2; - idx1 = i1_present ? idx1 : (step > 0 ? 0 : s_len-1); - idx2 = i2_present ? idx2 : (step > 0 ? s_len : -1); - idx2 = step > 0 ? (idx2 > s_len ? s_len : idx2) : idx2; - idx1 = step < 0 ? (idx1 >= s_len ? s_len-1 : idx1) : idx1; - struct list_r32 *__tmp = (struct list_r32*) malloc(sizeof(struct list_r32)); - list_init_r32(__tmp, 4); - int s_i = idx1; - while((step > 0 && s_i >= idx1 && s_i < idx2) || - (step < 0 && s_i <= idx1 && s_i > idx2)) { - list_append_r32(__tmp, x->data[s_i]); - s_i+=step; - } - return __tmp; -} - - diff --git a/tests/reference/cpp-test_unary_op_03-fd9669a.json b/tests/reference/cpp-test_unary_op_03-fd9669a.json deleted file mode 100644 index b09b2a94a3..0000000000 --- a/tests/reference/cpp-test_unary_op_03-fd9669a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "cpp-test_unary_op_03-fd9669a", - "cmd": "lpython --no-color --show-cpp {infile}", - "infile": "tests/../integration_tests/test_unary_op_03.py", - "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", - "outfile": null, - "outfile_hash": null, - "stdout": "cpp-test_unary_op_03-fd9669a.stdout", - "stdout_hash": "50205765dbafb525c90c7551a7217ca5b5c197047dfe471ffd2f4dec", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/cpp-test_unary_op_03-fd9669a.stdout b/tests/reference/cpp-test_unary_op_03-fd9669a.stdout deleted file mode 100644 index 1f8faa116b..0000000000 --- a/tests/reference/cpp-test_unary_op_03-fd9669a.stdout +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -Kokkos::View from_std_vector(const std::vector &v) -{ - Kokkos::View r("r", v.size()); - for (size_t i=0; i < v.size(); i++) { - r(i) = v[i]; - } - return r; -} - -// Forward declarations -void __main__global_stmts(); -void f(); -namespace { -} - -// Implementations -void f() -{ - int32_t i; - int32_t res; - i = 5; - res = ~i; - assert (res == -6); - i = -235346; - assert (~i == 235345); -} - -void __main__global_stmts() -{ - f(); -} - -namespace { - -void main2() { - __main__global_stmts(); -} - -} -int main(int argc, char* argv[]) -{ - Kokkos::initialize(argc, argv); - main2(); - Kokkos::finalize(); - return 0; -} diff --git a/tests/reference/llvm-assert1-8df4f31.json b/tests/reference/llvm-assert1-8df4f31.json deleted file mode 100644 index f7af1f27c3..0000000000 --- a/tests/reference/llvm-assert1-8df4f31.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-assert1-8df4f31", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/assert1.py", - "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-assert1-8df4f31.stdout", - "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-assert1-8df4f31.stdout b/tests/reference/llvm-assert1-8df4f31.stdout deleted file mode 100644 index 084a225695..0000000000 --- a/tests/reference/llvm-assert1-8df4f31.stdout +++ /dev/null @@ -1,10 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-bindc_01-c984f09.json b/tests/reference/llvm-bindc_01-c984f09.json deleted file mode 100644 index b8bf60feb9..0000000000 --- a/tests/reference/llvm-bindc_01-c984f09.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-bindc_01-c984f09", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/../integration_tests/bindc_01.py", - "infile_hash": "3cfb601d3294c470842a85777832f5582ab52cb5bd64c0e02d40deb6", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-bindc_01-c984f09.stdout", - "stdout_hash": "36302aceabcf2682f3e954ab4bc56dd960fe532dc7799cb58baa19a3", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-bindc_01-c984f09.stdout b/tests/reference/llvm-bindc_01-c984f09.stdout deleted file mode 100644 index 16f056eec7..0000000000 --- a/tests/reference/llvm-bindc_01-c984f09.stdout +++ /dev/null @@ -1,81 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@queries = global void* null -@x = global i16* null -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [13 x i8] c"%lld%s%lld%s\00", align 1 -@3 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 -@4 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - %0 = load void*, void** @queries, align 8 - %1 = bitcast void* %0 to i16* - store i16* %1, i16** @x, align 8 - %2 = load void*, void** @queries, align 8 - %3 = ptrtoint void* %2 to i64 - %4 = load i16*, i16** @x, align 8 - %5 = ptrtoint i16* %4 to i64 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @2, i32 0, i32 0), i64 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - call void @__module___main___test_issue_1781() - br label %return - -return: ; preds = %.entry - ret void -} - -define void @__module___main___test_issue_1781() { -.entry: - %p = alloca void*, align 8 - store void* null, void** %p, align 8 - %0 = load void*, void** %p, align 8 - %1 = ptrtoint void* %0 to i64 - %2 = icmp eq i64 %1, 0 - br i1 %2, label %then, label %else - -then: ; preds = %.entry - br label %ifcont - -else: ; preds = %.entry - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @3, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont - -ifcont: ; preds = %else, %then - %3 = load void*, void** %p, align 8 - %4 = ptrtoint void* %3 to i64 - %5 = icmp ne i64 %4, 0 - %6 = xor i1 %5, true - br i1 %6, label %then1, label %else2 - -then1: ; preds = %ifcont - br label %ifcont3 - -else2: ; preds = %ifcont - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @4, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont3 - -ifcont3: ; preds = %else2, %then1 - br label %return - -return: ; preds = %ifcont3 - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -declare void @_lcompilers_print_error(i8*, ...) - -declare void @exit(i32) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-bool1-af4376b.json b/tests/reference/llvm-bool1-af4376b.json deleted file mode 100644 index 8a924e4972..0000000000 --- a/tests/reference/llvm-bool1-af4376b.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-bool1-af4376b", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/bool1.py", - "infile_hash": "f61ed4d1f164753f9f78f63957d4faf040bcd6099e18dbf3e32cf7d5", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-bool1-af4376b.stdout", - "stdout_hash": "cb60cdc2beb220bbe693b54079b5ebc7efcdc2cdc830c3cc0e213c39", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-bool1-af4376b.stdout b/tests/reference/llvm-bool1-af4376b.stdout deleted file mode 100644 index 67423eab3e..0000000000 --- a/tests/reference/llvm-bool1-af4376b.stdout +++ /dev/null @@ -1,64 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [6 x i8] c"False\00", align 1 -@3 = private unnamed_addr constant [5 x i8] c"True\00", align 1 -@4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 -@5 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@7 = private unnamed_addr constant [6 x i8] c"False\00", align 1 -@8 = private unnamed_addr constant [5 x i8] c"True\00", align 1 -@9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 -@10 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@11 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@12 = private unnamed_addr constant [6 x i8] c"False\00", align 1 -@13 = private unnamed_addr constant [5 x i8] c"True\00", align 1 -@14 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 -@15 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@17 = private unnamed_addr constant [6 x i8] c"False\00", align 1 -@18 = private unnamed_addr constant [5 x i8] c"True\00", align 1 -@19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - call void @__module___main___test_bool() - br label %return - -return: ; preds = %.entry - ret void -} - -define void @__module___main___test_bool() { -.entry: - %b = alloca i1, align 1 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) - store i1 true, i1* %b, align 1 - %0 = load i1, i1* %b, align 1 - %1 = icmp eq i1 %0, false - %2 = select i1 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0) - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @14, i32 0, i32 0), i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @11, i32 0, i32 0)) - store i1 false, i1* %b, align 1 - %3 = load i1, i1* %b, align 1 - %4 = icmp eq i1 %3, false - %5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0) - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) - br label %return - -return: ; preds = %.entry - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-expr14-b96b5b1.json b/tests/reference/llvm-expr14-b96b5b1.json deleted file mode 100644 index a3c6d2f1be..0000000000 --- a/tests/reference/llvm-expr14-b96b5b1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-expr14-b96b5b1", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/expr14.py", - "infile_hash": "d18abc152939c944f6a1e493754cea8b72f0d03d360ab4c9e75ad697", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-expr14-b96b5b1.stdout", - "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-expr14-b96b5b1.stdout b/tests/reference/llvm-expr14-b96b5b1.stdout deleted file mode 100644 index 084a225695..0000000000 --- a/tests/reference/llvm-expr14-b96b5b1.stdout +++ /dev/null @@ -1,10 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-expr_01-54467c1.json b/tests/reference/llvm-expr_01-54467c1.json deleted file mode 100644 index f3c32d129d..0000000000 --- a/tests/reference/llvm-expr_01-54467c1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-expr_01-54467c1", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/expr_01.py", - "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-expr_01-54467c1.stdout", - "stdout_hash": "8018bddb16bb05f28f77e84b0c4bb63a5515c75d5fee087543a243b5", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-expr_01-54467c1.stdout b/tests/reference/llvm-expr_01-54467c1.stdout deleted file mode 100644 index 1eb63578bf..0000000000 --- a/tests/reference/llvm-expr_01-54467c1.stdout +++ /dev/null @@ -1,41 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - call void @__module___main___main0() - br label %return - -return: ; preds = %.entry - ret void -} - -define void @__module___main___main0() { -.entry: - %x = alloca i32, align 4 - %x2 = alloca i64, align 8 - %y = alloca float, align 4 - %y2 = alloca double, align 8 - store i32 25, i32* %x, align 4 - %0 = load i32, i32* %x, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - br label %return - -return: ; preds = %.entry - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-func_inline_01-2d4583a.json b/tests/reference/llvm-func_inline_01-2d4583a.json deleted file mode 100644 index 075a1dfc5f..0000000000 --- a/tests/reference/llvm-func_inline_01-2d4583a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-func_inline_01-2d4583a", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/../integration_tests/func_inline_01.py", - "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-func_inline_01-2d4583a.stdout", - "stdout_hash": "a91f2155136dbc019a41e5b1006d9b4a9e1f7def08086e307aafd15c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-func_inline_01-2d4583a.stdout b/tests/reference/llvm-func_inline_01-2d4583a.stdout deleted file mode 100644 index ec43646d47..0000000000 --- a/tests/reference/llvm-func_inline_01-2d4583a.stdout +++ /dev/null @@ -1,100 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [7 x i8] c"%lld%s\00", align 1 -@3 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - call void @__module___main____xx_lcompilers_changed_main_xx() - br label %return - -return: ; preds = %.entry - ret void -} - -define i64 @__module___main___fib(i64* %n) { -.entry: - %call_arg_value1 = alloca i64, align 8 - %call_arg_value = alloca i64, align 8 - %_lpython_return_variable = alloca i64, align 8 - %0 = load i64, i64* %n, align 4 - %1 = icmp slt i64 %0, 2 - br i1 %1, label %then, label %else - -then: ; preds = %.entry - %2 = load i64, i64* %n, align 4 - store i64 %2, i64* %_lpython_return_variable, align 4 - br label %return - -unreachable_after_return: ; No predecessors! - br label %ifcont - -else: ; preds = %.entry - br label %ifcont - -ifcont: ; preds = %else, %unreachable_after_return - %3 = load i64, i64* %n, align 4 - %4 = sub i64 %3, 1 - store i64 %4, i64* %call_arg_value, align 4 - %5 = call i64 @__module___main___fib(i64* %call_arg_value) - %6 = load i64, i64* %n, align 4 - %7 = sub i64 %6, 2 - store i64 %7, i64* %call_arg_value1, align 4 - %8 = call i64 @__module___main___fib(i64* %call_arg_value1) - %9 = add i64 %5, %8 - store i64 %9, i64* %_lpython_return_variable, align 4 - br label %return - -unreachable_after_return2: ; No predecessors! - br label %return - -return: ; preds = %unreachable_after_return2, %ifcont, %then - %10 = load i64, i64* %_lpython_return_variable, align 4 - ret i64 %10 -} - -define void @__module___main____xx_lcompilers_changed_main_xx() { -.entry: - %ans = alloca i64, align 8 - %x = alloca i64, align 8 - store i64 40, i64* %x, align 4 - %0 = call i64 @__module___main___fib(i64* %x) - store i64 %0, i64* %ans, align 4 - %1 = load i64, i64* %ans, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i32 0, i32 0), i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - %2 = load i64, i64* %ans, align 4 - %3 = icmp eq i64 %2, 102334155 - br i1 %3, label %then, label %else - -then: ; preds = %.entry - br label %ifcont - -else: ; preds = %.entry - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @3, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont - -ifcont: ; preds = %else, %then - br label %return - -return: ; preds = %ifcont - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -declare void @_lcompilers_print_error(i8*, ...) - -declare void @exit(i32) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-lpython1-23c5987.json b/tests/reference/llvm-lpython1-23c5987.json deleted file mode 100644 index 326c58af5a..0000000000 --- a/tests/reference/llvm-lpython1-23c5987.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-lpython1-23c5987", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/lpython1.py", - "infile_hash": "195a467b66705e0f2638aee8c8a6e9145112b2964e05896c328e0d86", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-lpython1-23c5987.stdout", - "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-lpython1-23c5987.stdout b/tests/reference/llvm-lpython1-23c5987.stdout deleted file mode 100644 index 084a225695..0000000000 --- a/tests/reference/llvm-lpython1-23c5987.stdout +++ /dev/null @@ -1,10 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-print_04-443a8d8.json b/tests/reference/llvm-print_04-443a8d8.json deleted file mode 100644 index 6edad74b2a..0000000000 --- a/tests/reference/llvm-print_04-443a8d8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-print_04-443a8d8", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/../integration_tests/print_04.py", - "infile_hash": "88affcdc1013b979debbf8b47a481909670b62c91fc5963af42c2495", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-print_04-443a8d8.stdout", - "stdout_hash": "5fd7d7df606b54cd4d8304825a94448d366762055fdc5de73c61738c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-print_04-443a8d8.stdout b/tests/reference/llvm-print_04-443a8d8.stdout deleted file mode 100644 index 520f8a3d65..0000000000 --- a/tests/reference/llvm-print_04-443a8d8.stdout +++ /dev/null @@ -1,46 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@u = global i64 -922337203685477580 -@x = global i32 -2147483648 -@y = global i16 -32768 -@z = global i8 -128 -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [7 x i8] c"%lld%s\00", align 1 -@3 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@5 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 -@6 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@7 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@8 = private unnamed_addr constant [6 x i8] c"%hi%s\00", align 1 -@9 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@11 = private unnamed_addr constant [7 x i8] c"%hhi%s\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - %0 = load i64, i64* @u, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i32 0, i32 0), i64 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - %1 = load i32, i32* @x, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) - %2 = load i16, i16* @y, align 2 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @8, i32 0, i32 0), i16 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @7, i32 0, i32 0)) - %3 = load i8, i8* @z, align 1 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @11, i32 0, i32 0), i8 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) - br label %return - -return: ; preds = %.entry - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-structs_11-09fea6a.json b/tests/reference/llvm-structs_11-09fea6a.json deleted file mode 100644 index 861941353b..0000000000 --- a/tests/reference/llvm-structs_11-09fea6a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-structs_11-09fea6a", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/structs_11.py", - "infile_hash": "9cb6c80ad837ba66472a91b22e9068ec439b6a2a179a452d90d84c78", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-structs_11-09fea6a.stdout", - "stdout_hash": "c6cdeacf6cdb7b9a5e68d2263a28585e68ec51e11f544fd366eac428", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-structs_11-09fea6a.stdout b/tests/reference/llvm-structs_11-09fea6a.stdout deleted file mode 100644 index c72ba9709d..0000000000 --- a/tests/reference/llvm-structs_11-09fea6a.stdout +++ /dev/null @@ -1,45 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -%Bar = type { %Foo } -%Foo = type { i32 } - -@bar = global %Bar zeroinitializer -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 -@3 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@5 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 - -define void @__module___main_____main__global_init() { -.entry: - br label %return - -return: ; preds = %.entry - ret void -} - -define void @__module___main_____main__global_stmts() { -.entry: - %0 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - %1 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) - br label %return - -return: ; preds = %.entry - ret void -} - -declare void @_lfortran_printf(i8*, ...) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_init() - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-test_issue_518-cdb641a.json b/tests/reference/llvm-test_issue_518-cdb641a.json deleted file mode 100644 index e11cc83f6d..0000000000 --- a/tests/reference/llvm-test_issue_518-cdb641a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-test_issue_518-cdb641a", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_issue_518.py", - "infile_hash": "9cf223e018e0affc76044dff23cb75157fbdca458be3ae68871da8db", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-test_issue_518-cdb641a.stdout", - "stdout_hash": "61bea2762ce630ed6295649a1653e608a77cc1165f7575d28fdfefd1", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-test_issue_518-cdb641a.stdout b/tests/reference/llvm-test_issue_518-cdb641a.stdout deleted file mode 100644 index 00236ee26f..0000000000 --- a/tests/reference/llvm-test_issue_518-cdb641a.stdout +++ /dev/null @@ -1,121 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 -@1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - call void @__module___main___main0() - call void @__module___main____xx_lcompilers_changed_main_xx() - br label %return - -return: ; preds = %.entry - ret void -} - -define i64 @__module___main___fib(i64* %n) { -.entry: - %call_arg_value1 = alloca i64, align 8 - %call_arg_value = alloca i64, align 8 - %_lpython_return_variable = alloca i64, align 8 - %0 = load i64, i64* %n, align 4 - %1 = icmp slt i64 %0, 2 - br i1 %1, label %then, label %else - -then: ; preds = %.entry - %2 = load i64, i64* %n, align 4 - store i64 %2, i64* %_lpython_return_variable, align 4 - br label %return - -unreachable_after_return: ; No predecessors! - br label %ifcont - -else: ; preds = %.entry - %3 = load i64, i64* %n, align 4 - %4 = sub i64 %3, 1 - store i64 %4, i64* %call_arg_value, align 4 - %5 = call i64 @__module___main___fib(i64* %call_arg_value) - %6 = load i64, i64* %n, align 4 - %7 = sub i64 %6, 2 - store i64 %7, i64* %call_arg_value1, align 4 - %8 = call i64 @__module___main___fib(i64* %call_arg_value1) - %9 = add i64 %5, %8 - store i64 %9, i64* %_lpython_return_variable, align 4 - br label %return - -unreachable_after_return2: ; No predecessors! - br label %ifcont - -ifcont: ; preds = %unreachable_after_return2, %unreachable_after_return - br label %return - -return: ; preds = %ifcont, %else, %then - %10 = load i64, i64* %_lpython_return_variable, align 4 - ret i64 %10 -} - -define void @__module___main____xx_lcompilers_changed_main_xx() { -.entry: - %call_arg_value = alloca i64, align 8 - %ans = alloca i64, align 8 - store i64 10, i64* %call_arg_value, align 4 - %0 = call i64 @__module___main___fib(i64* %call_arg_value) - store i64 %0, i64* %ans, align 4 - %1 = load i64, i64* %ans, align 4 - %2 = icmp eq i64 %1, 55 - br i1 %2, label %then, label %else - -then: ; preds = %.entry - br label %ifcont - -else: ; preds = %.entry - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @0, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont - -ifcont: ; preds = %else, %then - br label %return - -return: ; preds = %ifcont - ret void -} - -define void @__module___main___main0() { -.entry: - %call_arg_value = alloca i64, align 8 - %ans = alloca i64, align 8 - store i64 15, i64* %call_arg_value, align 4 - %0 = call i64 @__module___main___fib(i64* %call_arg_value) - store i64 %0, i64* %ans, align 4 - %1 = load i64, i64* %ans, align 4 - %2 = icmp eq i64 %1, 610 - br i1 %2, label %then, label %else - -then: ; preds = %.entry - br label %ifcont - -else: ; preds = %.entry - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont - -ifcont: ; preds = %else, %then - br label %return - -return: ; preds = %ifcont - ret void -} - -declare void @_lcompilers_print_error(i8*, ...) - -declare void @exit(i32) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-test_unary_op_03-046fb86.json b/tests/reference/llvm-test_unary_op_03-046fb86.json deleted file mode 100644 index d6390dde20..0000000000 --- a/tests/reference/llvm-test_unary_op_03-046fb86.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm-test_unary_op_03-046fb86", - "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", - "infile": "tests/../integration_tests/test_unary_op_03.py", - "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm-test_unary_op_03-046fb86.stdout", - "stdout_hash": "1e9e596b5383d76430007e2e89893f64e5b07c21d46edeea5bd5acba", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm-test_unary_op_03-046fb86.stdout b/tests/reference/llvm-test_unary_op_03-046fb86.stdout deleted file mode 100644 index f460174a28..0000000000 --- a/tests/reference/llvm-test_unary_op_03-046fb86.stdout +++ /dev/null @@ -1,69 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 -@1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 - -define void @__module___main_____main__global_stmts() { -.entry: - call void @__module___main___f() - br label %return - -return: ; preds = %.entry - ret void -} - -define void @__module___main___f() { -.entry: - %i = alloca i32, align 4 - %res = alloca i32, align 4 - store i32 5, i32* %i, align 4 - %0 = load i32, i32* %i, align 4 - %1 = xor i32 %0, -1 - store i32 %1, i32* %res, align 4 - %2 = load i32, i32* %res, align 4 - %3 = icmp eq i32 %2, -6 - br i1 %3, label %then, label %else - -then: ; preds = %.entry - br label %ifcont - -else: ; preds = %.entry - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @0, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont - -ifcont: ; preds = %else, %then - store i32 -235346, i32* %i, align 4 - %4 = load i32, i32* %i, align 4 - %5 = xor i32 %4, -1 - %6 = icmp eq i32 %5, 235345 - br i1 %6, label %then1, label %else2 - -then1: ; preds = %ifcont - br label %ifcont3 - -else2: ; preds = %ifcont - call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i32 0, i32 0)) - call void @exit(i32 1) - br label %ifcont3 - -ifcont3: ; preds = %else2, %then1 - br label %return - -return: ; preds = %ifcont3 - ret void -} - -declare void @_lcompilers_print_error(i8*, ...) - -declare void @exit(i32) - -define i32 @main(i32 %0, i8** %1) { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1) - call void @__module___main_____main__global_stmts() - ret i32 0 -} - -declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.json b/tests/reference/llvm_dbg-expr_01-9fc5f30.json deleted file mode 100644 index c139101c1d..0000000000 --- a/tests/reference/llvm_dbg-expr_01-9fc5f30.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "llvm_dbg-expr_01-9fc5f30", - "cmd": "lpython --no-color --show-llvm -g --debug-with-line-column {infile} -o {outfile}", - "infile": "tests/expr_01.py", - "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", - "outfile": null, - "outfile_hash": null, - "stdout": "llvm_dbg-expr_01-9fc5f30.stdout", - "stdout_hash": "f5424d14e2553fd4ea59a66c0d1560e435f0871cdfc5250f6a5df57d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout b/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout deleted file mode 100644 index c942af4f3a..0000000000 --- a/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout +++ /dev/null @@ -1,79 +0,0 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" - -@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 -@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 -@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 - -define void @__module___main_____main__global_stmts() !dbg !3 { -.entry: - call void @__module___main___main0(), !dbg !6 - br label %return, !dbg !6 - -return: ; preds = %.entry - ret void, !dbg !6 -} - -define void @__module___main___main0() !dbg !7 { -.entry: - %x = alloca i32, align 4, !dbg !8 - call void @llvm.dbg.declare(metadata i32* %x, metadata !9, metadata !DIExpression()), !dbg !11 - %x2 = alloca i64, align 8 - call void @llvm.dbg.declare(metadata i64* %x2, metadata !12, metadata !DIExpression()), !dbg !14 - %y = alloca float, align 4 - call void @llvm.dbg.declare(metadata float* %y, metadata !15, metadata !DIExpression()), !dbg !17 - %y2 = alloca double, align 8 - call void @llvm.dbg.declare(metadata double* %y2, metadata !18, metadata !DIExpression()), !dbg !20 - store i32 25, i32* %x, align 4, !dbg !21 - %0 = load i32, i32* %x, align 4, !dbg !21 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)), !dbg !21 - br label %return, !dbg !21 - -return: ; preds = %.entry - ret void, !dbg !21 -} - -; Function Attrs: nounwind readnone speculatable willreturn -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -declare void @_lfortran_printf(i8*, ...) - -define i32 @main(i32 %0, i8** %1) !dbg !22 { -.entry: - call void @_lpython_set_argv(i32 %0, i8** %1), !dbg !25 - call void @__module___main_____main__global_stmts(), !dbg !25 - ret i32 0, !dbg !25 -} - -declare void @_lpython_set_argv(i32, i8**) - -attributes #0 = { nounwind readnone speculatable willreturn } - -!llvm.dbg.cu = !{!0} - -!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "LPython Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) -!1 = !DIFile(filename: "tests/expr_01.py", directory: ".") -!2 = !{} -!3 = distinct !DISubprogram(name: "__main__global_stmts", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!4 = !DISubroutineType(types: !5) -!5 = !{null} -!6 = !DILocation(line: 9, column: 1, scope: !3) -!7 = distinct !DISubprogram(name: "main0", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!8 = !DILocation(line: 1, column: 1, scope: !7) -!9 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 2, type: !10) -!10 = !DIBasicType(name: "integer", size: 32, encoding: DW_ATE_signed) -!11 = !DILocation(line: 2, scope: !7) -!12 = !DILocalVariable(name: "x2", arg: 2, scope: !7, file: !1, line: 3, type: !13) -!13 = !DIBasicType(name: "integer", size: 64, encoding: DW_ATE_signed) -!14 = !DILocation(line: 3, scope: !7) -!15 = !DILocalVariable(name: "y", arg: 3, scope: !7, file: !1, line: 4, type: !16) -!16 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) -!17 = !DILocation(line: 4, scope: !7) -!18 = !DILocalVariable(name: "y2", arg: 4, scope: !7, file: !1, line: 5, type: !19) -!19 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) -!20 = !DILocation(line: 5, scope: !7) -!21 = !DILocation(line: 6, column: 5, scope: !7) -!22 = distinct !DISubprogram(name: "main_program", scope: !1, file: !1, line: 1, type: !23, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) -!23 = !DISubroutineType(types: !24) -!24 = !{!10} -!25 = !DILocation(line: 1, column: 1, scope: !22) diff --git a/tests/reference/pass_class_constructor-structs_16-5e3508f.json b/tests/reference/pass_class_constructor-structs_16-5e3508f.json deleted file mode 100644 index 62901bd56c..0000000000 --- a/tests/reference/pass_class_constructor-structs_16-5e3508f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "pass_class_constructor-structs_16-5e3508f", - "cmd": "lpython --cumulative --pass=class_constructor --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/structs_16.py", - "infile_hash": "e87ea0ba10cb7fcd6ce2eb6d2e953a26dcd6a843f6cf4e891287dcb1", - "outfile": null, - "outfile_hash": null, - "stdout": "pass_class_constructor-structs_16-5e3508f.stdout", - "stdout_hash": "74b7cad17c2d6f7774e930e8a24b9bf35ca37425c7a3fa6f4851ef84", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout b/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout deleted file mode 100644 index a3b30d3762..0000000000 --- a/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout +++ /dev/null @@ -1,356 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - A: - (StructType - (SymbolTable - 3 - { - B: - (UnionType - (SymbolTable - 4 - { - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - B - [] - [x - y] - Source - Public - [(()) - (())] - () - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (Union - 3 B - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ) - }) - A - [] - [b - c] - Source - Public - .false. - .false. - [(()) - (())] - () - () - ), - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [test_ordering] - [] - [(SubroutineCall - 2 test_ordering - () - [] - () - )] - () - Public - .false. - .false. - () - ), - test_ordering: - (Function - (SymbolTable - 5 - { - 1_A_b: - (ExternalSymbol - 5 - 1_A_b - 3 b - A - [] - b - Public - ), - 1_A_c: - (ExternalSymbol - 5 - 1_A_c - 3 c - A - [] - c - Public - ), - A_B: - (ExternalSymbol - 5 - A_B - 3 B - A - [] - B - Public - ), - ad: - (Variable - 5 - ad - [] - Local - () - () - Default - (Struct - 2 A - ) - () - Source - Public - Required - .false. - ), - bd: - (Variable - 5 - bd - [] - Local - () - () - Default - (Union - 5 A_B - ) - () - Source - Public - Required - .false. - ) - }) - test_ordering - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 bd) - (UnionTypeConstructor - 5 A_B - [] - (Union - 5 A_B - ) - () - ) - () - ) - (= - (UnionInstanceMember - (Var 5 bd) - 4 x - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4)) - () - ) - (= - (StructInstanceMember - (Var 5 ad) - 5 1_A_b - (Union - 3 B - ) - () - ) - (Var 5 bd) - () - ) - (= - (StructInstanceMember - (Var 5 ad) - 5 1_A_c - (Integer 4) - () - ) - (IntegerConstant 2 (Integer 4)) - () - ) - (Assert - (IntegerCompare - (UnionInstanceMember - (StructInstanceMember - (Var 5 ad) - 3 b - (Union - 3 B - ) - () - ) - 4 x - (Integer 4) - () - ) - Eq - (IntegerConstant 1 (Integer 4)) - (Logical 4) - () - ) - () - ) - (Assert - (IntegerCompare - (StructInstanceMember - (Var 5 ad) - 3 c - (Integer 4) - () - ) - Eq - (IntegerConstant 2 (Integer 4)) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json deleted file mode 100644 index b388bc658f..0000000000 --- a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "pass_inline_function_calls-func_inline_01-8b6a5da", - "cmd": "lpython --pass=inline_function_calls --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/func_inline_01.py", - "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", - "outfile": null, - "outfile_hash": null, - "stdout": "pass_inline_function_calls-func_inline_01-8b6a5da.stdout", - "stdout_hash": "7663857180d522294ed1b3012593172c8ffde3c3fa016f8c0f8185aa", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout deleted file mode 100644 index 8bb565e306..0000000000 --- a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout +++ /dev/null @@ -1,432 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 5 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [main] - [] - [(SubroutineCall - 2 main - () - [] - () - )] - () - Public - .false. - .false. - () - ), - fib: - (Function - (SymbolTable - 3 - { - _lpython_return_variable: - (Variable - 3 - _lpython_return_variable - [] - ReturnVar - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - n: - (Variable - 3 - n - [] - In - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ) - }) - fib - (FunctionType - [(Integer 8)] - (Integer 8) - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [fib] - [(Var 3 n)] - [(If - (IntegerCompare - (Var 3 n) - Lt - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Logical 4) - () - ) - [(= - (Var 3 _lpython_return_variable) - (Var 3 n) - () - ) - (Return)] - [] - ) - (= - (Var 3 _lpython_return_variable) - (IntegerBinOp - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 3 n) - Sub - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - Add - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 3 n) - Sub - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - (Integer 8) - () - ) - () - ) - (Return)] - (Var 3 _lpython_return_variable) - Public - .false. - .false. - () - ), - main: - (Function - (SymbolTable - 4 - { - _lpython_return_variable_fib: - (Variable - 4 - _lpython_return_variable_fib - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - ans: - (Variable - 4 - ans - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - n_fib: - (Variable - 4 - n_fib - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (Integer 8) - () - Source - Public - Required - .false. - ), - ~empty_block: - (Block - (SymbolTable - 7 - { - - }) - ~empty_block - [] - ) - }) - main - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [fib] - [] - [(= - (Var 4 x) - (Cast - (IntegerConstant 40 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 40 (Integer 8)) - ) - () - ) - (= - (Var 4 n_fib) - (Var 4 x) - () - ) - (If - (IntegerCompare - (Var 4 n_fib) - Lt - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Logical 4) - () - ) - [(= - (Var 4 _lpython_return_variable_fib) - (Var 4 n_fib) - () - ) - (GoTo - 1 - __1 - )] - [] - ) - (= - (Var 4 _lpython_return_variable_fib) - (IntegerBinOp - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 4 n_fib) - Sub - (Cast - (IntegerConstant 1 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 1 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - Add - (FunctionCall - 2 fib - () - [((IntegerBinOp - (Var 4 n_fib) - Sub - (Cast - (IntegerConstant 2 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 2 (Integer 8)) - ) - (Integer 8) - () - ))] - (Integer 8) - () - () - ) - (Integer 8) - () - ) - () - ) - (GoTo - 1 - __1 - ) - (BlockCall - 1 - 4 ~empty_block - ) - (= - (Var 4 ans) - (Var 4 _lpython_return_variable_fib) - () - ) - (Print - () - [(Var 4 ans)] - () - () - ) - (Assert - (IntegerCompare - (Var 4 ans) - Eq - (Cast - (IntegerConstant 102334155 (Integer 4)) - IntegerToInteger - (Integer 8) - (IntegerConstant 102334155 (Integer 8)) - ) - (Logical 4) - () - ) - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 6 - { - __main__global_stmts: - (ExternalSymbol - 6 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 6 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json deleted file mode 100644 index e023d7e0eb..0000000000 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "pass_loop_vectorise-vec_01-be9985e", - "cmd": "lpython --pass=loop_vectorise --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/vec_01.py", - "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "pass_loop_vectorise-vec_01-be9985e.stderr", - "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", - "returncode": 2 -} \ No newline at end of file diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr deleted file mode 100644 index 0371022cc6..0000000000 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/vec_01.py:2:1 - | -2 | from numpy import empty, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/pass_print_list_tuple-print_02-09600eb.json b/tests/reference/pass_print_list_tuple-print_02-09600eb.json deleted file mode 100644 index ef9da7864b..0000000000 --- a/tests/reference/pass_print_list_tuple-print_02-09600eb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "pass_print_list_tuple-print_02-09600eb", - "cmd": "lpython --pass=print_list_tuple --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/print_02.py", - "infile_hash": "c4513f1b2ab1a2f33a0784fe80b4d32b506c05799b0c920c4f5b0411", - "outfile": null, - "outfile_hash": null, - "stdout": "pass_print_list_tuple-print_02-09600eb.stdout", - "stdout_hash": "92cf61833ce7c5944c99f073590128d6199de5ae303f96c4a384ee19", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout b/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout deleted file mode 100644 index 98d84e254e..0000000000 --- a/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout +++ /dev/null @@ -1,8761 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 8 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [check] - [] - [(SubroutineCall - 2 check - () - [] - () - )] - () - Public - .false. - .false. - () - ), - check: - (Function - (SymbolTable - 7 - { - - }) - check - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f - test_nested_lists - test_nested_lists2 - test_print_list_tuple] - [] - [(SubroutineCall - 2 f - () - [] - () - ) - (SubroutineCall - 2 test_nested_lists - () - [] - () - ) - (SubroutineCall - 2 test_nested_lists2 - () - [] - () - ) - (SubroutineCall - 2 test_print_list_tuple - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - __list_iterator: - (Variable - 3 - __list_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator1: - (Variable - 3 - __list_iterator1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator10: - (Variable - 3 - __list_iterator10 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator11: - (Variable - 3 - __list_iterator11 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator12: - (Variable - 3 - __list_iterator12 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator13: - (Variable - 3 - __list_iterator13 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator14: - (Variable - 3 - __list_iterator14 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator15: - (Variable - 3 - __list_iterator15 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator16: - (Variable - 3 - __list_iterator16 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator17: - (Variable - 3 - __list_iterator17 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator18: - (Variable - 3 - __list_iterator18 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator2: - (Variable - 3 - __list_iterator2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator3: - (Variable - 3 - __list_iterator3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator4: - (Variable - 3 - __list_iterator4 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator5: - (Variable - 3 - __list_iterator5 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator6: - (Variable - 3 - __list_iterator6 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator7: - (Variable - 3 - __list_iterator7 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator8: - (Variable - 3 - __list_iterator8 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator9: - (Variable - 3 - __list_iterator9 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 3 - a - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 3 - b - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 3 - c - [] - Local - () - () - Default - (List - (Real 8) - ) - () - Source - Public - Required - .false. - ), - d: - (Variable - 3 - d - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 a) - (ListConstant - [(StringConstant - "ab" - (Character 1 2 ()) - ) - (StringConstant - "abc" - (Character 1 3 ()) - ) - (StringConstant - "abcd" - (Character 1 4 ()) - )] - (List - (Character 1 2 ()) - ) - ) - () - ) - (= - (Var 3 b) - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 3 c) - (ListConstant - [(RealConstant - 1.230000 - (Real 8) - ) - (RealConstant - 324.300000 - (Real 8) - ) - (RealConstant - 56.431000 - (Real 8) - ) - (RealConstant - 90.500000 - (Real 8) - ) - (RealConstant - 34.100000 - (Real 8) - )] - (List - (Real 8) - ) - ) - () - ) - (= - (Var 3 d) - (ListConstant - [] - (List - (Integer 4) - ) - ) - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator1) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 b) - (Var 3 __list_iterator1) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator1) - Lt - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator2) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 c) - (Var 3 __list_iterator2) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator2) - Lt - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator3) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 d) - (Var 3 __list_iterator3) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator3) - Lt - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator4) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator4) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator4) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator5) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator5) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator5) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator6) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 b) - (Var 3 __list_iterator6) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator6) - Lt - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator7) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 c) - (Var 3 __list_iterator7) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator7) - Lt - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator8) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 d) - (Var 3 __list_iterator8) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator8) - Lt - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator9) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator9) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator9) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator10) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator10) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator10) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(IntegerConstant 1 (Integer 4))] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator11) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 b) - (Var 3 __list_iterator11) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator11) - Lt - (IntegerBinOp - (ListLen - (Var 3 b) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator12) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 c) - (Var 3 __list_iterator12) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator12) - Lt - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(RealConstant - 1.100000 - (Real 8) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator13) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 d) - (Var 3 __list_iterator13) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator13) - Lt - (IntegerBinOp - (ListLen - (Var 3 d) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator14) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 0 (Integer 4))] - (List - (Integer 4) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 0 (Integer 4))] - (List - (Integer 4) - ) - ) - (Var 3 __list_iterator14) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator14) - Lt - (IntegerBinOp - (ListLen - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 0 (Integer 4))] - (List - (Integer 4) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator15) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "d" - (Character 1 1 ()) - ) - (StringConstant - "e" - (Character 1 1 ()) - ) - (StringConstant - "f" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "d" - (Character 1 1 ()) - ) - (StringConstant - "e" - (Character 1 1 ()) - ) - (StringConstant - "f" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (Var 3 __list_iterator15) - (Character 1 1 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator15) - Lt - (IntegerBinOp - (ListLen - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "b" - (Character 1 1 ()) - ) - (StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "d" - (Character 1 1 ()) - ) - (StringConstant - "e" - (Character 1 1 ()) - ) - (StringConstant - "f" - (Character 1 1 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator16) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - (Var 3 __list_iterator16) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator16) - Lt - (IntegerBinOp - (ListLen - (ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator17) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 3 a) - (Var 3 __list_iterator17) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator17) - Lt - (IntegerBinOp - (ListLen - (Var 3 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator18) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 3 c) - (Var 3 __list_iterator18) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator18) - Lt - (IntegerBinOp - (ListLen - (Var 3 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - test_nested_lists: - (Function - (SymbolTable - 4 - { - __list_iterator: - (Variable - 4 - __list_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator1: - (Variable - 4 - __list_iterator1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator10: - (Variable - 4 - __list_iterator10 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator11: - (Variable - 4 - __list_iterator11 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator2: - (Variable - 4 - __list_iterator2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator3: - (Variable - 4 - __list_iterator3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator4: - (Variable - 4 - __list_iterator4 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator5: - (Variable - 4 - __list_iterator5 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator6: - (Variable - 4 - __list_iterator6 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator7: - (Variable - 4 - __list_iterator7 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator8: - (Variable - 4 - __list_iterator8 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator9: - (Variable - 4 - __list_iterator9 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - w: - (Variable - 4 - w - [] - Local - () - () - Default - (List - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - () - Source - Public - Required - .false. - ), - x: - (Variable - 4 - x - [] - Local - () - () - Default - (List - (List - (List - (Integer 4) - ) - ) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 4 - y - [] - Local - () - () - Default - (List - (List - (Real 8) - ) - ) - () - Source - Public - Required - .false. - ), - z: - (Variable - 4 - z - [] - Local - () - () - Default - (List - (List - (Character 1 -2 ()) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_nested_lists - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 4 w) - (ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 2.130000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 98.170000 - (Real 8) - ) - (Real 8) - (RealConstant - -98.170000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 1.110000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - )] - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - )] - (List - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - ) - () - ) - (= - (Var 4 x) - (ListConstant - [(ListConstant - [(ListConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 1 (Integer 4)) - (Integer 4) - (IntegerConstant -1 (Integer 4)) - )] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 2 (Integer 4)) - (Integer 4) - (IntegerConstant -2 (Integer 4)) - ) - (IntegerConstant 5 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 5 (Integer 4))] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - ) - (ListConstant - [(ListConstant - [(IntegerUnaryMinus - (IntegerConstant 3 (Integer 4)) - (Integer 4) - (IntegerConstant -3 (Integer 4)) - ) - (IntegerConstant 1 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 2 (Integer 4)) - (IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - )] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerUnaryMinus - (IntegerConstant 5 (Integer 4)) - (Integer 4) - (IntegerConstant -5 (Integer 4)) - )] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - )] - (List - (List - (List - (Integer 4) - ) - ) - ) - ) - () - ) - (= - (Var 4 y) - (ListConstant - [(ListConstant - [(RealConstant - 3.140000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 1.001200 - (Real 8) - ) - (Real 8) - (RealConstant - -1.001200 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 2.380000 - (Real 8) - ) - (Real 8) - (RealConstant - -2.380000 - (Real 8) - ) - ) - (RealConstant - 5.510000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - () - ) - (= - (Var 4 z) - (ListConstant - [(ListConstant - [(StringConstant - "bat" - (Character 1 3 ()) - ) - (StringConstant - "ball" - (Character 1 4 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "cat" - (Character 1 3 ()) - ) - (StringConstant - "dog" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "c" - (Character 1 1 ()) - ) - (StringConstant - "c++" - (Character 1 3 ()) - ) - (StringConstant - "java" - (Character 1 4 ()) - ) - (StringConstant - "python" - (Character 1 6 ()) - )] - (List - (Character 1 1 ()) - ) - )] - (List - (List - (Character 1 3 ()) - ) - ) - ) - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 4 w) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator1) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator2) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator3) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 4 __list_iterator2) - (List - (List - (Real 8) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator4) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 4 __list_iterator2) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 4 __list_iterator3) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListItem - (ListItem - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 4 __list_iterator2) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 4 __list_iterator3) - (List - (Real 8) - ) - () - ) - (Var 4 __list_iterator4) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator4) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 4 __list_iterator2) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 4 __list_iterator3) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator3) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 4 __list_iterator2) - (List - (List - (Real 8) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator2) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Var 4 __list_iterator1) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator1) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 4 w) - (Var 4 __list_iterator) - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator) - Lt - (IntegerBinOp - (ListLen - (Var 4 w) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator5) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 4 x) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator6) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 4 x) - (Var 4 __list_iterator5) - (List - (List - (Integer 4) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator7) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 4 x) - (Var 4 __list_iterator5) - (List - (List - (Integer 4) - ) - ) - () - ) - (Var 4 __list_iterator6) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListItem - (ListItem - (Var 4 x) - (Var 4 __list_iterator5) - (List - (List - (Integer 4) - ) - ) - () - ) - (Var 4 __list_iterator6) - (List - (Integer 4) - ) - () - ) - (Var 4 __list_iterator7) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator7) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 4 x) - (Var 4 __list_iterator5) - (List - (List - (Integer 4) - ) - ) - () - ) - (Var 4 __list_iterator6) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator6) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 4 x) - (Var 4 __list_iterator5) - (List - (List - (Integer 4) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator5) - Lt - (IntegerBinOp - (ListLen - (Var 4 x) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator8) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 4 y) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator9) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 4 y) - (Var 4 __list_iterator8) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListItem - (Var 4 y) - (Var 4 __list_iterator8) - (List - (Real 8) - ) - () - ) - (Var 4 __list_iterator9) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator9) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 4 y) - (Var 4 __list_iterator8) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator8) - Lt - (IntegerBinOp - (ListLen - (Var 4 y) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator10) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 4 z) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 4 __list_iterator11) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 4 z) - (Var 4 __list_iterator10) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (ListItem - (Var 4 z) - (Var 4 __list_iterator10) - (List - (Character 1 -2 ()) - ) - () - ) - (Var 4 __list_iterator11) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator11) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 4 z) - (Var 4 __list_iterator10) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 4 __list_iterator10) - Lt - (IntegerBinOp - (ListLen - (Var 4 z) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - test_nested_lists2: - (Function - (SymbolTable - 6 - { - __list_iterator: - (Variable - 6 - __list_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator1: - (Variable - 6 - __list_iterator1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator2: - (Variable - 6 - __list_iterator2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator3: - (Variable - 6 - __list_iterator3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator4: - (Variable - 6 - __list_iterator4 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator5: - (Variable - 6 - __list_iterator5 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator6: - (Variable - 6 - __list_iterator6 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator7: - (Variable - 6 - __list_iterator7 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator8: - (Variable - 6 - __list_iterator8 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - p: - (Variable - 6 - p - [] - Local - () - () - Default - (List - (List - (Integer 4) - ) - ) - () - Source - Public - Required - .false. - ), - q: - (Variable - 6 - q - [] - Local - () - () - Default - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - () - Source - Public - Required - .false. - ), - r: - (Variable - 6 - r - [] - Local - () - () - Default - (List - (List - (List - (Character 1 -2 ()) - ) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_nested_lists2 - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 6 p) - (ListConstant - [(ListConstant - [(IntegerConstant 0 (Integer 4)) - (IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4)) - (IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4)) - (IntegerConstant 5 (Integer 4)) - (IntegerConstant 6 (Integer 4)) - (IntegerConstant 7 (Integer 4)) - (IntegerConstant 8 (Integer 4)) - (IntegerConstant 9 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 10 (Integer 4)) - (IntegerConstant 11 (Integer 4)) - (IntegerConstant 12 (Integer 4)) - (IntegerConstant 13 (Integer 4)) - (IntegerConstant 14 (Integer 4)) - (IntegerConstant 15 (Integer 4)) - (IntegerConstant 16 (Integer 4)) - (IntegerConstant 17 (Integer 4)) - (IntegerConstant 18 (Integer 4)) - (IntegerConstant 19 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 20 (Integer 4)) - (IntegerConstant 21 (Integer 4)) - (IntegerConstant 22 (Integer 4)) - (IntegerConstant 23 (Integer 4)) - (IntegerConstant 24 (Integer 4)) - (IntegerConstant 25 (Integer 4)) - (IntegerConstant 26 (Integer 4)) - (IntegerConstant 27 (Integer 4)) - (IntegerConstant 28 (Integer 4)) - (IntegerConstant 29 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 30 (Integer 4)) - (IntegerConstant 31 (Integer 4)) - (IntegerConstant 32 (Integer 4)) - (IntegerConstant 33 (Integer 4)) - (IntegerConstant 34 (Integer 4)) - (IntegerConstant 35 (Integer 4)) - (IntegerConstant 36 (Integer 4)) - (IntegerConstant 37 (Integer 4)) - (IntegerConstant 38 (Integer 4)) - (IntegerConstant 39 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 40 (Integer 4)) - (IntegerConstant 41 (Integer 4)) - (IntegerConstant 42 (Integer 4)) - (IntegerConstant 43 (Integer 4)) - (IntegerConstant 44 (Integer 4)) - (IntegerConstant 45 (Integer 4)) - (IntegerConstant 46 (Integer 4)) - (IntegerConstant 47 (Integer 4)) - (IntegerConstant 48 (Integer 4)) - (IntegerConstant 49 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 50 (Integer 4)) - (IntegerConstant 51 (Integer 4)) - (IntegerConstant 52 (Integer 4)) - (IntegerConstant 53 (Integer 4)) - (IntegerConstant 54 (Integer 4)) - (IntegerConstant 55 (Integer 4)) - (IntegerConstant 56 (Integer 4)) - (IntegerConstant 57 (Integer 4)) - (IntegerConstant 58 (Integer 4)) - (IntegerConstant 59 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 60 (Integer 4)) - (IntegerConstant 61 (Integer 4)) - (IntegerConstant 62 (Integer 4)) - (IntegerConstant 63 (Integer 4)) - (IntegerConstant 64 (Integer 4)) - (IntegerConstant 65 (Integer 4)) - (IntegerConstant 66 (Integer 4)) - (IntegerConstant 67 (Integer 4)) - (IntegerConstant 68 (Integer 4)) - (IntegerConstant 69 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 70 (Integer 4)) - (IntegerConstant 71 (Integer 4)) - (IntegerConstant 72 (Integer 4)) - (IntegerConstant 73 (Integer 4)) - (IntegerConstant 74 (Integer 4)) - (IntegerConstant 75 (Integer 4)) - (IntegerConstant 76 (Integer 4)) - (IntegerConstant 77 (Integer 4)) - (IntegerConstant 78 (Integer 4)) - (IntegerConstant 79 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 80 (Integer 4)) - (IntegerConstant 81 (Integer 4)) - (IntegerConstant 82 (Integer 4)) - (IntegerConstant 83 (Integer 4)) - (IntegerConstant 84 (Integer 4)) - (IntegerConstant 85 (Integer 4)) - (IntegerConstant 86 (Integer 4)) - (IntegerConstant 87 (Integer 4)) - (IntegerConstant 88 (Integer 4)) - (IntegerConstant 89 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 90 (Integer 4)) - (IntegerConstant 91 (Integer 4)) - (IntegerConstant 92 (Integer 4)) - (IntegerConstant 93 (Integer 4)) - (IntegerConstant 94 (Integer 4)) - (IntegerConstant 95 (Integer 4)) - (IntegerConstant 96 (Integer 4)) - (IntegerConstant 97 (Integer 4)) - (IntegerConstant 98 (Integer 4)) - (IntegerConstant 99 (Integer 4))] - (List - (Integer 4) - ) - )] - (List - (List - (Integer 4) - ) - ) - ) - () - ) - (= - (Var 6 q) - (ListConstant - [(ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 74.550000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 77.640000 - (Real 8) - ) - (Real 8) - (RealConstant - -77.640000 - (Real 8) - ) - ) - (RealConstant - 52.350000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 78.250000 - (Real 8) - ) - (Real 8) - (RealConstant - -78.250000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 19.240000 - (Real 8) - ) - (Real 8) - (RealConstant - -19.240000 - (Real 8) - ) - ) - (RealConstant - 81.380000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 7.860000 - (Real 8) - ) - (RealConstant - 12.110000 - (Real 8) - ) - (RealConstant - 27.500000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 98.930000 - (Real 8) - ) - (Real 8) - (RealConstant - -98.930000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 79.620000 - (Real 8) - ) - (Real 8) - (RealConstant - -79.620000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 73.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -73.760000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 42.050000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 90.290000 - (Real 8) - ) - (Real 8) - (RealConstant - -90.290000 - (Real 8) - ) - ) - (RealConstant - 69.950000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 59.320000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 70.780000 - (Real 8) - ) - (Real 8) - (RealConstant - -70.780000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 53.220000 - (Real 8) - ) - (Real 8) - (RealConstant - -53.220000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 53.520000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 93.880000 - (Real 8) - ) - (Real 8) - (RealConstant - -93.880000 - (Real 8) - ) - ) - (RealConstant - 49.650000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 2.180000 - (Real 8) - ) - (RealConstant - 19.910000 - (Real 8) - ) - (RealConstant - 69.240000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 78.510000 - (Real 8) - ) - (RealConstant - 89.690000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 86.680000 - (Real 8) - ) - (Real 8) - (RealConstant - -86.680000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 92.480000 - (Real 8) - ) - (Real 8) - (RealConstant - -92.480000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 80.750000 - (Real 8) - ) - (Real 8) - (RealConstant - -80.750000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 27.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -27.760000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 13.350000 - (Real 8) - ) - (Real 8) - (RealConstant - -13.350000 - (Real 8) - ) - ) - (RealConstant - 12.280000 - (Real 8) - ) - (RealConstant - 79.610000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 48.480000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 10.490000 - (Real 8) - ) - (Real 8) - (RealConstant - -10.490000 - (Real 8) - ) - ) - (RealConstant - 41.100000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 20.330000 - (Real 8) - ) - (RealConstant - 14.520000 - (Real 8) - ) - (RealConstant - 82.560000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 57.760000 - (Real 8) - ) - (Real 8) - (RealConstant - -57.760000 - (Real 8) - ) - ) - (RealConstant - 76.030000 - (Real 8) - ) - (RealConstant - 67.330000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 21.500000 - (Real 8) - ) - (Real 8) - (RealConstant - -21.500000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 11.920000 - (Real 8) - ) - (Real 8) - (RealConstant - -11.920000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 31.840000 - (Real 8) - ) - (Real 8) - (RealConstant - -31.840000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealConstant - 9.650000 - (Real 8) - ) - (RealConstant - 11.150000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 36.580000 - (Real 8) - ) - (Real 8) - (RealConstant - -36.580000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 56.550000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 70.850000 - (Real 8) - ) - (Real 8) - (RealConstant - -70.850000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 50.670000 - (Real 8) - ) - (Real 8) - (RealConstant - -50.670000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 94.630000 - (Real 8) - ) - (RealConstant - 25.680000 - (Real 8) - ) - (RealConstant - 89.300000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - ) - (ListConstant - [(ListConstant - [(ListConstant - [(RealConstant - 28.530000 - (Real 8) - ) - (RealConstant - 71.220000 - (Real 8) - ) - (RealConstant - 71.870000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 58.390000 - (Real 8) - ) - (Real 8) - (RealConstant - -58.390000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 6.960000 - (Real 8) - ) - (Real 8) - (RealConstant - -6.960000 - (Real 8) - ) - ) - (RealConstant - 42.980000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 8.950000 - (Real 8) - ) - (Real 8) - (RealConstant - -8.950000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 75.090000 - (Real 8) - ) - (Real 8) - (RealConstant - -75.090000 - (Real 8) - ) - ) - (RealConstant - 37.960000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 31.750000 - (Real 8) - ) - (Real 8) - (RealConstant - -31.750000 - (Real 8) - ) - ) - (RealConstant - 67.330000 - (Real 8) - ) - (RealConstant - 58.170000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 64.010000 - (Real 8) - ) - (Real 8) - (RealConstant - -64.010000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 9.220000 - (Real 8) - ) - (Real 8) - (RealConstant - -9.220000 - (Real 8) - ) - ) - (RealConstant - 9.590000 - (Real 8) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 15.710000 - (Real 8) - ) - (RealConstant - 82.360000 - (Real 8) - ) - (RealConstant - 51.180000 - (Real 8) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - ) - (ListConstant - [(ListConstant - [(RealUnaryMinus - (RealConstant - 100.290000 - (Real 8) - ) - (Real 8) - (RealConstant - -100.290000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 32.720000 - (Real 8) - ) - (Real 8) - (RealConstant - -32.720000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 54.940000 - (Real 8) - ) - (Real 8) - (RealConstant - -54.940000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealUnaryMinus - (RealConstant - 0.320000 - (Real 8) - ) - (Real 8) - (RealConstant - -0.320000 - (Real 8) - ) - ) - (RealConstant - 68.810000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 55.090000 - (Real 8) - ) - (Real 8) - (RealConstant - -55.090000 - (Real 8) - ) - )] - (List - (Real 8) - ) - ) - (ListConstant - [(RealConstant - 97.280000 - (Real 8) - ) - (RealUnaryMinus - (RealConstant - 28.200000 - (Real 8) - ) - (Real 8) - (RealConstant - -28.200000 - (Real 8) - ) - ) - (RealUnaryMinus - (RealConstant - 62.610000 - (Real 8) - ) - (Real 8) - (RealConstant - -62.610000 - (Real 8) - ) - )] - (List - (Real 8) - ) - )] - (List - (List - (Real 8) - ) - ) - )] - (List - (List - (List - (Real 8) - ) - ) - ) - )] - (List - (List - (List - (List - (Real 8) - ) - ) - ) - ) - ) - () - ) - (= - (Var 6 r) - (ListConstant - [(ListConstant - [(ListConstant - [(StringConstant - "Io" - (Character 1 2 ()) - ) - (StringConstant - "tl" - (Character 1 2 ()) - ) - (StringConstant - "bLvjV" - (Character 1 5 ()) - ) - (StringConstant - "wjFKQ" - (Character 1 5 ()) - ) - (StringConstant - "lY2" - (Character 1 3 ()) - )] - (List - (Character 1 2 ()) - ) - ) - (ListConstant - [(StringConstant - "Be2l6bqE" - (Character 1 8 ()) - ) - (StringConstant - "pQER3utIXA" - (Character 1 10 ()) - ) - (StringConstant - "llZBJj5Cdu" - (Character 1 10 ()) - ) - (StringConstant - "C8" - (Character 1 2 ()) - ) - (StringConstant - "gwTr77PdYR" - (Character 1 10 ()) - )] - (List - (Character 1 8 ()) - ) - ) - (ListConstant - [(StringConstant - "4M6L" - (Character 1 4 ()) - ) - (StringConstant - "ktPdowqERy" - (Character 1 10 ()) - ) - (StringConstant - "KSifqTkR" - (Character 1 8 ()) - ) - (StringConstant - "ZE2p1N78f1" - (Character 1 10 ()) - ) - (StringConstant - "Mi5e87Xw" - (Character 1 8 ()) - )] - (List - (Character 1 4 ()) - ) - ) - (ListConstant - [(StringConstant - "uwfzqDq9g" - (Character 1 9 ()) - ) - (StringConstant - "QaM1s" - (Character 1 5 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "LB" - (Character 1 2 ()) - )] - (List - (Character 1 9 ()) - ) - ) - (ListConstant - [(StringConstant - "OJFRY6k" - (Character 1 7 ()) - ) - (StringConstant - "iz7Oie" - (Character 1 6 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "LUYLF" - (Character 1 5 ()) - ) - (StringConstant - "JBND5FuV7l" - (Character 1 10 ()) - )] - (List - (Character 1 7 ()) - ) - )] - (List - (List - (Character 1 2 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "m" - (Character 1 1 ()) - ) - (StringConstant - "WIQBQfV" - (Character 1 7 ()) - ) - (StringConstant - "jxjDrqxu" - (Character 1 8 ()) - ) - (StringConstant - "kea" - (Character 1 3 ()) - ) - (StringConstant - "mu" - (Character 1 2 ()) - )] - (List - (Character 1 1 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "GI8aOwLMe" - (Character 1 9 ()) - ) - (StringConstant - "Y5m8" - (Character 1 4 ()) - ) - (StringConstant - "a02Rz" - (Character 1 5 ()) - ) - (StringConstant - "xNKCJ" - (Character 1 5 ()) - )] - (List - (Character 1 0 ()) - ) - ) - (ListConstant - [(StringConstant - "LzkhyiJQHP" - (Character 1 10 ()) - ) - (StringConstant - "uzc3xyoXL" - (Character 1 9 ()) - ) - (StringConstant - "sKGnYfpRy" - (Character 1 9 ()) - ) - (StringConstant - "7x" - (Character 1 2 ()) - ) - (StringConstant - "WTVKrnPO" - (Character 1 8 ()) - )] - (List - (Character 1 10 ()) - ) - ) - (ListConstant - [(StringConstant - "TZa6" - (Character 1 4 ()) - ) - (StringConstant - "GXRuyRX" - (Character 1 7 ()) - ) - (StringConstant - "R" - (Character 1 1 ()) - ) - (StringConstant - "JQxS" - (Character 1 4 ()) - ) - (StringConstant - "OH" - (Character 1 2 ()) - )] - (List - (Character 1 4 ()) - ) - ) - (ListConstant - [(StringConstant - "bSVJZ1OQ" - (Character 1 8 ()) - ) - (StringConstant - "M" - (Character 1 1 ()) - ) - (StringConstant - "I9omlF" - (Character 1 6 ()) - ) - (StringConstant - "x7FR" - (Character 1 4 ()) - ) - (StringConstant - "XtpL" - (Character 1 4 ()) - )] - (List - (Character 1 8 ()) - ) - )] - (List - (List - (Character 1 1 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "DKOpK" - (Character 1 5 ()) - ) - (StringConstant - "eg8Nz" - (Character 1 5 ()) - ) - (StringConstant - "ru" - (Character 1 2 ()) - ) - (StringConstant - "Sj" - (Character 1 2 ()) - ) - (StringConstant - "YUDxyI" - (Character 1 6 ()) - )] - (List - (Character 1 5 ()) - ) - ) - (ListConstant - [(StringConstant - "Q5uyhvp" - (Character 1 7 ()) - ) - (StringConstant - "Ydx" - (Character 1 3 ()) - ) - (StringConstant - "p" - (Character 1 1 ()) - ) - (StringConstant - "DLM5RX" - (Character 1 6 ()) - ) - (StringConstant - "pwOujxCO" - (Character 1 8 ()) - )] - (List - (Character 1 7 ()) - ) - ) - (ListConstant - [(StringConstant - "s5GOWnNJV" - (Character 1 9 ()) - ) - (StringConstant - "af" - (Character 1 2 ()) - ) - (StringConstant - "KAkD" - (Character 1 4 ()) - ) - (StringConstant - "4IIZK" - (Character 1 5 ()) - ) - (StringConstant - "JQK040x" - (Character 1 7 ()) - )] - (List - (Character 1 9 ()) - ) - ) - (ListConstant - [(StringConstant - "9vF" - (Character 1 3 ()) - ) - (StringConstant - "9pc7R8v" - (Character 1 7 ()) - ) - (StringConstant - "nDReIU7" - (Character 1 7 ()) - ) - (StringConstant - "K" - (Character 1 1 ()) - ) - (StringConstant - "btn" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "wVeivkdi" - (Character 1 8 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "C" - (Character 1 1 ()) - )] - (List - (Character 1 0 ()) - ) - )] - (List - (List - (Character 1 5 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "vNTtcRXD" - (Character 1 8 ()) - ) - (StringConstant - "rsi" - (Character 1 3 ()) - ) - (StringConstant - "YsoF7mZD" - (Character 1 8 ()) - ) - (StringConstant - "VrPXU50rgA" - (Character 1 10 ()) - ) - (StringConstant - "mG7zqN0G" - (Character 1 8 ()) - )] - (List - (Character 1 8 ()) - ) - ) - (ListConstant - [(StringConstant - "la7cJ" - (Character 1 5 ()) - ) - (StringConstant - "M5rLJ8Go" - (Character 1 8 ()) - ) - (StringConstant - "gb" - (Character 1 2 ()) - ) - (StringConstant - "FjKwYZ7E" - (Character 1 8 ()) - ) - (StringConstant - "uSPD" - (Character 1 4 ()) - )] - (List - (Character 1 5 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "oOa79jWcMx" - (Character 1 10 ()) - ) - (StringConstant - "yyAYZZ" - (Character 1 6 ()) - ) - (StringConstant - "wbvggXm" - (Character 1 7 ()) - ) - (StringConstant - "aE3BkCL4" - (Character 1 8 ()) - )] - (List - (Character 1 0 ()) - ) - ) - (ListConstant - [(StringConstant - "RdP" - (Character 1 3 ()) - ) - (StringConstant - "Hwc0x9RZ" - (Character 1 8 ()) - ) - (StringConstant - "sy" - (Character 1 2 ()) - ) - (StringConstant - "9" - (Character 1 1 ()) - ) - (StringConstant - "W1d9xA2BXe" - (Character 1 10 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "A" - (Character 1 1 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "QnK" - (Character 1 3 ()) - ) - (StringConstant - "N5tzN" - (Character 1 5 ()) - ) - (StringConstant - "ou7Lp" - (Character 1 5 ()) - )] - (List - (Character 1 1 ()) - ) - )] - (List - (List - (Character 1 8 ()) - ) - ) - ) - (ListConstant - [(ListConstant - [(StringConstant - "DL68rDF" - (Character 1 7 ()) - ) - (StringConstant - "v" - (Character 1 1 ()) - ) - (StringConstant - "kQ3Mxm" - (Character 1 6 ()) - ) - (StringConstant - "g" - (Character 1 1 ()) - ) - (StringConstant - "6KTeF4Eo" - (Character 1 8 ()) - )] - (List - (Character 1 7 ()) - ) - ) - (ListConstant - [(StringConstant - "Hx9" - (Character 1 3 ()) - ) - (StringConstant - "Y1IzQm85Z4" - (Character 1 10 ()) - ) - (StringConstant - "3D8" - (Character 1 3 ()) - ) - (StringConstant - "ZLZ5" - (Character 1 4 ()) - ) - (StringConstant - "rWn" - (Character 1 3 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "LtT" - (Character 1 3 ()) - ) - (StringConstant - "Dh5B" - (Character 1 4 ()) - ) - (StringConstant - "M" - (Character 1 1 ()) - ) - (StringConstant - "F" - (Character 1 1 ()) - ) - (StringConstant - "QTARbY" - (Character 1 6 ()) - )] - (List - (Character 1 3 ()) - ) - ) - (ListConstant - [(StringConstant - "Sh" - (Character 1 2 ()) - ) - (StringConstant - "WL" - (Character 1 2 ()) - ) - (StringConstant - "yvAfWvZSx1" - (Character 1 10 ()) - ) - (StringConstant - "90yx" - (Character 1 4 ()) - ) - (StringConstant - "v" - (Character 1 1 ()) - )] - (List - (Character 1 2 ()) - ) - ) - (ListConstant - [(StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "7IBW" - (Character 1 4 ()) - ) - (StringConstant - "nI" - (Character 1 2 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "6Cbp5c8RT" - (Character 1 9 ()) - )] - (List - (Character 1 0 ()) - ) - )] - (List - (List - (Character 1 7 ()) - ) - ) - )] - (List - (List - (List - (Character 1 2 ()) - ) - ) - ) - ) - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 6 p) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator1) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 6 p) - (Var 6 __list_iterator) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListItem - (Var 6 p) - (Var 6 __list_iterator) - (List - (Integer 4) - ) - () - ) - (Var 6 __list_iterator1) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator1) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 6 p) - (Var 6 __list_iterator) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator) - Lt - (IntegerBinOp - (ListLen - (Var 6 p) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator2) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 6 q) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator3) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator4) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 6 __list_iterator3) - (List - (List - (Real 8) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator5) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 6 __list_iterator3) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 6 __list_iterator4) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (ListItem - (ListItem - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 6 __list_iterator3) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 6 __list_iterator4) - (List - (Real 8) - ) - () - ) - (Var 6 __list_iterator5) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator5) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 6 __list_iterator3) - (List - (List - (Real 8) - ) - ) - () - ) - (Var 6 __list_iterator4) - (List - (Real 8) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator4) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Var 6 __list_iterator3) - (List - (List - (Real 8) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator3) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 6 q) - (Var 6 __list_iterator2) - (List - (List - (List - (Real 8) - ) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator2) - Lt - (IntegerBinOp - (ListLen - (Var 6 q) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator6) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 6 r) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator7) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 6 r) - (Var 6 __list_iterator6) - (List - (List - (Character 1 -2 ()) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 6 __list_iterator8) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 6 r) - (Var 6 __list_iterator6) - (List - (List - (Character 1 -2 ()) - ) - ) - () - ) - (Var 6 __list_iterator7) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (ListItem - (ListItem - (Var 6 r) - (Var 6 __list_iterator6) - (List - (List - (Character 1 -2 ()) - ) - ) - () - ) - (Var 6 __list_iterator7) - (List - (Character 1 -2 ()) - ) - () - ) - (Var 6 __list_iterator8) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator8) - Lt - (IntegerBinOp - (ListLen - (ListItem - (ListItem - (Var 6 r) - (Var 6 __list_iterator6) - (List - (List - (Character 1 -2 ()) - ) - ) - () - ) - (Var 6 __list_iterator7) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator7) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 6 r) - (Var 6 __list_iterator6) - (List - (List - (Character 1 -2 ()) - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 6 __list_iterator6) - Lt - (IntegerBinOp - (ListLen - (Var 6 r) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ), - test_print_list_tuple: - (Function - (SymbolTable - 5 - { - __list_iterator: - (Variable - 5 - __list_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator1: - (Variable - 5 - __list_iterator1 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator2: - (Variable - 5 - __list_iterator2 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator3: - (Variable - 5 - __list_iterator3 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator4: - (Variable - 5 - __list_iterator4 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator5: - (Variable - 5 - __list_iterator5 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - __list_iterator6: - (Variable - 5 - __list_iterator6 - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - a: - (Variable - 5 - a - [] - Local - () - () - Default - (List - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - Source - Public - Required - .false. - ), - b: - (Variable - 5 - b - [] - Local - () - () - Default - (Tuple - [(List - (Character 1 -2 ()) - ) - (List - (Integer 4) - ) - (Real 8)] - ) - () - Source - Public - Required - .false. - ), - b1: - (Variable - 5 - b1 - [] - Local - () - () - Default - (List - (Character 1 -2 ()) - ) - () - Source - Public - Required - .false. - ), - b2: - (Variable - 5 - b2 - [] - Local - () - () - Default - (List - (Integer 4) - ) - () - Source - Public - Required - .false. - ), - c: - (Variable - 5 - c - [] - Local - () - () - Default - (List - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - ) - () - Source - Public - Required - .false. - ) - }) - test_print_list_tuple - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 5 a) - (ListConstant - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 5 (Integer 4)) - (IntegerConstant 6 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - )] - (List - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - ) - () - ) - (= - (Var 5 c) - (ListConstant - [(ListConstant - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (StringConstant - "a" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - (TupleConstant - [(IntegerConstant 2 (Integer 4)) - (StringConstant - "b" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - )] - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - ) - (ListConstant - [(TupleConstant - [(IntegerConstant 3 (Integer 4)) - (StringConstant - "c" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - (TupleConstant - [(IntegerConstant 4 (Integer 4)) - (StringConstant - "d" - (Character 1 1 ()) - )] - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - )] - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - )] - (List - (List - (Tuple - [(Integer 4) - (Character 1 1 ())] - ) - ) - ) - ) - () - ) - (= - (Var 5 b1) - (ListConstant - [(StringConstant - "a" - (Character 1 1 ()) - ) - (StringConstant - "bb" - (Character 1 2 ()) - ) - (StringConstant - "ccc" - (Character 1 3 ()) - ) - (StringConstant - "dddd" - (Character 1 4 ()) - ) - (StringConstant - "eeeee" - (Character 1 5 ()) - )] - (List - (Character 1 1 ()) - ) - ) - () - ) - (= - (Var 5 b2) - (ListConstant - [(IntegerConstant 10 (Integer 4)) - (IntegerConstant 20 (Integer 4)) - (IntegerConstant 30 (Integer 4)) - (IntegerConstant 40 (Integer 4))] - (List - (Integer 4) - ) - ) - () - ) - (= - (Var 5 b) - (TupleConstant - [(Var 5 b1) - (Var 5 b2) - (RealConstant - 6.030500 - (Real 8) - )] - (Tuple - [(List - (Character 1 -2 ()) - ) - (List - (Integer 4) - ) - (Real 8)] - ) - ) - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 5 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "(" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (ListItem - (Var 5 a) - (Var 5 __list_iterator) - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (ListItem - (Var 5 a) - (Var 5 __list_iterator) - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ")" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator) - Lt - (IntegerBinOp - (ListLen - (Var 5 a) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "(" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator1) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (TupleItem - (Var 5 b) - (IntegerConstant 0 (Integer 4)) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (TupleItem - (Var 5 b) - (IntegerConstant 0 (Integer 4)) - (List - (Character 1 -2 ()) - ) - () - ) - (Var 5 __list_iterator1) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator1) - Lt - (IntegerBinOp - (ListLen - (TupleItem - (Var 5 b) - (IntegerConstant 0 (Integer 4)) - (List - (Character 1 -2 ()) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator2) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (TupleItem - (Var 5 b) - (IntegerConstant 1 (Integer 4)) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (TupleItem - (Var 5 b) - (IntegerConstant 1 (Integer 4)) - (List - (Integer 4) - ) - () - ) - (Var 5 __list_iterator2) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator2) - Lt - (IntegerBinOp - (ListLen - (TupleItem - (Var 5 b) - (IntegerConstant 1 (Integer 4)) - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (Var 5 b) - (IntegerConstant 2 (Integer 4)) - (Real 8) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ")" - (Character 1 1 ()) - )] - () - () - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator3) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 5 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator4) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (ListItem - (Var 5 c) - (Var 5 __list_iterator3) - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "(" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (ListItem - (ListItem - (Var 5 c) - (Var 5 __list_iterator3) - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - () - ) - (Var 5 __list_iterator4) - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - () - ) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (TupleItem - (ListItem - (ListItem - (Var 5 c) - (Var 5 __list_iterator3) - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - () - ) - (Var 5 __list_iterator4) - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - () - ) - (IntegerConstant 1 (Integer 4)) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ")" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator4) - Lt - (IntegerBinOp - (ListLen - (ListItem - (Var 5 c) - (Var 5 __list_iterator3) - (List - (Tuple - [(Integer 4) - (Character 1 -2 ())] - ) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator3) - Lt - (IntegerBinOp - (ListLen - (Var 5 c) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator5) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 5 b1) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(StringConstant - "'" - (Character 1 1 ()) - ) - (ListItem - (Var 5 b1) - (Var 5 __list_iterator5) - (Character 1 -2 ()) - () - ) - (StringConstant - "'" - (Character 1 1 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator5) - Lt - (IntegerBinOp - (ListLen - (Var 5 b1) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 5 __list_iterator6) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (Var 5 b2) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (Var 5 b2) - (Var 5 __list_iterator6) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 5 __list_iterator6) - Lt - (IntegerBinOp - (ListLen - (Var 5 b2) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(RealConstant - 3.420000 - (Real 8) - ) - (StringConstant - "okay" - (Character 1 4 ()) - ) - (LogicalConstant - .true. - (Logical 4) - ) - (IntegerConstant 14483 (Integer 4))] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 9 - { - __main__global_stmts: - (ExternalSymbol - 9 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 9 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json deleted file mode 100644 index 7eb0803aaf..0000000000 --- a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "pass_print_list_tuple-print_list_tuple_03-195fa9c", - "cmd": "lpython --pass=print_list_tuple --show-asr --no-color {infile} -o {outfile}", - "infile": "tests/../integration_tests/print_list_tuple_03.py", - "infile_hash": "5131d7b6049e22c278ad41494969ff1f70c1dc811313032a9fcf58f3", - "outfile": null, - "outfile_hash": null, - "stdout": "pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout", - "stdout_hash": "2dbf3429f4e3c9e37321ed5251aebc13df479e2001fb95f16f37ed2f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout deleted file mode 100644 index 42cfebc908..0000000000 --- a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout +++ /dev/null @@ -1,522 +0,0 @@ -(TranslationUnit - (SymbolTable - 1 - { - __main__: - (Module - (SymbolTable - 2 - { - __main__global_stmts: - (Function - (SymbolTable - 4 - { - - }) - __main__global_stmts - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [f] - [] - [(SubroutineCall - 2 f - () - [] - () - )] - () - Public - .false. - .false. - () - ), - f: - (Function - (SymbolTable - 3 - { - __list_iterator: - (Variable - 3 - __list_iterator - [] - Local - () - () - Default - (Integer 4) - () - Source - Public - Required - .false. - ), - x: - (Variable - 3 - x - [] - Local - () - () - Default - (Dict - (Integer 4) - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - () - Source - Public - Required - .false. - ), - y: - (Variable - 3 - y - [] - Local - () - () - Default - (Dict - (Integer 4) - (List - (Integer 4) - ) - ) - () - Source - Public - Required - .false. - ) - }) - f - (FunctionType - [] - () - Source - Implementation - () - .false. - .false. - .false. - .false. - .false. - [] - .false. - ) - [] - [] - [(= - (Var 3 x) - (DictConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - [(TupleConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - (TupleConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (Tuple - [(Integer 4) - (Integer 4)] - ) - )] - (Dict - (Integer 4) - (Tuple - [(Integer 4) - (Integer 4)] - ) - ) - ) - () - ) - (= - (Var 3 y) - (DictConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - [(ListConstant - [(IntegerConstant 1 (Integer 4)) - (IntegerConstant 2 (Integer 4))] - (List - (Integer 4) - ) - ) - (ListConstant - [(IntegerConstant 3 (Integer 4)) - (IntegerConstant 4 (Integer 4))] - (List - (Integer 4) - ) - )] - (Dict - (Integer 4) - (List - (Integer 4) - ) - ) - ) - () - ) - (Print - () - [(StringConstant - "(" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (DictItem - (Var 3 x) - (IntegerConstant 1 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (DictItem - (Var 3 x) - (IntegerConstant 1 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ")" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "(" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (DictItem - (Var 3 x) - (IntegerConstant 2 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 0 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(TupleItem - (DictItem - (Var 3 x) - (IntegerConstant 2 (Integer 4)) - () - (Tuple - [(Integer 4) - (Integer 4)] - ) - () - ) - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (Print - () - [(StringConstant - ")" - (Character 1 1 ()) - )] - () - (StringConstant - " " - (Character 1 1 ()) - ) - ) - (Print - () - [(StringConstant - "[" - (Character 1 1 ()) - )] - () - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (DoLoop - () - ((Var 3 __list_iterator) - (IntegerConstant 0 (Integer 4)) - (IntegerBinOp - (ListLen - (DictItem - (Var 3 y) - (IntegerConstant 1 (Integer 4)) - () - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (IntegerConstant 1 (Integer 4))) - [(Print - () - [(ListItem - (DictItem - (Var 3 y) - (IntegerConstant 1 (Integer 4)) - () - (List - (Integer 4) - ) - () - ) - (Var 3 __list_iterator) - (Integer 4) - () - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - ) - (If - (IntegerCompare - (Var 3 __list_iterator) - Lt - (IntegerBinOp - (ListLen - (DictItem - (Var 3 y) - (IntegerConstant 1 (Integer 4)) - () - (List - (Integer 4) - ) - () - ) - (Integer 4) - () - ) - Sub - (IntegerConstant 1 (Integer 4)) - (Integer 4) - () - ) - (Logical 4) - () - ) - [(Print - () - [(StringConstant - ", " - (Character 1 2 ()) - )] - (StringConstant - "" - (Character 1 0 ()) - ) - (StringConstant - "" - (Character 1 0 ()) - ) - )] - [] - )] - ) - (Print - () - [(StringConstant - "]" - (Character 1 1 ()) - )] - () - () - )] - () - Public - .false. - .false. - () - ) - }) - __main__ - [] - .false. - .false. - ), - main_program: - (Program - (SymbolTable - 5 - { - __main__global_stmts: - (ExternalSymbol - 5 - __main__global_stmts - 2 __main__global_stmts - __main__ - [] - __main__global_stmts - Public - ) - }) - main_program - [__main__] - [(SubroutineCall - 5 __main__global_stmts - 2 __main__global_stmts - [] - () - )] - ) - }) - [] -) diff --git a/tests/reference/run_dbg-test_assert_01-2f34744.json b/tests/reference/run_dbg-test_assert_01-2f34744.json deleted file mode 100644 index f8ac5ccbe9..0000000000 --- a/tests/reference/run_dbg-test_assert_01-2f34744.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "run_dbg-test_assert_01-2f34744", - "cmd": "lpython {infile} -g --debug-with-line-column --no-color", - "infile": "tests/runtime_errors/test_assert_01.py", - "infile_hash": "7a380295a35651b1a5120e1e64a44cae95d2c14c89cf5a4b6ea3dd1a", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "run_dbg-test_assert_01-2f34744.stderr", - "stderr_hash": "4811af471c73572b285e9ea01c8689abdd3cb32c717b3cd4876d2669", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_01-2f34744.stderr b/tests/reference/run_dbg-test_assert_01-2f34744.stderr deleted file mode 100644 index a7dc14d623..0000000000 --- a/tests/reference/run_dbg-test_assert_01-2f34744.stderr +++ /dev/null @@ -1,7 +0,0 @@ - File "tests/runtime_errors/test_assert_01.py", line 1 - def test(): - File "tests/runtime_errors/test_assert_01.py", line 4 - test() - File "tests/runtime_errors/test_assert_01.py", line 2 - assert False -AssertionError diff --git a/tests/reference/run_dbg-test_assert_02-c6de25a.json b/tests/reference/run_dbg-test_assert_02-c6de25a.json deleted file mode 100644 index 19b16179f5..0000000000 --- a/tests/reference/run_dbg-test_assert_02-c6de25a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "run_dbg-test_assert_02-c6de25a", - "cmd": "lpython {infile} -g --debug-with-line-column --no-color", - "infile": "tests/runtime_errors/test_assert_02.py", - "infile_hash": "85f0e908c3e5d21da83216f95221f59ebd69b477f42718842c1d6c8c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "run_dbg-test_assert_02-c6de25a.stderr", - "stderr_hash": "d5bfce55992e8d0630849442ee1f9b32864c64c328917c29fafc9424", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_02-c6de25a.stderr b/tests/reference/run_dbg-test_assert_02-c6de25a.stderr deleted file mode 100644 index 0b837dc18e..0000000000 --- a/tests/reference/run_dbg-test_assert_02-c6de25a.stderr +++ /dev/null @@ -1,7 +0,0 @@ - File "tests/runtime_errors/test_assert_02.py", line 1 - def test(): - File "tests/runtime_errors/test_assert_02.py", line 4 - test() - File "tests/runtime_errors/test_assert_02.py", line 2 - assert 1 != 1, "One is equal to one." -AssertionError: One is equal to one. diff --git a/tests/reference/run_dbg-test_assert_03-bd7b7dd.json b/tests/reference/run_dbg-test_assert_03-bd7b7dd.json deleted file mode 100644 index f771107475..0000000000 --- a/tests/reference/run_dbg-test_assert_03-bd7b7dd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "run_dbg-test_assert_03-bd7b7dd", - "cmd": "lpython {infile} -g --debug-with-line-column --no-color", - "infile": "tests/runtime_errors/test_assert_03.py", - "infile_hash": "8d04aa5eb18e1faa6b0f923f5585bfd8211391b1e423b159d5da4764", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "run_dbg-test_assert_03-bd7b7dd.stderr", - "stderr_hash": "cae7dd955478787917e9dbb0bc1f63631317b13da1d892c3ebab9097", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr b/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr deleted file mode 100644 index 65f2444ba9..0000000000 --- a/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr +++ /dev/null @@ -1,11 +0,0 @@ - File "tests/runtime_errors/test_assert_03.py", line 1 - def f(): - File "tests/runtime_errors/test_assert_03.py", line 10 - main() - File "tests/runtime_errors/test_assert_03.py", line 8 - f() - File "tests/runtime_errors/test_assert_03.py", line 2 - g() - File "tests/runtime_errors/test_assert_03.py", line 5 - assert False -AssertionError diff --git a/tests/reference/run_dbg-test_quit_01-30889cc.json b/tests/reference/run_dbg-test_quit_01-30889cc.json deleted file mode 100644 index d46739a952..0000000000 --- a/tests/reference/run_dbg-test_quit_01-30889cc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "run_dbg-test_quit_01-30889cc", - "cmd": "lpython {infile} -g --debug-with-line-column --no-color", - "infile": "tests/runtime_errors/test_quit_01.py", - "infile_hash": "d2c544c21b4973dde53993e0a26bae6fac9581e7d5c87dd2cfc93f07", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "run_dbg-test_quit_01-30889cc.stderr", - "stderr_hash": "b3dac87462f9f0650e5a6af68791137ca9d29f9a64139ba7718a9f96", - "returncode": 10 -} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_quit_01-30889cc.stderr b/tests/reference/run_dbg-test_quit_01-30889cc.stderr deleted file mode 100644 index c1c7a54e60..0000000000 --- a/tests/reference/run_dbg-test_quit_01-30889cc.stderr +++ /dev/null @@ -1,7 +0,0 @@ - File "tests/runtime_errors/test_quit_01.py", line 1 - def test(): - File "tests/runtime_errors/test_quit_01.py", line 4 - test() - File "tests/runtime_errors/test_quit_01.py", line 2 - quit(10) -STOP diff --git a/tests/reference/run_dbg-test_raise_01-dfd86ca.json b/tests/reference/run_dbg-test_raise_01-dfd86ca.json deleted file mode 100644 index 2dbe004c7e..0000000000 --- a/tests/reference/run_dbg-test_raise_01-dfd86ca.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "run_dbg-test_raise_01-dfd86ca", - "cmd": "lpython {infile} -g --debug-with-line-column --no-color", - "infile": "tests/runtime_errors/test_raise_01.py", - "infile_hash": "359f595e813294fccdacb372c25a2aa6d3827066af7d91db62e32d83", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "run_dbg-test_raise_01-dfd86ca.stderr", - "stderr_hash": "76085f527077a81ba6457af8f982a497038168f555ab4027d0d6340e", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr b/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr deleted file mode 100644 index 42bc707825..0000000000 --- a/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr +++ /dev/null @@ -1,7 +0,0 @@ - File "tests/runtime_errors/test_raise_01.py", line 1 - def test(): - File "tests/runtime_errors/test_raise_01.py", line 4 - test() - File "tests/runtime_errors/test_raise_01.py", line 2 - raise -ERROR STOP diff --git a/tests/reference/runtime-test_dict14-421fe53.json b/tests/reference/runtime-test_dict14-421fe53.json deleted file mode 100644 index ae6a837f77..0000000000 --- a/tests/reference/runtime-test_dict14-421fe53.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_dict14-421fe53", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_dict14.py", - "infile_hash": "c81e4a1e050c87d04f537b49fcfb0b479a5ce3ed7735f90d2c347dba", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_dict14-421fe53.stderr", - "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict14-421fe53.stderr b/tests/reference/runtime-test_dict14-421fe53.stderr deleted file mode 100644 index e8c90e4e1d..0000000000 --- a/tests/reference/runtime-test_dict14-421fe53.stderr +++ /dev/null @@ -1 +0,0 @@ -KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_dict15-6f3af0d.json b/tests/reference/runtime-test_dict15-6f3af0d.json deleted file mode 100644 index 5bf5c80a4b..0000000000 --- a/tests/reference/runtime-test_dict15-6f3af0d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_dict15-6f3af0d", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_dict15.py", - "infile_hash": "6a0e507b9a9cf659cb433abbdc3435b4c63a6079eadcd7d2c765def1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_dict15-6f3af0d.stderr", - "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict15-6f3af0d.stderr b/tests/reference/runtime-test_dict15-6f3af0d.stderr deleted file mode 100644 index e8c90e4e1d..0000000000 --- a/tests/reference/runtime-test_dict15-6f3af0d.stderr +++ /dev/null @@ -1 +0,0 @@ -KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_dict16-c5a958d.json b/tests/reference/runtime-test_dict16-c5a958d.json deleted file mode 100644 index 471c82d252..0000000000 --- a/tests/reference/runtime-test_dict16-c5a958d.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_dict16-c5a958d", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_dict16.py", - "infile_hash": "7b00cfd7f6eac8338897bd99e5d953605f16927ee0f27683146b0182", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_dict16-c5a958d.stderr", - "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict16-c5a958d.stderr b/tests/reference/runtime-test_dict16-c5a958d.stderr deleted file mode 100644 index e8c90e4e1d..0000000000 --- a/tests/reference/runtime-test_dict16-c5a958d.stderr +++ /dev/null @@ -1 +0,0 @@ -KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_list_01-3ee9b3e.json b/tests/reference/runtime-test_list_01-3ee9b3e.json deleted file mode 100644 index 0c845eb4e6..0000000000 --- a/tests/reference/runtime-test_list_01-3ee9b3e.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_01-3ee9b3e", - "cmd": "lpython {infile}", - "infile": "tests/runtime_errors/test_list_01.py", - "infile_hash": "a982aac98be709cc9304e20c7d79f4141f41fdfb0eba261d00beff2c", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_01-3ee9b3e.stderr", - "stderr_hash": "c9cbdc4df1e7fbe0a6e73db7ac7809f71102fb524c8aa86139271006", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_01-3ee9b3e.stderr b/tests/reference/runtime-test_list_01-3ee9b3e.stderr deleted file mode 100644 index 86d697f5c2..0000000000 --- a/tests/reference/runtime-test_list_01-3ee9b3e.stderr +++ /dev/null @@ -1 +0,0 @@ -ValueError: The list does not contain the element: 4 diff --git a/tests/reference/runtime-test_list_02-5f7db5f.json b/tests/reference/runtime-test_list_02-5f7db5f.json deleted file mode 100644 index c4afb880c4..0000000000 --- a/tests/reference/runtime-test_list_02-5f7db5f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_02-5f7db5f", - "cmd": "lpython {infile}", - "infile": "tests/runtime_errors/test_list_02.py", - "infile_hash": "004ac679732e715b87556ac0d6f0ea649612981999a20dad4e25acd0", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_02-5f7db5f.stderr", - "stderr_hash": "f45ba86e610eeb2cc11fc176120e56d153a896f486e9b04d94fa3de1", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_02-5f7db5f.stderr b/tests/reference/runtime-test_list_02-5f7db5f.stderr deleted file mode 100644 index 4f2d5a50c5..0000000000 --- a/tests/reference/runtime-test_list_02-5f7db5f.stderr +++ /dev/null @@ -1 +0,0 @@ -IndexError: List index is out of range. Index range is (0, 2), but the given index is 3 diff --git a/tests/reference/runtime-test_list_index-0483808.json b/tests/reference/runtime-test_list_index-0483808.json deleted file mode 100644 index 36ec2cbe9d..0000000000 --- a/tests/reference/runtime-test_list_index-0483808.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_index-0483808", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_list_index.py", - "infile_hash": "cded5d4f016ab4642b0ad1e30239da53272d823fe7d01c999c2811a1", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_index-0483808.stderr", - "stderr_hash": "dd3d49b5f2f97ed8f1d27cd73ebca7a8740483660dd4ae702e2048b2", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index-0483808.stderr b/tests/reference/runtime-test_list_index-0483808.stderr deleted file mode 100644 index 93fd195103..0000000000 --- a/tests/reference/runtime-test_list_index-0483808.stderr +++ /dev/null @@ -1 +0,0 @@ -ValueError: The list does not contain the element: 0 diff --git a/tests/reference/runtime-test_list_index2-1249233.json b/tests/reference/runtime-test_list_index2-1249233.json deleted file mode 100644 index f1e4344ce2..0000000000 --- a/tests/reference/runtime-test_list_index2-1249233.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_index2-1249233", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_list_index2.py", - "infile_hash": "f7f556f1c048a88ee6eb9eae3ce3a337da17b3705b602085ff62ac4f", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_index2-1249233.stderr", - "stderr_hash": "fc647b30c89710c23d7efec0fe4390894c725680b5d8c4b4c939a5bf", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index2-1249233.stderr b/tests/reference/runtime-test_list_index2-1249233.stderr deleted file mode 100644 index 68bd909af9..0000000000 --- a/tests/reference/runtime-test_list_index2-1249233.stderr +++ /dev/null @@ -1 +0,0 @@ -ValueError: The list does not contain the element: 1 diff --git a/tests/reference/runtime-test_list_index3-647a94a.json b/tests/reference/runtime-test_list_index3-647a94a.json deleted file mode 100644 index 6a0d2c606b..0000000000 --- a/tests/reference/runtime-test_list_index3-647a94a.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_index3-647a94a", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_list_index3.py", - "infile_hash": "2e560614ee9a755d3a001cee48f968f2ff90bea9f00ab22b441667b2", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_index3-647a94a.stderr", - "stderr_hash": "fc647b30c89710c23d7efec0fe4390894c725680b5d8c4b4c939a5bf", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index3-647a94a.stderr b/tests/reference/runtime-test_list_index3-647a94a.stderr deleted file mode 100644 index 68bd909af9..0000000000 --- a/tests/reference/runtime-test_list_index3-647a94a.stderr +++ /dev/null @@ -1 +0,0 @@ -ValueError: The list does not contain the element: 1 diff --git a/tests/reference/runtime-test_list_index4-c31dfdb.json b/tests/reference/runtime-test_list_index4-c31dfdb.json deleted file mode 100644 index 237d1a5f2e..0000000000 --- a/tests/reference/runtime-test_list_index4-c31dfdb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_list_index4-c31dfdb", - "cmd": "lpython {infile}", - "infile": "tests/errors/test_list_index4.py", - "infile_hash": "4513031129335b8c83686936c12f6b24516c14a79ad5c3b9a9d98113", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "runtime-test_list_index4-c31dfdb.stderr", - "stderr_hash": "3e3eee1ba7f96c1edaeed1c7b93f54b397dbe3b08d20c9b720c291a5", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index4-c31dfdb.stderr b/tests/reference/runtime-test_list_index4-c31dfdb.stderr deleted file mode 100644 index 6adc6bd250..0000000000 --- a/tests/reference/runtime-test_list_index4-c31dfdb.stderr +++ /dev/null @@ -1 +0,0 @@ -ValueError: The list does not contain the element: 2 diff --git a/tests/reference/runtime-test_str_01-50bdf2f.json b/tests/reference/runtime-test_str_01-50bdf2f.json deleted file mode 100644 index d28f645eca..0000000000 --- a/tests/reference/runtime-test_str_01-50bdf2f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_str_01-50bdf2f", - "cmd": "lpython {infile}", - "infile": "tests/runtime_errors/test_str_01.py", - "infile_hash": "7fb9748271af03bfa35e190a4514480662f42263ebfa0a6b2e082868", - "outfile": null, - "outfile_hash": null, - "stdout": "runtime-test_str_01-50bdf2f.stdout", - "stdout_hash": "ae5584858d62f3df08abdd365ea09fed0a7aa75f0f10698a7f7c2508", - "stderr": null, - "stderr_hash": null, - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_str_01-50bdf2f.stdout b/tests/reference/runtime-test_str_01-50bdf2f.stdout deleted file mode 100644 index 8a34c88ede..0000000000 --- a/tests/reference/runtime-test_str_01-50bdf2f.stdout +++ /dev/null @@ -1 +0,0 @@ -String index: -4 is out of Bounds diff --git a/tests/reference/runtime-test_str_02-c38ba27.json b/tests/reference/runtime-test_str_02-c38ba27.json deleted file mode 100644 index 18d74d95fd..0000000000 --- a/tests/reference/runtime-test_str_02-c38ba27.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "runtime-test_str_02-c38ba27", - "cmd": "lpython {infile}", - "infile": "tests/runtime_errors/test_str_02.py", - "infile_hash": "63853d644565a26ea82a41221d8fe11d9fc20d9132a36a76e6aba5e6", - "outfile": null, - "outfile_hash": null, - "stdout": "runtime-test_str_02-c38ba27.stdout", - "stdout_hash": "59f7b180db70f25c853c552c014ae09c1ee0671dfa0cbe205815c6b9", - "stderr": null, - "stderr_hash": null, - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/runtime-test_str_02-c38ba27.stdout b/tests/reference/runtime-test_str_02-c38ba27.stdout deleted file mode 100644 index 2d17446782..0000000000 --- a/tests/reference/runtime-test_str_02-c38ba27.stdout +++ /dev/null @@ -1 +0,0 @@ -String index: -8 is out of Bounds diff --git a/tests/reference/tokens-comment1-2f8ab90.json b/tests/reference/tokens-comment1-2f8ab90.json deleted file mode 100644 index cea27f0740..0000000000 --- a/tests/reference/tokens-comment1-2f8ab90.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-comment1-2f8ab90", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/comment1.py", - "infile_hash": "27258459bf39e8c5bcaa41e7fef8a593775a915273787edc46c73b4d", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-comment1-2f8ab90.stdout", - "stdout_hash": "9e9a900b941381aadb0d8f29662fa337e918a769daba0c019d7ccdee", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-comment1-2f8ab90.stdout b/tests/reference/tokens-comment1-2f8ab90.stdout deleted file mode 100644 index 778edf2ad2..0000000000 --- a/tests/reference/tokens-comment1-2f8ab90.stdout +++ /dev/null @@ -1,34 +0,0 @@ -(TOKEN "comment") 0:9 -(NEWLINE) 10:10 -(KEYWORD "def") 11:13 -(TOKEN "identifier" test) 15:18 -(TOKEN "(") 19:19 -(TOKEN ")") 20:20 -(TOKEN ":") 21:21 -(TOKEN "eolcomment") 23:33 -(NEWLINE) 34:34 -(TOKEN "comment") 39:49 -(NEWLINE) 50:50 -(TOKEN "indent") 51:54 -(TOKEN "identifier" print) 55:59 -(TOKEN "(") 60:60 -(TOKEN ")") 61:61 -(NEWLINE) 62:62 -(TOKEN "comment") 63:73 -(NEWLINE) 74:74 -(TOKEN "dedent") 74:74 -(TOKEN "identifier" test) 75:78 -(TOKEN "(") 79:79 -(TOKEN ")") 80:80 -(TOKEN "eolcomment") 82:92 -(NEWLINE) 93:93 -(TOKEN "comment") 94:104 -(NEWLINE) 105:105 -(NEWLINE) 106:106 -(TOKEN "comment") 107:109 -(NEWLINE) 110:110 -(TOKEN "comment") 111:122 -(NEWLINE) 123:123 -(TOKEN "comment") 124:133 -(NEWLINE) 134:134 -(EOF) 135:135 diff --git a/tests/reference/tokens-comment2-b289dad.json b/tests/reference/tokens-comment2-b289dad.json deleted file mode 100644 index 8bdb10892b..0000000000 --- a/tests/reference/tokens-comment2-b289dad.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-comment2-b289dad", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/comment2.py", - "infile_hash": "b62404a5d774f0b18fcad6fb1dac8733334ce3593a77d34bcbb05019", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-comment2-b289dad.stdout", - "stdout_hash": "40e09fec45afa4b961404b5b0e5d4b1ff68828891bbf3c2cd373a910", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-comment2-b289dad.stdout b/tests/reference/tokens-comment2-b289dad.stdout deleted file mode 100644 index 3013ac4416..0000000000 --- a/tests/reference/tokens-comment2-b289dad.stdout +++ /dev/null @@ -1,133 +0,0 @@ -(KEYWORD "def") 0:2 -(TOKEN "identifier" main) 4:7 -(TOKEN "(") 8:8 -(TOKEN ")") 9:9 -(TOKEN ":") 10:10 -(NEWLINE) 11:11 -(TOKEN "comment") 12:14 -(NEWLINE) 15:15 -(TOKEN "comment") 20:22 -(NEWLINE) 23:23 -(TOKEN "indent") 24:27 -(KEYWORD "if") 28:29 -(TOKEN "identifier" foo) 31:33 -(TOKEN ":") 34:34 -(TOKEN "eolcomment") 36:38 -(NEWLINE) 39:39 -(TOKEN "comment") 48:50 -(NEWLINE) 51:51 -(TOKEN "comment") 56:58 -(NEWLINE) 59:59 -(TOKEN "comment") 60:61 -(NEWLINE) 62:62 -(TOKEN "indent") 63:70 -(KEYWORD "if") 71:72 -(TOKEN "identifier" bar) 74:76 -(TOKEN ":") 77:77 -(TOKEN "eolcomment") 79:81 -(NEWLINE) 82:82 -(TOKEN "indent") 83:94 -(KEYWORD "pass") 95:98 -(NEWLINE) 99:99 -(TOKEN "dedent") 100:103 -(TOKEN "dedent") 103:103 -(KEYWORD "else") 104:107 -(TOKEN ":") 108:108 -(NEWLINE) 109:109 -(TOKEN "indent") 110:117 -(KEYWORD "pass") 118:121 -(NEWLINE) 122:122 -(TOKEN "dedent") 123:126 -(KEYWORD "return") 127:132 -(NEWLINE) 133:133 -(NEWLINE) 134:134 -(TOKEN "dedent") 134:134 -(KEYWORD "def") 135:137 -(TOKEN "identifier" test) 139:142 -(TOKEN "(") 143:143 -(TOKEN ")") 144:144 -(TOKEN ":") 145:145 -(NEWLINE) 146:146 -(TOKEN "indent") 147:150 -(TOKEN "identifier" print) 151:155 -(TOKEN "(") 156:156 -(TOKEN ")") 157:157 -(NEWLINE) 158:158 -(NEWLINE) 159:159 -(TOKEN "comment") 160:168 -(NEWLINE) 169:169 -(NEWLINE) 170:170 -(TOKEN "dedent") 170:170 -(KEYWORD "def") 171:173 -(TOKEN "identifier" main) 175:178 -(TOKEN "(") 179:179 -(TOKEN ")") 180:180 -(TOKEN ":") 181:181 -(NEWLINE) 182:182 -(TOKEN "indent") 183:186 -(TOKEN "identifier" print) 187:191 -(TOKEN "(") 192:192 -(TOKEN ")") 193:193 -(NEWLINE) 194:194 -(TOKEN "comment") 199:207 -(NEWLINE) 208:208 -(NEWLINE) 209:209 -(TOKEN "dedent") 209:209 -(KEYWORD "def") 210:212 -(TOKEN "identifier" main) 214:217 -(TOKEN "(") 218:218 -(TOKEN ")") 219:219 -(TOKEN ":") 220:220 -(NEWLINE) 221:221 -(TOKEN "indent") 222:225 -(TOKEN "identifier" print) 226:230 -(TOKEN "(") 231:231 -(TOKEN ")") 232:232 -(NEWLINE) 233:233 -(TOKEN "comment") 234:242 -(NEWLINE) 243:243 -(KEYWORD "pass") 248:251 -(NEWLINE) 252:252 -(NEWLINE) 253:253 -(TOKEN "dedent") 253:253 -(KEYWORD "def") 254:256 -(TOKEN "identifier" main) 258:261 -(TOKEN "(") 262:262 -(TOKEN ")") 263:263 -(TOKEN ":") 264:264 -(NEWLINE) 265:265 -(TOKEN "indent") 266:269 -(KEYWORD "if") 270:271 -(TOKEN "identifier" foo) 273:275 -(TOKEN ":") 276:276 -(NEWLINE) 277:277 -(TOKEN "indent") 278:285 -(KEYWORD "pass") 286:289 -(NEWLINE) 290:290 -(TOKEN "comment") 291:299 -(NEWLINE) 300:300 -(KEYWORD "pass") 309:312 -(NEWLINE) 313:313 -(KEYWORD "if") 322:323 -(TOKEN "identifier" bar) 325:327 -(TOKEN ":") 328:328 -(NEWLINE) 329:329 -(TOKEN "indent") 330:341 -(KEYWORD "pass") 342:345 -(NEWLINE) 346:346 -(TOKEN "dedent") 347:354 -(KEYWORD "pass") 355:358 -(NEWLINE) 359:359 -(TOKEN "dedent") 360:363 -(KEYWORD "pass") 364:367 -(NEWLINE) 368:368 -(NEWLINE) 369:369 -(TOKEN "dedent") 369:369 -(TOKEN "identifier" x) 370:370 -(TOKEN "=") 372:372 -(TOKEN "[") 374:374 -(TOKEN "identifier" a) 390:390 -(TOKEN ",") 391:391 -(TOKEN "]") 393:393 -(NEWLINE) 394:394 -(EOF) 395:395 diff --git a/tests/reference/tokens-docstring1-1355fbb.json b/tests/reference/tokens-docstring1-1355fbb.json deleted file mode 100644 index ee767caca7..0000000000 --- a/tests/reference/tokens-docstring1-1355fbb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-docstring1-1355fbb", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/docstring1.py", - "infile_hash": "76a733fb41e5cfebb1d9bd74a719fa2644e746ce06a64fbbf91358a8", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-docstring1-1355fbb.stdout", - "stdout_hash": "9afa056946f77dcfa0a5aa89b3ff738274836892169e03c14ee14a8f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-docstring1-1355fbb.stdout b/tests/reference/tokens-docstring1-1355fbb.stdout deleted file mode 100644 index fe9060da80..0000000000 --- a/tests/reference/tokens-docstring1-1355fbb.stdout +++ /dev/null @@ -1,36 +0,0 @@ -(KEYWORD "def") 0:2 -(TOKEN "identifier" test1) 4:8 -(TOKEN "(") 9:9 -(TOKEN ")") 10:10 -(TOKEN ":") 11:11 -(NEWLINE) 12:12 -(TOKEN "indent") 13:16 -(TOKEN "string" "A multi-line\n docstring.\n ") 17:54 -(NEWLINE) 55:55 -(NEWLINE) 56:56 -(TOKEN "dedent") 56:56 -(KEYWORD "def") 57:59 -(TOKEN "identifier" test2) 61:65 -(TOKEN "(") 66:66 -(TOKEN ")") 67:67 -(TOKEN ":") 68:68 -(NEWLINE) 69:69 -(TOKEN "indent") 70:73 -(TOKEN "string" "\n A multi-line\n docstring.\n ") 74:116 -(NEWLINE) 117:117 -(NEWLINE) 118:118 -(TOKEN "dedent") 118:118 -(KEYWORD "def") 119:121 -(TOKEN "identifier" test2) 123:127 -(TOKEN "(") 128:128 -(TOKEN ")") 129:129 -(TOKEN ":") 130:130 -(NEWLINE) 131:131 -(TOKEN "indent") 132:135 -(TOKEN "string" " A single-line docstring.") 136:166 -(NEWLINE) 167:167 -(NEWLINE) 168:168 -(TOKEN "dedent") 168:168 -(TOKEN "string" "\nA multi-line\ndocstring.\n") 169:199 -(NEWLINE) 200:200 -(EOF) 201:201 diff --git a/tests/reference/tokens-indent1-0b243c5.json b/tests/reference/tokens-indent1-0b243c5.json deleted file mode 100644 index 8f6a69248b..0000000000 --- a/tests/reference/tokens-indent1-0b243c5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-indent1-0b243c5", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/indent1.py", - "infile_hash": "e4b85b69276c943f42a1779fce9d11e4afdcf5a037890a3222afa21d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-indent1-0b243c5.stderr", - "stderr_hash": "d642cbfab3b7f5cdc1d373d420877c776d64b9eb6dcdd2491f7970f7", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-indent1-0b243c5.stderr b/tests/reference/tokens-indent1-0b243c5.stderr deleted file mode 100644 index ce7ce194d9..0000000000 --- a/tests/reference/tokens-indent1-0b243c5.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Indentation should be of the same type (either tabs or spaces) - --> tests/tokens/errors/indent1.py:3:1 - | -3 | pass - | ^^ diff --git a/tests/reference/tokens-indent1-290e858.json b/tests/reference/tokens-indent1-290e858.json deleted file mode 100644 index 7374507118..0000000000 --- a/tests/reference/tokens-indent1-290e858.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-indent1-290e858", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/indent1.py", - "infile_hash": "e8d2e3a0872f5aea8db4b6631f2fcb0e562dda5b3f59ff247cb9aaa9", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-indent1-290e858.stdout", - "stdout_hash": "9b71c23ca510cf5a4529540766fb16fc3c5b59bc7225efcfe25b3f0b", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-indent1-290e858.stdout b/tests/reference/tokens-indent1-290e858.stdout deleted file mode 100644 index 98197c5ed5..0000000000 --- a/tests/reference/tokens-indent1-290e858.stdout +++ /dev/null @@ -1,73 +0,0 @@ -(KEYWORD "from") 0:3 -(TOKEN "identifier" lpython) 5:11 -(KEYWORD "import") 13:18 -(TOKEN "identifier" i32) 26:28 -(NEWLINE) 29:29 -(NEWLINE) 30:30 -(KEYWORD "def") 31:33 -(TOKEN "identifier" test) 35:38 -(TOKEN "(") 39:39 -(TOKEN ")") 40:40 -(TOKEN ":") 41:41 -(NEWLINE) 42:42 -(TOKEN "indent") 43:46 -(TOKEN "identifier" print) 47:51 -(TOKEN "(") 52:52 -(TOKEN ")") 53:53 -(NEWLINE) 54:54 -(KEYWORD "if") 59:60 -(TOKEN "integer" 1) 62:62 -(TOKEN ">") 64:64 -(TOKEN "integer" 0) 66:66 -(TOKEN ":") 67:67 -(NEWLINE) 68:68 -(TOKEN "indent") 69:76 -(TOKEN "identifier" print) 77:81 -(TOKEN "(") 82:82 -(TOKEN ")") 83:83 -(NEWLINE) 84:84 -(KEYWORD "if") 93:94 -(TOKEN "integer" 2) 96:96 -(TOKEN ">") 98:98 -(TOKEN "integer" 0) 100:100 -(TOKEN ":") 101:101 -(NEWLINE) 102:102 -(TOKEN "indent") 103:114 -(TOKEN "identifier" print) 115:119 -(TOKEN "(") 120:120 -(TOKEN ")") 121:121 -(NEWLINE) 122:122 -(TOKEN "dedent") 123:126 -(TOKEN "dedent") 126:126 -(KEYWORD "if") 127:128 -(TOKEN "integer" 3) 130:130 -(TOKEN ">") 132:132 -(TOKEN "integer" 0) 134:134 -(TOKEN ":") 135:135 -(NEWLINE) 136:136 -(TOKEN "indent") 137:144 -(TOKEN "identifier" print) 145:149 -(TOKEN "(") 150:150 -(TOKEN ")") 151:151 -(NEWLINE) 152:152 -(NEWLINE) 153:153 -(KEYWORD "if") 162:163 -(TOKEN "integer" 4) 165:165 -(TOKEN ">") 167:167 -(TOKEN "integer" 0) 169:169 -(TOKEN ":") 170:170 -(NEWLINE) 171:171 -(TOKEN "indent") 172:183 -(TOKEN "identifier" print) 184:188 -(TOKEN "(") 189:189 -(TOKEN ")") 190:190 -(NEWLINE) 191:191 -(NEWLINE) 192:192 -(TOKEN "dedent") 192:192 -(TOKEN "dedent") 192:192 -(TOKEN "dedent") 192:192 -(TOKEN "identifier" test) 193:196 -(TOKEN "(") 197:197 -(TOKEN ")") 198:198 -(NEWLINE) 199:199 -(EOF) 200:200 diff --git a/tests/reference/tokens-indent2-a8438a0.json b/tests/reference/tokens-indent2-a8438a0.json deleted file mode 100644 index 6842962c04..0000000000 --- a/tests/reference/tokens-indent2-a8438a0.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-indent2-a8438a0", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/indent2.py", - "infile_hash": "19c2d8095cd65d521be708e23a2e29ab3cb672b888bc5fa8fbf745b3", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-indent2-a8438a0.stderr", - "stderr_hash": "ab862ff68983c5975d21f13c5b159de2a2888cae1d38a38a24700a88", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-indent2-a8438a0.stderr b/tests/reference/tokens-indent2-a8438a0.stderr deleted file mode 100644 index 75f882f0a8..0000000000 --- a/tests/reference/tokens-indent2-a8438a0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Indentation should be of the same type (either tabs or spaces) - --> tests/tokens/errors/indent2.py:4:1 - | -4 | else: - | ^ diff --git a/tests/reference/tokens-indent2-e702789.json b/tests/reference/tokens-indent2-e702789.json deleted file mode 100644 index a30e0d0e55..0000000000 --- a/tests/reference/tokens-indent2-e702789.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-indent2-e702789", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/indent2.py", - "infile_hash": "6ee8bbeb2e48631f07b13012f569904545ce5c14e714003d030fc385", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-indent2-e702789.stdout", - "stdout_hash": "e259b5fcc4c1d83a04924c51a6a6f6d9be631970d3663e5be065ed7d", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-indent2-e702789.stdout b/tests/reference/tokens-indent2-e702789.stdout deleted file mode 100644 index 46aca1243c..0000000000 --- a/tests/reference/tokens-indent2-e702789.stdout +++ /dev/null @@ -1,88 +0,0 @@ -(KEYWORD "class") 0:4 -(TOKEN "identifier" Test) 6:9 -(TOKEN ":") 10:10 -(NEWLINE) 11:11 -(TOKEN "indent") 12:15 -(KEYWORD "def") 16:18 -(TOKEN "identifier" foo) 20:22 -(TOKEN "(") 23:23 -(TOKEN "identifier" a) 24:24 -(TOKEN ")") 25:25 -(TOKEN ":") 26:26 -(NEWLINE) 27:27 -(TOKEN "indent") 28:35 -(KEYWORD "if") 36:37 -(TOKEN "identifier" a) 39:39 -(TOKEN "==") 41:42 -(TOKEN "string" "foo") 44:48 -(TOKEN ":") 49:49 -(NEWLINE) 50:50 -(TOKEN "indent") 51:62 -(KEYWORD "return") 63:68 -(TOKEN "string" "foo") 70:74 -(NEWLINE) 75:75 -(TOKEN "dedent") 76:83 -(KEYWORD "return") 84:89 -(TOKEN "string" "bar") 91:95 -(NEWLINE) 96:96 -(NEWLINE) 97:97 -(TOKEN "dedent") 97:97 -(TOKEN "dedent") 97:97 -(KEYWORD "def") 98:100 -(TOKEN "identifier" test) 102:105 -(TOKEN "(") 106:106 -(TOKEN ")") 107:107 -(TOKEN ":") 108:108 -(NEWLINE) 109:109 -(TOKEN "indent") 110:110 -(KEYWORD "if") 111:112 -(TOKEN "True") 114:117 -(TOKEN ":") 118:118 -(NEWLINE) 119:119 -(TOKEN "indent") 120:121 -(KEYWORD "pass") 122:125 -(NEWLINE) 126:126 -(TOKEN "dedent") 127:127 -(KEYWORD "else") 128:131 -(TOKEN ":") 132:132 -(NEWLINE) 133:133 -(TOKEN "indent") 134:135 -(KEYWORD "pass") 136:139 -(NEWLINE) 140:140 -(NEWLINE) 141:141 -(TOKEN "dedent") 141:141 -(TOKEN "dedent") 141:141 -(KEYWORD "def") 142:144 -(TOKEN "identifier" test) 146:149 -(TOKEN "(") 150:150 -(TOKEN "identifier" x) 151:151 -(TOKEN ":") 152:152 -(TOKEN "identifier" i32) 154:156 -(TOKEN ")") 157:157 -(TOKEN ":") 158:158 -(NEWLINE) 159:159 -(TOKEN "indent") 160:160 -(KEYWORD "if") 161:162 -(TOKEN "identifier" x) 164:164 -(TOKEN "<") 166:166 -(TOKEN "integer" 0) 168:168 -(TOKEN ":") 169:169 -(NEWLINE) 170:170 -(TOKEN "indent") 171:172 -(KEYWORD "pass") 173:176 -(NEWLINE) 177:177 -(TOKEN "dedent") 178:178 -(KEYWORD "else") 179:182 -(TOKEN ":") 183:183 -(NEWLINE) 184:184 -(TOKEN "indent") 185:186 -(TOKEN "identifier" Test) 187:190 -(TOKEN ".") 191:191 -(TOKEN "identifier" foo) 192:194 -(TOKEN "(") 195:195 -(TOKEN "identifier" x) 196:196 -(TOKEN ")") 197:197 -(NEWLINE) 198:198 -(TOKEN "dedent") 198:198 -(TOKEN "dedent") 198:198 -(EOF) 199:199 diff --git a/tests/reference/tokens-indent3-0eaf3e6.json b/tests/reference/tokens-indent3-0eaf3e6.json deleted file mode 100644 index e1ee281ca3..0000000000 --- a/tests/reference/tokens-indent3-0eaf3e6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-indent3-0eaf3e6", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/indent3.py", - "infile_hash": "cd9102f8d110fa0d6b12c07025d6646de807b60ee17b4604d9df08dc", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-indent3-0eaf3e6.stderr", - "stderr_hash": "1eddb6f37641a3eee16900c7025e6420f21cd97d3f877720bc90401b", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-indent3-0eaf3e6.stderr b/tests/reference/tokens-indent3-0eaf3e6.stderr deleted file mode 100644 index d6f7eb6224..0000000000 --- a/tests/reference/tokens-indent3-0eaf3e6.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expected an indented block. - --> tests/tokens/errors/indent3.py:5:1 - | -5 | pass - | ^^^^ diff --git a/tests/reference/tokens-numbers1-589063f.json b/tests/reference/tokens-numbers1-589063f.json deleted file mode 100644 index 6b70fe6d2a..0000000000 --- a/tests/reference/tokens-numbers1-589063f.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-numbers1-589063f", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/numbers1.py", - "infile_hash": "8905fda648bd8c1b0dde75bdbd1eeb72232d459d634f324a676a70aa", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-numbers1-589063f.stdout", - "stdout_hash": "10d82b7f649d7cded64379a82a40123a29115546eb66bf54389958cf", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-numbers1-589063f.stdout b/tests/reference/tokens-numbers1-589063f.stdout deleted file mode 100644 index b887a5a96d..0000000000 --- a/tests/reference/tokens-numbers1-589063f.stdout +++ /dev/null @@ -1,242 +0,0 @@ -(TOKEN "identifier" i) 0:0 -(TOKEN "=") 2:2 -(TOKEN "integer" 123) 4:6 -(NEWLINE) 7:7 -(TOKEN "identifier" i) 8:8 -(TOKEN "=") 10:10 -(TOKEN "-") 12:12 -(TOKEN "integer" 123) 13:15 -(NEWLINE) 16:16 -(TOKEN "identifier" i) 17:17 -(TOKEN "=") 19:19 -(TOKEN "-") 21:21 -(TOKEN "integer" 291) 22:26 -(NEWLINE) 27:27 -(TOKEN "identifier" i) 28:28 -(TOKEN "=") 30:30 -(TOKEN "integer" 6844) 32:37 -(NEWLINE) 38:38 -(TOKEN "identifier" i) 39:39 -(TOKEN "=") 41:41 -(TOKEN "integer" 6844) 43:48 -(NEWLINE) 49:49 -(TOKEN "identifier" i) 50:50 -(TOKEN "=") 52:52 -(TOKEN "-") 54:54 -(TOKEN "integer" 83) 55:59 -(NEWLINE) 60:60 -(TOKEN "identifier" i) 61:61 -(TOKEN "=") 63:63 -(TOKEN "integer" 87) 65:70 -(NEWLINE) 71:71 -(TOKEN "identifier" i) 72:72 -(TOKEN "=") 74:74 -(TOKEN "-") 76:76 -(TOKEN "integer" 13) 77:82 -(NEWLINE) 83:83 -(TOKEN "identifier" i) 84:84 -(TOKEN "=") 86:86 -(TOKEN "integer" 13) 88:93 -(NEWLINE) 94:94 -(TOKEN "identifier" i) 95:95 -(TOKEN "=") 97:97 -(TOKEN "real" 123.000000) 99:102 -(NEWLINE) 103:103 -(TOKEN "identifier" i) 104:104 -(TOKEN "=") 106:106 -(TOKEN "real" 0.123000) 108:111 -(NEWLINE) 112:112 -(TOKEN "identifier" i) 113:113 -(TOKEN "=") 115:115 -(TOKEN "real" 123.450000) 117:122 -(NEWLINE) 123:123 -(TOKEN "identifier" i) 124:124 -(TOKEN "=") 126:126 -(TOKEN "real" 0.123000) 128:132 -(NEWLINE) 133:133 -(TOKEN "identifier" i) 134:134 -(TOKEN "=") 136:136 -(TOKEN "real" 120000000000.000000) 138:144 -(NEWLINE) 145:145 -(TOKEN "identifier" i) 146:146 -(TOKEN "=") 148:148 -(TOKEN "real" 123400000000.000000) 150:158 -(NEWLINE) 159:159 -(TOKEN "identifier" i) 160:160 -(TOKEN "=") 162:162 -(TOKEN "real" 0.000000) 164:170 -(NEWLINE) 171:171 -(TOKEN "identifier" i) 172:172 -(TOKEN "=") 174:174 -(TOKEN "real" 0.000000) 176:183 -(NEWLINE) 184:184 -(TOKEN "identifier" i) 185:185 -(TOKEN "=") 187:187 -(TOKEN "real" 123400000000.000000) 189:196 -(NEWLINE) 197:197 -(TOKEN "identifier" i) 198:198 -(TOKEN "=") 200:200 -(TOKEN "integer" 12) 202:203 -(TOKEN "+") 204:204 -(TOKEN "imag number" 3.000000j) 205:206 -(NEWLINE) 207:207 -(TOKEN "identifier" i) 208:208 -(TOKEN "=") 210:210 -(TOKEN "integer" 12) 212:213 -(TOKEN "+") 214:214 -(TOKEN "imag number" 3.000000j) 215:216 -(NEWLINE) 217:217 -(TOKEN "identifier" i) 218:218 -(TOKEN "=") 220:220 -(TOKEN "integer" 12) 222:223 -(TOKEN "+") 224:224 -(TOKEN "imag number" 0.000000j) 225:233 -(NEWLINE) 234:234 -(TOKEN "identifier" i) 235:235 -(TOKEN "=") 237:237 -(TOKEN "real" 0.120000) 239:241 -(TOKEN "+") 242:242 -(TOKEN "imag number" 0.001000j) 243:247 -(NEWLINE) 248:248 -(NEWLINE) 249:249 -(TOKEN "identifier" i) 250:250 -(TOKEN "=") 252:252 -(TOKEN "integer" 1234) 254:258 -(NEWLINE) 259:259 -(TOKEN "identifier" i) 260:260 -(TOKEN "=") 262:262 -(TOKEN "-") 264:264 -(TOKEN "integer" 1234) 265:269 -(NEWLINE) 270:270 -(TOKEN "identifier" i) 271:271 -(TOKEN "=") 273:273 -(TOKEN "-") 275:275 -(TOKEN "integer" 291) 276:281 -(NEWLINE) 282:282 -(TOKEN "identifier" i) 283:283 -(TOKEN "=") 285:285 -(TOKEN "integer" 6844) 287:293 -(NEWLINE) 294:294 -(TOKEN "identifier" i) 295:295 -(TOKEN "=") 297:297 -(TOKEN "integer" 4796) 299:305 -(NEWLINE) 306:306 -(TOKEN "identifier" i) 307:307 -(TOKEN "=") 309:309 -(TOKEN "-") 311:311 -(TOKEN "integer" 83) 312:317 -(NEWLINE) 318:318 -(TOKEN "identifier" i) 319:319 -(TOKEN "=") 321:321 -(TOKEN "integer" 87) 323:329 -(NEWLINE) 330:330 -(TOKEN "identifier" i) 331:331 -(TOKEN "=") 333:333 -(TOKEN "-") 335:335 -(TOKEN "integer" 43) 336:345 -(NEWLINE) 346:346 -(TOKEN "identifier" i) 347:347 -(TOKEN "=") 349:349 -(TOKEN "integer" 13) 351:358 -(NEWLINE) 359:359 -(TOKEN "identifier" i) 360:360 -(TOKEN "=") 362:362 -(TOKEN "real" 1123.000000) 364:369 -(NEWLINE) 370:370 -(TOKEN "identifier" i) 371:371 -(TOKEN "=") 373:373 -(TOKEN "real" 0.123000) 375:380 -(NEWLINE) 381:381 -(TOKEN "identifier" i) 382:382 -(TOKEN "=") 384:384 -(TOKEN "real" 0.123000) 386:392 -(NEWLINE) 393:393 -(TOKEN "identifier" i) 394:394 -(TOKEN "=") 396:396 -(TOKEN "real" 120000000000.000000) 398:406 -(NEWLINE) 407:407 -(TOKEN "identifier" i) 408:408 -(TOKEN "=") 410:410 -(TOKEN "real" 0.000001) 412:428 -(NEWLINE) 429:429 -(TOKEN "identifier" i) 430:430 -(TOKEN "=") 432:432 -(TOKEN "integer" 1234) 434:438 -(TOKEN "+") 439:439 -(TOKEN "imag number" 3456.000000j) 440:445 -(NEWLINE) 446:446 -(TOKEN "identifier" i) 447:447 -(TOKEN "=") 449:449 -(TOKEN "integer" 12) 451:452 -(TOKEN "+") 453:453 -(TOKEN "imag number" 0.000000j) 454:465 -(NEWLINE) 466:466 -(TOKEN "identifier" i) 467:467 -(TOKEN "=") 469:469 -(TOKEN "real" 1000.120000) 471:478 -(TOKEN "+") 479:479 -(TOKEN "imag number" 0.000100j) 480:486 -(NEWLINE) 487:487 -(NEWLINE) 488:488 -(TOKEN "identifier" float) 489:493 -(TOKEN "(") 494:494 -(TOKEN "real" inf) 495:499 -(TOKEN ")") 500:500 -(NEWLINE) 501:501 -(TOKEN "identifier" x) 502:502 -(TOKEN "=") 504:504 -(TOKEN "real" inf) 506:510 -(NEWLINE) 511:511 -(TOKEN "identifier" complex) 512:518 -(TOKEN "(") 519:519 -(TOKEN "real" 140000000000000005528749527191103381749434659621913717006437476935335702571970573026452444307820696028601680522881043700541120085625386611604505789664591785922123926873769078699987831481595335695749181141356976015104370165785971235340948584343131219149608095136586496161650337802003105866881830462290332221440.000000) 520:526 -(TOKEN ",") 527:527 -(TOKEN "real" 140000000000000005528749527191103381749434659621913717006437476935335702571970573026452444307820696028601680522881043700541120085625386611604505789664591785922123926873769078699987831481595335695749181141356976015104370165785971235340948584343131219149608095136586496161650337802003105866881830462290332221440.000000) 529:535 -(TOKEN ")") 536:536 -(NEWLINE) 537:537 -(TOKEN "identifier" abs_err) 538:544 -(TOKEN "=") 546:546 -(TOKEN "real" 0.000000) 548:553 -(NEWLINE) 554:554 -(TOKEN "identifier" tiny) 555:558 -(TOKEN "=") 560:560 -(TOKEN "real" 0.000000) 562:567 -(NEWLINE) 568:568 -(TOKEN "-") 569:569 -(TOKEN "real" 1.000000) 570:571 -(TOKEN "+") 572:572 -(TOKEN "imag number" 0.000000j) 573:579 -(NEWLINE) 580:580 -(TOKEN "identifier" vals) 581:584 -(TOKEN "=") 586:586 -(TOKEN "[") 588:588 -(TOKEN "real" 0.000000) 589:594 -(TOKEN ",") 595:595 -(TOKEN "real" 0.000000) 597:602 -(TOKEN ",") 603:603 -(TOKEN "real" 0.000000) 605:610 -(TOKEN "]") 611:611 -(NEWLINE) 612:612 -(TOKEN "identifier" z2) 613:614 -(TOKEN "=") 616:616 -(TOKEN "-") 618:618 -(TOKEN "imag number" infj) 619:625 -(NEWLINE) 626:626 -(TOKEN "identifier" repr) 627:630 -(TOKEN "(") 631:631 -(TOKEN "real" 1000000000000000052504760255204420248704468581108159154915854115511802457988908195786371375080447864043704443832883878176942523235360430575644792184786706982848387200926575803737830233794788090059368953234970799945081119038967640880074652742780142494579258788820056842838115669472196386865459400540160.000000) 632:636 -(TOKEN "*") 638:638 -(TOKEN "real" 1000000000000000052504760255204420248704468581108159154915854115511802457988908195786371375080447864043704443832883878176942523235360430575644792184786706982848387200926575803737830233794788090059368953234970799945081119038967640880074652742780142494579258788820056842838115669472196386865459400540160.000000) 640:644 -(TOKEN "*") 646:646 -(TOKEN "integer" 0) 648:648 -(TOKEN ")") 649:649 -(NEWLINE) 650:650 -(TOKEN "identifier" weights) 651:657 -(TOKEN "=") 658:658 -(TOKEN "[") 659:659 -(TOKEN "real" 0.000000) 660:665 -(TOKEN ",") 666:666 -(TOKEN "real" 0.000000) 668:673 -(TOKEN "]") 674:674 -(NEWLINE) 675:675 -(EOF) 676:676 diff --git a/tests/reference/tokens-paren1-94fa736.json b/tests/reference/tokens-paren1-94fa736.json deleted file mode 100644 index b939a408f3..0000000000 --- a/tests/reference/tokens-paren1-94fa736.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-paren1-94fa736", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/paren1.py", - "infile_hash": "2daad629476f5c2f192512f8759c633b7d52da75889d137d32a2d562", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-paren1-94fa736.stderr", - "stderr_hash": "d0af4503aa7935c5215252efbb68900d95a6b897f6ad195850573db0", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-paren1-94fa736.stderr b/tests/reference/tokens-paren1-94fa736.stderr deleted file mode 100644 index 9d1d1aee5a..0000000000 --- a/tests/reference/tokens-paren1-94fa736.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Too many nested parentheses - --> tests/tokens/errors/paren1.py:1:202 - | -1 | -(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - | ^ diff --git a/tests/reference/tokens-paren2-0eef339.json b/tests/reference/tokens-paren2-0eef339.json deleted file mode 100644 index 8d1ac74d27..0000000000 --- a/tests/reference/tokens-paren2-0eef339.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-paren2-0eef339", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/paren2.py", - "infile_hash": "64ddb2cf28db48e5c99c9ff58a848b654a8eaf8e4d133c6772034522", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-paren2-0eef339.stderr", - "stderr_hash": "60430252b0f0f0ab667252a10da601d08dcc962d240fbc7c3fe3fd6c", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-paren2-0eef339.stderr b/tests/reference/tokens-paren2-0eef339.stderr deleted file mode 100644 index e1fa73a259..0000000000 --- a/tests/reference/tokens-paren2-0eef339.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Parentheses does not match - --> tests/tokens/errors/paren2.py:6:3 - | -6 | [{]} - | ^ diff --git a/tests/reference/tokens-paren3-0d47100.json b/tests/reference/tokens-paren3-0d47100.json deleted file mode 100644 index a0fc7a5fe8..0000000000 --- a/tests/reference/tokens-paren3-0d47100.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-paren3-0d47100", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/paren3.py", - "infile_hash": "57c6a1bdbc4971271437ae51ef8eef6a26f1061ff38d6be8a281560b", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-paren3-0d47100.stderr", - "stderr_hash": "5dfebef8a231835dd95c490a961ef3981b73e717a91351ad9d327676", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-paren3-0d47100.stderr b/tests/reference/tokens-paren3-0d47100.stderr deleted file mode 100644 index fd5422d82b..0000000000 --- a/tests/reference/tokens-paren3-0d47100.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Parenthesis unexpected - --> tests/tokens/errors/paren3.py:2:1 - | -2 | ] {}} - | ^ diff --git a/tests/reference/tokens-paren4-5c2fc32.json b/tests/reference/tokens-paren4-5c2fc32.json deleted file mode 100644 index 184481775c..0000000000 --- a/tests/reference/tokens-paren4-5c2fc32.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-paren4-5c2fc32", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/errors/paren4.py", - "infile_hash": "10d0c8281aba40d1910e24ea824a43117ba9e95d518053323278284d", - "outfile": null, - "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "tokens-paren4-5c2fc32.stderr", - "stderr_hash": "4ee038fab6af5c6ed6e0bfc147b98031946c9aa227364e263aaa4913", - "returncode": 1 -} \ No newline at end of file diff --git a/tests/reference/tokens-paren4-5c2fc32.stderr b/tests/reference/tokens-paren4-5c2fc32.stderr deleted file mode 100644 index 28331acf02..0000000000 --- a/tests/reference/tokens-paren4-5c2fc32.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Parentheses was never closed - --> tests/tokens/errors/paren4.py:6:1 - | -6 | - | ^ diff --git a/tests/reference/tokens-symbols1-658c990.json b/tests/reference/tokens-symbols1-658c990.json deleted file mode 100644 index 58240ae0fe..0000000000 --- a/tests/reference/tokens-symbols1-658c990.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "tokens-symbols1-658c990", - "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", - "infile": "tests/tokens/symbols1.py", - "infile_hash": "3f7910682e26267a50d48952da7dfcd8414cebb79ce55acc3b7ccc3f", - "outfile": null, - "outfile_hash": null, - "stdout": "tokens-symbols1-658c990.stdout", - "stdout_hash": "19dac50b2ce24d3a3d807a0d471b725063dd652bb785b46ffe05c81f", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/tokens-symbols1-658c990.stdout b/tests/reference/tokens-symbols1-658c990.stdout deleted file mode 100644 index 0987cc79f9..0000000000 --- a/tests/reference/tokens-symbols1-658c990.stdout +++ /dev/null @@ -1,340 +0,0 @@ -(KEYWORD "from") 0:3 -(TOKEN "identifier" typing) 5:10 -(KEYWORD "import") 12:17 -(TOKEN "identifier" overload) 19:26 -(NEWLINE) 27:27 -(NEWLINE) 28:28 -(TOKEN "identifier" i) 29:29 -(TOKEN "=") 31:31 -(TOKEN "{") 33:33 -(TOKEN "integer" 1) 34:34 -(TOKEN ":") 35:35 -(TOKEN "[") 37:37 -(TOKEN "(") 38:38 -(TOKEN "integer" 1) 39:39 -(TOKEN ",") 40:40 -(TOKEN "integer" 2) 42:42 -(TOKEN ")") 43:43 -(TOKEN ",") 44:44 -(TOKEN "(") 46:46 -(TOKEN "integer" 3) 47:47 -(TOKEN ",") 48:48 -(TOKEN "integer" 4) 50:50 -(TOKEN ")") 51:51 -(TOKEN "]") 52:52 -(TOKEN "}") 53:53 -(NEWLINE) 54:54 -(NEWLINE) 55:55 -(TOKEN "identifier" i) 56:56 -(KEYWORD "is") 58:59 -(TOKEN "identifier" i) 61:61 -(NEWLINE) 62:62 -(TOKEN "identifier" j) 63:63 -(TOKEN "=") 65:65 -(TOKEN "integer" 1) 67:67 -(NEWLINE) 68:68 -(TOKEN "identifier" j) 69:69 -(KEYWORD "in") 71:72 -(TOKEN "identifier" i) 74:74 -(NEWLINE) 75:75 -(NEWLINE) 76:76 -(KEYWORD "def") 77:79 -(TOKEN "identifier" test) 81:84 -(TOKEN "(") 85:85 -(TOKEN ")") 86:86 -(TOKEN ":") 87:87 -(NEWLINE) 88:88 -(TOKEN "indent") 89:92 -(TOKEN "identifier" print) 93:97 -(TOKEN "(") 98:98 -(TOKEN "string" ":") 99:101 -(TOKEN ")") 102:102 -(TOKEN ";") 103:103 -(TOKEN "identifier" print) 105:109 -(TOKEN "(") 110:110 -(TOKEN "string" ";") 111:113 -(TOKEN ")") 114:114 -(NEWLINE) 115:115 -(NEWLINE) 116:116 -(TOKEN "dedent") 116:116 -(TOKEN "identifier" i) 117:117 -(TOKEN "=") 119:119 -(TOKEN "integer" 1) 121:121 -(TOKEN "+") 123:123 -(TOKEN "integer" 2) 125:125 -(TOKEN "-") 127:127 -(TOKEN "integer" 3) 129:129 -(TOKEN "*") 131:131 -(TOKEN "integer" 4) 133:133 -(TOKEN "/") 135:135 -(TOKEN "integer" 5) 137:137 -(TOKEN "%") 139:139 -(TOKEN "integer" 6) 141:141 -(NEWLINE) 142:142 -(NEWLINE) 143:143 -(TOKEN "identifier" i) 144:144 -(TOKEN "=") 146:146 -(TOKEN "True") 148:151 -(TOKEN "<") 153:153 -(TOKEN "(") 155:155 -(TOKEN "False") 156:160 -(TOKEN ">") 162:162 -(TOKEN "True") 164:167 -(TOKEN ")") 168:168 -(NEWLINE) 169:169 -(NEWLINE) 170:170 -(TOKEN "identifier" i) 171:171 -(TOKEN "=") 173:173 -(TOKEN "not") 175:177 -(TOKEN "(") 178:178 -(TOKEN "False") 179:183 -(TOKEN "==") 185:186 -(TOKEN "False") 188:192 -(TOKEN ")") 193:193 -(TOKEN "!=") 195:196 -(TOKEN "True") 198:201 -(NEWLINE) 202:202 -(TOKEN "identifier" i) 203:203 -(TOKEN "=") 205:205 -(TOKEN "integer" 3) 207:207 -(TOKEN "<=") 209:210 -(TOKEN "integer" 4) 212:212 -(TOKEN "and") 214:216 -(TOKEN "integer" 4) 218:218 -(TOKEN ">=") 220:221 -(TOKEN "integer" 3) 223:223 -(NEWLINE) 224:224 -(TOKEN "identifier" i) 225:225 -(TOKEN "=") 227:227 -(TOKEN "integer" 3) 229:229 -(TOKEN "<=") 231:232 -(TOKEN "integer" 4) 234:234 -(TOKEN "or") 236:237 -(TOKEN "integer" 4) 239:239 -(TOKEN ">=") 241:242 -(TOKEN "integer" 3) 244:244 -(NEWLINE) 245:245 -(NEWLINE) 246:246 -(TOKEN "identifier" i) 247:247 -(TOKEN "=") 249:249 -(TOKEN "~") 251:251 -(TOKEN "identifier" i) 252:252 -(NEWLINE) 253:253 -(TOKEN "identifier" i) 254:254 -(TOKEN "=") 256:256 -(TOKEN "integer" 1) 258:258 -(TOKEN "^") 260:260 -(TOKEN "integer" 2) 262:262 -(NEWLINE) 263:263 -(TOKEN "identifier" i) 264:264 -(TOKEN "=") 266:266 -(TOKEN "integer" 2) 268:268 -(TOKEN "<<") 270:271 -(TOKEN "integer" 3) 273:273 -(NEWLINE) 274:274 -(TOKEN "identifier" i) 275:275 -(TOKEN "=") 277:277 -(TOKEN "integer" 3) 279:279 -(TOKEN ">>") 281:282 -(TOKEN "integer" 4) 284:284 -(NEWLINE) 285:285 -(TOKEN "identifier" i) 286:286 -(TOKEN "=") 288:288 -(TOKEN "integer" 4) 290:290 -(TOKEN "**") 292:293 -(TOKEN "integer" 5) 295:295 -(NEWLINE) 296:296 -(TOKEN "identifier" i) 297:297 -(TOKEN "=") 299:299 -(TOKEN "integer" 5) 301:301 -(TOKEN "//") 303:304 -(TOKEN "integer" 6) 306:306 -(NEWLINE) 307:307 -(TOKEN "identifier" i) 308:308 -(TOKEN "=") 310:310 -(TOKEN "integer" 6) 312:312 -(TOKEN "|") 314:314 -(TOKEN "integer" 7) 316:316 -(NEWLINE) 317:317 -(TOKEN "identifier" i) 318:318 -(TOKEN "=") 320:320 -(TOKEN "integer" 7) 322:322 -(TOKEN "&") 324:324 -(TOKEN "integer" 8) 326:326 -(NEWLINE) 327:327 -(NEWLINE) 328:328 -(TOKEN "identifier" i) 329:329 -(TOKEN "|=") 331:332 -(TOKEN "integer" 1) 334:334 -(NEWLINE) 335:335 -(TOKEN "identifier" i) 336:336 -(TOKEN "&=") 338:339 -(TOKEN "integer" 2) 341:341 -(NEWLINE) 342:342 -(TOKEN "identifier" i) 343:343 -(TOKEN "^=") 345:346 -(TOKEN "integer" 3) 348:348 -(NEWLINE) 349:349 -(TOKEN "identifier" i) 350:350 -(TOKEN "//=") 352:354 -(TOKEN "integer" 4) 356:356 -(NEWLINE) 357:357 -(TOKEN "identifier" i) 358:358 -(TOKEN "**=") 360:362 -(TOKEN "integer" 5) 364:364 -(NEWLINE) 365:365 -(TOKEN "identifier" i) 366:366 -(TOKEN "<<=") 368:370 -(TOKEN "integer" 6) 372:372 -(NEWLINE) 373:373 -(TOKEN "identifier" i) 374:374 -(TOKEN ">>=") 376:378 -(TOKEN "integer" 7) 380:380 -(NEWLINE) 381:381 -(TOKEN "identifier" i) 382:382 -(TOKEN "+=") 384:385 -(TOKEN "integer" 8) 387:387 -(NEWLINE) 388:388 -(TOKEN "identifier" i) 389:389 -(TOKEN "-=") 391:392 -(TOKEN "integer" 9) 394:394 -(NEWLINE) 395:395 -(TOKEN "identifier" i) 396:396 -(TOKEN "*=") 398:399 -(TOKEN "integer" 10) 401:402 -(NEWLINE) 403:403 -(TOKEN "identifier" i) 404:404 -(TOKEN "/=") 406:407 -(TOKEN "integer" 11) 409:410 -(NEWLINE) 411:411 -(TOKEN "identifier" i) 412:412 -(TOKEN "%=") 414:415 -(TOKEN "integer" 12) 417:418 -(NEWLINE) 419:419 -(NEWLINE) 420:420 -(TOKEN "@") 421:421 -(TOKEN "identifier" overload) 422:429 -(NEWLINE) 430:430 -(KEYWORD "def") 431:433 -(TOKEN "identifier" test) 435:438 -(TOKEN "(") 439:439 -(TOKEN "identifier" x) 440:440 -(TOKEN ")") 441:441 -(TOKEN ":") 442:442 -(NEWLINE) 443:443 -(TOKEN "indent") 444:447 -(TOKEN "identifier" print) 448:452 -(TOKEN "(") 453:453 -(TOKEN "string" "Decorators") 454:465 -(TOKEN ")") 466:466 -(NEWLINE) 467:467 -(NEWLINE) 468:468 -(TOKEN "dedent") 468:468 -(KEYWORD "class") 469:473 -(TOKEN "identifier" t) 475:475 -(TOKEN ":") 476:476 -(NEWLINE) 477:477 -(TOKEN "indent") 478:481 -(KEYWORD "def") 482:484 -(TOKEN "identifier" __init__) 486:493 -(TOKEN "(") 494:494 -(TOKEN "identifier" self) 495:498 -(TOKEN ",") 499:499 -(TOKEN "identifier" x) 501:501 -(TOKEN ")") 502:502 -(TOKEN ":") 503:503 -(NEWLINE) 504:504 -(TOKEN "indent") 505:512 -(TOKEN "identifier" self) 513:516 -(TOKEN ".") 517:517 -(TOKEN "identifier" x) 518:518 -(TOKEN "=") 520:520 -(TOKEN "identifier" x) 522:522 -(NEWLINE) 523:523 -(NEWLINE) 524:524 -(TOKEN "dedent") 524:524 -(TOKEN "dedent") 524:524 -(KEYWORD "if") 525:526 -(TOKEN "identifier" i) 528:528 -(TOKEN ">=") 530:531 -(TOKEN "integer" 1) 533:533 -(TOKEN "or") 535:536 -(TOKEN "identifier" j) 548:548 -(TOKEN "<=") 550:551 -(TOKEN "integer" 10) 553:554 -(TOKEN ":") 555:555 -(NEWLINE) 556:556 -(TOKEN "indent") 557:560 -(TOKEN "identifier" print) 561:565 -(TOKEN "(") 566:566 -(TOKEN "string" "Backlash") 567:576 -(TOKEN ")") 577:577 -(NEWLINE) 578:578 -(NEWLINE) 579:579 -(TOKEN "dedent") 579:579 -(KEYWORD "assert") 580:585 -(TOKEN "identifier" self) 587:590 -(TOKEN ".") 591:591 -(TOKEN "identifier" conv) 592:595 -(TOKEN "(") 596:596 -(TOKEN "identifier" np) 597:598 -(TOKEN ".") 599:599 -(TOKEN "identifier" RAISE) 600:604 -(TOKEN ")") 605:605 -(TOKEN "==") 607:608 -(TOKEN "string" "NPY_RAISE") 610:620 -(NEWLINE) 621:621 -(TOKEN "identifier" args) 622:625 -(TOKEN "+=") 627:628 -(TOKEN "identifier" k) 630:630 -(TOKEN "+") 632:632 -(TOKEN "string" "=") 634:636 -(TOKEN "+") 638:638 -(TOKEN "identifier" v) 640:640 -(TOKEN ".") 641:641 -(TOKEN "identifier" tostring) 642:649 -(TOKEN "(") 650:650 -(TOKEN "identifier" Precedence) 651:660 -(TOKEN ".") 661:661 -(TOKEN "identifier" NONE) 662:665 -(TOKEN ")") 666:666 -(NEWLINE) 667:667 -(NEWLINE) 668:668 -(TOKEN "identifier" x) 669:669 -(TOKEN "=") 671:671 -(TOKEN "identifier" none) 673:676 -(NEWLINE) 677:677 -(TOKEN "identifier" x) 678:678 -(TOKEN "=") 680:680 -(KEYWORD "none") 682:685 -(NEWLINE) 686:686 -(NEWLINE) 687:687 -(KEYWORD "if") 688:689 -(TOKEN "not") 691:693 -(TOKEN "identifier" info) 695:698 -(TOKEN "or") 700:701 -(TOKEN "identifier" name) 703:706 -(KEYWORD "in") 708:709 -(TOKEN "identifier" info) 711:714 -(TOKEN "[") 715:715 -(TOKEN "-") 716:716 -(TOKEN "integer" 1) 717:717 -(TOKEN "]") 718:718 -(TOKEN ":") 719:719 -(TOKEN "eolcomment") 721:736 -(NEWLINE) 737:737 -(TOKEN "indent") 738:741 -(KEYWORD "pass") 742:745 -(NEWLINE) 746:746 -(NEWLINE) 747:747 -(TOKEN "dedent") 747:747 -(TOKEN "identifier" assert_) 748:754 -(TOKEN "(") 755:755 -(TOKEN "not") 756:758 -(TOKEN "identifier" internal_overlap) 760:775 -(TOKEN "(") 776:776 -(TOKEN "identifier" a) 777:777 -(TOKEN ")") 778:778 -(TOKEN ")") 779:779 -(NEWLINE) 780:780 -(EOF) 781:781 diff --git a/tests/reference/wat-bool1-234bcd1.json b/tests/reference/wat-bool1-234bcd1.json deleted file mode 100644 index 4be1a3e7c1..0000000000 --- a/tests/reference/wat-bool1-234bcd1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-bool1-234bcd1", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/bool1.py", - "infile_hash": "f61ed4d1f164753f9f78f63957d4faf040bcd6099e18dbf3e32cf7d5", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-bool1-234bcd1.stdout", - "stdout_hash": "1ac138f5c0fd3b21a75e6bf4e0024d5f0df2f0a6b195defd472677c2", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-bool1-234bcd1.stdout b/tests/reference/wat-bool1-234bcd1.stdout deleted file mode 100644 index b50b0ccd6a..0000000000 --- a/tests/reference/wat-bool1-234bcd1.stdout +++ /dev/null @@ -1,218 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (type (;3;) (func (param) (result))) - (type (;4;) (func (param) (result))) - (type (;5;) (func (param i64) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - call 3 - return - ) - (func $3 (type 3) (param) (result) - (local i32) - i32.const 1 - i64.extend_i32_s - call 5 - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 0 - i64.extend_i32_s - call 5 - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - local.set 0 - local.get 0 - i64.extend_i32_s - call 5 - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 0 - local.set 0 - local.get 0 - i64.extend_i32_s - call 5 - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - return - ) - (func $4 (type 4) (param) (result) - (local) - call 2 - i32.const 0 - call 0 - return - ) - (func $5 (type 5) (param i64) (result) - (local i64 i64 i64 i64) - local.get 0 - i64.const 0 - i64.eq - if - i32.const 1 - i32.const 88 - i32.const 1 - i32.const 0 - call 1 - drop - return - else - end - local.get 0 - i64.const 0 - i64.lt_s - if - i32.const 1 - i32.const 28 - i32.const 1 - i32.const 0 - call 1 - drop - local.get 0 - i64.const -1 - i64.mul - local.set 0 - else - end - local.get 0 - local.set 4 - i64.const 0 - local.set 1 - loop - local.get 0 - i64.const 0 - i64.gt_s - if - local.get 1 - i64.const 1 - i64.add - local.set 1 - local.get 0 - i64.const 10 - i64.div_s - local.set 0 - br 1 - else - end - end - loop - local.get 1 - i64.const 0 - i64.gt_s - if - local.get 1 - i64.const 1 - i64.sub - local.set 1 - i64.const 1 - local.set 2 - i64.const 0 - local.set 3 - loop - local.get 3 - local.get 1 - i64.lt_s - if - local.get 3 - i64.const 1 - i64.add - local.set 3 - local.get 2 - i64.const 10 - i64.mul - local.set 2 - br 1 - else - end - end - local.get 4 - local.get 2 - i64.div_s - i64.const 10 - i64.rem_s - i64.const 12 - i64.mul - i64.const 88 - i64.add - local.set 0 - i32.const 1 - local.get 0 - i32.wrap_i64 - i32.const 1 - i32.const 0 - call 1 - drop - br 1 - else - end - end - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "__main__global_stmts" (func 2)) - (export "test_bool" (func 3)) - (export "_start" (func 4)) - (export "print_i64" (func 5)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") -) diff --git a/tests/reference/wat-expr14-5e0cb96.json b/tests/reference/wat-expr14-5e0cb96.json deleted file mode 100644 index 09741a198d..0000000000 --- a/tests/reference/wat-expr14-5e0cb96.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-expr14-5e0cb96", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/expr14.py", - "infile_hash": "d18abc152939c944f6a1e493754cea8b72f0d03d360ab4c9e75ad697", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-expr14-5e0cb96.stdout", - "stdout_hash": "f8ff7eb9eb4bc533fc4d36c58a0378df6dfbf135313962dbf379d69a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-expr14-5e0cb96.stdout b/tests/reference/wat-expr14-5e0cb96.stdout deleted file mode 100644 index 60c9b0a760..0000000000 --- a/tests/reference/wat-expr14-5e0cb96.stdout +++ /dev/null @@ -1,57 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - i32.const 0 - call 0 - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "_start" (func 2)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") -) diff --git a/tests/reference/wat-expr2-8b17723.json b/tests/reference/wat-expr2-8b17723.json deleted file mode 100644 index ad73a311e7..0000000000 --- a/tests/reference/wat-expr2-8b17723.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-expr2-8b17723", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/expr2.py", - "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-expr2-8b17723.stdout", - "stdout_hash": "f8ff7eb9eb4bc533fc4d36c58a0378df6dfbf135313962dbf379d69a", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-expr2-8b17723.stdout b/tests/reference/wat-expr2-8b17723.stdout deleted file mode 100644 index 60c9b0a760..0000000000 --- a/tests/reference/wat-expr2-8b17723.stdout +++ /dev/null @@ -1,57 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - i32.const 0 - call 0 - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "_start" (func 2)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") -) diff --git a/tests/reference/wat-expr9-f73afd1.json b/tests/reference/wat-expr9-f73afd1.json deleted file mode 100644 index a5aa2534df..0000000000 --- a/tests/reference/wat-expr9-f73afd1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-expr9-f73afd1", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/expr9.py", - "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-expr9-f73afd1.stdout", - "stdout_hash": "169634bcbf991ebd3a4315e3824320762aea19971ac0a85026095e6c", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-expr9-f73afd1.stdout b/tests/reference/wat-expr9-f73afd1.stdout deleted file mode 100644 index d02d5684b0..0000000000 --- a/tests/reference/wat-expr9-f73afd1.stdout +++ /dev/null @@ -1,113 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (type (;3;) (func (param) (result))) - (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param i32) (result i32))) - (type (;6;) (func (param i32) (result i32))) - (type (;7;) (func (param) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - call 3 - return - ) - (func $3 (type 3) (param) (result) - (local i32 i32) - i32.const 4 - call 4 - local.set 0 - i32.const 4 - call 5 - local.set 1 - i32.const 4 - call 6 - local.set 0 - return - ) - (func $4 (type 4) (param i32) (result i32) - (local i32 i32) - i32.const 5 - local.set 2 - local.get 2 - local.set 1 - local.get 1 - return - ) - (func $5 (type 5) (param i32) (result i32) - (local i32 i32) - i32.const 208 - local.set 2 - local.get 2 - local.set 1 - local.get 1 - return - ) - (func $6 (type 6) (param i32) (result i32) - (local i32) - local.get 0 - local.set 1 - local.get 1 - return - ) - (func $7 (type 7) (param) (result) - (local) - call 2 - i32.const 0 - call 0 - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "__main__global_stmts" (func 2)) - (export "main0" (func 3)) - (export "test_return_1" (func 4)) - (export "test_return_2" (func 5)) - (export "test_return_3" (func 6)) - (export "_start" (func 7)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") - (data (;34;) (i32.const 208) "\d8\00\00\00\04\00\00\00") - (data (;35;) (i32.const 216) "test") -) diff --git a/tests/reference/wat-loop1-e0046d4.json b/tests/reference/wat-loop1-e0046d4.json deleted file mode 100644 index 05dedbeef8..0000000000 --- a/tests/reference/wat-loop1-e0046d4.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-loop1-e0046d4", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/loop1.py", - "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-loop1-e0046d4.stdout", - "stdout_hash": "186355413b04732159a4ea9cf108245721b5a41d5a6630a4f8cc7785", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-loop1-e0046d4.stdout b/tests/reference/wat-loop1-e0046d4.stdout deleted file mode 100644 index 2683a49e6c..0000000000 --- a/tests/reference/wat-loop1-e0046d4.stdout +++ /dev/null @@ -1,197 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (type (;3;) (func (param) (result))) - (type (;4;) (func (param i32) (result i32))) - (type (;5;) (func (param i32) (result i32))) - (type (;6;) (func (param i32) (result i64))) - (type (;7;) (func (param) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - call 3 - return - ) - (func $3 (type 3) (param) (result) - (local i32 i64) - i32.const 4 - call 4 - local.set 0 - i32.const 4 - call 5 - local.set 0 - i32.const 5 - call 6 - local.set 1 - return - ) - (func $4 (type 4) (param i32) (result i32) - (local i32 i32) - local.get 0 - i32.const 0 - i32.lt_s - if - i32.const 0 - local.set 1 - local.get 1 - return - else - end - i32.const 1 - local.set 2 - loop - local.get 0 - i32.const 0 - i32.gt_s - if - local.get 2 - local.get 0 - i32.mul - local.set 2 - local.get 0 - i32.const 1 - i32.sub - local.set 0 - br 1 - else - end - end - local.get 2 - local.set 1 - local.get 1 - return - ) - (func $5 (type 5) (param i32) (result i32) - (local i32 i32 i32) - i32.const 1 - local.set 3 - i32.const 1 - i32.const 1 - i32.sub - local.set 2 - loop - local.get 2 - i32.const 1 - i32.add - local.get 0 - i32.const 1 - i32.add - i32.const 1 - i32.sub - i32.le_s - if - local.get 2 - i32.const 1 - i32.add - local.set 2 - local.get 3 - local.get 2 - i32.mul - local.set 3 - br 1 - else - end - end - local.get 3 - local.set 1 - local.get 1 - return - ) - (func $6 (type 6) (param i32) (result i64) - (local i64 i64) - i64.const 0 - local.set 2 - local.get 0 - i32.const 0 - i32.lt_s - if - local.get 2 - local.set 1 - local.get 1 - return - else - end - i64.const 1 - local.set 2 - loop - local.get 0 - i32.const 0 - i32.gt_s - if - local.get 2 - local.get 0 - i64.extend_i32_s - i64.mul - local.set 2 - local.get 0 - i32.const 1 - i32.sub - local.set 0 - br 1 - else - end - end - local.get 2 - local.set 1 - local.get 1 - return - ) - (func $7 (type 7) (param) (result) - (local) - call 2 - i32.const 0 - call 0 - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "__main__global_stmts" (func 2)) - (export "main0" (func 3)) - (export "test_factorial_1" (func 4)) - (export "test_factorial_2" (func 5)) - (export "test_factorial_3" (func 6)) - (export "_start" (func 7)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") -) diff --git a/tests/reference/wat-print_str-385e953.json b/tests/reference/wat-print_str-385e953.json deleted file mode 100644 index de1714455f..0000000000 --- a/tests/reference/wat-print_str-385e953.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "basename": "wat-print_str-385e953", - "cmd": "lpython --no-color --show-wat {infile}", - "infile": "tests/print_str.py", - "infile_hash": "56d2a86f8e1cca05ff1749d1c4cdaa79f99b6f92d3ce60870ee900d7", - "outfile": null, - "outfile_hash": null, - "stdout": "wat-print_str-385e953.stdout", - "stdout_hash": "8e9a0f7a017cdd451f10e9b8686d3a9ba00c1c4088fbd01cfa2df1cc", - "stderr": null, - "stderr_hash": null, - "returncode": 0 -} \ No newline at end of file diff --git a/tests/reference/wat-print_str-385e953.stdout b/tests/reference/wat-print_str-385e953.stdout deleted file mode 100644 index 9db655a5ed..0000000000 --- a/tests/reference/wat-print_str-385e953.stdout +++ /dev/null @@ -1,162 +0,0 @@ -(module - (type (;0;) (func (param i32) (result))) - (type (;1;) (func (param i32 i32 i32 i32) (result i32))) - (type (;2;) (func (param) (result))) - (type (;3;) (func (param) (result))) - (type (;4;) (func (param) (result))) - (type (;5;) (func (param) (result))) - (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) - (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) - (global $0 (mut i32) (i32.const 0)) - (global $1 (mut i32) (i32.const 0)) - (global $2 (mut i64) (i64.const 0)) - (global $3 (mut f32) (f32.const 0.000000)) - (global $4 (mut f32) (f32.const 0.000000)) - (global $5 (mut f64) (f64.const 0.000000)) - (global $6 (mut f64) (f64.const 0.000000)) - (func $2 (type 2) (param) (result) - (local) - call 3 - return - ) - (func $3 (type 3) (param) (result) - (local) - call 4 - return - ) - (func $4 (type 4) (param) (result) - (local) - i32.const 1 - i32.const 208 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 224 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 240 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 256 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 272 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 288 - i32.const 1 - i32.const 0 - call 1 - drop - i32.const 1 - i32.const 16 - i32.const 1 - i32.const 0 - call 1 - drop - return - ) - (func $5 (type 5) (param) (result) - (local) - call 2 - i32.const 0 - call 0 - return - ) - (memory (;0;) 1000 1000) - (export "memory" (memory 0)) - (export "__main__global_stmts" (func 2)) - (export "main0" (func 3)) - (export "printCompOperations" (func 4)) - (export "_start" (func 5)) - (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") - (data (;1;) (i32.const 12) " ") - (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") - (data (;3;) (i32.const 24) "\n ") - (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") - (data (;5;) (i32.const 36) "- ") - (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") - (data (;7;) (i32.const 48) ". ") - (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") - (data (;9;) (i32.const 60) "( ") - (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") - (data (;11;) (i32.const 72) ") ") - (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") - (data (;13;) (i32.const 84) ", ") - (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") - (data (;15;) (i32.const 96) "0 ") - (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") - (data (;17;) (i32.const 108) "1 ") - (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") - (data (;19;) (i32.const 120) "2 ") - (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") - (data (;21;) (i32.const 132) "3 ") - (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") - (data (;23;) (i32.const 144) "4 ") - (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") - (data (;25;) (i32.const 156) "5 ") - (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") - (data (;27;) (i32.const 168) "6 ") - (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") - (data (;29;) (i32.const 180) "7 ") - (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") - (data (;31;) (i32.const 192) "8 ") - (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") - (data (;33;) (i32.const 204) "9 ") - (data (;34;) (i32.const 208) "\d8\00\00\00\05\00\00\00") - (data (;35;) (i32.const 216) "x < y ") - (data (;36;) (i32.const 224) "\e8\00\00\00\06\00\00\00") - (data (;37;) (i32.const 232) "x !< y ") - (data (;38;) (i32.const 240) "\f8\00\00\00\05\00\00\00") - (data (;39;) (i32.const 248) "x > y ") - (data (;40;) (i32.const 256) "\08\01\00\00\06\00\00\00") - (data (;41;) (i32.const 264) "x !> y ") - (data (;42;) (i32.const 272) "\18\01\00\00\06\00\00\00") - (data (;43;) (i32.const 280) "x == y ") - (data (;44;) (i32.const 288) "\28\01\00\00\06\00\00\00") - (data (;45;) (i32.const 296) "x != y ") -) From 08aa19a0b98f3358534832b119bca4ed9751b907 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:41:38 +0530 Subject: [PATCH 05/18] Add test reference --- .../reference/asr-array_01_decl-39cf894.json | 13 + .../asr-array_01_decl-39cf894.stderr | 17 + .../reference/asr-array_02_decl-e8f6874.json | 13 + .../asr-array_02_decl-e8f6874.stderr | 17 + tests/reference/asr-arrays_01-a617b64.json | 13 + tests/reference/asr-arrays_01-a617b64.stderr | 17 + tests/reference/asr-arrays_02-da94458.json | 13 + tests/reference/asr-arrays_02-da94458.stderr | 17 + tests/reference/asr-arrays_03-de2e952.json | 13 + tests/reference/asr-arrays_03-de2e952.stderr | 17 + tests/reference/asr-arrays_04-880407c.json | 13 + tests/reference/asr-arrays_04-880407c.stderr | 17 + tests/reference/asr-arrays_05-ec8fbd5.json | 13 + tests/reference/asr-arrays_05-ec8fbd5.stderr | 17 + tests/reference/asr-arrays_06-fbb09a3.json | 13 + tests/reference/asr-arrays_06-fbb09a3.stderr | 17 + tests/reference/asr-arrays_07-de430fd.json | 13 + tests/reference/asr-arrays_07-de430fd.stderr | 17 + tests/reference/asr-arrays_08-ba317a3.json | 13 + tests/reference/asr-arrays_08-ba317a3.stderr | 17 + tests/reference/asr-arrays_09-50ee586.json | 13 + tests/reference/asr-arrays_09-50ee586.stderr | 17 + tests/reference/asr-arrays_10-bc82d75.json | 13 + tests/reference/asr-arrays_10-bc82d75.stderr | 17 + tests/reference/asr-arrays_11-fc505b4.json | 13 + tests/reference/asr-arrays_11-fc505b4.stderr | 17 + tests/reference/asr-arrays_12-63d6f25.json | 13 + tests/reference/asr-arrays_12-63d6f25.stderr | 17 + tests/reference/asr-arrays_13-b5fcc7e.json | 13 + tests/reference/asr-arrays_13-b5fcc7e.stderr | 17 + tests/reference/asr-arrays_14-78be00e.json | 13 + tests/reference/asr-arrays_14-78be00e.stderr | 17 + tests/reference/asr-assert1-1ce92ea.json | 13 + tests/reference/asr-assert1-1ce92ea.stdout | 102 + tests/reference/asr-assign1-886f049.json | 13 + tests/reference/asr-assign1-886f049.stdout | 196 + tests/reference/asr-assign2-8d1a2ee.json | 13 + tests/reference/asr-assign2-8d1a2ee.stdout | 118 + tests/reference/asr-bindc_01-6d521a9.json | 13 + tests/reference/asr-bindc_01-6d521a9.stdout | 210 + tests/reference/asr-bindc_01-f761165.json | 13 + tests/reference/asr-bindc_01-f761165.stderr | 8 + tests/reference/asr-bindc_02-5092d8e.json | 13 + tests/reference/asr-bindc_02-5092d8e.stderr | 8 + tests/reference/asr-bindc_02-bc1a7ea.json | 13 + tests/reference/asr-bindc_02-bc1a7ea.stderr | 17 + tests/reference/asr-bindc_03-95dbba7.json | 13 + tests/reference/asr-bindc_03-95dbba7.stderr | 17 + tests/reference/asr-bindc_04-06bd800.json | 13 + tests/reference/asr-bindc_04-06bd800.stderr | 17 + tests/reference/asr-bindc_10e-8b10394.json | 13 + tests/reference/asr-bindc_10e-8b10394.stderr | 14 + tests/reference/asr-c_interop1-cf2e9b4.json | 13 + tests/reference/asr-c_interop1-cf2e9b4.stdout | 568 ++ tests/reference/asr-callback_01-df40fd5.json | 13 + .../reference/asr-callback_01-df40fd5.stdout | 569 ++ tests/reference/asr-cast-435c233.json | 13 + tests/reference/asr-cast-435c233.stderr | 11 + tests/reference/asr-complex1-f26c460.json | 13 + tests/reference/asr-complex1-f26c460.stderr | 11 + tests/reference/asr-const_01-af8289b.json | 13 + tests/reference/asr-const_01-af8289b.stderr | 5 + tests/reference/asr-const_02-fce29b7.json | 13 + tests/reference/asr-const_02-fce29b7.stderr | 5 + tests/reference/asr-constants1-5828e8a.json | 13 + tests/reference/asr-constants1-5828e8a.stderr | 11 + tests/reference/asr-cptr_01-4e660f1.json | 13 + tests/reference/asr-cptr_01-4e660f1.stderr | 5 + tests/reference/asr-dictionary1-a105a36.json | 13 + .../reference/asr-dictionary1-a105a36.stdout | 608 ++ .../asr-doconcurrentloop_01-3fdc189.json | 13 + .../asr-doconcurrentloop_01-3fdc189.stdout | 580 ++ tests/reference/asr-elemental_01-b58df26.json | 13 + .../reference/asr-elemental_01-b58df26.stderr | 17 + tests/reference/asr-enum_01-30e1b4a.json | 13 + tests/reference/asr-enum_01-30e1b4a.stderr | 9 + tests/reference/asr-enum_02-54656c5.json | 13 + tests/reference/asr-enum_02-54656c5.stderr | 9 + tests/reference/asr-expr1-8df2d66.json | 13 + tests/reference/asr-expr1-8df2d66.stdout | 148 + tests/reference/asr-expr10-efcbb1b.json | 13 + tests/reference/asr-expr10-efcbb1b.stderr | 11 + tests/reference/asr-expr11-9b91d35.json | 13 + tests/reference/asr-expr11-9b91d35.stdout | 186 + tests/reference/asr-expr12-5c5b71e.json | 13 + tests/reference/asr-expr12-5c5b71e.stdout | 307 + tests/reference/asr-expr13-81bdb5a.json | 13 + tests/reference/asr-expr13-81bdb5a.stderr | 11 + tests/reference/asr-expr16-a3dc453.json | 13 + tests/reference/asr-expr16-a3dc453.stderr | 5 + tests/reference/asr-expr2-2e78a12.json | 13 + tests/reference/asr-expr2-2e78a12.stdout | 187 + tests/reference/asr-expr4-cef6743.json | 13 + tests/reference/asr-expr4-cef6743.stdout | 104 + tests/reference/asr-expr5-645ffcc.json | 13 + tests/reference/asr-expr5-645ffcc.stdout | 142 + tests/reference/asr-expr6-368e5ed.json | 13 + tests/reference/asr-expr6-368e5ed.stdout | 151 + tests/reference/asr-expr7-480ba2f.json | 13 + tests/reference/asr-expr7-480ba2f.stderr | 11 + tests/reference/asr-expr8-6beda60.json | 13 + tests/reference/asr-expr8-6beda60.stderr | 11 + tests/reference/asr-expr9-814e4bc.json | 13 + tests/reference/asr-expr9-814e4bc.stdout | 424 + tests/reference/asr-expr_01-211000e.json | 13 + tests/reference/asr-expr_01-211000e.stdout | 195 + tests/reference/asr-expr_01-a0d4829.json | 13 + tests/reference/asr-expr_01-a0d4829.stdout | 418 + tests/reference/asr-expr_05-3a37324.json | 13 + tests/reference/asr-expr_05-3a37324.stderr | 11 + tests/reference/asr-expr_07-7742668.json | 13 + tests/reference/asr-expr_07-7742668.stdout | 432 + tests/reference/asr-expr_09-f3e89c8.json | 13 + tests/reference/asr-expr_09-f3e89c8.stdout | 1009 ++ tests/reference/asr-expr_10-d39708c.json | 13 + tests/reference/asr-expr_10-d39708c.stdout | 301 + tests/reference/asr-expr_12-6769be0.json | 13 + tests/reference/asr-expr_12-6769be0.stdout | 444 + tests/reference/asr-expr_14-f2bd343.json | 13 + tests/reference/asr-expr_14-f2bd343.stdout | 929 ++ tests/reference/asr-func_01-d87aa4a.json | 13 + tests/reference/asr-func_01-d87aa4a.stderr | 9 + tests/reference/asr-func_02-b439474.json | 13 + tests/reference/asr-func_02-b439474.stderr | 5 + tests/reference/asr-func_03-cd744a0.json | 13 + tests/reference/asr-func_03-cd744a0.stderr | 5 + tests/reference/asr-func_04-eef2656.json | 13 + tests/reference/asr-func_04-eef2656.stderr | 5 + tests/reference/asr-func_05-c22b921.json | 13 + tests/reference/asr-func_05-c22b921.stderr | 5 + tests/reference/asr-func_06-62e738c.json | 13 + tests/reference/asr-func_06-62e738c.stderr | 8 + tests/reference/asr-func_07-4a8c076.json | 13 + tests/reference/asr-func_07-4a8c076.stderr | 5 + tests/reference/asr-func_08-c137415.json | 13 + tests/reference/asr-func_08-c137415.stderr | 5 + .../reference/asr-func_inline_01-56af272.json | 13 + .../asr-func_inline_01-56af272.stdout | 313 + tests/reference/asr-generics_01-d616074.json | 13 + .../reference/asr-generics_01-d616074.stdout | 712 ++ tests/reference/asr-generics_02-e2ea5c9.json | 13 + .../reference/asr-generics_02-e2ea5c9.stdout | 411 + .../asr-generics_array_01-682b1b2.json | 13 + .../asr-generics_array_01-682b1b2.stderr | 17 + .../asr-generics_array_02-22c8dc1.json | 13 + .../asr-generics_array_02-22c8dc1.stderr | 17 + .../asr-generics_array_03-fb3706c.json | 13 + .../asr-generics_array_03-fb3706c.stderr | 17 + .../asr-generics_error_01-1e05cd6.json | 13 + .../asr-generics_error_01-1e05cd6.stderr | 5 + .../asr-generics_error_02-d614928.json | 13 + .../asr-generics_error_02-d614928.stderr | 5 + .../asr-generics_error_03-208d10d.json | 13 + .../asr-generics_error_03-208d10d.stderr | 9 + .../asr-generics_list_01-39c4044.json | 13 + .../asr-generics_list_01-39c4044.stdout | 2023 ++++ .../reference/asr-global_scope1-354e217.json | 13 + .../asr-global_scope1-354e217.stdout | 94 + .../reference/asr-global_syms_01-273906f.json | 13 + .../asr-global_syms_01-273906f.stdout | 189 + tests/reference/asr-intent_01-66824bc.json | 13 + tests/reference/asr-intent_01-66824bc.stdout | 184 + .../asr-kwargs_01_error-ab9530d.json | 13 + .../asr-kwargs_01_error-ab9530d.stderr | 5 + .../asr-kwargs_02_error-7c91f8f.json | 13 + .../asr-kwargs_02_error-7c91f8f.stderr | 11 + .../asr-kwargs_03_error-a68cc46.json | 13 + .../asr-kwargs_03_error-a68cc46.stderr | 5 + tests/reference/asr-lambda_01-1ec3e01.json | 13 + tests/reference/asr-lambda_01-1ec3e01.stderr | 5 + tests/reference/asr-list1-770ba33.json | 13 + tests/reference/asr-list1-770ba33.stdout | 439 + tests/reference/asr-loop1-10d3109.json | 13 + tests/reference/asr-loop1-10d3109.stdout | 604 ++ tests/reference/asr-loop3-a579196.json | 13 + tests/reference/asr-loop3-a579196.stdout | 90 + tests/reference/asr-loop4-3d3216e.json | 13 + tests/reference/asr-loop4-3d3216e.stdout | 176 + tests/reference/asr-loop_01-e7aa06a.json | 13 + tests/reference/asr-loop_01-e7aa06a.stderr | 5 + tests/reference/asr-loop_02-5741651.json | 13 + tests/reference/asr-loop_02-5741651.stderr | 5 + tests/reference/asr-loop_03-401ab45.json | 13 + tests/reference/asr-loop_03-401ab45.stderr | 5 + tests/reference/asr-modules_02-ec92e6f.json | 13 + tests/reference/asr-modules_02-ec92e6f.stdout | 283 + tests/reference/asr-print_02-afbe092.json | 13 + tests/reference/asr-print_02-afbe092.stdout | 2957 ++++++ .../asr-print_list_tuple_03-9de3736.json | 13 + .../asr-print_list_tuple_03-9de3736.stdout | 244 + tests/reference/asr-set1-b7b913a.json | 13 + tests/reference/asr-set1-b7b913a.stdout | 186 + tests/reference/asr-string_01-78629c4.json | 13 + tests/reference/asr-string_01-78629c4.stderr | 5 + tests/reference/asr-string_02-499c9ff.json | 13 + tests/reference/asr-string_02-499c9ff.stderr | 11 + tests/reference/asr-structs_01-0893e35.json | 13 + tests/reference/asr-structs_01-0893e35.stderr | 5 + tests/reference/asr-structs_01-66dc2c9.json | 13 + tests/reference/asr-structs_01-66dc2c9.stdout | 190 + tests/reference/asr-structs_01-be14d49.json | 13 + tests/reference/asr-structs_01-be14d49.stdout | 535 + tests/reference/asr-structs_02-2ab459a.json | 13 + tests/reference/asr-structs_02-2ab459a.stdout | 403 + tests/reference/asr-structs_02-f95782c.json | 13 + tests/reference/asr-structs_02-f95782c.stderr | 5 + tests/reference/asr-structs_03-0cef911.json | 13 + tests/reference/asr-structs_03-0cef911.stdout | 384 + tests/reference/asr-structs_03-754fb64.json | 13 + tests/reference/asr-structs_03-754fb64.stderr | 5 + tests/reference/asr-structs_04-387747b.json | 13 + tests/reference/asr-structs_04-387747b.stdout | 648 ++ tests/reference/asr-structs_04-7b864bc.json | 13 + tests/reference/asr-structs_04-7b864bc.stderr | 5 + tests/reference/asr-structs_05-fa98307.json | 13 + tests/reference/asr-structs_05-fa98307.stderr | 17 + tests/reference/asr-structs_06-6e14537.json | 13 + tests/reference/asr-structs_06-6e14537.stderr | 5 + tests/reference/asr-structs_07-83694b7.json | 13 + tests/reference/asr-structs_07-83694b7.stderr | 5 + tests/reference/asr-structs_08-fa4dbf0.json | 13 + tests/reference/asr-structs_08-fa4dbf0.stderr | 5 + tests/reference/asr-structs_09-f3ffe08.json | 13 + tests/reference/asr-structs_09-f3ffe08.stderr | 5 + tests/reference/asr-structs_10-cb8a283.json | 13 + tests/reference/asr-structs_10-cb8a283.stderr | 9 + tests/reference/asr-structs_16-44de89a.json | 13 + tests/reference/asr-structs_16-44de89a.stdout | 327 + tests/reference/asr-subscript1-1acfc19.json | 13 + tests/reference/asr-subscript1-1acfc19.stdout | 335 + .../asr-test_annassign_01-2f18669.json | 13 + .../asr-test_annassign_01-2f18669.stderr | 5 + .../asr-test_annassign_02-accf6db.json | 13 + .../asr-test_annassign_02-accf6db.stderr | 5 + .../asr-test_annassign_03-f8c6160.json | 13 + .../asr-test_annassign_03-f8c6160.stderr | 5 + ...-test_annassign_type_mismatch-7dac7be.json | 13 + ...est_annassign_type_mismatch-7dac7be.stderr | 5 + ...test_annassign_type_mismatch2-fc883f7.json | 13 + ...st_annassign_type_mismatch2-fc883f7.stderr | 5 + ...asr-test_append_type_mismatch-030e9c7.json | 13 + ...r-test_append_type_mismatch-030e9c7.stderr | 5 + tests/reference/asr-test_assign1-a94d41e.json | 13 + .../reference/asr-test_assign1-a94d41e.stderr | 5 + tests/reference/asr-test_assign2-fa29029.json | 13 + .../reference/asr-test_assign2-fa29029.stderr | 5 + tests/reference/asr-test_assign3-cc6fc9d.json | 13 + .../reference/asr-test_assign3-cc6fc9d.stderr | 5 + tests/reference/asr-test_assign4-a2136e0.json | 13 + .../reference/asr-test_assign4-a2136e0.stderr | 5 + tests/reference/asr-test_assign5-694a98f.json | 13 + .../reference/asr-test_assign5-694a98f.stderr | 5 + tests/reference/asr-test_assign6-05cd64f.json | 13 + .../reference/asr-test_assign6-05cd64f.stderr | 5 + tests/reference/asr-test_assign7-beebac3.json | 13 + .../reference/asr-test_assign7-beebac3.stderr | 5 + tests/reference/asr-test_assign8-4b26e63.json | 13 + .../reference/asr-test_assign8-4b26e63.stderr | 11 + tests/reference/asr-test_assign9-51278b8.json | 13 + .../reference/asr-test_assign9-51278b8.stderr | 5 + tests/reference/asr-test_binop1-50b63f6.json | 13 + .../reference/asr-test_binop1-50b63f6.stderr | 5 + tests/reference/asr-test_binop2-e5749af.json | 13 + .../reference/asr-test_binop2-e5749af.stderr | 5 + tests/reference/asr-test_binop3-a67201d.json | 13 + .../reference/asr-test_binop3-a67201d.stderr | 11 + .../asr-test_bit_length-da3a264.json | 13 + .../asr-test_bit_length-da3a264.stderr | 5 + .../asr-test_bitwise_on_complex-dd9568b.json | 13 + ...asr-test_bitwise_on_complex-dd9568b.stderr | 5 + .../asr-test_bitwise_on_float-2e09b30.json | 13 + .../asr-test_bitwise_on_float-2e09b30.stderr | 5 + .../asr-test_bool_binop-f856ef0.json | 13 + .../asr-test_bool_binop-f856ef0.stderr | 11 + tests/reference/asr-test_builtin-aa64615.json | 13 + .../reference/asr-test_builtin-aa64615.stdout | 2149 ++++ .../asr-test_builtin_abs-c74d2c9.json | 13 + .../asr-test_builtin_abs-c74d2c9.stdout | 605 ++ .../asr-test_builtin_bin-52ba9fa.json | 13 + .../asr-test_builtin_bin-52ba9fa.stderr | 11 + .../asr-test_builtin_bool-330223a.json | 13 + .../asr-test_builtin_bool-330223a.stderr | 11 + .../asr-test_builtin_float-20601dd.json | 13 + .../asr-test_builtin_float-20601dd.stdout | 530 + .../asr-test_builtin_hex-64bd268.json | 13 + .../asr-test_builtin_hex-64bd268.stderr | 11 + .../asr-test_builtin_int-8f88fdc.json | 13 + .../asr-test_builtin_int-8f88fdc.stdout | 1010 ++ .../asr-test_builtin_len-55b0dec.json | 13 + .../asr-test_builtin_len-55b0dec.stdout | 691 ++ .../asr-test_builtin_oct-20b9066.json | 13 + .../asr-test_builtin_oct-20b9066.stderr | 11 + .../asr-test_builtin_pow-f02fcda.json | 13 + .../asr-test_builtin_pow-f02fcda.stderr | 11 + .../asr-test_builtin_round-7417a21.json | 13 + .../asr-test_builtin_round-7417a21.stderr | 11 + .../asr-test_builtin_str-580e920.json | 13 + .../asr-test_builtin_str-580e920.stdout | 1471 +++ .../asr-test_c_interop_01-e374f43.json | 13 + .../asr-test_c_interop_01-e374f43.stdout | 711 ++ tests/reference/asr-test_chr-91f4987.json | 13 + tests/reference/asr-test_chr-91f4987.stderr | 5 + .../asr-test_compare_01-c594bbe.json | 13 + .../asr-test_compare_01-c594bbe.stderr | 5 + .../asr-test_compare_02-bf2c76e.json | 13 + .../asr-test_compare_02-bf2c76e.stderr | 5 + .../asr-test_complex_01-a6def58.json | 13 + .../asr-test_complex_01-a6def58.stderr | 11 + .../asr-test_complex_02-782ba2d.json | 13 + .../asr-test_complex_02-782ba2d.stderr | 11 + tests/reference/asr-test_dict1-a45a075.json | 13 + tests/reference/asr-test_dict1-a45a075.stderr | 5 + tests/reference/asr-test_dict10-8c0beff.json | 13 + .../reference/asr-test_dict10-8c0beff.stderr | 5 + tests/reference/asr-test_dict11-2ab4e6c.json | 13 + .../reference/asr-test_dict11-2ab4e6c.stderr | 5 + tests/reference/asr-test_dict12-7c74d08.json | 13 + .../reference/asr-test_dict12-7c74d08.stderr | 5 + tests/reference/asr-test_dict13-683b290.json | 13 + .../reference/asr-test_dict13-683b290.stderr | 11 + tests/reference/asr-test_dict2-4587f02.json | 13 + tests/reference/asr-test_dict2-4587f02.stderr | 5 + tests/reference/asr-test_dict3-d28f38f.json | 13 + tests/reference/asr-test_dict3-d28f38f.stderr | 5 + tests/reference/asr-test_dict4-39489fa.json | 13 + tests/reference/asr-test_dict4-39489fa.stderr | 5 + tests/reference/asr-test_dict5-c436d37.json | 13 + tests/reference/asr-test_dict5-c436d37.stderr | 5 + tests/reference/asr-test_dict6-95e3b14.json | 13 + tests/reference/asr-test_dict6-95e3b14.stderr | 5 + tests/reference/asr-test_dict7-1415e14.json | 13 + tests/reference/asr-test_dict7-1415e14.stderr | 5 + tests/reference/asr-test_dict8-d960ce0.json | 13 + tests/reference/asr-test_dict8-d960ce0.stderr | 5 + tests/reference/asr-test_dict9-907bda7.json | 13 + tests/reference/asr-test_dict9-907bda7.stderr | 5 + .../asr-test_end_sep_keywords-2226a67.json | 13 + .../asr-test_end_sep_keywords-2226a67.stdout | 189 + tests/reference/asr-test_for2-e5d893f.json | 13 + tests/reference/asr-test_for2-e5d893f.stderr | 9 + .../reference/asr-test_func_args-a898a72.json | 13 + .../asr-test_func_args-a898a72.stderr | 5 + .../reference/asr-test_import_01-b859c43.json | 13 + .../asr-test_import_01-b859c43.stderr | 10 + .../reference/asr-test_import_02-55b47fa.json | 13 + .../asr-test_import_02-55b47fa.stderr | 11 + tests/reference/asr-test_len1-839a615.json | 13 + tests/reference/asr-test_len1-839a615.stderr | 5 + tests/reference/asr-test_list1-73fd538.json | 13 + tests/reference/asr-test_list1-73fd538.stderr | 5 + tests/reference/asr-test_list2-10ffdd7.json | 13 + tests/reference/asr-test_list2-10ffdd7.stderr | 5 + tests/reference/asr-test_list3-5f4d2a8.json | 13 + tests/reference/asr-test_list3-5f4d2a8.stderr | 5 + tests/reference/asr-test_list4-d18a7e3.json | 13 + tests/reference/asr-test_list4-d18a7e3.stderr | 5 + .../asr-test_list_concat-41d186f.json | 13 + .../asr-test_list_concat-41d186f.stderr | 5 + .../asr-test_list_count-4b42498.json | 13 + .../asr-test_list_count-4b42498.stderr | 5 + .../asr-test_list_slicing-984fbf0.json | 13 + .../asr-test_list_slicing-984fbf0.stderr | 5 + tests/reference/asr-test_max_min-3c2fc51.json | 13 + .../reference/asr-test_max_min-3c2fc51.stderr | 11 + .../reference/asr-test_numpy_03-e600a49.json | 13 + .../asr-test_numpy_03-e600a49.stderr | 17 + .../reference/asr-test_numpy_04-ecbb614.json | 13 + .../asr-test_numpy_04-ecbb614.stderr | 17 + .../asr-test_operator_01-0f232bf.json | 13 + .../asr-test_operator_01-0f232bf.stderr | 5 + tests/reference/asr-test_ord-316ce61.json | 13 + tests/reference/asr-test_ord-316ce61.stderr | 5 + .../asr-test_pointer_types-1bf0d01.json | 13 + .../asr-test_pointer_types-1bf0d01.stderr | 5 + tests/reference/asr-test_pow-3f5d550.json | 13 + tests/reference/asr-test_pow-3f5d550.stderr | 11 + tests/reference/asr-test_pow1-581ef42.json | 13 + tests/reference/asr-test_pow1-581ef42.stderr | 11 + tests/reference/asr-test_pow2-0dcbd7d.json | 13 + tests/reference/asr-test_pow2-0dcbd7d.stderr | 11 + tests/reference/asr-test_pow3-79749ed.json | 13 + tests/reference/asr-test_pow3-79749ed.stderr | 11 + tests/reference/asr-test_pow4-ef60978.json | 13 + tests/reference/asr-test_pow4-ef60978.stderr | 11 + tests/reference/asr-test_print1-f1f36f1.json | 13 + .../reference/asr-test_print1-f1f36f1.stderr | 5 + tests/reference/asr-test_print2-64acb15.json | 13 + .../reference/asr-test_print2-64acb15.stderr | 5 + tests/reference/asr-test_return1-2603c9e.json | 13 + .../reference/asr-test_return1-2603c9e.stderr | 5 + tests/reference/asr-test_return2-add829b.json | 13 + .../reference/asr-test_return2-add829b.stderr | 5 + tests/reference/asr-test_set1-11379c7.json | 13 + tests/reference/asr-test_set1-11379c7.stderr | 5 + tests/reference/asr-test_set2-d91a6f0.json | 13 + tests/reference/asr-test_set2-d91a6f0.stderr | 5 + tests/reference/asr-test_set3-f9bbffb.json | 13 + tests/reference/asr-test_set3-f9bbffb.stderr | 5 + tests/reference/asr-test_set4-53fea39.json | 13 + tests/reference/asr-test_set4-53fea39.stderr | 5 + .../asr-test_set_indexing-a1c21b8.json | 13 + .../asr-test_set_indexing-a1c21b8.stderr | 5 + .../asr-test_str_capitalize-9f8dfa9.json | 13 + .../asr-test_str_capitalize-9f8dfa9.stderr | 5 + .../asr-test_str_indexing-b200a4e.json | 13 + .../asr-test_str_indexing-b200a4e.stderr | 5 + .../asr-test_str_slicing-eca1381.json | 13 + .../asr-test_str_slicing-eca1381.stderr | 5 + .../asr-test_str_slicing2-2f07e9a.json | 13 + .../asr-test_str_slicing2-2f07e9a.stderr | 5 + .../asr-test_str_slicing3-fe6a03c.json | 13 + .../asr-test_str_slicing3-fe6a03c.stderr | 5 + .../asr-test_str_slicing4-a0c7a69.json | 13 + .../asr-test_str_slicing4-a0c7a69.stderr | 5 + .../asr-test_str_to_int-61553e7.json | 13 + .../asr-test_str_to_int-61553e7.stderr | 5 + tests/reference/asr-test_tuple1-7abe88f.json | 13 + .../reference/asr-test_tuple1-7abe88f.stderr | 5 + tests/reference/asr-test_tuple2-b046610.json | 13 + .../reference/asr-test_tuple2-b046610.stderr | 5 + tests/reference/asr-test_tuple3-19fa47f.json | 13 + .../reference/asr-test_tuple3-19fa47f.stderr | 5 + .../asr-test_type_mismatch_01-09e8af3.json | 13 + .../asr-test_type_mismatch_01-09e8af3.stderr | 5 + .../asr-test_unary_op_03-e799eae.json | 13 + .../asr-test_unary_op_03-e799eae.stdout | 191 + .../asr-test_unsupported_type-0d813dd.json | 13 + .../asr-test_unsupported_type-0d813dd.stderr | 5 + .../asr-test_zero_division-3dd84e8.json | 13 + .../asr-test_zero_division-3dd84e8.stderr | 5 + .../asr-test_zero_division2-d84989f.json | 13 + .../asr-test_zero_division2-d84989f.stderr | 5 + .../asr-test_zero_division3-29efb9e.json | 13 + .../asr-test_zero_division3-29efb9e.stderr | 5 + .../asr-test_zero_division4-bf4af64.json | 13 + .../asr-test_zero_division4-bf4af64.stderr | 5 + tests/reference/asr-tuple1-09972ab.json | 13 + tests/reference/asr-tuple1-09972ab.stdout | 587 ++ .../reference/asr-type_mismatch-61052c7.json | 13 + .../asr-type_mismatch-61052c7.stderr | 5 + tests/reference/asr-unsigned_01-892b178.json | 13 + .../reference/asr-unsigned_01-892b178.stderr | 5 + tests/reference/asr-unsigned_02-6563e58.json | 13 + .../reference/asr-unsigned_02-6563e58.stderr | 5 + tests/reference/asr-unsigned_03-f785652.json | 13 + .../reference/asr-unsigned_03-f785652.stderr | 5 + tests/reference/asr-unsigned_04-c856d3a.json | 13 + .../reference/asr-unsigned_04-c856d3a.stderr | 5 + tests/reference/asr-vec_01-66ac423.json | 13 + tests/reference/asr-vec_01-66ac423.stderr | 17 + .../asr_json-modules_02-53952e6.json | 13 + .../asr_json-modules_02-53952e6.stdout | 1000 ++ tests/reference/ast-assert1-b0154ee.json | 13 + tests/reference/ast-assert1-b0154ee.stdout | 70 + tests/reference/ast-assign1-2a4c9ed.json | 13 + tests/reference/ast-assign1-2a4c9ed.stdout | 151 + tests/reference/ast-complex1-800b4bb.json | 13 + tests/reference/ast-complex1-800b4bb.stdout | 686 ++ tests/reference/ast-constants1-91cb6ff.json | 13 + tests/reference/ast-constants1-91cb6ff.stdout | 1820 ++++ tests/reference/ast-dictionary1-1a7e00a.json | 13 + .../reference/ast-dictionary1-1a7e00a.stdout | 618 ++ .../ast-doconcurrentloop_01-ed7017b.json | 13 + .../ast-doconcurrentloop_01-ed7017b.stdout | 437 + tests/reference/ast-ellipsis1-4f6c4dd.json | 13 + tests/reference/ast-ellipsis1-4f6c4dd.stdout | 427 + tests/reference/ast-expr1-1e8f7b1.json | 13 + tests/reference/ast-expr1-1e8f7b1.stdout | 124 + tests/reference/ast-expr10-a8d646d.json | 13 + tests/reference/ast-expr10-a8d646d.stdout | 434 + tests/reference/ast-expr11-1d29f78.json | 13 + tests/reference/ast-expr11-1d29f78.stdout | 149 + tests/reference/ast-expr12-adaecda.json | 13 + tests/reference/ast-expr12-adaecda.stdout | 149 + tests/reference/ast-expr13-c35ace1.json | 13 + tests/reference/ast-expr13-c35ace1.stdout | 374 + tests/reference/ast-expr2-6642d4a.json | 13 + tests/reference/ast-expr2-6642d4a.stdout | 184 + tests/reference/ast-expr4-49316cb.json | 13 + tests/reference/ast-expr4-49316cb.stdout | 72 + tests/reference/ast-expr5-bbc6e71.json | 13 + tests/reference/ast-expr5-bbc6e71.stdout | 89 + tests/reference/ast-expr6-0b12a67.json | 13 + tests/reference/ast-expr6-0b12a67.stdout | 119 + tests/reference/ast-expr7-fe52776.json | 13 + tests/reference/ast-expr7-fe52776.stdout | 204 + tests/reference/ast-expr8-7db6b28.json | 13 + tests/reference/ast-expr8-7db6b28.stdout | 352 + tests/reference/ast-expr9-d184496.json | 13 + tests/reference/ast-expr9-d184496.stdout | 231 + tests/reference/ast-expr_01-d0927f9.json | 13 + tests/reference/ast-expr_01-d0927f9.stdout | 112 + tests/reference/ast-global1-b2690cf.json | 13 + tests/reference/ast-global1-b2690cf.stdout | 219 + .../reference/ast-global_scope1-1d68a6c.json | 13 + .../ast-global_scope1-1d68a6c.stdout | 26 + tests/reference/ast-list1-9ce2da0.json | 13 + tests/reference/ast-list1-9ce2da0.stdout | 539 + tests/reference/ast-loop1-194a137.json | 13 + tests/reference/ast-loop1-194a137.stdout | 480 + tests/reference/ast-loop3-f7e0393.json | 13 + tests/reference/ast-loop3-f7e0393.stdout | 54 + tests/reference/ast-set1-ebd6ee0.json | 13 + tests/reference/ast-set1-ebd6ee0.stdout | 190 + tests/reference/ast-subscript1-bd5584b.json | 13 + tests/reference/ast-subscript1-bd5584b.stdout | 415 + tests/reference/ast-tuple1-2fb5396.json | 13 + tests/reference/ast-tuple1-2fb5396.stdout | 702 ++ tests/reference/ast_new-async1-b3d07ed.json | 13 + tests/reference/ast_new-async1-b3d07ed.stdout | 752 ++ tests/reference/ast_new-boolOp1-478328f.json | 13 + .../reference/ast_new-boolOp1-478328f.stdout | 206 + .../reference/ast_new-class_def1-fe69291.json | 13 + .../ast_new-class_def1-fe69291.stdout | 500 + .../reference/ast_new-class_def2-c6db986.json | 13 + .../ast_new-class_def2-c6db986.stdout | 201 + tests/reference/ast_new-comment2-f0984d5.json | 13 + .../reference/ast_new-comment2-f0984d5.stdout | 150 + .../ast_new-comprehension1-69cf2af.json | 13 + .../ast_new-comprehension1-69cf2af.stdout | 1363 +++ .../ast_new-conditional_expr1-07ccb9e.json | 13 + .../ast_new-conditional_expr1-07ccb9e.stdout | 1069 ++ .../ast_new-dictionary1-445e718.json | 13 + .../ast_new-dictionary1-445e718.stdout | 299 + .../reference/ast_new-ellipsis2-3a9750b.json | 13 + .../ast_new-ellipsis2-3a9750b.stdout | 336 + tests/reference/ast_new-for1-887432e.json | 13 + tests/reference/ast_new-for1-887432e.stdout | 485 + tests/reference/ast_new-for2-af08901.json | 13 + tests/reference/ast_new-for2-af08901.stdout | 504 + .../ast_new-function_def1-1a872df.json | 13 + .../ast_new-function_def1-1a872df.stdout | 558 ++ .../ast_new-function_def2-52c4587.json | 13 + .../ast_new-function_def2-52c4587.stdout | 1315 +++ .../ast_new-function_def3-f66064a.json | 13 + .../ast_new-function_def3-f66064a.stdout | 538 + tests/reference/ast_new-global1-38edfbd.json | 13 + .../reference/ast_new-global1-38edfbd.stdout | 219 + tests/reference/ast_new-if1-db43586.json | 13 + tests/reference/ast_new-if1-db43586.stdout | 458 + tests/reference/ast_new-if2-c3b6022.json | 13 + tests/reference/ast_new-if2-c3b6022.stdout | 364 + tests/reference/ast_new-import1-f643fd3.json | 13 + .../reference/ast_new-import1-f643fd3.stdout | 185 + tests/reference/ast_new-lambda1-260d046.json | 13 + .../reference/ast_new-lambda1-260d046.stdout | 1093 ++ tests/reference/ast_new-lambda2-d84336e.json | 13 + .../reference/ast_new-lambda2-d84336e.stdout | 968 ++ .../ast_new-match_stmt1-9e84d24.json | 13 + .../ast_new-match_stmt1-9e84d24.stdout | 2245 +++++ tests/reference/ast_new-slice1-9c440e3.json | 13 + tests/reference/ast_new-slice1-9c440e3.stdout | 291 + .../ast_new-statements1-e081093.json | 13 + .../ast_new-statements1-e081093.stdout | 1695 ++++ .../ast_new-statements2-c4cdc5f.json | 13 + .../ast_new-statements2-c4cdc5f.stdout | 507 + tests/reference/ast_new-string1-96b90b3.json | 13 + .../reference/ast_new-string1-96b90b3.stdout | 520 + tests/reference/ast_new-string2-44323ea.json | 13 + .../reference/ast_new-string2-44323ea.stdout | 118 + tests/reference/ast_new-string3-37f35a0.json | 13 + .../reference/ast_new-string3-37f35a0.stdout | 129 + tests/reference/ast_new-try1-a9a22cf.json | 13 + tests/reference/ast_new-try1-a9a22cf.stdout | 301 + tests/reference/ast_new-tuple1-29c08af.json | 13 + tests/reference/ast_new-tuple1-29c08af.stdout | 650 ++ .../ast_new-type_comment1-710ea6c.json | 13 + .../ast_new-type_comment1-710ea6c.stdout | 175 + tests/reference/ast_new-unicode-d3199dc.json | 13 + .../reference/ast_new-unicode-d3199dc.stdout | 96 + tests/reference/ast_new-while1-a4c6382.json | 13 + tests/reference/ast_new-while1-a4c6382.stdout | 84 + tests/reference/ast_new-with1-6c88c0f.json | 13 + tests/reference/ast_new-with1-6c88c0f.stdout | 331 + tests/reference/ast_new-yield-4c41668.json | 13 + tests/reference/ast_new-yield-4c41668.stdout | 346 + tests/reference/c-c_interop1-e215531.json | 13 + tests/reference/c-c_interop1-e215531.stdout | 33 + tests/reference/c-expr7-bb2692a.json | 13 + tests/reference/c-expr7-bb2692a.stderr | 11 + tests/reference/c-expr_01-28f449f.json | 13 + tests/reference/c-expr_01-28f449f.stdout | 54 + tests/reference/c-expr_11-c452314.json | 13 + tests/reference/c-expr_11-c452314.stdout | 35 + tests/reference/c-expr_12-93c7780.json | 13 + tests/reference/c-expr_12-93c7780.stdout | 70 + tests/reference/c-func_static_01-fc146ec.json | 13 + .../reference/c-func_static_01-fc146ec.stdout | 46 + .../reference/c-import_order_01-3ebf3c3.json | 13 + .../c-import_order_01-3ebf3c3.stdout | 27 + tests/reference/c-loop1-3e341c7.json | 13 + tests/reference/c-loop1-3e341c7.stdout | 85 + tests/reference/c-loop4-eec10d3.json | 13 + tests/reference/c-loop4-eec10d3.stdout | 41 + tests/reference/c-print_01-4d44628.json | 13 + tests/reference/c-print_01-4d44628.stdout | 40 + tests/reference/c-test_import_02-d2c54c4.json | 13 + .../reference/c-test_import_02-d2c54c4.stdout | 53 + tests/reference/c-test_issue_518-fbbd299.json | 13 + .../reference/c-test_issue_518-fbbd299.stdout | 55 + .../reference/c-variable_decl_03-fa1823b.json | 13 + .../c-variable_decl_03-fa1823b.stdout | 52 + tests/reference/cpp-assert1-ba60925.json | 13 + tests/reference/cpp-assert1-ba60925.stdout | 37 + .../cpp-doconcurrentloop_01-4e9f274.json | 13 + .../cpp-doconcurrentloop_01-4e9f274.stdout | 105 + tests/reference/cpp-expr12-fd2ea87.json | 13 + tests/reference/cpp-expr12-fd2ea87.stdout | 69 + tests/reference/cpp-expr15-1661c0d.json | 13 + tests/reference/cpp-expr15-1661c0d.stderr | 11 + tests/reference/cpp-expr2-09c05ad.json | 13 + tests/reference/cpp-expr2-09c05ad.stdout | 37 + tests/reference/cpp-expr5-1de0e30.json | 13 + tests/reference/cpp-expr5-1de0e30.stdout | 37 + tests/reference/cpp-expr6-f337f4f.json | 13 + tests/reference/cpp-expr6-f337f4f.stdout | 37 + tests/reference/cpp-expr7-529bd53.json | 13 + tests/reference/cpp-expr7-529bd53.stderr | 11 + tests/reference/cpp-expr8-704cece.json | 13 + tests/reference/cpp-expr8-704cece.stderr | 11 + tests/reference/cpp-expr9-48868e9.json | 13 + tests/reference/cpp-expr9-48868e9.stdout | 82 + tests/reference/cpp-expr_11-422c839.json | 13 + tests/reference/cpp-expr_11-422c839.stdout | 55 + tests/reference/cpp-loop1-0a8cf3b.json | 13 + tests/reference/cpp-loop1-0a8cf3b.stdout | 105 + tests/reference/cpp-loop3-6020091.json | 13 + tests/reference/cpp-loop3-6020091.stdout | 37 + tests/reference/cpp-loop4-cdb2174.json | 13 + tests/reference/cpp-loop4-cdb2174.stdout | 61 + tests/reference/cpp-print_01-026ef17.json | 13 + tests/reference/cpp-print_01-026ef17.stdout | 61 + .../cpp-test_builtin_pow-56b3f92.json | 13 + .../cpp-test_builtin_pow-56b3f92.stderr | 11 + .../cpp-test_list_repeat2-698d7f4.json | 13 + .../cpp-test_list_repeat2-698d7f4.stdout | 256 + .../cpp-test_unary_op_03-fd9669a.json | 13 + .../cpp-test_unary_op_03-fd9669a.stdout | 56 + tests/reference/llvm-assert1-8df4f31.json | 13 + tests/reference/llvm-assert1-8df4f31.stdout | 10 + tests/reference/llvm-bindc_01-c984f09.json | 13 + tests/reference/llvm-bindc_01-c984f09.stdout | 81 + tests/reference/llvm-bool1-af4376b.json | 13 + tests/reference/llvm-bool1-af4376b.stdout | 64 + tests/reference/llvm-expr14-b96b5b1.json | 13 + tests/reference/llvm-expr14-b96b5b1.stdout | 10 + tests/reference/llvm-expr_01-54467c1.json | 13 + tests/reference/llvm-expr_01-54467c1.stdout | 41 + .../llvm-func_inline_01-2d4583a.json | 13 + .../llvm-func_inline_01-2d4583a.stdout | 100 + tests/reference/llvm-lpython1-23c5987.json | 13 + tests/reference/llvm-lpython1-23c5987.stdout | 10 + tests/reference/llvm-print_04-443a8d8.json | 13 + tests/reference/llvm-print_04-443a8d8.stdout | 46 + tests/reference/llvm-structs_11-09fea6a.json | 13 + .../reference/llvm-structs_11-09fea6a.stdout | 45 + .../llvm-test_issue_518-cdb641a.json | 13 + .../llvm-test_issue_518-cdb641a.stdout | 121 + .../llvm-test_unary_op_03-046fb86.json | 13 + .../llvm-test_unary_op_03-046fb86.stdout | 69 + tests/reference/llvm_dbg-expr_01-9fc5f30.json | 13 + .../reference/llvm_dbg-expr_01-9fc5f30.stdout | 79 + ..._class_constructor-structs_16-5e3508f.json | 13 + ...lass_constructor-structs_16-5e3508f.stdout | 356 + ...function_calls-func_inline_01-8b6a5da.json | 13 + ...nction_calls-func_inline_01-8b6a5da.stdout | 432 + .../pass_loop_vectorise-vec_01-be9985e.json | 13 + .../pass_loop_vectorise-vec_01-be9985e.stderr | 17 + ...ass_print_list_tuple-print_02-09600eb.json | 13 + ...s_print_list_tuple-print_02-09600eb.stdout | 8761 +++++++++++++++++ ...ist_tuple-print_list_tuple_03-195fa9c.json | 13 + ...t_tuple-print_list_tuple_03-195fa9c.stdout | 522 + .../run_dbg-test_assert_01-2f34744.json | 13 + .../run_dbg-test_assert_01-2f34744.stderr | 7 + .../run_dbg-test_assert_02-c6de25a.json | 13 + .../run_dbg-test_assert_02-c6de25a.stderr | 7 + .../run_dbg-test_assert_03-bd7b7dd.json | 13 + .../run_dbg-test_assert_03-bd7b7dd.stderr | 11 + .../run_dbg-test_quit_01-30889cc.json | 13 + .../run_dbg-test_quit_01-30889cc.stderr | 7 + .../run_dbg-test_raise_01-dfd86ca.json | 13 + .../run_dbg-test_raise_01-dfd86ca.stderr | 7 + .../runtime-test_dict14-421fe53.json | 13 + .../runtime-test_dict14-421fe53.stderr | 1 + .../runtime-test_dict15-6f3af0d.json | 13 + .../runtime-test_dict15-6f3af0d.stderr | 1 + .../runtime-test_dict16-c5a958d.json | 13 + .../runtime-test_dict16-c5a958d.stderr | 1 + .../runtime-test_list_01-3ee9b3e.json | 13 + .../runtime-test_list_01-3ee9b3e.stderr | 1 + .../runtime-test_list_02-5f7db5f.json | 13 + .../runtime-test_list_02-5f7db5f.stderr | 1 + .../runtime-test_list_index-0483808.json | 13 + .../runtime-test_list_index-0483808.stderr | 1 + .../runtime-test_list_index2-1249233.json | 13 + .../runtime-test_list_index2-1249233.stderr | 1 + .../runtime-test_list_index3-647a94a.json | 13 + .../runtime-test_list_index3-647a94a.stderr | 1 + .../runtime-test_list_index4-c31dfdb.json | 13 + .../runtime-test_list_index4-c31dfdb.stderr | 1 + .../runtime-test_str_01-50bdf2f.json | 13 + .../runtime-test_str_01-50bdf2f.stdout | 1 + .../runtime-test_str_02-c38ba27.json | 13 + .../runtime-test_str_02-c38ba27.stdout | 1 + tests/reference/tokens-comment1-2f8ab90.json | 13 + .../reference/tokens-comment1-2f8ab90.stdout | 34 + tests/reference/tokens-comment2-b289dad.json | 13 + .../reference/tokens-comment2-b289dad.stdout | 133 + .../reference/tokens-docstring1-1355fbb.json | 13 + .../tokens-docstring1-1355fbb.stdout | 36 + tests/reference/tokens-indent1-0b243c5.json | 13 + tests/reference/tokens-indent1-0b243c5.stderr | 5 + tests/reference/tokens-indent1-290e858.json | 13 + tests/reference/tokens-indent1-290e858.stdout | 73 + tests/reference/tokens-indent2-a8438a0.json | 13 + tests/reference/tokens-indent2-a8438a0.stderr | 5 + tests/reference/tokens-indent2-e702789.json | 13 + tests/reference/tokens-indent2-e702789.stdout | 88 + tests/reference/tokens-indent3-0eaf3e6.json | 13 + tests/reference/tokens-indent3-0eaf3e6.stderr | 5 + tests/reference/tokens-numbers1-589063f.json | 13 + .../reference/tokens-numbers1-589063f.stdout | 242 + tests/reference/tokens-paren1-94fa736.json | 13 + tests/reference/tokens-paren1-94fa736.stderr | 5 + tests/reference/tokens-paren2-0eef339.json | 13 + tests/reference/tokens-paren2-0eef339.stderr | 5 + tests/reference/tokens-paren3-0d47100.json | 13 + tests/reference/tokens-paren3-0d47100.stderr | 5 + tests/reference/tokens-paren4-5c2fc32.json | 13 + tests/reference/tokens-paren4-5c2fc32.stderr | 5 + tests/reference/tokens-symbols1-658c990.json | 13 + .../reference/tokens-symbols1-658c990.stdout | 340 + tests/reference/wat-bool1-234bcd1.json | 13 + tests/reference/wat-bool1-234bcd1.stdout | 218 + tests/reference/wat-expr14-5e0cb96.json | 13 + tests/reference/wat-expr14-5e0cb96.stdout | 57 + tests/reference/wat-expr2-8b17723.json | 13 + tests/reference/wat-expr2-8b17723.stdout | 57 + tests/reference/wat-expr9-f73afd1.json | 13 + tests/reference/wat-expr9-f73afd1.stdout | 113 + tests/reference/wat-loop1-e0046d4.json | 13 + tests/reference/wat-loop1-e0046d4.stdout | 197 + tests/reference/wat-print_str-385e953.json | 13 + tests/reference/wat-print_str-385e953.stdout | 162 + 744 files changed, 78178 insertions(+) create mode 100644 tests/reference/asr-array_01_decl-39cf894.json create mode 100644 tests/reference/asr-array_01_decl-39cf894.stderr create mode 100644 tests/reference/asr-array_02_decl-e8f6874.json create mode 100644 tests/reference/asr-array_02_decl-e8f6874.stderr create mode 100644 tests/reference/asr-arrays_01-a617b64.json create mode 100644 tests/reference/asr-arrays_01-a617b64.stderr create mode 100644 tests/reference/asr-arrays_02-da94458.json create mode 100644 tests/reference/asr-arrays_02-da94458.stderr create mode 100644 tests/reference/asr-arrays_03-de2e952.json create mode 100644 tests/reference/asr-arrays_03-de2e952.stderr create mode 100644 tests/reference/asr-arrays_04-880407c.json create mode 100644 tests/reference/asr-arrays_04-880407c.stderr create mode 100644 tests/reference/asr-arrays_05-ec8fbd5.json create mode 100644 tests/reference/asr-arrays_05-ec8fbd5.stderr create mode 100644 tests/reference/asr-arrays_06-fbb09a3.json create mode 100644 tests/reference/asr-arrays_06-fbb09a3.stderr create mode 100644 tests/reference/asr-arrays_07-de430fd.json create mode 100644 tests/reference/asr-arrays_07-de430fd.stderr create mode 100644 tests/reference/asr-arrays_08-ba317a3.json create mode 100644 tests/reference/asr-arrays_08-ba317a3.stderr create mode 100644 tests/reference/asr-arrays_09-50ee586.json create mode 100644 tests/reference/asr-arrays_09-50ee586.stderr create mode 100644 tests/reference/asr-arrays_10-bc82d75.json create mode 100644 tests/reference/asr-arrays_10-bc82d75.stderr create mode 100644 tests/reference/asr-arrays_11-fc505b4.json create mode 100644 tests/reference/asr-arrays_11-fc505b4.stderr create mode 100644 tests/reference/asr-arrays_12-63d6f25.json create mode 100644 tests/reference/asr-arrays_12-63d6f25.stderr create mode 100644 tests/reference/asr-arrays_13-b5fcc7e.json create mode 100644 tests/reference/asr-arrays_13-b5fcc7e.stderr create mode 100644 tests/reference/asr-arrays_14-78be00e.json create mode 100644 tests/reference/asr-arrays_14-78be00e.stderr create mode 100644 tests/reference/asr-assert1-1ce92ea.json create mode 100644 tests/reference/asr-assert1-1ce92ea.stdout create mode 100644 tests/reference/asr-assign1-886f049.json create mode 100644 tests/reference/asr-assign1-886f049.stdout create mode 100644 tests/reference/asr-assign2-8d1a2ee.json create mode 100644 tests/reference/asr-assign2-8d1a2ee.stdout create mode 100644 tests/reference/asr-bindc_01-6d521a9.json create mode 100644 tests/reference/asr-bindc_01-6d521a9.stdout create mode 100644 tests/reference/asr-bindc_01-f761165.json create mode 100644 tests/reference/asr-bindc_01-f761165.stderr create mode 100644 tests/reference/asr-bindc_02-5092d8e.json create mode 100644 tests/reference/asr-bindc_02-5092d8e.stderr create mode 100644 tests/reference/asr-bindc_02-bc1a7ea.json create mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stderr create mode 100644 tests/reference/asr-bindc_03-95dbba7.json create mode 100644 tests/reference/asr-bindc_03-95dbba7.stderr create mode 100644 tests/reference/asr-bindc_04-06bd800.json create mode 100644 tests/reference/asr-bindc_04-06bd800.stderr create mode 100644 tests/reference/asr-bindc_10e-8b10394.json create mode 100644 tests/reference/asr-bindc_10e-8b10394.stderr create mode 100644 tests/reference/asr-c_interop1-cf2e9b4.json create mode 100644 tests/reference/asr-c_interop1-cf2e9b4.stdout create mode 100644 tests/reference/asr-callback_01-df40fd5.json create mode 100644 tests/reference/asr-callback_01-df40fd5.stdout create mode 100644 tests/reference/asr-cast-435c233.json create mode 100644 tests/reference/asr-cast-435c233.stderr create mode 100644 tests/reference/asr-complex1-f26c460.json create mode 100644 tests/reference/asr-complex1-f26c460.stderr create mode 100644 tests/reference/asr-const_01-af8289b.json create mode 100644 tests/reference/asr-const_01-af8289b.stderr create mode 100644 tests/reference/asr-const_02-fce29b7.json create mode 100644 tests/reference/asr-const_02-fce29b7.stderr create mode 100644 tests/reference/asr-constants1-5828e8a.json create mode 100644 tests/reference/asr-constants1-5828e8a.stderr create mode 100644 tests/reference/asr-cptr_01-4e660f1.json create mode 100644 tests/reference/asr-cptr_01-4e660f1.stderr create mode 100644 tests/reference/asr-dictionary1-a105a36.json create mode 100644 tests/reference/asr-dictionary1-a105a36.stdout create mode 100644 tests/reference/asr-doconcurrentloop_01-3fdc189.json create mode 100644 tests/reference/asr-doconcurrentloop_01-3fdc189.stdout create mode 100644 tests/reference/asr-elemental_01-b58df26.json create mode 100644 tests/reference/asr-elemental_01-b58df26.stderr create mode 100644 tests/reference/asr-enum_01-30e1b4a.json create mode 100644 tests/reference/asr-enum_01-30e1b4a.stderr create mode 100644 tests/reference/asr-enum_02-54656c5.json create mode 100644 tests/reference/asr-enum_02-54656c5.stderr create mode 100644 tests/reference/asr-expr1-8df2d66.json create mode 100644 tests/reference/asr-expr1-8df2d66.stdout create mode 100644 tests/reference/asr-expr10-efcbb1b.json create mode 100644 tests/reference/asr-expr10-efcbb1b.stderr create mode 100644 tests/reference/asr-expr11-9b91d35.json create mode 100644 tests/reference/asr-expr11-9b91d35.stdout create mode 100644 tests/reference/asr-expr12-5c5b71e.json create mode 100644 tests/reference/asr-expr12-5c5b71e.stdout create mode 100644 tests/reference/asr-expr13-81bdb5a.json create mode 100644 tests/reference/asr-expr13-81bdb5a.stderr create mode 100644 tests/reference/asr-expr16-a3dc453.json create mode 100644 tests/reference/asr-expr16-a3dc453.stderr create mode 100644 tests/reference/asr-expr2-2e78a12.json create mode 100644 tests/reference/asr-expr2-2e78a12.stdout create mode 100644 tests/reference/asr-expr4-cef6743.json create mode 100644 tests/reference/asr-expr4-cef6743.stdout create mode 100644 tests/reference/asr-expr5-645ffcc.json create mode 100644 tests/reference/asr-expr5-645ffcc.stdout create mode 100644 tests/reference/asr-expr6-368e5ed.json create mode 100644 tests/reference/asr-expr6-368e5ed.stdout create mode 100644 tests/reference/asr-expr7-480ba2f.json create mode 100644 tests/reference/asr-expr7-480ba2f.stderr create mode 100644 tests/reference/asr-expr8-6beda60.json create mode 100644 tests/reference/asr-expr8-6beda60.stderr create mode 100644 tests/reference/asr-expr9-814e4bc.json create mode 100644 tests/reference/asr-expr9-814e4bc.stdout create mode 100644 tests/reference/asr-expr_01-211000e.json create mode 100644 tests/reference/asr-expr_01-211000e.stdout create mode 100644 tests/reference/asr-expr_01-a0d4829.json create mode 100644 tests/reference/asr-expr_01-a0d4829.stdout create mode 100644 tests/reference/asr-expr_05-3a37324.json create mode 100644 tests/reference/asr-expr_05-3a37324.stderr create mode 100644 tests/reference/asr-expr_07-7742668.json create mode 100644 tests/reference/asr-expr_07-7742668.stdout create mode 100644 tests/reference/asr-expr_09-f3e89c8.json create mode 100644 tests/reference/asr-expr_09-f3e89c8.stdout create mode 100644 tests/reference/asr-expr_10-d39708c.json create mode 100644 tests/reference/asr-expr_10-d39708c.stdout create mode 100644 tests/reference/asr-expr_12-6769be0.json create mode 100644 tests/reference/asr-expr_12-6769be0.stdout create mode 100644 tests/reference/asr-expr_14-f2bd343.json create mode 100644 tests/reference/asr-expr_14-f2bd343.stdout create mode 100644 tests/reference/asr-func_01-d87aa4a.json create mode 100644 tests/reference/asr-func_01-d87aa4a.stderr create mode 100644 tests/reference/asr-func_02-b439474.json create mode 100644 tests/reference/asr-func_02-b439474.stderr create mode 100644 tests/reference/asr-func_03-cd744a0.json create mode 100644 tests/reference/asr-func_03-cd744a0.stderr create mode 100644 tests/reference/asr-func_04-eef2656.json create mode 100644 tests/reference/asr-func_04-eef2656.stderr create mode 100644 tests/reference/asr-func_05-c22b921.json create mode 100644 tests/reference/asr-func_05-c22b921.stderr create mode 100644 tests/reference/asr-func_06-62e738c.json create mode 100644 tests/reference/asr-func_06-62e738c.stderr create mode 100644 tests/reference/asr-func_07-4a8c076.json create mode 100644 tests/reference/asr-func_07-4a8c076.stderr create mode 100644 tests/reference/asr-func_08-c137415.json create mode 100644 tests/reference/asr-func_08-c137415.stderr create mode 100644 tests/reference/asr-func_inline_01-56af272.json create mode 100644 tests/reference/asr-func_inline_01-56af272.stdout create mode 100644 tests/reference/asr-generics_01-d616074.json create mode 100644 tests/reference/asr-generics_01-d616074.stdout create mode 100644 tests/reference/asr-generics_02-e2ea5c9.json create mode 100644 tests/reference/asr-generics_02-e2ea5c9.stdout create mode 100644 tests/reference/asr-generics_array_01-682b1b2.json create mode 100644 tests/reference/asr-generics_array_01-682b1b2.stderr create mode 100644 tests/reference/asr-generics_array_02-22c8dc1.json create mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stderr create mode 100644 tests/reference/asr-generics_array_03-fb3706c.json create mode 100644 tests/reference/asr-generics_array_03-fb3706c.stderr create mode 100644 tests/reference/asr-generics_error_01-1e05cd6.json create mode 100644 tests/reference/asr-generics_error_01-1e05cd6.stderr create mode 100644 tests/reference/asr-generics_error_02-d614928.json create mode 100644 tests/reference/asr-generics_error_02-d614928.stderr create mode 100644 tests/reference/asr-generics_error_03-208d10d.json create mode 100644 tests/reference/asr-generics_error_03-208d10d.stderr create mode 100644 tests/reference/asr-generics_list_01-39c4044.json create mode 100644 tests/reference/asr-generics_list_01-39c4044.stdout create mode 100644 tests/reference/asr-global_scope1-354e217.json create mode 100644 tests/reference/asr-global_scope1-354e217.stdout create mode 100644 tests/reference/asr-global_syms_01-273906f.json create mode 100644 tests/reference/asr-global_syms_01-273906f.stdout create mode 100644 tests/reference/asr-intent_01-66824bc.json create mode 100644 tests/reference/asr-intent_01-66824bc.stdout create mode 100644 tests/reference/asr-kwargs_01_error-ab9530d.json create mode 100644 tests/reference/asr-kwargs_01_error-ab9530d.stderr create mode 100644 tests/reference/asr-kwargs_02_error-7c91f8f.json create mode 100644 tests/reference/asr-kwargs_02_error-7c91f8f.stderr create mode 100644 tests/reference/asr-kwargs_03_error-a68cc46.json create mode 100644 tests/reference/asr-kwargs_03_error-a68cc46.stderr create mode 100644 tests/reference/asr-lambda_01-1ec3e01.json create mode 100644 tests/reference/asr-lambda_01-1ec3e01.stderr create mode 100644 tests/reference/asr-list1-770ba33.json create mode 100644 tests/reference/asr-list1-770ba33.stdout create mode 100644 tests/reference/asr-loop1-10d3109.json create mode 100644 tests/reference/asr-loop1-10d3109.stdout create mode 100644 tests/reference/asr-loop3-a579196.json create mode 100644 tests/reference/asr-loop3-a579196.stdout create mode 100644 tests/reference/asr-loop4-3d3216e.json create mode 100644 tests/reference/asr-loop4-3d3216e.stdout create mode 100644 tests/reference/asr-loop_01-e7aa06a.json create mode 100644 tests/reference/asr-loop_01-e7aa06a.stderr create mode 100644 tests/reference/asr-loop_02-5741651.json create mode 100644 tests/reference/asr-loop_02-5741651.stderr create mode 100644 tests/reference/asr-loop_03-401ab45.json create mode 100644 tests/reference/asr-loop_03-401ab45.stderr create mode 100644 tests/reference/asr-modules_02-ec92e6f.json create mode 100644 tests/reference/asr-modules_02-ec92e6f.stdout create mode 100644 tests/reference/asr-print_02-afbe092.json create mode 100644 tests/reference/asr-print_02-afbe092.stdout create mode 100644 tests/reference/asr-print_list_tuple_03-9de3736.json create mode 100644 tests/reference/asr-print_list_tuple_03-9de3736.stdout create mode 100644 tests/reference/asr-set1-b7b913a.json create mode 100644 tests/reference/asr-set1-b7b913a.stdout create mode 100644 tests/reference/asr-string_01-78629c4.json create mode 100644 tests/reference/asr-string_01-78629c4.stderr create mode 100644 tests/reference/asr-string_02-499c9ff.json create mode 100644 tests/reference/asr-string_02-499c9ff.stderr create mode 100644 tests/reference/asr-structs_01-0893e35.json create mode 100644 tests/reference/asr-structs_01-0893e35.stderr create mode 100644 tests/reference/asr-structs_01-66dc2c9.json create mode 100644 tests/reference/asr-structs_01-66dc2c9.stdout create mode 100644 tests/reference/asr-structs_01-be14d49.json create mode 100644 tests/reference/asr-structs_01-be14d49.stdout create mode 100644 tests/reference/asr-structs_02-2ab459a.json create mode 100644 tests/reference/asr-structs_02-2ab459a.stdout create mode 100644 tests/reference/asr-structs_02-f95782c.json create mode 100644 tests/reference/asr-structs_02-f95782c.stderr create mode 100644 tests/reference/asr-structs_03-0cef911.json create mode 100644 tests/reference/asr-structs_03-0cef911.stdout create mode 100644 tests/reference/asr-structs_03-754fb64.json create mode 100644 tests/reference/asr-structs_03-754fb64.stderr create mode 100644 tests/reference/asr-structs_04-387747b.json create mode 100644 tests/reference/asr-structs_04-387747b.stdout create mode 100644 tests/reference/asr-structs_04-7b864bc.json create mode 100644 tests/reference/asr-structs_04-7b864bc.stderr create mode 100644 tests/reference/asr-structs_05-fa98307.json create mode 100644 tests/reference/asr-structs_05-fa98307.stderr create mode 100644 tests/reference/asr-structs_06-6e14537.json create mode 100644 tests/reference/asr-structs_06-6e14537.stderr create mode 100644 tests/reference/asr-structs_07-83694b7.json create mode 100644 tests/reference/asr-structs_07-83694b7.stderr create mode 100644 tests/reference/asr-structs_08-fa4dbf0.json create mode 100644 tests/reference/asr-structs_08-fa4dbf0.stderr create mode 100644 tests/reference/asr-structs_09-f3ffe08.json create mode 100644 tests/reference/asr-structs_09-f3ffe08.stderr create mode 100644 tests/reference/asr-structs_10-cb8a283.json create mode 100644 tests/reference/asr-structs_10-cb8a283.stderr create mode 100644 tests/reference/asr-structs_16-44de89a.json create mode 100644 tests/reference/asr-structs_16-44de89a.stdout create mode 100644 tests/reference/asr-subscript1-1acfc19.json create mode 100644 tests/reference/asr-subscript1-1acfc19.stdout create mode 100644 tests/reference/asr-test_annassign_01-2f18669.json create mode 100644 tests/reference/asr-test_annassign_01-2f18669.stderr create mode 100644 tests/reference/asr-test_annassign_02-accf6db.json create mode 100644 tests/reference/asr-test_annassign_02-accf6db.stderr create mode 100644 tests/reference/asr-test_annassign_03-f8c6160.json create mode 100644 tests/reference/asr-test_annassign_03-f8c6160.stderr create mode 100644 tests/reference/asr-test_annassign_type_mismatch-7dac7be.json create mode 100644 tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr create mode 100644 tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json create mode 100644 tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr create mode 100644 tests/reference/asr-test_append_type_mismatch-030e9c7.json create mode 100644 tests/reference/asr-test_append_type_mismatch-030e9c7.stderr create mode 100644 tests/reference/asr-test_assign1-a94d41e.json create mode 100644 tests/reference/asr-test_assign1-a94d41e.stderr create mode 100644 tests/reference/asr-test_assign2-fa29029.json create mode 100644 tests/reference/asr-test_assign2-fa29029.stderr create mode 100644 tests/reference/asr-test_assign3-cc6fc9d.json create mode 100644 tests/reference/asr-test_assign3-cc6fc9d.stderr create mode 100644 tests/reference/asr-test_assign4-a2136e0.json create mode 100644 tests/reference/asr-test_assign4-a2136e0.stderr create mode 100644 tests/reference/asr-test_assign5-694a98f.json create mode 100644 tests/reference/asr-test_assign5-694a98f.stderr create mode 100644 tests/reference/asr-test_assign6-05cd64f.json create mode 100644 tests/reference/asr-test_assign6-05cd64f.stderr create mode 100644 tests/reference/asr-test_assign7-beebac3.json create mode 100644 tests/reference/asr-test_assign7-beebac3.stderr create mode 100644 tests/reference/asr-test_assign8-4b26e63.json create mode 100644 tests/reference/asr-test_assign8-4b26e63.stderr create mode 100644 tests/reference/asr-test_assign9-51278b8.json create mode 100644 tests/reference/asr-test_assign9-51278b8.stderr create mode 100644 tests/reference/asr-test_binop1-50b63f6.json create mode 100644 tests/reference/asr-test_binop1-50b63f6.stderr create mode 100644 tests/reference/asr-test_binop2-e5749af.json create mode 100644 tests/reference/asr-test_binop2-e5749af.stderr create mode 100644 tests/reference/asr-test_binop3-a67201d.json create mode 100644 tests/reference/asr-test_binop3-a67201d.stderr create mode 100644 tests/reference/asr-test_bit_length-da3a264.json create mode 100644 tests/reference/asr-test_bit_length-da3a264.stderr create mode 100644 tests/reference/asr-test_bitwise_on_complex-dd9568b.json create mode 100644 tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr create mode 100644 tests/reference/asr-test_bitwise_on_float-2e09b30.json create mode 100644 tests/reference/asr-test_bitwise_on_float-2e09b30.stderr create mode 100644 tests/reference/asr-test_bool_binop-f856ef0.json create mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stderr create mode 100644 tests/reference/asr-test_builtin-aa64615.json create mode 100644 tests/reference/asr-test_builtin-aa64615.stdout create mode 100644 tests/reference/asr-test_builtin_abs-c74d2c9.json create mode 100644 tests/reference/asr-test_builtin_abs-c74d2c9.stdout create mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.json create mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stderr create mode 100644 tests/reference/asr-test_builtin_bool-330223a.json create mode 100644 tests/reference/asr-test_builtin_bool-330223a.stderr create mode 100644 tests/reference/asr-test_builtin_float-20601dd.json create mode 100644 tests/reference/asr-test_builtin_float-20601dd.stdout create mode 100644 tests/reference/asr-test_builtin_hex-64bd268.json create mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stderr create mode 100644 tests/reference/asr-test_builtin_int-8f88fdc.json create mode 100644 tests/reference/asr-test_builtin_int-8f88fdc.stdout create mode 100644 tests/reference/asr-test_builtin_len-55b0dec.json create mode 100644 tests/reference/asr-test_builtin_len-55b0dec.stdout create mode 100644 tests/reference/asr-test_builtin_oct-20b9066.json create mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stderr create mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.json create mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.stderr create mode 100644 tests/reference/asr-test_builtin_round-7417a21.json create mode 100644 tests/reference/asr-test_builtin_round-7417a21.stderr create mode 100644 tests/reference/asr-test_builtin_str-580e920.json create mode 100644 tests/reference/asr-test_builtin_str-580e920.stdout create mode 100644 tests/reference/asr-test_c_interop_01-e374f43.json create mode 100644 tests/reference/asr-test_c_interop_01-e374f43.stdout create mode 100644 tests/reference/asr-test_chr-91f4987.json create mode 100644 tests/reference/asr-test_chr-91f4987.stderr create mode 100644 tests/reference/asr-test_compare_01-c594bbe.json create mode 100644 tests/reference/asr-test_compare_01-c594bbe.stderr create mode 100644 tests/reference/asr-test_compare_02-bf2c76e.json create mode 100644 tests/reference/asr-test_compare_02-bf2c76e.stderr create mode 100644 tests/reference/asr-test_complex_01-a6def58.json create mode 100644 tests/reference/asr-test_complex_01-a6def58.stderr create mode 100644 tests/reference/asr-test_complex_02-782ba2d.json create mode 100644 tests/reference/asr-test_complex_02-782ba2d.stderr create mode 100644 tests/reference/asr-test_dict1-a45a075.json create mode 100644 tests/reference/asr-test_dict1-a45a075.stderr create mode 100644 tests/reference/asr-test_dict10-8c0beff.json create mode 100644 tests/reference/asr-test_dict10-8c0beff.stderr create mode 100644 tests/reference/asr-test_dict11-2ab4e6c.json create mode 100644 tests/reference/asr-test_dict11-2ab4e6c.stderr create mode 100644 tests/reference/asr-test_dict12-7c74d08.json create mode 100644 tests/reference/asr-test_dict12-7c74d08.stderr create mode 100644 tests/reference/asr-test_dict13-683b290.json create mode 100644 tests/reference/asr-test_dict13-683b290.stderr create mode 100644 tests/reference/asr-test_dict2-4587f02.json create mode 100644 tests/reference/asr-test_dict2-4587f02.stderr create mode 100644 tests/reference/asr-test_dict3-d28f38f.json create mode 100644 tests/reference/asr-test_dict3-d28f38f.stderr create mode 100644 tests/reference/asr-test_dict4-39489fa.json create mode 100644 tests/reference/asr-test_dict4-39489fa.stderr create mode 100644 tests/reference/asr-test_dict5-c436d37.json create mode 100644 tests/reference/asr-test_dict5-c436d37.stderr create mode 100644 tests/reference/asr-test_dict6-95e3b14.json create mode 100644 tests/reference/asr-test_dict6-95e3b14.stderr create mode 100644 tests/reference/asr-test_dict7-1415e14.json create mode 100644 tests/reference/asr-test_dict7-1415e14.stderr create mode 100644 tests/reference/asr-test_dict8-d960ce0.json create mode 100644 tests/reference/asr-test_dict8-d960ce0.stderr create mode 100644 tests/reference/asr-test_dict9-907bda7.json create mode 100644 tests/reference/asr-test_dict9-907bda7.stderr create mode 100644 tests/reference/asr-test_end_sep_keywords-2226a67.json create mode 100644 tests/reference/asr-test_end_sep_keywords-2226a67.stdout create mode 100644 tests/reference/asr-test_for2-e5d893f.json create mode 100644 tests/reference/asr-test_for2-e5d893f.stderr create mode 100644 tests/reference/asr-test_func_args-a898a72.json create mode 100644 tests/reference/asr-test_func_args-a898a72.stderr create mode 100644 tests/reference/asr-test_import_01-b859c43.json create mode 100644 tests/reference/asr-test_import_01-b859c43.stderr create mode 100644 tests/reference/asr-test_import_02-55b47fa.json create mode 100644 tests/reference/asr-test_import_02-55b47fa.stderr create mode 100644 tests/reference/asr-test_len1-839a615.json create mode 100644 tests/reference/asr-test_len1-839a615.stderr create mode 100644 tests/reference/asr-test_list1-73fd538.json create mode 100644 tests/reference/asr-test_list1-73fd538.stderr create mode 100644 tests/reference/asr-test_list2-10ffdd7.json create mode 100644 tests/reference/asr-test_list2-10ffdd7.stderr create mode 100644 tests/reference/asr-test_list3-5f4d2a8.json create mode 100644 tests/reference/asr-test_list3-5f4d2a8.stderr create mode 100644 tests/reference/asr-test_list4-d18a7e3.json create mode 100644 tests/reference/asr-test_list4-d18a7e3.stderr create mode 100644 tests/reference/asr-test_list_concat-41d186f.json create mode 100644 tests/reference/asr-test_list_concat-41d186f.stderr create mode 100644 tests/reference/asr-test_list_count-4b42498.json create mode 100644 tests/reference/asr-test_list_count-4b42498.stderr create mode 100644 tests/reference/asr-test_list_slicing-984fbf0.json create mode 100644 tests/reference/asr-test_list_slicing-984fbf0.stderr create mode 100644 tests/reference/asr-test_max_min-3c2fc51.json create mode 100644 tests/reference/asr-test_max_min-3c2fc51.stderr create mode 100644 tests/reference/asr-test_numpy_03-e600a49.json create mode 100644 tests/reference/asr-test_numpy_03-e600a49.stderr create mode 100644 tests/reference/asr-test_numpy_04-ecbb614.json create mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stderr create mode 100644 tests/reference/asr-test_operator_01-0f232bf.json create mode 100644 tests/reference/asr-test_operator_01-0f232bf.stderr create mode 100644 tests/reference/asr-test_ord-316ce61.json create mode 100644 tests/reference/asr-test_ord-316ce61.stderr create mode 100644 tests/reference/asr-test_pointer_types-1bf0d01.json create mode 100644 tests/reference/asr-test_pointer_types-1bf0d01.stderr create mode 100644 tests/reference/asr-test_pow-3f5d550.json create mode 100644 tests/reference/asr-test_pow-3f5d550.stderr create mode 100644 tests/reference/asr-test_pow1-581ef42.json create mode 100644 tests/reference/asr-test_pow1-581ef42.stderr create mode 100644 tests/reference/asr-test_pow2-0dcbd7d.json create mode 100644 tests/reference/asr-test_pow2-0dcbd7d.stderr create mode 100644 tests/reference/asr-test_pow3-79749ed.json create mode 100644 tests/reference/asr-test_pow3-79749ed.stderr create mode 100644 tests/reference/asr-test_pow4-ef60978.json create mode 100644 tests/reference/asr-test_pow4-ef60978.stderr create mode 100644 tests/reference/asr-test_print1-f1f36f1.json create mode 100644 tests/reference/asr-test_print1-f1f36f1.stderr create mode 100644 tests/reference/asr-test_print2-64acb15.json create mode 100644 tests/reference/asr-test_print2-64acb15.stderr create mode 100644 tests/reference/asr-test_return1-2603c9e.json create mode 100644 tests/reference/asr-test_return1-2603c9e.stderr create mode 100644 tests/reference/asr-test_return2-add829b.json create mode 100644 tests/reference/asr-test_return2-add829b.stderr create mode 100644 tests/reference/asr-test_set1-11379c7.json create mode 100644 tests/reference/asr-test_set1-11379c7.stderr create mode 100644 tests/reference/asr-test_set2-d91a6f0.json create mode 100644 tests/reference/asr-test_set2-d91a6f0.stderr create mode 100644 tests/reference/asr-test_set3-f9bbffb.json create mode 100644 tests/reference/asr-test_set3-f9bbffb.stderr create mode 100644 tests/reference/asr-test_set4-53fea39.json create mode 100644 tests/reference/asr-test_set4-53fea39.stderr create mode 100644 tests/reference/asr-test_set_indexing-a1c21b8.json create mode 100644 tests/reference/asr-test_set_indexing-a1c21b8.stderr create mode 100644 tests/reference/asr-test_str_capitalize-9f8dfa9.json create mode 100644 tests/reference/asr-test_str_capitalize-9f8dfa9.stderr create mode 100644 tests/reference/asr-test_str_indexing-b200a4e.json create mode 100644 tests/reference/asr-test_str_indexing-b200a4e.stderr create mode 100644 tests/reference/asr-test_str_slicing-eca1381.json create mode 100644 tests/reference/asr-test_str_slicing-eca1381.stderr create mode 100644 tests/reference/asr-test_str_slicing2-2f07e9a.json create mode 100644 tests/reference/asr-test_str_slicing2-2f07e9a.stderr create mode 100644 tests/reference/asr-test_str_slicing3-fe6a03c.json create mode 100644 tests/reference/asr-test_str_slicing3-fe6a03c.stderr create mode 100644 tests/reference/asr-test_str_slicing4-a0c7a69.json create mode 100644 tests/reference/asr-test_str_slicing4-a0c7a69.stderr create mode 100644 tests/reference/asr-test_str_to_int-61553e7.json create mode 100644 tests/reference/asr-test_str_to_int-61553e7.stderr create mode 100644 tests/reference/asr-test_tuple1-7abe88f.json create mode 100644 tests/reference/asr-test_tuple1-7abe88f.stderr create mode 100644 tests/reference/asr-test_tuple2-b046610.json create mode 100644 tests/reference/asr-test_tuple2-b046610.stderr create mode 100644 tests/reference/asr-test_tuple3-19fa47f.json create mode 100644 tests/reference/asr-test_tuple3-19fa47f.stderr create mode 100644 tests/reference/asr-test_type_mismatch_01-09e8af3.json create mode 100644 tests/reference/asr-test_type_mismatch_01-09e8af3.stderr create mode 100644 tests/reference/asr-test_unary_op_03-e799eae.json create mode 100644 tests/reference/asr-test_unary_op_03-e799eae.stdout create mode 100644 tests/reference/asr-test_unsupported_type-0d813dd.json create mode 100644 tests/reference/asr-test_unsupported_type-0d813dd.stderr create mode 100644 tests/reference/asr-test_zero_division-3dd84e8.json create mode 100644 tests/reference/asr-test_zero_division-3dd84e8.stderr create mode 100644 tests/reference/asr-test_zero_division2-d84989f.json create mode 100644 tests/reference/asr-test_zero_division2-d84989f.stderr create mode 100644 tests/reference/asr-test_zero_division3-29efb9e.json create mode 100644 tests/reference/asr-test_zero_division3-29efb9e.stderr create mode 100644 tests/reference/asr-test_zero_division4-bf4af64.json create mode 100644 tests/reference/asr-test_zero_division4-bf4af64.stderr create mode 100644 tests/reference/asr-tuple1-09972ab.json create mode 100644 tests/reference/asr-tuple1-09972ab.stdout create mode 100644 tests/reference/asr-type_mismatch-61052c7.json create mode 100644 tests/reference/asr-type_mismatch-61052c7.stderr create mode 100644 tests/reference/asr-unsigned_01-892b178.json create mode 100644 tests/reference/asr-unsigned_01-892b178.stderr create mode 100644 tests/reference/asr-unsigned_02-6563e58.json create mode 100644 tests/reference/asr-unsigned_02-6563e58.stderr create mode 100644 tests/reference/asr-unsigned_03-f785652.json create mode 100644 tests/reference/asr-unsigned_03-f785652.stderr create mode 100644 tests/reference/asr-unsigned_04-c856d3a.json create mode 100644 tests/reference/asr-unsigned_04-c856d3a.stderr create mode 100644 tests/reference/asr-vec_01-66ac423.json create mode 100644 tests/reference/asr-vec_01-66ac423.stderr create mode 100644 tests/reference/asr_json-modules_02-53952e6.json create mode 100644 tests/reference/asr_json-modules_02-53952e6.stdout create mode 100644 tests/reference/ast-assert1-b0154ee.json create mode 100644 tests/reference/ast-assert1-b0154ee.stdout create mode 100644 tests/reference/ast-assign1-2a4c9ed.json create mode 100644 tests/reference/ast-assign1-2a4c9ed.stdout create mode 100644 tests/reference/ast-complex1-800b4bb.json create mode 100644 tests/reference/ast-complex1-800b4bb.stdout create mode 100644 tests/reference/ast-constants1-91cb6ff.json create mode 100644 tests/reference/ast-constants1-91cb6ff.stdout create mode 100644 tests/reference/ast-dictionary1-1a7e00a.json create mode 100644 tests/reference/ast-dictionary1-1a7e00a.stdout create mode 100644 tests/reference/ast-doconcurrentloop_01-ed7017b.json create mode 100644 tests/reference/ast-doconcurrentloop_01-ed7017b.stdout create mode 100644 tests/reference/ast-ellipsis1-4f6c4dd.json create mode 100644 tests/reference/ast-ellipsis1-4f6c4dd.stdout create mode 100644 tests/reference/ast-expr1-1e8f7b1.json create mode 100644 tests/reference/ast-expr1-1e8f7b1.stdout create mode 100644 tests/reference/ast-expr10-a8d646d.json create mode 100644 tests/reference/ast-expr10-a8d646d.stdout create mode 100644 tests/reference/ast-expr11-1d29f78.json create mode 100644 tests/reference/ast-expr11-1d29f78.stdout create mode 100644 tests/reference/ast-expr12-adaecda.json create mode 100644 tests/reference/ast-expr12-adaecda.stdout create mode 100644 tests/reference/ast-expr13-c35ace1.json create mode 100644 tests/reference/ast-expr13-c35ace1.stdout create mode 100644 tests/reference/ast-expr2-6642d4a.json create mode 100644 tests/reference/ast-expr2-6642d4a.stdout create mode 100644 tests/reference/ast-expr4-49316cb.json create mode 100644 tests/reference/ast-expr4-49316cb.stdout create mode 100644 tests/reference/ast-expr5-bbc6e71.json create mode 100644 tests/reference/ast-expr5-bbc6e71.stdout create mode 100644 tests/reference/ast-expr6-0b12a67.json create mode 100644 tests/reference/ast-expr6-0b12a67.stdout create mode 100644 tests/reference/ast-expr7-fe52776.json create mode 100644 tests/reference/ast-expr7-fe52776.stdout create mode 100644 tests/reference/ast-expr8-7db6b28.json create mode 100644 tests/reference/ast-expr8-7db6b28.stdout create mode 100644 tests/reference/ast-expr9-d184496.json create mode 100644 tests/reference/ast-expr9-d184496.stdout create mode 100644 tests/reference/ast-expr_01-d0927f9.json create mode 100644 tests/reference/ast-expr_01-d0927f9.stdout create mode 100644 tests/reference/ast-global1-b2690cf.json create mode 100644 tests/reference/ast-global1-b2690cf.stdout create mode 100644 tests/reference/ast-global_scope1-1d68a6c.json create mode 100644 tests/reference/ast-global_scope1-1d68a6c.stdout create mode 100644 tests/reference/ast-list1-9ce2da0.json create mode 100644 tests/reference/ast-list1-9ce2da0.stdout create mode 100644 tests/reference/ast-loop1-194a137.json create mode 100644 tests/reference/ast-loop1-194a137.stdout create mode 100644 tests/reference/ast-loop3-f7e0393.json create mode 100644 tests/reference/ast-loop3-f7e0393.stdout create mode 100644 tests/reference/ast-set1-ebd6ee0.json create mode 100644 tests/reference/ast-set1-ebd6ee0.stdout create mode 100644 tests/reference/ast-subscript1-bd5584b.json create mode 100644 tests/reference/ast-subscript1-bd5584b.stdout create mode 100644 tests/reference/ast-tuple1-2fb5396.json create mode 100644 tests/reference/ast-tuple1-2fb5396.stdout create mode 100644 tests/reference/ast_new-async1-b3d07ed.json create mode 100644 tests/reference/ast_new-async1-b3d07ed.stdout create mode 100644 tests/reference/ast_new-boolOp1-478328f.json create mode 100644 tests/reference/ast_new-boolOp1-478328f.stdout create mode 100644 tests/reference/ast_new-class_def1-fe69291.json create mode 100644 tests/reference/ast_new-class_def1-fe69291.stdout create mode 100644 tests/reference/ast_new-class_def2-c6db986.json create mode 100644 tests/reference/ast_new-class_def2-c6db986.stdout create mode 100644 tests/reference/ast_new-comment2-f0984d5.json create mode 100644 tests/reference/ast_new-comment2-f0984d5.stdout create mode 100644 tests/reference/ast_new-comprehension1-69cf2af.json create mode 100644 tests/reference/ast_new-comprehension1-69cf2af.stdout create mode 100644 tests/reference/ast_new-conditional_expr1-07ccb9e.json create mode 100644 tests/reference/ast_new-conditional_expr1-07ccb9e.stdout create mode 100644 tests/reference/ast_new-dictionary1-445e718.json create mode 100644 tests/reference/ast_new-dictionary1-445e718.stdout create mode 100644 tests/reference/ast_new-ellipsis2-3a9750b.json create mode 100644 tests/reference/ast_new-ellipsis2-3a9750b.stdout create mode 100644 tests/reference/ast_new-for1-887432e.json create mode 100644 tests/reference/ast_new-for1-887432e.stdout create mode 100644 tests/reference/ast_new-for2-af08901.json create mode 100644 tests/reference/ast_new-for2-af08901.stdout create mode 100644 tests/reference/ast_new-function_def1-1a872df.json create mode 100644 tests/reference/ast_new-function_def1-1a872df.stdout create mode 100644 tests/reference/ast_new-function_def2-52c4587.json create mode 100644 tests/reference/ast_new-function_def2-52c4587.stdout create mode 100644 tests/reference/ast_new-function_def3-f66064a.json create mode 100644 tests/reference/ast_new-function_def3-f66064a.stdout create mode 100644 tests/reference/ast_new-global1-38edfbd.json create mode 100644 tests/reference/ast_new-global1-38edfbd.stdout create mode 100644 tests/reference/ast_new-if1-db43586.json create mode 100644 tests/reference/ast_new-if1-db43586.stdout create mode 100644 tests/reference/ast_new-if2-c3b6022.json create mode 100644 tests/reference/ast_new-if2-c3b6022.stdout create mode 100644 tests/reference/ast_new-import1-f643fd3.json create mode 100644 tests/reference/ast_new-import1-f643fd3.stdout create mode 100644 tests/reference/ast_new-lambda1-260d046.json create mode 100644 tests/reference/ast_new-lambda1-260d046.stdout create mode 100644 tests/reference/ast_new-lambda2-d84336e.json create mode 100644 tests/reference/ast_new-lambda2-d84336e.stdout create mode 100644 tests/reference/ast_new-match_stmt1-9e84d24.json create mode 100644 tests/reference/ast_new-match_stmt1-9e84d24.stdout create mode 100644 tests/reference/ast_new-slice1-9c440e3.json create mode 100644 tests/reference/ast_new-slice1-9c440e3.stdout create mode 100644 tests/reference/ast_new-statements1-e081093.json create mode 100644 tests/reference/ast_new-statements1-e081093.stdout create mode 100644 tests/reference/ast_new-statements2-c4cdc5f.json create mode 100644 tests/reference/ast_new-statements2-c4cdc5f.stdout create mode 100644 tests/reference/ast_new-string1-96b90b3.json create mode 100644 tests/reference/ast_new-string1-96b90b3.stdout create mode 100644 tests/reference/ast_new-string2-44323ea.json create mode 100644 tests/reference/ast_new-string2-44323ea.stdout create mode 100644 tests/reference/ast_new-string3-37f35a0.json create mode 100644 tests/reference/ast_new-string3-37f35a0.stdout create mode 100644 tests/reference/ast_new-try1-a9a22cf.json create mode 100644 tests/reference/ast_new-try1-a9a22cf.stdout create mode 100644 tests/reference/ast_new-tuple1-29c08af.json create mode 100644 tests/reference/ast_new-tuple1-29c08af.stdout create mode 100644 tests/reference/ast_new-type_comment1-710ea6c.json create mode 100644 tests/reference/ast_new-type_comment1-710ea6c.stdout create mode 100644 tests/reference/ast_new-unicode-d3199dc.json create mode 100644 tests/reference/ast_new-unicode-d3199dc.stdout create mode 100644 tests/reference/ast_new-while1-a4c6382.json create mode 100644 tests/reference/ast_new-while1-a4c6382.stdout create mode 100644 tests/reference/ast_new-with1-6c88c0f.json create mode 100644 tests/reference/ast_new-with1-6c88c0f.stdout create mode 100644 tests/reference/ast_new-yield-4c41668.json create mode 100644 tests/reference/ast_new-yield-4c41668.stdout create mode 100644 tests/reference/c-c_interop1-e215531.json create mode 100644 tests/reference/c-c_interop1-e215531.stdout create mode 100644 tests/reference/c-expr7-bb2692a.json create mode 100644 tests/reference/c-expr7-bb2692a.stderr create mode 100644 tests/reference/c-expr_01-28f449f.json create mode 100644 tests/reference/c-expr_01-28f449f.stdout create mode 100644 tests/reference/c-expr_11-c452314.json create mode 100644 tests/reference/c-expr_11-c452314.stdout create mode 100644 tests/reference/c-expr_12-93c7780.json create mode 100644 tests/reference/c-expr_12-93c7780.stdout create mode 100644 tests/reference/c-func_static_01-fc146ec.json create mode 100644 tests/reference/c-func_static_01-fc146ec.stdout create mode 100644 tests/reference/c-import_order_01-3ebf3c3.json create mode 100644 tests/reference/c-import_order_01-3ebf3c3.stdout create mode 100644 tests/reference/c-loop1-3e341c7.json create mode 100644 tests/reference/c-loop1-3e341c7.stdout create mode 100644 tests/reference/c-loop4-eec10d3.json create mode 100644 tests/reference/c-loop4-eec10d3.stdout create mode 100644 tests/reference/c-print_01-4d44628.json create mode 100644 tests/reference/c-print_01-4d44628.stdout create mode 100644 tests/reference/c-test_import_02-d2c54c4.json create mode 100644 tests/reference/c-test_import_02-d2c54c4.stdout create mode 100644 tests/reference/c-test_issue_518-fbbd299.json create mode 100644 tests/reference/c-test_issue_518-fbbd299.stdout create mode 100644 tests/reference/c-variable_decl_03-fa1823b.json create mode 100644 tests/reference/c-variable_decl_03-fa1823b.stdout create mode 100644 tests/reference/cpp-assert1-ba60925.json create mode 100644 tests/reference/cpp-assert1-ba60925.stdout create mode 100644 tests/reference/cpp-doconcurrentloop_01-4e9f274.json create mode 100644 tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout create mode 100644 tests/reference/cpp-expr12-fd2ea87.json create mode 100644 tests/reference/cpp-expr12-fd2ea87.stdout create mode 100644 tests/reference/cpp-expr15-1661c0d.json create mode 100644 tests/reference/cpp-expr15-1661c0d.stderr create mode 100644 tests/reference/cpp-expr2-09c05ad.json create mode 100644 tests/reference/cpp-expr2-09c05ad.stdout create mode 100644 tests/reference/cpp-expr5-1de0e30.json create mode 100644 tests/reference/cpp-expr5-1de0e30.stdout create mode 100644 tests/reference/cpp-expr6-f337f4f.json create mode 100644 tests/reference/cpp-expr6-f337f4f.stdout create mode 100644 tests/reference/cpp-expr7-529bd53.json create mode 100644 tests/reference/cpp-expr7-529bd53.stderr create mode 100644 tests/reference/cpp-expr8-704cece.json create mode 100644 tests/reference/cpp-expr8-704cece.stderr create mode 100644 tests/reference/cpp-expr9-48868e9.json create mode 100644 tests/reference/cpp-expr9-48868e9.stdout create mode 100644 tests/reference/cpp-expr_11-422c839.json create mode 100644 tests/reference/cpp-expr_11-422c839.stdout create mode 100644 tests/reference/cpp-loop1-0a8cf3b.json create mode 100644 tests/reference/cpp-loop1-0a8cf3b.stdout create mode 100644 tests/reference/cpp-loop3-6020091.json create mode 100644 tests/reference/cpp-loop3-6020091.stdout create mode 100644 tests/reference/cpp-loop4-cdb2174.json create mode 100644 tests/reference/cpp-loop4-cdb2174.stdout create mode 100644 tests/reference/cpp-print_01-026ef17.json create mode 100644 tests/reference/cpp-print_01-026ef17.stdout create mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.json create mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.stderr create mode 100644 tests/reference/cpp-test_list_repeat2-698d7f4.json create mode 100644 tests/reference/cpp-test_list_repeat2-698d7f4.stdout create mode 100644 tests/reference/cpp-test_unary_op_03-fd9669a.json create mode 100644 tests/reference/cpp-test_unary_op_03-fd9669a.stdout create mode 100644 tests/reference/llvm-assert1-8df4f31.json create mode 100644 tests/reference/llvm-assert1-8df4f31.stdout create mode 100644 tests/reference/llvm-bindc_01-c984f09.json create mode 100644 tests/reference/llvm-bindc_01-c984f09.stdout create mode 100644 tests/reference/llvm-bool1-af4376b.json create mode 100644 tests/reference/llvm-bool1-af4376b.stdout create mode 100644 tests/reference/llvm-expr14-b96b5b1.json create mode 100644 tests/reference/llvm-expr14-b96b5b1.stdout create mode 100644 tests/reference/llvm-expr_01-54467c1.json create mode 100644 tests/reference/llvm-expr_01-54467c1.stdout create mode 100644 tests/reference/llvm-func_inline_01-2d4583a.json create mode 100644 tests/reference/llvm-func_inline_01-2d4583a.stdout create mode 100644 tests/reference/llvm-lpython1-23c5987.json create mode 100644 tests/reference/llvm-lpython1-23c5987.stdout create mode 100644 tests/reference/llvm-print_04-443a8d8.json create mode 100644 tests/reference/llvm-print_04-443a8d8.stdout create mode 100644 tests/reference/llvm-structs_11-09fea6a.json create mode 100644 tests/reference/llvm-structs_11-09fea6a.stdout create mode 100644 tests/reference/llvm-test_issue_518-cdb641a.json create mode 100644 tests/reference/llvm-test_issue_518-cdb641a.stdout create mode 100644 tests/reference/llvm-test_unary_op_03-046fb86.json create mode 100644 tests/reference/llvm-test_unary_op_03-046fb86.stdout create mode 100644 tests/reference/llvm_dbg-expr_01-9fc5f30.json create mode 100644 tests/reference/llvm_dbg-expr_01-9fc5f30.stdout create mode 100644 tests/reference/pass_class_constructor-structs_16-5e3508f.json create mode 100644 tests/reference/pass_class_constructor-structs_16-5e3508f.stdout create mode 100644 tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json create mode 100644 tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout create mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.json create mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr create mode 100644 tests/reference/pass_print_list_tuple-print_02-09600eb.json create mode 100644 tests/reference/pass_print_list_tuple-print_02-09600eb.stdout create mode 100644 tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json create mode 100644 tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout create mode 100644 tests/reference/run_dbg-test_assert_01-2f34744.json create mode 100644 tests/reference/run_dbg-test_assert_01-2f34744.stderr create mode 100644 tests/reference/run_dbg-test_assert_02-c6de25a.json create mode 100644 tests/reference/run_dbg-test_assert_02-c6de25a.stderr create mode 100644 tests/reference/run_dbg-test_assert_03-bd7b7dd.json create mode 100644 tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr create mode 100644 tests/reference/run_dbg-test_quit_01-30889cc.json create mode 100644 tests/reference/run_dbg-test_quit_01-30889cc.stderr create mode 100644 tests/reference/run_dbg-test_raise_01-dfd86ca.json create mode 100644 tests/reference/run_dbg-test_raise_01-dfd86ca.stderr create mode 100644 tests/reference/runtime-test_dict14-421fe53.json create mode 100644 tests/reference/runtime-test_dict14-421fe53.stderr create mode 100644 tests/reference/runtime-test_dict15-6f3af0d.json create mode 100644 tests/reference/runtime-test_dict15-6f3af0d.stderr create mode 100644 tests/reference/runtime-test_dict16-c5a958d.json create mode 100644 tests/reference/runtime-test_dict16-c5a958d.stderr create mode 100644 tests/reference/runtime-test_list_01-3ee9b3e.json create mode 100644 tests/reference/runtime-test_list_01-3ee9b3e.stderr create mode 100644 tests/reference/runtime-test_list_02-5f7db5f.json create mode 100644 tests/reference/runtime-test_list_02-5f7db5f.stderr create mode 100644 tests/reference/runtime-test_list_index-0483808.json create mode 100644 tests/reference/runtime-test_list_index-0483808.stderr create mode 100644 tests/reference/runtime-test_list_index2-1249233.json create mode 100644 tests/reference/runtime-test_list_index2-1249233.stderr create mode 100644 tests/reference/runtime-test_list_index3-647a94a.json create mode 100644 tests/reference/runtime-test_list_index3-647a94a.stderr create mode 100644 tests/reference/runtime-test_list_index4-c31dfdb.json create mode 100644 tests/reference/runtime-test_list_index4-c31dfdb.stderr create mode 100644 tests/reference/runtime-test_str_01-50bdf2f.json create mode 100644 tests/reference/runtime-test_str_01-50bdf2f.stdout create mode 100644 tests/reference/runtime-test_str_02-c38ba27.json create mode 100644 tests/reference/runtime-test_str_02-c38ba27.stdout create mode 100644 tests/reference/tokens-comment1-2f8ab90.json create mode 100644 tests/reference/tokens-comment1-2f8ab90.stdout create mode 100644 tests/reference/tokens-comment2-b289dad.json create mode 100644 tests/reference/tokens-comment2-b289dad.stdout create mode 100644 tests/reference/tokens-docstring1-1355fbb.json create mode 100644 tests/reference/tokens-docstring1-1355fbb.stdout create mode 100644 tests/reference/tokens-indent1-0b243c5.json create mode 100644 tests/reference/tokens-indent1-0b243c5.stderr create mode 100644 tests/reference/tokens-indent1-290e858.json create mode 100644 tests/reference/tokens-indent1-290e858.stdout create mode 100644 tests/reference/tokens-indent2-a8438a0.json create mode 100644 tests/reference/tokens-indent2-a8438a0.stderr create mode 100644 tests/reference/tokens-indent2-e702789.json create mode 100644 tests/reference/tokens-indent2-e702789.stdout create mode 100644 tests/reference/tokens-indent3-0eaf3e6.json create mode 100644 tests/reference/tokens-indent3-0eaf3e6.stderr create mode 100644 tests/reference/tokens-numbers1-589063f.json create mode 100644 tests/reference/tokens-numbers1-589063f.stdout create mode 100644 tests/reference/tokens-paren1-94fa736.json create mode 100644 tests/reference/tokens-paren1-94fa736.stderr create mode 100644 tests/reference/tokens-paren2-0eef339.json create mode 100644 tests/reference/tokens-paren2-0eef339.stderr create mode 100644 tests/reference/tokens-paren3-0d47100.json create mode 100644 tests/reference/tokens-paren3-0d47100.stderr create mode 100644 tests/reference/tokens-paren4-5c2fc32.json create mode 100644 tests/reference/tokens-paren4-5c2fc32.stderr create mode 100644 tests/reference/tokens-symbols1-658c990.json create mode 100644 tests/reference/tokens-symbols1-658c990.stdout create mode 100644 tests/reference/wat-bool1-234bcd1.json create mode 100644 tests/reference/wat-bool1-234bcd1.stdout create mode 100644 tests/reference/wat-expr14-5e0cb96.json create mode 100644 tests/reference/wat-expr14-5e0cb96.stdout create mode 100644 tests/reference/wat-expr2-8b17723.json create mode 100644 tests/reference/wat-expr2-8b17723.stdout create mode 100644 tests/reference/wat-expr9-f73afd1.json create mode 100644 tests/reference/wat-expr9-f73afd1.stdout create mode 100644 tests/reference/wat-loop1-e0046d4.json create mode 100644 tests/reference/wat-loop1-e0046d4.stdout create mode 100644 tests/reference/wat-print_str-385e953.json create mode 100644 tests/reference/wat-print_str-385e953.stdout diff --git a/tests/reference/asr-array_01_decl-39cf894.json b/tests/reference/asr-array_01_decl-39cf894.json new file mode 100644 index 0000000000..b23bdaa272 --- /dev/null +++ b/tests/reference/asr-array_01_decl-39cf894.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-array_01_decl-39cf894", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/array_01_decl.py", + "infile_hash": "3dff59bab7475d254ce0470065c11e797e52a5b2a3d7546acc0e6705", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-array_01_decl-39cf894.stderr", + "stderr_hash": "5155e10cd4958bdda66178e2ed1b6faed6f415ff1cf3ff78e45f9cbb", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-array_01_decl-39cf894.stderr b/tests/reference/asr-array_01_decl-39cf894.stderr new file mode 100644 index 0000000000..2ef3142ddf --- /dev/null +++ b/tests/reference/asr-array_01_decl-39cf894.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/array_01_decl.py:2:1 + | +2 | from numpy import empty, int16, int32, int64, float32, float64, complex64, complex128 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-array_02_decl-e8f6874.json b/tests/reference/asr-array_02_decl-e8f6874.json new file mode 100644 index 0000000000..f59af233fa --- /dev/null +++ b/tests/reference/asr-array_02_decl-e8f6874.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-array_02_decl-e8f6874", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/array_02_decl.py", + "infile_hash": "9a398864499c7a3b4e2a480faf3a5dccaa65f9771a8de27f55f11ca4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-array_02_decl-e8f6874.stderr", + "stderr_hash": "b9fd331511456947bef74d5df2f292244e7fa1861ab43918a6e02acd", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-array_02_decl-e8f6874.stderr b/tests/reference/asr-array_02_decl-e8f6874.stderr new file mode 100644 index 0000000000..143230f959 --- /dev/null +++ b/tests/reference/asr-array_02_decl-e8f6874.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/array_02_decl.py:2:1 + | +2 | from numpy import empty, int32, int64, float32, float64, complex64, complex128 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_01-a617b64.json b/tests/reference/asr-arrays_01-a617b64.json new file mode 100644 index 0000000000..ca8f874250 --- /dev/null +++ b/tests/reference/asr-arrays_01-a617b64.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_01-a617b64", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_01.py", + "infile_hash": "9e11033fc97f884cd3d55a9194cb45add6805e5fc4d9473f9e1b9611", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_01-a617b64.stderr", + "stderr_hash": "ddb2640e06012a8ab9efe1bc1dbe130321fb96721ce3fd749813c988", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_01-a617b64.stderr b/tests/reference/asr-arrays_01-a617b64.stderr new file mode 100644 index 0000000000..e712ee9cf1 --- /dev/null +++ b/tests/reference/asr-arrays_01-a617b64.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_01.py:2:1 + | +2 | from numpy import empty, int8 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_02-da94458.json b/tests/reference/asr-arrays_02-da94458.json new file mode 100644 index 0000000000..2dfc6c7f7c --- /dev/null +++ b/tests/reference/asr-arrays_02-da94458.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_02-da94458", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_02.py", + "infile_hash": "05e70a0056dc67dbf3a54ea66965db8746f9de012561ca95cb1fdb43", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_02-da94458.stderr", + "stderr_hash": "b7b907310495016dfb487fccb13739865174dda44541ade08931bae9", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_02-da94458.stderr b/tests/reference/asr-arrays_02-da94458.stderr new file mode 100644 index 0000000000..5229403208 --- /dev/null +++ b/tests/reference/asr-arrays_02-da94458.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_02.py:2:1 + | +2 | from numpy import (empty, int8) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_03-de2e952.json b/tests/reference/asr-arrays_03-de2e952.json new file mode 100644 index 0000000000..77b002c31e --- /dev/null +++ b/tests/reference/asr-arrays_03-de2e952.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_03-de2e952", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_03.py", + "infile_hash": "429c486d84e37401f89fe1e678039ae0e16b2cf5bf13417767160858", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_03-de2e952.stderr", + "stderr_hash": "ddfa8ceea3cb39c9b59069d2a67d13c8752ec2511fc62c162e77b206", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_03-de2e952.stderr b/tests/reference/asr-arrays_03-de2e952.stderr new file mode 100644 index 0000000000..00df208054 --- /dev/null +++ b/tests/reference/asr-arrays_03-de2e952.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_03.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_04-880407c.json b/tests/reference/asr-arrays_04-880407c.json new file mode 100644 index 0000000000..69bda74cc5 --- /dev/null +++ b/tests/reference/asr-arrays_04-880407c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_04-880407c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_04.py", + "infile_hash": "9dfe40ad5fd610b75685a45ffd700ff14e263738dd5ba968952d7874", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_04-880407c.stderr", + "stderr_hash": "ee2a3d13e91567e2924e0154d6c09db79923debe4c2733b246964808", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_04-880407c.stderr b/tests/reference/asr-arrays_04-880407c.stderr new file mode 100644 index 0000000000..692cb026bf --- /dev/null +++ b/tests/reference/asr-arrays_04-880407c.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_04.py:2:1 + | +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_05-ec8fbd5.json b/tests/reference/asr-arrays_05-ec8fbd5.json new file mode 100644 index 0000000000..8ff8c5a20d --- /dev/null +++ b/tests/reference/asr-arrays_05-ec8fbd5.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_05-ec8fbd5", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_05.py", + "infile_hash": "c525449694f73038495a6bd8fded408301f43d18b1c387765b92b792", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_05-ec8fbd5.stderr", + "stderr_hash": "066b86f582348bb519b6a39a7e7421ac5a666b29d9ef96d753be0207", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_05-ec8fbd5.stderr b/tests/reference/asr-arrays_05-ec8fbd5.stderr new file mode 100644 index 0000000000..ee5cc62302 --- /dev/null +++ b/tests/reference/asr-arrays_05-ec8fbd5.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_05.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_06-fbb09a3.json b/tests/reference/asr-arrays_06-fbb09a3.json new file mode 100644 index 0000000000..8c473166fc --- /dev/null +++ b/tests/reference/asr-arrays_06-fbb09a3.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_06-fbb09a3", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_06.py", + "infile_hash": "670cbcac5e942bae5293cd94090bab65a2039384d71fb8be4c6db5a1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_06-fbb09a3.stderr", + "stderr_hash": "529c8dc2333a83b0b67feb5db104ea294258fdcac341dad9e314cfee", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_06-fbb09a3.stderr b/tests/reference/asr-arrays_06-fbb09a3.stderr new file mode 100644 index 0000000000..8d8b27a690 --- /dev/null +++ b/tests/reference/asr-arrays_06-fbb09a3.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_06.py:2:1 + | +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_07-de430fd.json b/tests/reference/asr-arrays_07-de430fd.json new file mode 100644 index 0000000000..a3c5bfc680 --- /dev/null +++ b/tests/reference/asr-arrays_07-de430fd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_07-de430fd", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_07.py", + "infile_hash": "efe8b3c4a474aca55cb8a537a3ea2cd30eb5d5abf140d8c2c0b9e3f4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_07-de430fd.stderr", + "stderr_hash": "78a96ca7fbcae19b8cdaa9f9a2d18de003d7569070edb855bd07bff6", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_07-de430fd.stderr b/tests/reference/asr-arrays_07-de430fd.stderr new file mode 100644 index 0000000000..f5f3ff9143 --- /dev/null +++ b/tests/reference/asr-arrays_07-de430fd.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_07.py:2:1 + | +2 | from numpy import empty, complex64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_08-ba317a3.json b/tests/reference/asr-arrays_08-ba317a3.json new file mode 100644 index 0000000000..068d21e7d1 --- /dev/null +++ b/tests/reference/asr-arrays_08-ba317a3.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_08-ba317a3", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_08.py", + "infile_hash": "3f7a5a8889301df17222a777f7e92a5667097ffca9ac4d275ccb310f", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_08-ba317a3.stderr", + "stderr_hash": "2c0dffd29d0f996f1403e49241e6fe1cfbf7df0ce479e4434c3a7c6a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_08-ba317a3.stderr b/tests/reference/asr-arrays_08-ba317a3.stderr new file mode 100644 index 0000000000..d5aad26c5b --- /dev/null +++ b/tests/reference/asr-arrays_08-ba317a3.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_08.py:2:1 + | +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_09-50ee586.json b/tests/reference/asr-arrays_09-50ee586.json new file mode 100644 index 0000000000..1180b9b694 --- /dev/null +++ b/tests/reference/asr-arrays_09-50ee586.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_09-50ee586", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_09.py", + "infile_hash": "e6f2cca7de4ecfddffdc96ee4c278de35c220b608c9e4fe4731fd9b8", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_09-50ee586.stderr", + "stderr_hash": "31ae490ebcebebc570a4846a32f1723dd3e9861f47c6805e9cc5e9b4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_09-50ee586.stderr b/tests/reference/asr-arrays_09-50ee586.stderr new file mode 100644 index 0000000000..efb877322b --- /dev/null +++ b/tests/reference/asr-arrays_09-50ee586.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_09.py:2:1 + | +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_10-bc82d75.json b/tests/reference/asr-arrays_10-bc82d75.json new file mode 100644 index 0000000000..8125d1c0f8 --- /dev/null +++ b/tests/reference/asr-arrays_10-bc82d75.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_10-bc82d75", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_10.py", + "infile_hash": "05aedf3d1013c61f73afc3de4ddca88ee33f029dcd62fadb66e7ec83", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_10-bc82d75.stderr", + "stderr_hash": "12434839db5b4ef953cdf8002472348be5b31f95ed106f68c6646523", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_10-bc82d75.stderr b/tests/reference/asr-arrays_10-bc82d75.stderr new file mode 100644 index 0000000000..af28c4fcb3 --- /dev/null +++ b/tests/reference/asr-arrays_10-bc82d75.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_10.py:2:1 + | +2 | from numpy import empty, int64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_11-fc505b4.json b/tests/reference/asr-arrays_11-fc505b4.json new file mode 100644 index 0000000000..31cf31d842 --- /dev/null +++ b/tests/reference/asr-arrays_11-fc505b4.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_11-fc505b4", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_11.py", + "infile_hash": "111b4224a1988a90dc091fda4e0b1ebfd096f25f7b4ccc2f13728c1c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_11-fc505b4.stderr", + "stderr_hash": "f5a3fde8bbd2fd083b1f1d2148c92c3ae71ef4aaaed74e725061cb94", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_11-fc505b4.stderr b/tests/reference/asr-arrays_11-fc505b4.stderr new file mode 100644 index 0000000000..1fd700c7b4 --- /dev/null +++ b/tests/reference/asr-arrays_11-fc505b4.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_11.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_12-63d6f25.json b/tests/reference/asr-arrays_12-63d6f25.json new file mode 100644 index 0000000000..4f456715f5 --- /dev/null +++ b/tests/reference/asr-arrays_12-63d6f25.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_12-63d6f25", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_12.py", + "infile_hash": "03cc809a4ee6a2ff47b5a91111d26e501ded647478e7fa03bde5bdf7", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_12-63d6f25.stderr", + "stderr_hash": "28d115256d1f8e36fdce5f2192e17e06c4b6daaa2166ece7bed3947c", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_12-63d6f25.stderr b/tests/reference/asr-arrays_12-63d6f25.stderr new file mode 100644 index 0000000000..4dc8ec210c --- /dev/null +++ b/tests/reference/asr-arrays_12-63d6f25.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_12.py:2:1 + | +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_13-b5fcc7e.json b/tests/reference/asr-arrays_13-b5fcc7e.json new file mode 100644 index 0000000000..d2c834ff6a --- /dev/null +++ b/tests/reference/asr-arrays_13-b5fcc7e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_13-b5fcc7e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_13.py", + "infile_hash": "6aa585e55d5ba97e0c139b1a86268b41104955236fc6f87a11771505", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_13-b5fcc7e.stderr", + "stderr_hash": "684ced8828de6debbd6d46dd706f9bbb993e8c85b22b656583c3a077", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_13-b5fcc7e.stderr b/tests/reference/asr-arrays_13-b5fcc7e.stderr new file mode 100644 index 0000000000..1533a34f7a --- /dev/null +++ b/tests/reference/asr-arrays_13-b5fcc7e.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_13.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-arrays_14-78be00e.json b/tests/reference/asr-arrays_14-78be00e.json new file mode 100644 index 0000000000..9a235f1984 --- /dev/null +++ b/tests/reference/asr-arrays_14-78be00e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-arrays_14-78be00e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/arrays_14.py", + "infile_hash": "f724b8a5dfe7bc481f465e6f9105c9a2e6a8b7a5985a63ba52b58db2", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-arrays_14-78be00e.stderr", + "stderr_hash": "3539282cce2d83675ca57e47d093800765d28c5b74a04eb46457f715", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-arrays_14-78be00e.stderr b/tests/reference/asr-arrays_14-78be00e.stderr new file mode 100644 index 0000000000..14bdfe6421 --- /dev/null +++ b/tests/reference/asr-arrays_14-78be00e.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/arrays_14.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-assert1-1ce92ea.json b/tests/reference/asr-assert1-1ce92ea.json new file mode 100644 index 0000000000..5e5858a464 --- /dev/null +++ b/tests/reference/asr-assert1-1ce92ea.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-assert1-1ce92ea", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/assert1.py", + "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-assert1-1ce92ea.stdout", + "stdout_hash": "ce8797c74c843e69622a590671ed85a981a9261278f1f83878327414", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-assert1-1ce92ea.stdout b/tests/reference/asr-assert1-1ce92ea.stdout new file mode 100644 index 0000000000..6f1053a992 --- /dev/null +++ b/tests/reference/asr-assert1-1ce92ea.stdout @@ -0,0 +1,102 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_assert: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_assert + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (IntegerConstant 5 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (Var 3 a) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + (StringConstant + "a is not 5" + (Character 1 10 ()) + ) + ) + (Assert + (IntegerCompare + (Var 3 a) + NotEq + (IntegerConstant 10 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-assign1-886f049.json b/tests/reference/asr-assign1-886f049.json new file mode 100644 index 0000000000..6e23997392 --- /dev/null +++ b/tests/reference/asr-assign1-886f049.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-assign1-886f049", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/assign1.py", + "infile_hash": "3b82a73e457bd65e85828b72d56596ca927e7c661e333691f154912b", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-assign1-886f049.stdout", + "stdout_hash": "c2ffd64d63b0780c568d6f28ec8306cade4e74588adc6f7db056603f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-assign1-886f049.stdout b/tests/reference/asr-assign1-886f049.stdout new file mode 100644 index 0000000000..eff4af54bc --- /dev/null +++ b/tests/reference/asr-assign1-886f049.stdout @@ -0,0 +1,196 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_augassign: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + r: + (Variable + 3 + r + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_augassign + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 r) + (IntegerConstant 0 (Integer 4)) + () + ) + (= + (Var 3 r) + (IntegerBinOp + (Var 3 r) + Add + (IntegerConstant 4 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (Var 3 s) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 3 r) + (IntegerBinOp + (Var 3 r) + Mul + (Var 3 s) + (Integer 4) + () + ) + () + ) + (= + (Var 3 r) + (IntegerBinOp + (Var 3 r) + Sub + (IntegerConstant 2 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (Var 3 s) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 3 r) + (RealBinOp + (Cast + (Var 3 r) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (Var 3 s) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (= + (Var 3 a) + (StringConstant + "" + (Character 1 0 ()) + ) + () + ) + (= + (Var 3 a) + (StringConcat + (Var 3 a) + (StringConstant + "test" + (Character 1 4 ()) + ) + (Character 1 2 ()) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-assign2-8d1a2ee.json b/tests/reference/asr-assign2-8d1a2ee.json new file mode 100644 index 0000000000..a0e50b5045 --- /dev/null +++ b/tests/reference/asr-assign2-8d1a2ee.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-assign2-8d1a2ee", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/assign2.py", + "infile_hash": "9b182950a8d1abbd951007b692fff95382e90ada103c7f14c4497b06", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-assign2-8d1a2ee.stdout", + "stdout_hash": "7bec7662e29763790b836536cc3a60aacdaf849a44e8cb9c5d4d3298", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-assign2-8d1a2ee.stdout b/tests/reference/asr-assign2-8d1a2ee.stdout new file mode 100644 index 0000000000..cace4a2618 --- /dev/null +++ b/tests/reference/asr-assign2-8d1a2ee.stdout @@ -0,0 +1,118 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + f: + (Variable + 2 + f + [] + Local + (Cast + (RealConstant + 1.234568 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.234568 + (Real 4) + ) + ) + (RealConstant + 1.234568 + (Real 4) + ) + Default + (Real 4) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 2 + f2 + [] + Local + (RealConstant + 1.234568 + (Real 8) + ) + (RealConstant + 1.234568 + (Real 8) + ) + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 2 + i + [] + Local + (IntegerConstant 5 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 2 + i2 + [] + Local + (Cast + (IntegerConstant 53430903434 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 53430903434 (Integer 8)) + ) + (IntegerConstant 53430903434 (Integer 8)) + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 3 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-bindc_01-6d521a9.json b/tests/reference/asr-bindc_01-6d521a9.json new file mode 100644 index 0000000000..f16953e5e3 --- /dev/null +++ b/tests/reference/asr-bindc_01-6d521a9.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_01-6d521a9", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/bindc_01.py", + "infile_hash": "3cfb601d3294c470842a85777832f5582ab52cb5bd64c0e02d40deb6", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-bindc_01-6d521a9.stdout", + "stdout_hash": "ec7543eae1d1bbaeba72993e35e98165ba0248ab59dc6597f9c50e7b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_01-6d521a9.stdout b/tests/reference/asr-bindc_01-6d521a9.stdout new file mode 100644 index 0000000000..9e5a7b2cd4 --- /dev/null +++ b/tests/reference/asr-bindc_01-6d521a9.stdout @@ -0,0 +1,210 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_issue_1781] + [] + [(CPtrToPointer + (Var 2 queries) + (Var 2 x) + () + () + ) + (Print + () + [(Var 2 queries) + (Var 2 x)] + () + () + ) + (SubroutineCall + 2 test_issue_1781 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + queries: + (Variable + 2 + queries + [] + Local + (PointerNullConstant + (CPtr) + ) + (PointerNullConstant + (CPtr) + ) + Default + (CPtr) + () + Source + Public + Required + .false. + ), + test_issue_1781: + (Function + (SymbolTable + 3 + { + p: + (Variable + 3 + p + [] + Local + () + () + Default + (CPtr) + () + Source + Public + Required + .false. + ) + }) + test_issue_1781 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 p) + (PointerNullConstant + (CPtr) + ) + () + ) + (Assert + (CPtrCompare + (Var 3 p) + Eq + (PointerNullConstant + (CPtr) + ) + (Logical 4) + () + ) + () + ) + (Assert + (LogicalNot + (CPtrCompare + (Var 3 p) + NotEq + (PointerNullConstant + (CPtr) + ) + (Logical 4) + () + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + x: + (Variable + 2 + x + [] + Local + () + () + Default + (Pointer + (Integer 2) + ) + () + Source + Public + Required + .false. + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-bindc_01-f761165.json b/tests/reference/asr-bindc_01-f761165.json new file mode 100644 index 0000000000..24d385098d --- /dev/null +++ b/tests/reference/asr-bindc_01-f761165.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_01-f761165", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/bindc_01.py", + "infile_hash": "5f60d96ef8d39100cf775974c5af355ebc1d1f3e67d442564faf7f07", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_01-f761165.stderr", + "stderr_hash": "b2d416fa6afa00923a130cb76dbd580798a9ee0841e34980c531b050", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_01-f761165.stderr b/tests/reference/asr-bindc_01-f761165.stderr new file mode 100644 index 0000000000..7fe85cd32b --- /dev/null +++ b/tests/reference/asr-bindc_01-f761165.stderr @@ -0,0 +1,8 @@ +semantic error: Type mismatch in procedure call; the types must be compatible + --> tests/errors/bindc_01.py:9:14 + | +9 | cptr_arg(int32obj) + | ^^^^^^^^ type mismatch (passed argument type is i32 but required type is CPtr) + | +4 | def cptr_arg(arg1: CPtr): + | ^^^^ type mismatch (passed argument type is i32 but required type is CPtr) diff --git a/tests/reference/asr-bindc_02-5092d8e.json b/tests/reference/asr-bindc_02-5092d8e.json new file mode 100644 index 0000000000..6b3c472b5c --- /dev/null +++ b/tests/reference/asr-bindc_02-5092d8e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_02-5092d8e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/bindc_02.py", + "infile_hash": "c1e886c2295631b0c4647c418c68d0edf53d5ab4ce3439b058a657ee", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_02-5092d8e.stderr", + "stderr_hash": "315076027d80c91db75f4ec44ea5cf8d5fd37a499a367f627b6f6553", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-5092d8e.stderr b/tests/reference/asr-bindc_02-5092d8e.stderr new file mode 100644 index 0000000000..4ac4183597 --- /dev/null +++ b/tests/reference/asr-bindc_02-5092d8e.stderr @@ -0,0 +1,8 @@ +semantic error: Type mismatch in procedure call; the types must be compatible + --> tests/errors/bindc_02.py:9:24 + | +9 | s: Struct = Struct(int32obj) + | ^^^^^^^^ type mismatch (passed argument type is i32 but required type is CPtr) + | +5 | cptr_member: CPtr + | ^^^^ type mismatch (passed argument type is i32 but required type is CPtr) diff --git a/tests/reference/asr-bindc_02-bc1a7ea.json b/tests/reference/asr-bindc_02-bc1a7ea.json new file mode 100644 index 0000000000..b8abd26275 --- /dev/null +++ b/tests/reference/asr-bindc_02-bc1a7ea.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_02-bc1a7ea", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/bindc_02.py", + "infile_hash": "a29f0f269c494419077ca8725e7c2d2dc7a5b4964d5c909347f1caa4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_02-bc1a7ea.stderr", + "stderr_hash": "f35a1e2233396c7620436bb77c9e617e33e60fb9c92da2552280ed2c", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stderr b/tests/reference/asr-bindc_02-bc1a7ea.stderr new file mode 100644 index 0000000000..0366febb6a --- /dev/null +++ b/tests/reference/asr-bindc_02-bc1a7ea.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/bindc_02.py:2:1 + | +2 | from numpy import empty, int16, array + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_03-95dbba7.json b/tests/reference/asr-bindc_03-95dbba7.json new file mode 100644 index 0000000000..fa55114a3e --- /dev/null +++ b/tests/reference/asr-bindc_03-95dbba7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_03-95dbba7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/bindc_03.py", + "infile_hash": "68e9bc4105ff94df854ee89163425cdc8fd26bcb5615938f6993985c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_03-95dbba7.stderr", + "stderr_hash": "9225af71c044978cc3832abb4a60a5d13f6d143a8c4dc219e930eab9", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_03-95dbba7.stderr b/tests/reference/asr-bindc_03-95dbba7.stderr new file mode 100644 index 0000000000..98e9a26f07 --- /dev/null +++ b/tests/reference/asr-bindc_03-95dbba7.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/bindc_03.py:3:1 + | +3 | from numpy import array + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_04-06bd800.json b/tests/reference/asr-bindc_04-06bd800.json new file mode 100644 index 0000000000..a19d71962d --- /dev/null +++ b/tests/reference/asr-bindc_04-06bd800.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_04-06bd800", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/bindc_04.py", + "infile_hash": "009fad63ac85061e603f011869c2439b67409edcf8cc633d1fde9013", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_04-06bd800.stderr", + "stderr_hash": "6aa8aa05ae2628d04b771044165e1c9078ba3c5ae211906def3ff0be", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_04-06bd800.stderr b/tests/reference/asr-bindc_04-06bd800.stderr new file mode 100644 index 0000000000..704b35ab47 --- /dev/null +++ b/tests/reference/asr-bindc_04-06bd800.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/errors/bindc_04.py:2:1 + | +2 | from numpy import empty, int16 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-bindc_10e-8b10394.json b/tests/reference/asr-bindc_10e-8b10394.json new file mode 100644 index 0000000000..38439231b2 --- /dev/null +++ b/tests/reference/asr-bindc_10e-8b10394.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-bindc_10e-8b10394", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/bindc_10e.py", + "infile_hash": "fa023d4ad17e426f778a99326998e6dbeac5428fa252974a39a3219d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-bindc_10e-8b10394.stderr", + "stderr_hash": "9ea4ff2c8a8789057456196deb5772e4b3a2dffadbd10ecfe5f15f29", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-bindc_10e-8b10394.stderr b/tests/reference/asr-bindc_10e-8b10394.stderr new file mode 100644 index 0000000000..cc7c1cd0aa --- /dev/null +++ b/tests/reference/asr-bindc_10e-8b10394.stderr @@ -0,0 +1,14 @@ +semantic error: The struct in c_p_pointer must be C interoperable + --> tests/errors/bindc_10e.py:15:38 + | +15 | p2: Pointer[S] = c_p_pointer(p1, S) + | ^ not C interoperable + + --> tests/errors/bindc_10e_mod.py:5:1 - 7:10 + | + 5 | class S: + | ~~~~~~~~... +... + | + 7 | b: i64 + | ...~~~~~~~~~~ help: add the @ccallable decorator to this struct to make it C interoperable diff --git a/tests/reference/asr-c_interop1-cf2e9b4.json b/tests/reference/asr-c_interop1-cf2e9b4.json new file mode 100644 index 0000000000..9295ebdefe --- /dev/null +++ b/tests/reference/asr-c_interop1-cf2e9b4.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-c_interop1-cf2e9b4", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/c_interop1.py", + "infile_hash": "aeb797508318740ae58a14cf663910a8fa077c574eaf79b9f54656ef", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-c_interop1-cf2e9b4.stdout", + "stdout_hash": "9801d10f9a077b9618063bdc3ab6905625e0469a40b17a3f805419e7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-c_interop1-cf2e9b4.stdout b/tests/reference/asr-c_interop1-cf2e9b4.stdout new file mode 100644 index 0000000000..872e8d8b37 --- /dev/null +++ b/tests/reference/asr-c_interop1-cf2e9b4.stdout @@ -0,0 +1,568 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + f: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + BindC + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (Real 8) + () + BindC + Public + Required + .true. + ) + }) + f + (FunctionType + [(Real 8)] + (Real 8) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x)] + [] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + In + () + () + Default + (Real 8) + () + BindC + Public + Required + .true. + ), + b: + (Variable + 4 + b + [] + In + () + () + Default + (Real 4) + () + BindC + Public + Required + .true. + ), + c: + (Variable + 4 + c + [] + In + () + () + Default + (Integer 8) + () + BindC + Public + Required + .true. + ), + d: + (Variable + 4 + d + [] + In + () + () + Default + (Integer 4) + () + BindC + Public + Required + .true. + ) + }) + g + (FunctionType + [(Real 8) + (Real 4) + (Integer 8) + (Integer 4)] + () + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 a) + (Var 4 b) + (Var 4 c) + (Var 4 d)] + [] + () + Public + .false. + .false. + () + ), + h: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + BindC + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + In + () + () + Default + (Real 8) + () + BindC + Public + Required + .true. + ) + }) + h + (FunctionType + [(Real 8)] + (Real 8) + BindC + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 x)] + [(= + (Var 5 _lpython_return_variable) + (RealBinOp + (Var 5 x) + Add + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + () + ) + () + ) + (Return)] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ), + l: + (Function + (SymbolTable + 6 + { + a: + (Variable + 6 + a + [] + In + () + () + Default + (Real 8) + () + BindC + Public + Required + .true. + ), + b: + (Variable + 6 + b + [] + In + () + () + Default + (Real 4) + () + BindC + Public + Required + .true. + ), + c: + (Variable + 6 + c + [] + In + () + () + Default + (Integer 8) + () + BindC + Public + Required + .true. + ), + d: + (Variable + 6 + d + [] + In + () + () + Default + (Integer 4) + () + BindC + Public + Required + .true. + ) + }) + l + (FunctionType + [(Real 8) + (Real 4) + (Integer 8) + (Integer 4)] + () + BindC + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 6 a) + (Var 6 b) + (Var 6 c) + (Var 6 d)] + [(Print + () + [(StringConstant + "OK" + (Character 1 2 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 7 + { + i: + (Variable + 7 + i + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 7 + x + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 7 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + z: + (Variable + 7 + z + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + zz: + (Variable + 7 + zz + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + g + h + l] + [] + [(= + (Var 7 x) + (RealConstant + 5.000000 + (Real 8) + ) + () + ) + (= + (Var 7 i) + (FunctionCall + 2 f + () + [((Var 7 x))] + (Real 8) + () + () + ) + () + ) + (= + (Var 7 y) + (Cast + (RealConstant + 5.400000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.400000 + (Real 4) + ) + ) + () + ) + (= + (Var 7 z) + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + () + ) + (= + (Var 7 zz) + (IntegerConstant 2 (Integer 4)) + () + ) + (SubroutineCall + 2 g + () + [((Var 7 x)) + ((Var 7 y)) + ((Var 7 z)) + ((Var 7 zz))] + () + ) + (= + (Var 7 i) + (FunctionCall + 2 h + () + [((Var 7 x))] + (Real 8) + () + () + ) + () + ) + (SubroutineCall + 2 l + () + [((Var 7 x)) + ((Var 7 y)) + ((Var 7 z)) + ((Var 7 zz))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 8 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-callback_01-df40fd5.json b/tests/reference/asr-callback_01-df40fd5.json new file mode 100644 index 0000000000..bd4b1b73fc --- /dev/null +++ b/tests/reference/asr-callback_01-df40fd5.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-callback_01-df40fd5", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/callback_01.py", + "infile_hash": "c3ab71a93f40edda000ae863149c38c388bb43a8329ebae9320a7ab4", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-callback_01-df40fd5.stdout", + "stdout_hash": "5be73c5b09034604701853c55fffbdca38993aa3f92782e89a50c91e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-callback_01-df40fd5.stdout b/tests/reference/asr-callback_01-df40fd5.stdout new file mode 100644 index 0000000000..2151b35be2 --- /dev/null +++ b/tests/reference/asr-callback_01-df40fd5.stdout @@ -0,0 +1,569 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 9 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 8 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(Assert + (IntegerCompare + (FunctionCall + 2 g + () + [((Var 2 f)) + ((IntegerConstant 10 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 11 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 g + () + [((Var 2 f2)) + ((IntegerConstant 20 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 30 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 g + () + [((Var 2 f3)) + ((IntegerConstant 5 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 21 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x)] + [(= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (Var 3 x) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + f2: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f2 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x)] + [(= + (Var 4 _lpython_return_variable) + (IntegerBinOp + (Var 4 x) + Add + (IntegerConstant 10 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + f3: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f3 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + f2] + [(Var 5 x)] + [(= + (Var 5 _lpython_return_variable) + (IntegerBinOp + (FunctionCall + 2 f + () + [((Var 5 x))] + (Integer 4) + () + () + ) + Add + (FunctionCall + 2 f2 + () + [((Var 5 x))] + (Integer 4) + () + () + ) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 6 + { + _lpython_return_variable: + (Variable + 6 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + arg: + (Variable + 6 + arg + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + func: + (Function + (SymbolTable + 7 + { + func_arg_0: + (Variable + 7 + func_arg_0 + [] + Unspecified + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + func_return_var_name: + (Variable + 7 + func_return_var_name + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + func + (FunctionType + [(Integer 4)] + (Integer 4) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 7 func_arg_0)] + [] + (Var 7 func_return_var_name) + Public + .false. + .false. + () + ), + ret: + (Variable + 6 + ret + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [(FunctionType + [(Integer 4)] + (Integer 4) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [func] + [(Var 6 func) + (Var 6 arg)] + [(= + (Var 6 ret) + (FunctionCall + 6 func + () + [((Var 6 arg))] + (Integer 4) + () + () + ) + () + ) + (= + (Var 6 _lpython_return_variable) + (Var 6 ret) + () + ) + (Return)] + (Var 6 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 10 + { + __main__global_stmts: + (ExternalSymbol + 10 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 10 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-cast-435c233.json b/tests/reference/asr-cast-435c233.json new file mode 100644 index 0000000000..8614194075 --- /dev/null +++ b/tests/reference/asr-cast-435c233.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-cast-435c233", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/cast.py", + "infile_hash": "6e4219b25f4aa2035b57c9658dbb133f2dff55db0d9c128b19214f62", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-cast-435c233.stderr", + "stderr_hash": "94b3ddb64aab37aa358cd260252df21698826606401d00e07c873603", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-cast-435c233.stderr b/tests/reference/asr-cast-435c233.stderr new file mode 100644 index 0000000000..74531e3791 --- /dev/null +++ b/tests/reference/asr-cast-435c233.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/cast.py:5:9 + | +5 | x = list(s) + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json new file mode 100644 index 0000000000..2eb40d0cd8 --- /dev/null +++ b/tests/reference/asr-complex1-f26c460.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-complex1-f26c460", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/complex1.py", + "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-complex1-f26c460.stderr", + "stderr_hash": "850f4cbe87b0a7ae8138fbfb71f94b82843abf09e50752159f900292", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-complex1-f26c460.stderr b/tests/reference/asr-complex1-f26c460.stderr new file mode 100644 index 0000000000..b6f4d1d8f0 --- /dev/null +++ b/tests/reference/asr-complex1-f26c460.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/complex1.py:11:13 + | +11 | c = c32(complex()) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-const_01-af8289b.json b/tests/reference/asr-const_01-af8289b.json new file mode 100644 index 0000000000..c54ff59cdd --- /dev/null +++ b/tests/reference/asr-const_01-af8289b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-const_01-af8289b", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/const_01.py", + "infile_hash": "c147e6905815b0476dd2ec10669bb4c7fd65d604910e00b8b9eade30", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-const_01-af8289b.stderr", + "stderr_hash": "f47e74e916315ec82f38680f66c9cf5ef3c958bcdfa87b9efe09b264", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-const_01-af8289b.stderr b/tests/reference/asr-const_01-af8289b.stderr new file mode 100644 index 0000000000..47034b6158 --- /dev/null +++ b/tests/reference/asr-const_01-af8289b.stderr @@ -0,0 +1,5 @@ +semantic error: Constant variable x is not initialised at declaration. + --> tests/errors/const_01.py:4:5 + | +4 | x: Const[i32] + | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-const_02-fce29b7.json b/tests/reference/asr-const_02-fce29b7.json new file mode 100644 index 0000000000..af31951d5b --- /dev/null +++ b/tests/reference/asr-const_02-fce29b7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-const_02-fce29b7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/const_02.py", + "infile_hash": "9548b6585315578b1844bea16afc1ebe3b17df7b548574c871226e47", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-const_02-fce29b7.stderr", + "stderr_hash": "b8b90da28518edbe487dbe6f52f1f25f004042fe463e8fba7b96d174", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-const_02-fce29b7.stderr b/tests/reference/asr-const_02-fce29b7.stderr new file mode 100644 index 0000000000..3bdb12c237 --- /dev/null +++ b/tests/reference/asr-const_02-fce29b7.stderr @@ -0,0 +1,5 @@ +semantic error: Targets with Const[i32] type cannot be re-assigned. + --> tests/errors/const_02.py:5:5 + | +5 | x = 5 + | ^ diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json new file mode 100644 index 0000000000..5abb75edfe --- /dev/null +++ b/tests/reference/asr-constants1-5828e8a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-constants1-5828e8a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/constants1.py", + "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-constants1-5828e8a.stderr", + "stderr_hash": "ebf1574a4c5a5194ffa967d7e3a768aad6fe823a3eae7b48b0ea46f2", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-constants1-5828e8a.stderr b/tests/reference/asr-constants1-5828e8a.stderr new file mode 100644 index 0000000000..d831d31282 --- /dev/null +++ b/tests/reference/asr-constants1-5828e8a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/constants1.py:5:9 + | +5 | b = bin(5) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-cptr_01-4e660f1.json b/tests/reference/asr-cptr_01-4e660f1.json new file mode 100644 index 0000000000..c554aa6d5b --- /dev/null +++ b/tests/reference/asr-cptr_01-4e660f1.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-cptr_01-4e660f1", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/cptr_01.py", + "infile_hash": "92647f6c175f3599be307df700902b5f7fe69826f22fd5f082713ee4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-cptr_01-4e660f1.stderr", + "stderr_hash": "0477f93b29ff4932b3471a59731a173fb19d6e44273236829eeaffbe", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-cptr_01-4e660f1.stderr b/tests/reference/asr-cptr_01-4e660f1.stderr new file mode 100644 index 0000000000..510fd3ad0c --- /dev/null +++ b/tests/reference/asr-cptr_01-4e660f1.stderr @@ -0,0 +1,5 @@ +semantic error: Indexing CPtr typed expressions is not supported yet + --> tests/errors/cptr_01.py:5:11 + | +5 | print(x[0]) + | ^^^^ diff --git a/tests/reference/asr-dictionary1-a105a36.json b/tests/reference/asr-dictionary1-a105a36.json new file mode 100644 index 0000000000..3bc6f3bfd1 --- /dev/null +++ b/tests/reference/asr-dictionary1-a105a36.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-dictionary1-a105a36", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/dictionary1.py", + "infile_hash": "f164e8dbe52a04e4fd541d6ff6edae2994d683074087d8785a1759e4", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-dictionary1-a105a36.stdout", + "stdout_hash": "ac9f74e24e585a3382e6615e4f197e6ebda5ba099def0664967fbcc0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-dictionary1-a105a36.stdout b/tests/reference/asr-dictionary1-a105a36.stdout new file mode 100644 index 0000000000..b434f5addf --- /dev/null +++ b/tests/reference/asr-dictionary1-a105a36.stdout @@ -0,0 +1,608 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + f: + (Function + (SymbolTable + 7 + { + x: + (Variable + 7 + x + [] + InOut + () + () + Default + (Dict + (Integer 4) + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Dict + (Integer 4) + (Integer 4) + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 7 x)] + [(DictInsert + (Var 7 x) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + )] + () + Public + .false. + .false. + () + ), + test_Dict: + (Function + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Dict + (Integer 4) + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Dict + (Character 1 -2 ()) + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + z: + (Variable + 3 + z + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_Dict + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (DictConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + [(IntegerConstant 2 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (Dict + (Integer 4) + (Integer 4) + ) + ) + () + ) + (= + (Var 3 y) + (DictConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + )] + [(IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + )] + (Dict + (Character 1 1 ()) + (Integer 4) + ) + ) + () + ) + (= + (Var 3 z) + (DictItem + (Var 3 y) + (StringConstant + "a" + (Character 1 1 ()) + ) + () + (Integer 4) + () + ) + () + ) + (= + (Var 3 z) + (DictItem + (Var 3 y) + (StringConstant + "b" + (Character 1 1 ()) + ) + () + (Integer 4) + () + ) + () + ) + (= + (Var 3 z) + (DictItem + (Var 3 x) + (IntegerConstant 1 (Integer 4)) + () + (Integer 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_dict_get: + (Function + (SymbolTable + 5 + { + x: + (Variable + 5 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 5 + y + [] + Local + () + () + Default + (Dict + (Character 1 -2 ()) + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + test_dict_get + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 y) + (DictConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + )] + [(IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + )] + (Dict + (Character 1 1 ()) + (Integer 4) + ) + ) + () + ) + (= + (Var 5 x) + (DictItem + (Var 5 y) + (StringConstant + "a" + (Character 1 1 ()) + ) + () + (Integer 4) + () + ) + () + ) + (= + (Var 5 x) + (DictItem + (Var 5 y) + (StringConstant + "a" + (Character 1 1 ()) + ) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_dict_insert: + (Function + (SymbolTable + 4 + { + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Dict + (Character 1 -2 ()) + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + test_dict_insert + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 y) + (DictConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + )] + [(IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + )] + (Dict + (Character 1 1 ()) + (Integer 4) + ) + ) + () + ) + (DictInsert + (Var 4 y) + (StringConstant + "c" + (Character 1 1 ()) + ) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + )] + () + Public + .false. + .false. + () + ), + test_dict_pop: + (Function + (SymbolTable + 6 + { + x: + (Variable + 6 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 6 + y + [] + Local + () + () + Default + (Dict + (Character 1 -2 ()) + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + test_dict_pop + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 y) + (DictConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + )] + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Dict + (Character 1 1 ()) + (Integer 4) + ) + ) + () + ) + (= + (Var 6 x) + (DictPop + (Var 6 y) + (StringConstant + "a" + (Character 1 1 ()) + ) + (Integer 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_issue_204: + (Function + (SymbolTable + 8 + { + x: + (Variable + 8 + x + [] + Local + () + () + Default + (Dict + (Integer 4) + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + test_issue_204 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [((Var 8 x))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.json b/tests/reference/asr-doconcurrentloop_01-3fdc189.json new file mode 100644 index 0000000000..8d45750ad1 --- /dev/null +++ b/tests/reference/asr-doconcurrentloop_01-3fdc189.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-doconcurrentloop_01-3fdc189", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/doconcurrentloop_01.py", + "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-doconcurrentloop_01-3fdc189.stdout", + "stdout_hash": "0975f7d22eeb12c370338f1c6b5edb6292a8f4e076cb484ccab66b06", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout new file mode 100644 index 0000000000..ccf8993bd0 --- /dev/null +++ b/tests/reference/asr-doconcurrentloop_01-3fdc189.stdout @@ -0,0 +1,580 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 7 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 4 + c + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 4 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + nsize: + (Variable + 4 + nsize + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + scalar: + (Variable + 4 + scalar + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [triad] + [] + [(= + (Var 4 scalar) + (Cast + (RealConstant + 10.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 10.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 4 nsize) + (ArraySize + (Var 4 a) + () + (Integer 4) + () + ) + () + ) + (DoConcurrentLoop + ((Var 4 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 4 nsize) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 4 a) + [(() + (Var 4 i) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (RealConstant + 5.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.000000 + (Real 4) + ) + ) + () + ) + (= + (ArrayItem + (Var 4 b) + [(() + (Var 4 i) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (RealConstant + 5.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.000000 + (Real 4) + ) + ) + () + )] + ) + (SubroutineCall + 2 triad + () + [((ArrayPhysicalCast + (Var 4 a) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 4 b) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + DescriptorArray + ) + () + )) + ((Var 4 scalar)) + ((ArrayPhysicalCast + (Var 4 c) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10000 (Integer 4)))] + DescriptorArray + ) + () + ))] + () + ) + (Print + () + [(StringConstant + "End Stream Triad" + (Character 1 16 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + triad: + (Function + (SymbolTable + 3 + { + N: + (Variable + 3 + N + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 3 + a + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + scalar: + (Variable + 3 + scalar + [] + In + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + triad + (FunctionType + [(Array + (Real 4) + [(() + ())] + DescriptorArray + ) + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + (Real 4) + (Array + (Real 4) + [(() + ())] + DescriptorArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 a) + (Var 3 b) + (Var 3 scalar) + (Var 3 c)] + [(= + (Var 3 N) + (ArraySize + (Var 3 a) + () + (Integer 4) + () + ) + () + ) + (DoConcurrentLoop + ((Var 3 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 3 N) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 3 c) + [(() + (Var 3 i) + ())] + (Real 4) + RowMajor + () + ) + (RealBinOp + (ArrayItem + (Var 3 a) + [(() + (Var 3 i) + ())] + (Real 4) + RowMajor + () + ) + Add + (RealBinOp + (Var 3 scalar) + Mul + (ArrayItem + (Var 3 b) + [(() + (Var 3 i) + ())] + (Real 4) + RowMajor + () + ) + (Real 4) + () + ) + (Real 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 8 + { + __main__global_stmts: + (ExternalSymbol + 8 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 8 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-elemental_01-b58df26.json b/tests/reference/asr-elemental_01-b58df26.json new file mode 100644 index 0000000000..91ad0f8c5d --- /dev/null +++ b/tests/reference/asr-elemental_01-b58df26.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-elemental_01-b58df26", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/elemental_01.py", + "infile_hash": "1d1eb8ce26df5817c1e474e4f69b0b96e53df362a31f1b722efaadf0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-elemental_01-b58df26.stderr", + "stderr_hash": "cd10f41e485a55b944782ec55b168ba07907570bc9c92869d02f705e", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-elemental_01-b58df26.stderr b/tests/reference/asr-elemental_01-b58df26.stderr new file mode 100644 index 0000000000..464e01fed8 --- /dev/null +++ b/tests/reference/asr-elemental_01-b58df26.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/elemental_01.py:2:1 + | +2 | from numpy import empty, sin, cos, reshape, int32, float32, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-enum_01-30e1b4a.json b/tests/reference/asr-enum_01-30e1b4a.json new file mode 100644 index 0000000000..f21587576e --- /dev/null +++ b/tests/reference/asr-enum_01-30e1b4a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-enum_01-30e1b4a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/enum_01.py", + "infile_hash": "5f229c1dc30fb06044461359242b2a63d9b93c4086669b391cef7426", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-enum_01-30e1b4a.stderr", + "stderr_hash": "ee3775d6e144fa8c18d4beeae5a5790e317f7c4d26212100d03f29d4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-enum_01-30e1b4a.stderr b/tests/reference/asr-enum_01-30e1b4a.stderr new file mode 100644 index 0000000000..0947a787ea --- /dev/null +++ b/tests/reference/asr-enum_01-30e1b4a.stderr @@ -0,0 +1,9 @@ +semantic error: Enumerations with non-integer or non-unique integer values cannot interoperate with C code. + --> tests/errors/enum_01.py:5:1 - 8:19 + | +5 | class Color(Enum): + | ^^^^^^^^^^^^^^^^^^... +... + | +8 | BLUE: f64 = 0.7 + | ...^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-enum_02-54656c5.json b/tests/reference/asr-enum_02-54656c5.json new file mode 100644 index 0000000000..a989cef176 --- /dev/null +++ b/tests/reference/asr-enum_02-54656c5.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-enum_02-54656c5", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/enum_02.py", + "infile_hash": "8ef155d733622824b261f286d72fb1be235bc6e73586a7acc02906d3", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-enum_02-54656c5.stderr", + "stderr_hash": "88c95223e82c39f9d40d9f62923d1bffdf3a9f0a47565bad19b37dee", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-enum_02-54656c5.stderr b/tests/reference/asr-enum_02-54656c5.stderr new file mode 100644 index 0000000000..39fb6429e6 --- /dev/null +++ b/tests/reference/asr-enum_02-54656c5.stderr @@ -0,0 +1,9 @@ +semantic error: Enumerations with non-integer or non-unique integer values cannot interoperate with C code. + --> tests/errors/enum_02.py:5:1 - 8:17 + | +5 | class Color(Enum): + | ^^^^^^^^^^^^^^^^^^... +... + | +8 | BLUE: i32 = 2 + | ...^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-expr1-8df2d66.json b/tests/reference/asr-expr1-8df2d66.json new file mode 100644 index 0000000000..1d822feb22 --- /dev/null +++ b/tests/reference/asr-expr1-8df2d66.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr1-8df2d66", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr1.py", + "infile_hash": "a0c9e93e40f29b7d4541f8c513de490a892abf78a34700478d1827dd", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr1-8df2d66.stdout", + "stdout_hash": "f6ee3d989186cae0852628aac61f23c4831bdc638435bc489e4bdf7c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr1-8df2d66.stdout b/tests/reference/asr-expr1-8df2d66.stdout new file mode 100644 index 0000000000..8a80d6e5f9 --- /dev/null +++ b/tests/reference/asr-expr1-8df2d66.stdout @@ -0,0 +1,148 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_namedexpr: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_namedexpr + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (NamedExpr + (Var 3 y) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + ) + () + ) + (If + (NamedExpr + (Var 3 a) + (StringOrd + (StringConstant + "3" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 51 (Integer 4)) + ) + (Integer 4) + ) + [(= + (Var 3 x) + (IntegerConstant 1 (Integer 4)) + () + )] + [] + ) + (WhileLoop + () + (NamedExpr + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + ) + [(= + (Var 3 y) + (IntegerConstant 1 (Integer 4)) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json new file mode 100644 index 0000000000..62a4828972 --- /dev/null +++ b/tests/reference/asr-expr10-efcbb1b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr10-efcbb1b", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr10.py", + "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr10-efcbb1b.stderr", + "stderr_hash": "32b0a64a7d73278b8d793b2991e8550827128c4df7fd48bc82d20311", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr10-efcbb1b.stderr b/tests/reference/asr-expr10-efcbb1b.stderr new file mode 100644 index 0000000000..e35c34b037 --- /dev/null +++ b/tests/reference/asr-expr10-efcbb1b.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr10.py:28:14 + | +28 | c = +c32(complex(1, 2)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr11-9b91d35.json b/tests/reference/asr-expr11-9b91d35.json new file mode 100644 index 0000000000..27fc53c56a --- /dev/null +++ b/tests/reference/asr-expr11-9b91d35.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr11-9b91d35", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr11.py", + "infile_hash": "940f2d32759315dfb8d54ea50819f2bfef9737e486615703609fd47a", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr11-9b91d35.stdout", + "stdout_hash": "119588e11efc6683fe77260a150cf2622aad182814252c73dbc0b2e1", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr11-9b91d35.stdout b/tests/reference/asr-expr11-9b91d35.stdout new file mode 100644 index 0000000000..499a59590c --- /dev/null +++ b/tests/reference/asr-expr11-9b91d35.stdout @@ -0,0 +1,186 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_StrOp_repeat: + (Function + (SymbolTable + 3 + { + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_StrOp_repeat + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (StringRepeat + (StringConstant + "a" + (Character 1 1 ()) + ) + (IntegerConstant 2 (Integer 4)) + (Character 1 2 ()) + (StringConstant + "aa" + (Character 1 2 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringRepeat + (StringConstant + "a" + (Character 1 1 ()) + ) + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Character 1 0 ()) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringRepeat + (StringConstant + "test" + (Character 1 4 ()) + ) + (IntegerConstant 5 (Integer 4)) + (Character 1 20 ()) + (StringConstant + "testtesttesttesttest" + (Character 1 20 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringRepeat + (StringConstant + "bb" + (Character 1 2 ()) + ) + (IntegerConstant 4 (Integer 4)) + (Character 1 8 ()) + (StringConstant + "bbbbbbbb" + (Character 1 8 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringRepeat + (StringConstant + "bb" + (Character 1 2 ()) + ) + (IntegerUnaryMinus + (IntegerConstant 40 (Integer 4)) + (Integer 4) + (IntegerConstant -40 (Integer 4)) + ) + (Character 1 0 ()) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringRepeat + (StringRepeat + (StringConstant + "a" + (Character 1 1 ()) + ) + (IntegerConstant 3 (Integer 4)) + (Character 1 3 ()) + (StringConstant + "aaa" + (Character 1 3 ()) + ) + ) + (IntegerConstant 3 (Integer 4)) + (Character 1 9 ()) + (StringConstant + "aaaaaaaaa" + (Character 1 9 ()) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr12-5c5b71e.json b/tests/reference/asr-expr12-5c5b71e.json new file mode 100644 index 0000000000..f191d58517 --- /dev/null +++ b/tests/reference/asr-expr12-5c5b71e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr12-5c5b71e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr12.py", + "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr12-5c5b71e.stdout", + "stdout_hash": "68b01cfc65c60b82cb2ba5017c95cb10e05d130d085674593975310e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr12-5c5b71e.stdout b/tests/reference/asr-expr12-5c5b71e.stdout new file mode 100644 index 0000000000..4b91ecc679 --- /dev/null +++ b/tests/reference/asr-expr12-5c5b71e.stdout @@ -0,0 +1,307 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + check + (FunctionType + [] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test] + [] + [(= + (Var 4 a) + (FunctionCall + 2 test + () + [((IntegerConstant 2 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Integer 4) + () + () + ) + () + ) + (= + (Var 4 _lpython_return_variable) + (Var 4 a) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 5 + { + x: + (Variable + 5 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(= + (Var 5 x) + (FunctionCall + 2 check + () + [] + (Integer 4) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 3 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 a) + (Var 3 b)] + [(= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (Var 3 a) + Pow + (Var 3 b) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json new file mode 100644 index 0000000000..739e799cd5 --- /dev/null +++ b/tests/reference/asr-expr13-81bdb5a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr13-81bdb5a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr13.py", + "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr13-81bdb5a.stderr", + "stderr_hash": "0699d234dbdd85c470cbdb001dd7447b9419e96ce3aafa7642a9edc3", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr13-81bdb5a.stderr b/tests/reference/asr-expr13-81bdb5a.stderr new file mode 100644 index 0000000000..d05293f0a0 --- /dev/null +++ b/tests/reference/asr-expr13-81bdb5a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr13.py:9:9 + | +9 | a = complex(3, 4) == complex(3., 4.) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr16-a3dc453.json b/tests/reference/asr-expr16-a3dc453.json new file mode 100644 index 0000000000..14ce11462e --- /dev/null +++ b/tests/reference/asr-expr16-a3dc453.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr16-a3dc453", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr16.py", + "infile_hash": "c87ce02d4b227d695bad17d79c7359c0d8ffd64b5c5c231bce5528e4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr16-a3dc453.stderr", + "stderr_hash": "67cb0d8b08c9910cfdf81faffe003dec601823ff0fd07990a478baf4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr16-a3dc453.stderr b/tests/reference/asr-expr16-a3dc453.stderr new file mode 100644 index 0000000000..7b8ae5a07d --- /dev/null +++ b/tests/reference/asr-expr16-a3dc453.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in shorthand operator, the types must be compatible + --> tests/expr16.py:6:9 + | +6 | sum += data[i] + | ^^^ ^^^^^^^ type mismatch ('f64' and 'i32') diff --git a/tests/reference/asr-expr2-2e78a12.json b/tests/reference/asr-expr2-2e78a12.json new file mode 100644 index 0000000000..fb9017f692 --- /dev/null +++ b/tests/reference/asr-expr2-2e78a12.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr2-2e78a12", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr2.py", + "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr2-2e78a12.stdout", + "stdout_hash": "2ff834685a67310d1ac788a1882209a5179ab17c41e4be40773a53a6", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr2-2e78a12.stdout b/tests/reference/asr-expr2-2e78a12.stdout new file mode 100644 index 0000000000..510df79e02 --- /dev/null +++ b/tests/reference/asr-expr2-2e78a12.stdout @@ -0,0 +1,187 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_boolOp: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ) + }) + test_boolOp + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 a) + (LogicalBinOp + (Var 3 a) + And + (Var 3 b) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalBinOp + (Var 3 a) + Or + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (LogicalBinOp + (Var 3 a) + Or + (Var 3 b) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (LogicalBinOp + (Var 3 a) + And + (LogicalCompare + (Var 3 b) + Eq + (Var 3 b) + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (LogicalBinOp + (Var 3 a) + And + (LogicalCompare + (Var 3 b) + NotEq + (Var 3 b) + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (LogicalBinOp + (Var 3 b) + Or + (Var 3 b) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr4-cef6743.json b/tests/reference/asr-expr4-cef6743.json new file mode 100644 index 0000000000..76521609ad --- /dev/null +++ b/tests/reference/asr-expr4-cef6743.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr4-cef6743", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr4.py", + "infile_hash": "5cba7a5d589f54fc31463e48903d5b46604fb64e3e64ba215339047c", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr4-cef6743.stdout", + "stdout_hash": "666ba33cd5ae1e6c79478d456ed9d2ad73bf5497f8a541debadd4738", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr4-cef6743.stdout b/tests/reference/asr-expr4-cef6743.stdout new file mode 100644 index 0000000000..30d1e989c5 --- /dev/null +++ b/tests/reference/asr-expr4-cef6743.stdout @@ -0,0 +1,104 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_del: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_del + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (IntegerConstant 4 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerConstant 20 (Integer 4)) + () + ) + (ExplicitDeallocate + [(Var 3 a) + (Var 3 b)] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr5-645ffcc.json b/tests/reference/asr-expr5-645ffcc.json new file mode 100644 index 0000000000..890d1b68c6 --- /dev/null +++ b/tests/reference/asr-expr5-645ffcc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr5-645ffcc", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr5.py", + "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr5-645ffcc.stdout", + "stdout_hash": "c7893c51dec391aa10b49e7839e0b95eff9b93332273faad253f758f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr5-645ffcc.stdout b/tests/reference/asr-expr5-645ffcc.stdout new file mode 100644 index 0000000000..52dd2fcc4b --- /dev/null +++ b/tests/reference/asr-expr5-645ffcc.stdout @@ -0,0 +1,142 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_StrOp_concat: + (Function + (SymbolTable + 3 + { + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_StrOp_concat + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (StringConcat + (StringConstant + "3" + (Character 1 1 ()) + ) + (StringConstant + "4" + (Character 1 1 ()) + ) + (Character 1 2 ()) + (StringConstant + "34" + (Character 1 2 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringConcat + (StringConstant + "a " + (Character 1 2 ()) + ) + (StringConstant + "test" + (Character 1 4 ()) + ) + (Character 1 6 ()) + (StringConstant + "a test" + (Character 1 6 ()) + ) + ) + () + ) + (= + (Var 3 s) + (StringConcat + (StringConcat + (StringConstant + "test" + (Character 1 4 ()) + ) + (StringConstant + "test" + (Character 1 4 ()) + ) + (Character 1 8 ()) + (StringConstant + "testtest" + (Character 1 8 ()) + ) + ) + (StringConstant + "test" + (Character 1 4 ()) + ) + (Character 1 12 ()) + (StringConstant + "testtesttest" + (Character 1 12 ()) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr6-368e5ed.json b/tests/reference/asr-expr6-368e5ed.json new file mode 100644 index 0000000000..3255a6bb27 --- /dev/null +++ b/tests/reference/asr-expr6-368e5ed.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr6-368e5ed", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr6.py", + "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr6-368e5ed.stdout", + "stdout_hash": "eb681d9c5f81c0d94cd1f175bfb84ec29803a153327f1c7a5a17b7d4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr6-368e5ed.stdout b/tests/reference/asr-expr6-368e5ed.stdout new file mode 100644 index 0000000000..bb68ad16a9 --- /dev/null +++ b/tests/reference/asr-expr6-368e5ed.stdout @@ -0,0 +1,151 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_ifexp: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ) + }) + test_ifexp + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 3 b) + (IfExp + (IntegerCompare + (Var 3 a) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + (IntegerConstant 6 (Integer 4)) + (IntegerConstant 8 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (Var 3 c) + (IfExp + (IntegerCompare + (Var 3 b) + Gt + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + (LogicalConstant + .true. + (Logical 4) + ) + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json new file mode 100644 index 0000000000..7d13377709 --- /dev/null +++ b/tests/reference/asr-expr7-480ba2f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr7-480ba2f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr7.py", + "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr7-480ba2f.stderr", + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr7-480ba2f.stderr b/tests/reference/asr-expr7-480ba2f.stderr new file mode 100644 index 0000000000..d1b84ec030 --- /dev/null +++ b/tests/reference/asr-expr7-480ba2f.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr7.py:4:13 + | +4 | a = i32(pow(2, 2)) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json new file mode 100644 index 0000000000..7801dbd06d --- /dev/null +++ b/tests/reference/asr-expr8-6beda60.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr8-6beda60", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr8.py", + "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr8-6beda60.stderr", + "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr8-6beda60.stderr b/tests/reference/asr-expr8-6beda60.stderr new file mode 100644 index 0000000000..6e9d8d0f32 --- /dev/null +++ b/tests/reference/asr-expr8-6beda60.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr8.py:22:13 + | +22 | x = i32(b1//b1) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr9-814e4bc.json b/tests/reference/asr-expr9-814e4bc.json new file mode 100644 index 0000000000..5e5e4e24e7 --- /dev/null +++ b/tests/reference/asr-expr9-814e4bc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr9-814e4bc", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr9.py", + "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr9-814e4bc.stdout", + "stdout_hash": "a8334d45029aef40c38c8014b64aa2520c38fdc0186ae85869d72c36", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr9-814e4bc.stdout b/tests/reference/asr-expr9-814e4bc.stdout new file mode 100644 index 0000000000..70042e2dcd --- /dev/null +++ b/tests/reference/asr-expr9-814e4bc.stdout @@ -0,0 +1,424 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 7 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 6 + { + i: + (Variable + 6 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 6 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_return_1 + test_return_2 + test_return_3] + [] + [(= + (Var 6 i) + (FunctionCall + 2 test_return_1 + () + [((IntegerConstant 4 (Integer 4)))] + (Integer 4) + () + () + ) + () + ) + (= + (Var 6 s) + (FunctionCall + 2 test_return_2 + () + [((IntegerConstant 4 (Integer 4)))] + (Character 1 -2 ()) + () + () + ) + () + ) + (= + (Var 6 i) + (FunctionCall + 2 test_return_3 + () + [((IntegerConstant 4 (Integer 4)))] + (Integer 4) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_return_1: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 3 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_return_1 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 a)] + [(= + (Var 3 x) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 3 _lpython_return_variable) + (Var 3 x) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_return_2: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + a: + (Variable + 4 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_return_2 + (FunctionType + [(Integer 4)] + (Character 1 -2 ()) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 a)] + [(= + (Var 4 x) + (StringConstant + "test" + (Character 1 4 ()) + ) + () + ) + (= + (Var 4 _lpython_return_variable) + (Var 4 x) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_return_3: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 5 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_return_3 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 a)] + [(= + (Var 5 _lpython_return_variable) + (Var 5 a) + () + ) + (Return)] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 8 + { + __main__global_stmts: + (ExternalSymbol + 8 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 8 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_01-211000e.json b/tests/reference/asr-expr_01-211000e.json new file mode 100644 index 0000000000..3ce3960ab9 --- /dev/null +++ b/tests/reference/asr-expr_01-211000e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_01-211000e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/expr_01.py", + "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_01-211000e.stdout", + "stdout_hash": "41ef0d077c9deb5cbf309b21493b9d6780254a09a635e4c01dcc096e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_01-211000e.stdout b/tests/reference/asr-expr_01-211000e.stdout new file mode 100644 index 0000000000..d3d3cfdf8a --- /dev/null +++ b/tests/reference/asr-expr_01-211000e.stdout @@ -0,0 +1,195 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x2: + (Variable + 3 + x2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + y2: + (Variable + 3 + y2 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (IntegerBinOp + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Add + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Mul + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant 25 (Integer 4)) + ) + () + ) + (Print + () + [(Var 3 x)] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_01-a0d4829.json b/tests/reference/asr-expr_01-a0d4829.json new file mode 100644 index 0000000000..23075b510d --- /dev/null +++ b/tests/reference/asr-expr_01-a0d4829.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_01-a0d4829", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_01.py", + "infile_hash": "230a65e2cddb76f58d56747325caf24b8a1f6277810186581948c514", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_01-a0d4829.stdout", + "stdout_hash": "22c544446be0bf9235672437a74b58e230def3217713441058c35b49", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_01-a0d4829.stdout b/tests/reference/asr-expr_01-a0d4829.stdout new file mode 100644 index 0000000000..2f80c815e4 --- /dev/null +++ b/tests/reference/asr-expr_01-a0d4829.stdout @@ -0,0 +1,418 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + add: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + add + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .true. + .false. + [] + .false. + ) + [] + [(Var 3 x) + (Var 3 y)] + [(= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (Var 3 x) + Add + (Var 3 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + and_op: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + and_op + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .true. + .false. + [] + .false. + ) + [] + [(Var 4 x) + (Var 4 y)] + [(= + (Var 4 _lpython_return_variable) + (IntegerBinOp + (Var 4 x) + BitAnd + (Var 4 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 5 + { + x: + (Variable + 5 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 5 + y + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + z: + (Variable + 5 + z + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [add + and_op] + [] + [(= + (Var 5 x) + (IntegerBinOp + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Add + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Mul + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant 25 (Integer 4)) + ) + () + ) + (= + (Var 5 y) + (IntegerBinOp + (FunctionCall + 2 add + () + [((Var 5 x)) + ((IntegerConstant 2 (Integer 4)))] + (Integer 4) + () + () + ) + Mul + (IntegerConstant 2 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 x) + Eq + (IntegerConstant 25 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 y) + Eq + (IntegerConstant 54 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 z) + (FunctionCall + 2 and_op + () + [((Var 5 x)) + ((Var 5 y))] + (Integer 4) + () + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 z) + Eq + (IntegerConstant 16 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_05-3a37324.json b/tests/reference/asr-expr_05-3a37324.json new file mode 100644 index 0000000000..e366badac0 --- /dev/null +++ b/tests/reference/asr-expr_05-3a37324.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_05-3a37324", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_05.py", + "infile_hash": "cc922bec30fac0a8eb10efd99f72234aa5638b3c9cd92c68044c69ea", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-expr_05-3a37324.stderr", + "stderr_hash": "ec167ccde0bcc3539244c081abc86809b00655e649722a96f082d86b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_05-3a37324.stderr b/tests/reference/asr-expr_05-3a37324.stderr new file mode 100644 index 0000000000..a8b017fcee --- /dev/null +++ b/tests/reference/asr-expr_05-3a37324.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/expr_05.py:7:12 + | +7 | return a%b + | ^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-expr_07-7742668.json b/tests/reference/asr-expr_07-7742668.json new file mode 100644 index 0000000000..7d24bdbbdf --- /dev/null +++ b/tests/reference/asr-expr_07-7742668.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_07-7742668", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_07.py", + "infile_hash": "5c3cc1f1662783acd989ceafcb0eb3259e0194dad005c5bd4e502710", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_07-7742668.stdout", + "stdout_hash": "05202a24fb95d20a4ae8d229b4bcd3729916613a20603101197da0f8", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_07-7742668.stdout b/tests/reference/asr-expr_07-7742668.stdout new file mode 100644 index 0000000000..c0727259d4 --- /dev/null +++ b/tests/reference/asr-expr_07-7742668.stdout @@ -0,0 +1,432 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + bool_to_str] + [] + [(SubroutineCall + 2 f + () + [] + () + ) + (SubroutineCall + 2 bool_to_str + () + [] + () + )] + () + Public + .false. + .false. + () + ), + bool_to_str: + (Function + (SymbolTable + 5 + { + var: + (Variable + 5 + var + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ) + }) + bool_to_str + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 var) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Print + () + [(Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "True" + (Character 1 4 ()) + ) + )] + () + () + ) + (Assert + (StringCompare + (Cast + (Var 5 var) + LogicalToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "True" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 var) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (StringCompare + (Cast + (Var 5 var) + LogicalToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "False" + (Character 1 5 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "True" + (Character 1 4 ()) + ) + ) + Eq + (StringConstant + "True" + (Character 1 4 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(= + (Var 4 a) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 4 x) + (IntegerConstant 3 (Integer 4)) + () + ) + (= + (Var 4 x) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Var 4 x) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Print + () + [(Var 4 a) + (Var 4 b)] + () + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 6 (Integer 4)) + (Logical 4) + () + ) + () + ) + (SubroutineCall + 2 g + () + [((IntegerBinOp + (IntegerBinOp + (Var 4 a) + Mul + (Var 4 b) + (Integer 4) + () + ) + Add + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + ))] + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [(Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x)] + [(Print + () + [(Var 3 x)] + () + () + )] + () + Public + .false. + .false. + () + ), + x: + (Variable + 2 + x + [] + Local + (IntegerConstant 7 (Integer 4)) + (IntegerConstant 7 (Integer 4)) + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_09-f3e89c8.json b/tests/reference/asr-expr_09-f3e89c8.json new file mode 100644 index 0000000000..2c3196b845 --- /dev/null +++ b/tests/reference/asr-expr_09-f3e89c8.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_09-f3e89c8", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_09.py", + "infile_hash": "5786bfd0706e0850ec51d9f6cface5c7df4c30f3b4715f2e76cc553b", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_09-f3e89c8.stdout", + "stdout_hash": "ba3074d0bc0b2017872e27e730d06054b799d295c6599949176a0e15", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_09-f3e89c8.stdout b/tests/reference/asr-expr_09-f3e89c8.stdout new file mode 100644 index 0000000000..b6bad33ca5 --- /dev/null +++ b/tests/reference/asr-expr_09-f3e89c8.stdout @@ -0,0 +1,1009 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_multiple_assign_1 + test_issue_928 + main0] + [] + [(SubroutineCall + 2 test_multiple_assign_1 + () + [] + () + ) + (SubroutineCall + 2 test_issue_928 + () + [] + () + ) + (SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 3 + { + i1: + (Variable + 3 + i1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 3 + i2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 i1) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 3 i2) + (IntegerConstant 4 (Integer 4)) + () + ) + (= + (Var 3 i1) + (IntegerConstant 3 (Integer 4)) + () + ) + (= + (Var 3 i2) + (IntegerConstant 5 (Integer 4)) + () + ) + (Print + () + [(IntegerBinOp + (IntegerUnaryMinus + (Var 3 i1) + (Integer 4) + () + ) + BitXor + (IntegerUnaryMinus + (Var 3 i2) + (Integer 4) + () + ) + (Integer 4) + () + )] + () + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (Var 3 i1) + (Integer 4) + () + ) + BitXor + (IntegerUnaryMinus + (Var 3 i2) + (Integer 4) + () + ) + (Integer 4) + () + ) + Eq + (IntegerConstant 6 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_issue_928: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ) + }) + test_issue_928 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (TupleConstant + [(Var 5 a) + (Var 5 b)] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + ) + (= + (Var 5 c) + (TupleConstant + [(IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 b) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (LogicalBinOp + (IntegerCompare + (TupleItem + (Var 5 c) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + ) + Eq + (Var 5 a) + (Logical 4) + () + ) + And + (IntegerCompare + (TupleItem + (Var 5 c) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + Eq + (Var 5 b) + (Logical 4) + () + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_multiple_assign_1: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 4 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + d: + (Variable + 4 + d + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + e: + (Variable + 4 + e + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + g: + (Variable + 4 + g + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 4 + i + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + j: + (Variable + 4 + j + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + k: + (Variable + 4 + k + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + test_multiple_assign_1 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 g) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 4 d) + (RealBinOp + (Cast + (Var 4 g) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + () + ) + () + ) + (= + (Var 4 e) + (RealBinOp + (Cast + (Var 4 g) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + () + ) + () + ) + (= + (Var 4 a) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 4 b) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 4 c) + (IntegerConstant 10 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (Var 4 a) + Eq + (Var 4 b) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (Var 4 c) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 a) + Eq + (IntegerConstant 10 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (RealConstant + 23.000000 + (Real 8) + ) + () + ) + (= + (Var 4 y) + (RealConstant + 23.000000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 4 x) + Sub + (RealConstant + 23.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000001 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 4 y) + Sub + (RealConstant + 23.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 4 e) + Sub + (RealConstant + 6.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000001 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 4 d) + Sub + (RealConstant + 6.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 k) + (ListConstant + [] + (List + (Real 8) + ) + ) + () + ) + (= + (Var 4 g) + (IntegerConstant 0 (Integer 4)) + () + ) + (DoLoop + () + ((Var 4 g) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(ListAppend + (Var 4 k) + (RealBinOp + (RealBinOp + (Cast + (Var 4 g) + IntegerToReal + (Real 8) + () + ) + Mul + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Add + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + () + ) + )] + ) + (= + (Var 4 i) + (Var 4 k) + () + ) + (= + (Var 4 j) + (Var 4 k) + () + ) + (DoLoop + () + ((Var 4 g) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ListItem + (Var 4 i) + (Var 4 g) + (Real 8) + () + ) + Sub + (ListItem + (Var 4 j) + (Var 4 g) + (Real 8) + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ListItem + (Var 4 i) + (Var 4 g) + (Real 8) + () + ) + Sub + (ListItem + (Var 4 k) + (Var 4 g) + (Real 8) + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (RealBinOp + (Cast + (Var 4 g) + IntegerToReal + (Real 8) + () + ) + Mul + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Add + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + () + ) + Sub + (ListItem + (Var 4 k) + (Var 4 g) + (Real 8) + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_10-d39708c.json b/tests/reference/asr-expr_10-d39708c.json new file mode 100644 index 0000000000..41fbf0dd7e --- /dev/null +++ b/tests/reference/asr-expr_10-d39708c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_10-d39708c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_10.py", + "infile_hash": "a371877a6249c5d8af75ad5afdd4c6f762841733ed517dafcdfd6b10", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_10-d39708c.stdout", + "stdout_hash": "0a4b79034e67e8b6d3eb0d84aea96436f45dea9e63ce4b3910c76dd7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_10-d39708c.stdout b/tests/reference/asr-expr_10-d39708c.stdout new file mode 100644 index 0000000000..6ff9e6698f --- /dev/null +++ b/tests/reference/asr-expr_10-d39708c.stdout @@ -0,0 +1,301 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_fn1] + [] + [(SubroutineCall + 2 test_fn1 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 _lpython_return_variable) + (IntegerConstant 5 (Integer 4)) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + gsubrout: + (Function + (SymbolTable + 4 + { + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + gsubrout + (FunctionType + [(Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x)] + [(Print + () + [(Var 4 x)] + () + () + )] + () + Public + .false. + .false. + () + ), + test_fn1: + (Function + (SymbolTable + 5 + { + __lcompilers_dummy: + (Variable + 5 + __lcompilers_dummy + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 5 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 5 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_fn1 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g + gsubrout] + [] + [(= + (Var 5 i) + (FunctionCall + 2 g + () + [] + (Integer 4) + () + () + ) + () + ) + (= + (Var 5 j) + (FunctionCall + 2 g + () + [] + (Integer 4) + () + () + ) + () + ) + (= + (Var 5 __lcompilers_dummy) + (FunctionCall + 2 g + () + [] + (Integer 4) + () + () + ) + () + ) + (SubroutineCall + 2 gsubrout + () + [((Var 5 i))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_12-6769be0.json b/tests/reference/asr-expr_12-6769be0.json new file mode 100644 index 0000000000..852cabe5ff --- /dev/null +++ b/tests/reference/asr-expr_12-6769be0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_12-6769be0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_12.py", + "infile_hash": "00534ea8d2143408735ea96d7a26888e53563758c1b14569daf0f962", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_12-6769be0.stdout", + "stdout_hash": "d2a7d644dcafd925278b7bd2689679b2a0c3cb3397a784579679b64a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_12-6769be0.stdout b/tests/reference/asr-expr_12-6769be0.stdout new file mode 100644 index 0000000000..2db31cd76d --- /dev/null +++ b/tests/reference/asr-expr_12-6769be0.stdout @@ -0,0 +1,444 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 4 + { + ptr: + (Variable + 4 + ptr + [] + InOut + () + () + Default + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + Source + Public + Required + .false. + ) + }) + check + (FunctionType + [(Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 ptr)] + [(Assert + (IntegerCompare + (ArrayItem + (Var 4 ptr) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + Eq + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (ArrayItem + (Var 4 ptr) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + Eq + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 5 + { + y: + (Variable + 5 + y + [] + Local + () + () + Default + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + yptr1: + (Variable + 5 + yptr1 + [] + Local + () + () + Default + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g + check] + [] + [(SubroutineCall + 2 g + () + [((Var 5 yptr1)) + ((ArrayPhysicalCast + (Var 5 y) + FixedSizeArray + DescriptorArray + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + DescriptorArray + ) + () + ))] + () + ) + (SubroutineCall + 2 check + () + [((Var 5 yptr1))] + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + InOut + () + () + Default + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + InOut + () + () + Default + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [(Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + (Array + (Integer 2) + [(() + ())] + DescriptorArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x) + (Var 3 y)] + [(= + (ArrayItem + (Var 3 y) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + ) + () + ) + (= + (ArrayItem + (Var 3 y) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + ) + () + ) + (= + (Var 3 x) + (GetPointer + (Var 3 y) + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + ) + () + ) + (Print + () + [(ArrayItem + (Var 3 x) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (ArrayItem + (Var 3 x) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_14-f2bd343.json b/tests/reference/asr-expr_14-f2bd343.json new file mode 100644 index 0000000000..59cc62002a --- /dev/null +++ b/tests/reference/asr-expr_14-f2bd343.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-expr_14-f2bd343", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/expr_14.py", + "infile_hash": "bf5d0d167082af64149be967dc182b9e2e8cb35091fa410ae4afee6f", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-expr_14-f2bd343.stdout", + "stdout_hash": "b03cf9660c69a5bd18468550cc176ffd6f219869f5b9a198c2b23e71", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-expr_14-f2bd343.stdout b/tests/reference/asr-expr_14-f2bd343.stdout new file mode 100644 index 0000000000..004396081b --- /dev/null +++ b/tests/reference/asr-expr_14-f2bd343.stdout @@ -0,0 +1,929 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_divide] + [] + [(SubroutineCall + 2 test_divide + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_divide: + (Function + (SymbolTable + 3 + { + a1: + (Variable + 3 + a1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 3 + a2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a3: + (Variable + 3 + a3 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 3 + b2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + b3: + (Variable + 3 + b3 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + c1: + (Variable + 3 + c1 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + c2: + (Variable + 3 + c2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + c3: + (Variable + 3 + c3 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + d1: + (Variable + 3 + d1 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + d2: + (Variable + 3 + d2 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + d3: + (Variable + 3 + d3 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + e1: + (Variable + 3 + e1 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + e2: + (Variable + 3 + e2 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + e3: + (Variable + 3 + e3 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + f1: + (Variable + 3 + f1 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 3 + f2 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + f3: + (Variable + 3 + f3 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ) + }) + test_divide + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a1) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 3 a2) + (IntegerConstant 9 (Integer 4)) + () + ) + (= + (Var 3 a3) + (RealBinOp + (Cast + (Var 3 a2) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (Var 3 a1) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 a3) + Sub + (RealConstant + 9.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b1) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + () + ) + (= + (Var 3 b2) + (Cast + (IntegerConstant 10 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 10 (Integer 8)) + ) + () + ) + (= + (Var 3 b3) + (RealBinOp + (Cast + (Var 3 b2) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (Var 3 b1) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 b3) + Sub + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 c1) + (Cast + (RealConstant + 3.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 c2) + (Cast + (RealConstant + 11.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 11.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 c3) + (RealBinOp + (Var 3 c2) + Div + (Var 3 c1) + (Real 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 c3) + Sub + (Cast + (RealConstant + 3.666666 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.666666 + (Real 4) + ) + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + LtE + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 d1) + (RealConstant + 4.000000 + (Real 8) + ) + () + ) + (= + (Var 3 d2) + (RealConstant + 12.000000 + (Real 8) + ) + () + ) + (= + (Var 3 d3) + (RealBinOp + (Var 3 d2) + Div + (Var 3 d1) + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 d3) + Sub + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 e1) + (ComplexBinOp + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToComplex + (Complex 4) + (ComplexConstant + 5.000000 + 0.000000 + (Complex 4) + ) + ) + Add + (Cast + (ComplexConstant + 0.000000 + 6.000000 + (Complex 8) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.000000 + 6.000000 + (Complex 4) + ) + ) + (Complex 4) + (ComplexConstant + 5.000000 + 6.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 e2) + (ComplexBinOp + (Cast + (IntegerConstant 13 (Integer 4)) + IntegerToComplex + (Complex 4) + (ComplexConstant + 13.000000 + 0.000000 + (Complex 4) + ) + ) + Add + (Cast + (ComplexConstant + 0.000000 + 14.000000 + (Complex 8) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.000000 + 14.000000 + (Complex 4) + ) + ) + (Complex 4) + (ComplexConstant + 13.000000 + 14.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 e3) + (ComplexBinOp + (Var 3 e2) + Div + (Var 3 e1) + (Complex 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(ComplexBinOp + (ComplexBinOp + (Var 3 e3) + Sub + (Cast + (RealConstant + 2.442623 + (Real 8) + ) + RealToComplex + (Complex 4) + (ComplexConstant + 2.442623 + 0.000000 + (Complex 4) + ) + ) + (Complex 4) + () + ) + Add + (Cast + (ComplexConstant + 0.000000 + 0.131148 + (Complex 8) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.000000 + 0.131148 + (Complex 4) + ) + ) + (Complex 4) + () + )] + 0 + (Real 4) + () + ) + LtE + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f1) + (ComplexBinOp + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 7.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 8.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 7.000000 + 8.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 3 f2) + (ComplexBinOp + (Cast + (IntegerConstant 15 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 15.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 16.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 15.000000 + 16.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 3 f3) + (ComplexBinOp + (Var 3 f2) + Div + (Var 3 f1) + (Complex 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(ComplexBinOp + (ComplexBinOp + (Var 3 f3) + Sub + (Cast + (RealConstant + 2.061947 + (Real 8) + ) + RealToComplex + (Complex 8) + (ComplexConstant + 2.061947 + 0.000000 + (Complex 8) + ) + ) + (Complex 8) + () + ) + Add + (ComplexConstant + 0.000000 + 0.070796 + (Complex 8) + ) + (Complex 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000001 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-func_01-d87aa4a.json b/tests/reference/asr-func_01-d87aa4a.json new file mode 100644 index 0000000000..2ac3164ce4 --- /dev/null +++ b/tests/reference/asr-func_01-d87aa4a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_01-d87aa4a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_01.py", + "infile_hash": "feb3ed4318642084eaa53e796f3f055c2faa47af50bcb1d90c03910c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_01-d87aa4a.stderr", + "stderr_hash": "2a773033fab41aadd3ddf3732cfb473ba5da6c9649453516286dacf1", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_01-d87aa4a.stderr b/tests/reference/asr-func_01-d87aa4a.stderr new file mode 100644 index 0000000000..3963b1e1d5 --- /dev/null +++ b/tests/reference/asr-func_01-d87aa4a.stderr @@ -0,0 +1,9 @@ +semantic error: Function f is already defined + --> tests/errors/func_01.py:9:1 - 10:16 + | + 9 | def f(i: i32): + | ^^^^^^^^^^^^^^... +... + | +10 | print(i + 2) + | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-func_02-b439474.json b/tests/reference/asr-func_02-b439474.json new file mode 100644 index 0000000000..bc648e06af --- /dev/null +++ b/tests/reference/asr-func_02-b439474.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_02-b439474", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_02.py", + "infile_hash": "452658f9bae7ccab4d21b9b1c993adb7fbaf117c093dd82672755aa5", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_02-b439474.stderr", + "stderr_hash": "855967bc8c46a46b93c348de6e3004107861b10fad24496866c8a197", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_02-b439474.stderr b/tests/reference/asr-func_02-b439474.stderr new file mode 100644 index 0000000000..e4d6ca0563 --- /dev/null +++ b/tests/reference/asr-func_02-b439474.stderr @@ -0,0 +1,5 @@ +semantic error: Assignment to an input function parameter `n` is not allowed + --> tests/errors/func_02.py:4:5 + | +4 | n = 5 + | ^ Hint: create a new local variable with a different name diff --git a/tests/reference/asr-func_03-cd744a0.json b/tests/reference/asr-func_03-cd744a0.json new file mode 100644 index 0000000000..e0e191485d --- /dev/null +++ b/tests/reference/asr-func_03-cd744a0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_03-cd744a0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_03.py", + "infile_hash": "763216ad3cb1090dc322e63706d4f92be4e806b1fc2df6f160d02fd0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_03-cd744a0.stderr", + "stderr_hash": "d1201fe81d9eeb213996a3f316f463ee4071c9192fb20d7bf327a898", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_03-cd744a0.stderr b/tests/reference/asr-func_03-cd744a0.stderr new file mode 100644 index 0000000000..74251ce6c7 --- /dev/null +++ b/tests/reference/asr-func_03-cd744a0.stderr @@ -0,0 +1,5 @@ +semantic error: Assignment to an input function parameter `l` is not allowed + --> tests/errors/func_03.py:4:5 + | +4 | l[5] = 5 + | ^ Use InOut[list[i32]] to allow assignment diff --git a/tests/reference/asr-func_04-eef2656.json b/tests/reference/asr-func_04-eef2656.json new file mode 100644 index 0000000000..6fa82a6009 --- /dev/null +++ b/tests/reference/asr-func_04-eef2656.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_04-eef2656", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_04.py", + "infile_hash": "f8a6eed44ebd1dee435e6db842a874c41b8ba2b13d88d16944a4d265", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_04-eef2656.stderr", + "stderr_hash": "d1e5bb4b5356e57124ff34eea9e5b96ecc44d3bc8a1da4b0a7db5b4a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_04-eef2656.stderr b/tests/reference/asr-func_04-eef2656.stderr new file mode 100644 index 0000000000..744b9460d2 --- /dev/null +++ b/tests/reference/asr-func_04-eef2656.stderr @@ -0,0 +1,5 @@ +semantic error: Modifying input function parameter `l` is not allowed + --> tests/errors/func_04.py:4:5 + | +4 | l.append(5) + | ^^^^^^^^^^^ diff --git a/tests/reference/asr-func_05-c22b921.json b/tests/reference/asr-func_05-c22b921.json new file mode 100644 index 0000000000..46cec1c7b4 --- /dev/null +++ b/tests/reference/asr-func_05-c22b921.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_05-c22b921", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_05.py", + "infile_hash": "70a0b0ddad67252c7488d322ffc565a6669e1f79b96c3ef3014b0d0a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_05-c22b921.stderr", + "stderr_hash": "9611beb75ae308f86e573592164c5aca50c4e1acec2e91e48687ba96", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_05-c22b921.stderr b/tests/reference/asr-func_05-c22b921.stderr new file mode 100644 index 0000000000..fc959f032f --- /dev/null +++ b/tests/reference/asr-func_05-c22b921.stderr @@ -0,0 +1,5 @@ +semantic error: Simple Type i32 cannot be intent InOut/Out + --> tests/errors/func_05.py:3:7 + | +3 | def f(n: InOut[i32]): + | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-func_06-62e738c.json b/tests/reference/asr-func_06-62e738c.json new file mode 100644 index 0000000000..00d0a1051b --- /dev/null +++ b/tests/reference/asr-func_06-62e738c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_06-62e738c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_06.py", + "infile_hash": "eed0fcf15f1964c916df4aa9bc4fab78f74f87243a42549a99234b7b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_06-62e738c.stderr", + "stderr_hash": "a97e6d8f812ec9e81cb4b0565dc2fd30f3bd194ccab41770962f6e32", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_06-62e738c.stderr b/tests/reference/asr-func_06-62e738c.stderr new file mode 100644 index 0000000000..5e5827b226 --- /dev/null +++ b/tests/reference/asr-func_06-62e738c.stderr @@ -0,0 +1,8 @@ +semantic error: Parameter is already declared + --> tests/errors/func_06.py:1:12 + | +1 | def init_X(m:i32, n: i32, b: CPtr, m: i32) -> None: + | ~~~~~ original declaration + | +1 | def init_X(m:i32, n: i32, b: CPtr, m: i32) -> None: + | ^^^^^^ redeclaration diff --git a/tests/reference/asr-func_07-4a8c076.json b/tests/reference/asr-func_07-4a8c076.json new file mode 100644 index 0000000000..23a3ff6d21 --- /dev/null +++ b/tests/reference/asr-func_07-4a8c076.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_07-4a8c076", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_07.py", + "infile_hash": "1f03729509b64de761a779737f886f9c86e548a903cb875e8f9f15f0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_07-4a8c076.stderr", + "stderr_hash": "7ed110581f050d55b95ace1c09b3dc30176b30213c125e3ec19f5c68", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_07-4a8c076.stderr b/tests/reference/asr-func_07-4a8c076.stderr new file mode 100644 index 0000000000..d876637cc3 --- /dev/null +++ b/tests/reference/asr-func_07-4a8c076.stderr @@ -0,0 +1,5 @@ +semantic error: Assignment to an input function parameter `this` is not allowed + --> tests/errors/func_07.py:12:5 + | +12 | this._len = len(this._buf) + | ^^^^ Use InOut[struct StringIO] to allow assignment diff --git a/tests/reference/asr-func_08-c137415.json b/tests/reference/asr-func_08-c137415.json new file mode 100644 index 0000000000..e8987fe7e0 --- /dev/null +++ b/tests/reference/asr-func_08-c137415.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_08-c137415", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/func_08.py", + "infile_hash": "7db9398db0036bb22e787d74ea36241f6535928f25e66c09c59e76e3", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-func_08-c137415.stderr", + "stderr_hash": "5fe28460d4f28e79ced8c17e75ba6da4cdfccd36e20d1c3a85d07cf1", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-func_08-c137415.stderr b/tests/reference/asr-func_08-c137415.stderr new file mode 100644 index 0000000000..c372ea27dd --- /dev/null +++ b/tests/reference/asr-func_08-c137415.stderr @@ -0,0 +1,5 @@ +semantic error: Intent annotation 'In' cannot be used here + --> tests/errors/func_08.py:3:17 + | +3 | def main0(x: In[In[i32]]): + | ^^^^^^^ diff --git a/tests/reference/asr-func_inline_01-56af272.json b/tests/reference/asr-func_inline_01-56af272.json new file mode 100644 index 0000000000..bbebb60fee --- /dev/null +++ b/tests/reference/asr-func_inline_01-56af272.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-func_inline_01-56af272", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/func_inline_01.py", + "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-func_inline_01-56af272.stdout", + "stdout_hash": "0bb57e1f00283e1d9702b73b5ac6e2cd149919abafe5f228b1650859", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-func_inline_01-56af272.stdout b/tests/reference/asr-func_inline_01-56af272.stdout new file mode 100644 index 0000000000..8b9b41222c --- /dev/null +++ b/tests/reference/asr-func_inline_01-56af272.stdout @@ -0,0 +1,313 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 5 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main] + [] + [(SubroutineCall + 2 main + () + [] + () + )] + () + Public + .false. + .false. + () + ), + fib: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + n: + (Variable + 3 + n + [] + In + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + fib + (FunctionType + [(Integer 8)] + (Integer 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [fib] + [(Var 3 n)] + [(If + (IntegerCompare + (Var 3 n) + Lt + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Logical 4) + () + ) + [(= + (Var 3 _lpython_return_variable) + (Var 3 n) + () + ) + (Return)] + [] + ) + (= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 3 n) + Sub + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + Add + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 3 n) + Sub + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + (Integer 8) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + main: + (Function + (SymbolTable + 4 + { + ans: + (Variable + 4 + ans + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + main + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [fib] + [] + [(= + (Var 4 x) + (Cast + (IntegerConstant 40 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 40 (Integer 8)) + ) + () + ) + (= + (Var 4 ans) + (FunctionCall + 2 fib + () + [((Var 4 x))] + (Integer 8) + () + () + ) + () + ) + (Print + () + [(Var 4 ans)] + () + () + ) + (Assert + (IntegerCompare + (Var 4 ans) + Eq + (Cast + (IntegerConstant 102334155 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 102334155 (Integer 8)) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 6 + { + __main__global_stmts: + (ExternalSymbol + 6 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 6 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-generics_01-d616074.json b/tests/reference/asr-generics_01-d616074.json new file mode 100644 index 0000000000..6cfb7b0201 --- /dev/null +++ b/tests/reference/asr-generics_01-d616074.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_01-d616074", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_01.py", + "infile_hash": "3062320cca6688cea4b76b4c18dbaf5d1dcc1de193459ee598e84935", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-generics_01-d616074.stdout", + "stdout_hash": "a86dbbc3855a11fac0c305599cd98e368c31b0fc172e78dfc1fe484b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_01-d616074.stdout b/tests/reference/asr-generics_01-d616074.stdout new file mode 100644 index 0000000000..c9d885a77b --- /dev/null +++ b/tests/reference/asr-generics_01-d616074.stdout @@ -0,0 +1,712 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_f_0: + (Function + (SymbolTable + 7 + { + _lpython_return_variable: + (Variable + 7 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 7 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 7 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_f_0 + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_integer] + [(Var 7 x) + (Var 7 y)] + [(= + (Var 7 _lpython_return_variable) + (FunctionCall + 2 add_integer + () + [((Var 7 x)) + ((Var 7 y))] + (Integer 4) + () + () + ) + () + ) + (Return)] + (Var 7 _lpython_return_variable) + Public + .false. + .false. + () + ), + __asr_generic_f_1: + (Function + (SymbolTable + 8 + { + _lpython_return_variable: + (Variable + 8 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Character 1 1 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 8 + x + [] + In + () + () + Default + (Character 1 1 ()) + () + Source + Public + Required + .false. + ), + y: + (Variable + 8 + y + [] + In + () + () + Default + (Character 1 1 ()) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_f_1 + (FunctionType + [(Character 1 1 ()) + (Character 1 1 ())] + (Character 1 1 ()) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_string] + [(Var 8 x) + (Var 8 y)] + [(= + (Var 8 _lpython_return_variable) + (FunctionCall + 2 add_string + () + [((Var 8 x)) + ((Var 8 y))] + (Character 1 1 ()) + () + () + ) + () + ) + (Return)] + (Var 8 _lpython_return_variable) + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 9 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_f_0 + __asr_generic_f_1] + [] + [(Print + () + [(FunctionCall + 2 __asr_generic_f_0 + () + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Integer 4) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 __asr_generic_f_1 + () + [((StringConstant + "a" + (Character 1 1 ()) + )) + ((StringConstant + "b" + (Character 1 1 ()) + ))] + (Character 1 1 ()) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 __asr_generic_f_1 + () + [((StringConstant + "c" + (Character 1 1 ()) + )) + ((StringConstant + "d" + (Character 1 1 ()) + ))] + (Character 1 1 ()) + () + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + add: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + add + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 3 x) + (Var 3 y)] + [] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_integer: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + add_integer + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x) + (Var 4 y)] + [(= + (Var 4 _lpython_return_variable) + (IntegerBinOp + (Var 4 x) + Add + (Var 4 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_string: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + y: + (Variable + 5 + y + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + add_string + (FunctionType + [(Character 1 -2 ()) + (Character 1 -2 ())] + (Character 1 -2 ()) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 x) + (Var 5 y)] + [(= + (Var 5 _lpython_return_variable) + (StringConcat + (Var 5 x) + (Var 5 y) + (Character 1 -4 ()) + () + ) + () + ) + (Return)] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 6 + { + _lpython_return_variable: + (Variable + 6 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 6 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 6 + y + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add] + [(Var 6 x) + (Var 6 y)] + [(= + (Var 6 _lpython_return_variable) + (FunctionCall + 2 add + () + [((Var 6 x)) + ((Var 6 y))] + (TypeParameter + T + ) + () + () + ) + () + ) + (Return)] + (Var 6 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 10 + { + __main__global_stmts: + (ExternalSymbol + 10 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 10 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-generics_02-e2ea5c9.json b/tests/reference/asr-generics_02-e2ea5c9.json new file mode 100644 index 0000000000..e3f76b5d84 --- /dev/null +++ b/tests/reference/asr-generics_02-e2ea5c9.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_02-e2ea5c9", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_02.py", + "infile_hash": "8406b1b9329997678ed067f896373fbbf49daeb2e379c700c5c2e917", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-generics_02-e2ea5c9.stdout", + "stdout_hash": "f5a159e575ecf0fdad20418b4106f3da761a8abaf39ed65de2a7b83e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_02-e2ea5c9.stdout b/tests/reference/asr-generics_02-e2ea5c9.stdout new file mode 100644 index 0000000000..b6133e896a --- /dev/null +++ b/tests/reference/asr-generics_02-e2ea5c9.stdout @@ -0,0 +1,411 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_swap_0: + (Function + (SymbolTable + 5 + { + temp: + (Variable + 5 + temp + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + InOut + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 5 + y + [] + InOut + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_swap_0 + (FunctionType + [(Integer 4) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 x) + (Var 5 y)] + [(= + (Var 5 temp) + (Var 5 x) + () + ) + (= + (Var 5 x) + (Var 5 y) + () + ) + (= + (Var 5 y) + (Var 5 temp) + () + ) + (Print + () + [(Var 5 x)] + () + () + ) + (Print + () + [(Var 5 y)] + () + () + )] + () + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_swap_0] + [] + [(= + (Var 4 a) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 4 b) + (IntegerConstant 10 (Integer 4)) + () + ) + (Print + () + [(Var 4 a) + (Var 4 b)] + () + () + ) + (SubroutineCall + 2 __asr_generic_swap_0 + () + [((Var 4 a)) + ((Var 4 b))] + () + ) + (Print + () + [(Var 4 a) + (Var 4 b)] + () + () + )] + () + Public + .false. + .false. + () + ), + swap: + (Function + (SymbolTable + 3 + { + temp: + (Variable + 3 + temp + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + InOut + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + InOut + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + swap + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x) + (Var 3 y)] + [(= + (Var 3 temp) + (Var 3 x) + () + ) + (= + (Var 3 x) + (Var 3 y) + () + ) + (= + (Var 3 y) + (Var 3 temp) + () + ) + (Print + () + [(Var 3 x)] + () + () + ) + (Print + () + [(Var 3 y)] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-generics_array_01-682b1b2.json b/tests/reference/asr-generics_array_01-682b1b2.json new file mode 100644 index 0000000000..2da3a03bc0 --- /dev/null +++ b/tests/reference/asr-generics_array_01-682b1b2.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_array_01-682b1b2", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_array_01.py", + "infile_hash": "6e943dd0e26ab4d1ffb6ed6909a365b4135b6f5295957b2478cfb479", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_01-682b1b2.stderr", + "stderr_hash": "07809b586ef30105878e1532461ac0ad302722003d44d2ae71b4cb7a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_01-682b1b2.stderr b/tests/reference/asr-generics_array_01-682b1b2.stderr new file mode 100644 index 0000000000..91024d158c --- /dev/null +++ b/tests/reference/asr-generics_array_01-682b1b2.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_01.py:2:1 + | +2 | from numpy import empty, int32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_02-22c8dc1.json b/tests/reference/asr-generics_array_02-22c8dc1.json new file mode 100644 index 0000000000..b869c0013e --- /dev/null +++ b/tests/reference/asr-generics_array_02-22c8dc1.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_array_02-22c8dc1", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_array_02.py", + "infile_hash": "54b5f1d4b8fc7543c292ac0d6f7a39939816a657173937fa7dc02f07", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_02-22c8dc1.stderr", + "stderr_hash": "ab2cfe57f54581e673039761ff5a42919ddb665b1083a36342cbe7e1", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stderr b/tests/reference/asr-generics_array_02-22c8dc1.stderr new file mode 100644 index 0000000000..252a42ae21 --- /dev/null +++ b/tests/reference/asr-generics_array_02-22c8dc1.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_02.py:2:1 + | +2 | from numpy import empty, int32, float32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_03-fb3706c.json b/tests/reference/asr-generics_array_03-fb3706c.json new file mode 100644 index 0000000000..128484c0ae --- /dev/null +++ b/tests/reference/asr-generics_array_03-fb3706c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_array_03-fb3706c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_array_03.py", + "infile_hash": "5b415ae64a527ce3ab3b6878141238e227258bc2b2b8c37af6d23ff5", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_array_03-fb3706c.stderr", + "stderr_hash": "7d636bddcd76853697423eb36c823f5898b8274b21a62a55f764b63b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_array_03-fb3706c.stderr b/tests/reference/asr-generics_array_03-fb3706c.stderr new file mode 100644 index 0000000000..873e342ad1 --- /dev/null +++ b/tests/reference/asr-generics_array_03-fb3706c.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/generics_array_03.py:2:1 + | +2 | from numpy import empty, int32, float32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-generics_error_01-1e05cd6.json b/tests/reference/asr-generics_error_01-1e05cd6.json new file mode 100644 index 0000000000..80dcd03351 --- /dev/null +++ b/tests/reference/asr-generics_error_01-1e05cd6.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_error_01-1e05cd6", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/generics_error_01.py", + "infile_hash": "2c26a040a0d03561f54a6af9cdd9db262fa0e9db7a6db2b115f6c4eb", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_error_01-1e05cd6.stderr", + "stderr_hash": "45a4d8fba734f967b36ed69d703fe503111c67dc6c8887013477c791", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_01-1e05cd6.stderr b/tests/reference/asr-generics_error_01-1e05cd6.stderr new file mode 100644 index 0000000000..9d7abb86ef --- /dev/null +++ b/tests/reference/asr-generics_error_01-1e05cd6.stderr @@ -0,0 +1,5 @@ +semantic error: Inconsistent type variable for the function call + --> tests/errors/generics_error_01.py:12:7 + | +12 | print(f(1,"a")) + | ^^^^^^^^ diff --git a/tests/reference/asr-generics_error_02-d614928.json b/tests/reference/asr-generics_error_02-d614928.json new file mode 100644 index 0000000000..950f37b435 --- /dev/null +++ b/tests/reference/asr-generics_error_02-d614928.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_error_02-d614928", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/generics_error_02.py", + "infile_hash": "0cd9c07bbe28138a3cca57b750b625c528773ac79c36b15e5dc5830a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_error_02-d614928.stderr", + "stderr_hash": "2b82c797067dc1c722d416f8f13d837cfec47a0d4adb11c64f5b7e02", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_02-d614928.stderr b/tests/reference/asr-generics_error_02-d614928.stderr new file mode 100644 index 0000000000..22668c4d18 --- /dev/null +++ b/tests/reference/asr-generics_error_02-d614928.stderr @@ -0,0 +1,5 @@ +semantic error: No applicable argument to the restriction zero + --> tests/errors/generics_error_02.py:37:7 + | +37 | print(mean(["a","b","c"], add=add_string, div=div_string)) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-generics_error_03-208d10d.json b/tests/reference/asr-generics_error_03-208d10d.json new file mode 100644 index 0000000000..a5e6b0f007 --- /dev/null +++ b/tests/reference/asr-generics_error_03-208d10d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_error_03-208d10d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/generics_error_03.py", + "infile_hash": "d09e6306de96ad3575262220417ea0af090d29b26c6fceb01e73fd6d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-generics_error_03-208d10d.stderr", + "stderr_hash": "e4803340775b153d9eafeae36cff39a9469260a0e139f0fc41e9317d", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_error_03-208d10d.stderr b/tests/reference/asr-generics_error_03-208d10d.stderr new file mode 100644 index 0000000000..ef155d1bb4 --- /dev/null +++ b/tests/reference/asr-generics_error_03-208d10d.stderr @@ -0,0 +1,9 @@ +semantic error: Restriction mismatch with provided arguments + --> tests/errors/generics_error_03.py:20:1 - 21:16 + | +20 | def add_string(x: i32, y: i32) -> i32: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... +... + | +21 | return x + y + | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-generics_list_01-39c4044.json b/tests/reference/asr-generics_list_01-39c4044.json new file mode 100644 index 0000000000..3171241402 --- /dev/null +++ b/tests/reference/asr-generics_list_01-39c4044.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-generics_list_01-39c4044", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/generics_list_01.py", + "infile_hash": "fee10ba2a43151e515695ea4179e42231e1fd80d7c75637747511144", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-generics_list_01-39c4044.stdout", + "stdout_hash": "1b67e64b1337c59fb1f94f0afe307382c49ce404d59e61fc657c5225", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-generics_list_01-39c4044.stdout b/tests/reference/asr-generics_list_01-39c4044.stdout new file mode 100644 index 0000000000..9344bbb3dc --- /dev/null +++ b/tests/reference/asr-generics_list_01-39c4044.stdout @@ -0,0 +1,2023 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_mean_0: + (Function + (SymbolTable + 17 + { + _lpython_return_variable: + (Variable + 17 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 17 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 17 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + res: + (Variable + 17 + res + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 17 + x + [] + In + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_mean_0 + (FunctionType + [(List + (Integer 4) + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 zero + 2 add + 2 div] + .false. + ) + [empty_integer + add_integer + div_integer] + [(Var 17 x)] + [(= + (Var 17 k) + (ListLen + (Var 17 x) + (Integer 4) + () + ) + () + ) + (If + (IntegerCompare + (Var 17 k) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 17 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + [] + ) + (= + (Var 17 res) + (FunctionCall + 2 empty_integer + () + [((ListItem + (Var 17 x) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + ))] + (Integer 4) + () + () + ) + () + ) + (DoLoop + () + ((Var 17 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 17 k) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 17 res) + (FunctionCall + 2 add_integer + () + [((Var 17 res)) + ((ListItem + (Var 17 x) + (Var 17 i) + (Integer 4) + () + ))] + (Integer 4) + () + () + ) + () + )] + ) + (= + (Var 17 _lpython_return_variable) + (FunctionCall + 2 div_integer + () + [((Var 17 res)) + ((Var 17 k))] + (Real 8) + () + () + ) + () + ) + (Return)] + (Var 17 _lpython_return_variable) + Public + .false. + .false. + () + ), + __asr_generic_mean_1: + (Function + (SymbolTable + 18 + { + _lpython_return_variable: + (Variable + 18 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 18 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 18 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + res: + (Variable + 18 + res + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 18 + x + [] + In + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_mean_1 + (FunctionType + [(List + (Real 8) + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 zero + 2 add + 2 div] + .false. + ) + [empty_float + add_float + div_float] + [(Var 18 x)] + [(= + (Var 18 k) + (ListLen + (Var 18 x) + (Integer 4) + () + ) + () + ) + (If + (IntegerCompare + (Var 18 k) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 18 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + [] + ) + (= + (Var 18 res) + (FunctionCall + 2 empty_float + () + [((ListItem + (Var 18 x) + (IntegerConstant 0 (Integer 4)) + (Real 8) + () + ))] + (Real 8) + () + () + ) + () + ) + (DoLoop + () + ((Var 18 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 18 k) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 18 res) + (FunctionCall + 2 add_float + () + [((Var 18 res)) + ((ListItem + (Var 18 x) + (Var 18 i) + (Real 8) + () + ))] + (Real 8) + () + () + ) + () + )] + ) + (= + (Var 18 _lpython_return_variable) + (FunctionCall + 2 div_float + () + [((Var 18 res)) + ((Var 18 k))] + (Real 8) + () + () + ) + () + ) + (Return)] + (Var 18 _lpython_return_variable) + Public + .false. + .false. + () + ), + __asr_generic_mean_2: + (Function + (SymbolTable + 19 + { + _lpython_return_variable: + (Variable + 19 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 19 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 19 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + res: + (Variable + 19 + res + [] + Local + () + () + Default + (Character 1 1 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 19 + x + [] + In + () + () + Default + (List + (Character 1 1 ()) + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_mean_2 + (FunctionType + [(List + (Character 1 1 ()) + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 zero + 2 add + 2 div] + .false. + ) + [empty_string + add_string + div_string] + [(Var 19 x)] + [(= + (Var 19 k) + (ListLen + (Var 19 x) + (Integer 4) + () + ) + () + ) + (If + (IntegerCompare + (Var 19 k) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 19 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + [] + ) + (= + (Var 19 res) + (FunctionCall + 2 empty_string + () + [((ListItem + (Var 19 x) + (IntegerConstant 0 (Integer 4)) + (Character 1 1 ()) + () + ))] + (Character 1 1 ()) + () + () + ) + () + ) + (DoLoop + () + ((Var 19 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 19 k) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 19 res) + (FunctionCall + 2 add_string + () + [((Var 19 res)) + ((ListItem + (Var 19 x) + (Var 19 i) + (Character 1 1 ()) + () + ))] + (Character 1 1 ()) + () + () + ) + () + )] + ) + (= + (Var 19 _lpython_return_variable) + (FunctionCall + 2 div_string + () + [((Var 19 res)) + ((Var 19 k))] + (Real 8) + () + () + ) + () + ) + (Return)] + (Var 19 _lpython_return_variable) + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 20 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_mean_0 + __asr_generic_mean_1 + __asr_generic_mean_2] + [] + [(Print + () + [(FunctionCall + 2 __asr_generic_mean_0 + () + [((ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (List + (Integer 4) + ) + ))] + (Real 8) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 __asr_generic_mean_1 + () + [((ListConstant + [(RealConstant + 1.000000 + (Real 8) + ) + (RealConstant + 2.000000 + (Real 8) + ) + (RealConstant + 3.000000 + (Real 8) + )] + (List + (Real 8) + ) + ))] + (Real 8) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 __asr_generic_mean_2 + () + [((ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ))] + (Real 8) + () + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + add: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + add + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 4 x) + (Var 4 y)] + [] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_float: + (Function + (SymbolTable + 10 + { + _lpython_return_variable: + (Variable + 10 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 10 + x + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 10 + y + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + add_float + (FunctionType + [(Real 8) + (Real 8)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 10 x) + (Var 10 y)] + [(= + (Var 10 _lpython_return_variable) + (RealBinOp + (Var 10 x) + Add + (Var 10 y) + (Real 8) + () + ) + () + ) + (Return)] + (Var 10 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_integer: + (Function + (SymbolTable + 7 + { + _lpython_return_variable: + (Variable + 7 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 7 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 7 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + add_integer + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 7 x) + (Var 7 y)] + [(= + (Var 7 _lpython_return_variable) + (IntegerBinOp + (Var 7 x) + Add + (Var 7 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 7 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_string: + (Function + (SymbolTable + 13 + { + _lpython_return_variable: + (Variable + 13 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 13 + x + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + y: + (Variable + 13 + y + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + add_string + (FunctionType + [(Character 1 -2 ()) + (Character 1 -2 ())] + (Character 1 -2 ()) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 13 x) + (Var 13 y)] + [(= + (Var 13 _lpython_return_variable) + (StringConcat + (Var 13 x) + (Var 13 y) + (Character 1 -4 ()) + () + ) + () + ) + (Return)] + (Var 13 _lpython_return_variable) + Public + .false. + .false. + () + ), + div: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + k: + (Variable + 5 + k + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + div + (FunctionType + [(TypeParameter + T + ) + (Integer 4)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 5 x) + (Var 5 k)] + [] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ), + div_float: + (Function + (SymbolTable + 11 + { + _lpython_return_variable: + (Variable + 11 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + k: + (Variable + 11 + k + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 11 + x + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + div_float + (FunctionType + [(Real 8) + (Integer 4)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 11 x) + (Var 11 k)] + [(= + (Var 11 _lpython_return_variable) + (RealBinOp + (Var 11 x) + Div + (Cast + (Var 11 k) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (Return)] + (Var 11 _lpython_return_variable) + Public + .false. + .false. + () + ), + div_integer: + (Function + (SymbolTable + 8 + { + _lpython_return_variable: + (Variable + 8 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + k: + (Variable + 8 + k + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 8 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + div_integer + (FunctionType + [(Integer 4) + (Integer 4)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 8 x) + (Var 8 k)] + [(= + (Var 8 _lpython_return_variable) + (RealBinOp + (Cast + (Var 8 x) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (Var 8 k) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (Return)] + (Var 8 _lpython_return_variable) + Public + .false. + .false. + () + ), + div_string: + (Function + (SymbolTable + 14 + { + _lpython_return_variable: + (Variable + 14 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + k: + (Variable + 14 + k + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 14 + x + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + div_string + (FunctionType + [(Character 1 -2 ()) + (Integer 4)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 14 x) + (Var 14 k)] + [(= + (Var 14 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + (Var 14 _lpython_return_variable) + Public + .false. + .false. + () + ), + empty_float: + (Function + (SymbolTable + 9 + { + _lpython_return_variable: + (Variable + 9 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 9 + x + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + empty_float + (FunctionType + [(Real 8)] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 9 x)] + [(= + (Var 9 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + (Var 9 _lpython_return_variable) + Public + .false. + .false. + () + ), + empty_integer: + (Function + (SymbolTable + 6 + { + _lpython_return_variable: + (Variable + 6 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 6 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + empty_integer + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 6 x)] + [(= + (Var 6 _lpython_return_variable) + (IntegerConstant 0 (Integer 4)) + () + ) + (Return)] + (Var 6 _lpython_return_variable) + Public + .false. + .false. + () + ), + empty_string: + (Function + (SymbolTable + 12 + { + _lpython_return_variable: + (Variable + 12 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 12 + x + [] + In + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + empty_string + (FunctionType + [(Character 1 -2 ())] + (Character 1 -2 ()) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 12 x)] + [(= + (Var 12 _lpython_return_variable) + (StringConstant + "" + (Character 1 0 ()) + ) + () + ) + (Return)] + (Var 12 _lpython_return_variable) + Public + .false. + .false. + () + ), + mean: + (Function + (SymbolTable + 15 + { + _lpython_return_variable: + (Variable + 15 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 15 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 15 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + res: + (Variable + 15 + res + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 15 + x + [] + In + () + () + Default + (List + (TypeParameter + T + ) + ) + () + Source + Public + Required + .false. + ) + }) + mean + (FunctionType + [(List + (TypeParameter + T + ) + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 zero + 2 add + 2 div] + .false. + ) + [zero + add + div] + [(Var 15 x)] + [(= + (Var 15 k) + (ListLen + (Var 15 x) + (Integer 4) + () + ) + () + ) + (If + (IntegerCompare + (Var 15 k) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 15 _lpython_return_variable) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Return)] + [] + ) + (= + (Var 15 res) + (FunctionCall + 2 zero + () + [((ListItem + (Var 15 x) + (IntegerConstant 0 (Integer 4)) + (TypeParameter + T + ) + () + ))] + (TypeParameter + T + ) + () + () + ) + () + ) + (DoLoop + () + ((Var 15 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 15 k) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 15 res) + (FunctionCall + 2 add + () + [((Var 15 res)) + ((ListItem + (Var 15 x) + (Var 15 i) + (TypeParameter + T + ) + () + ))] + (TypeParameter + T + ) + () + () + ) + () + )] + ) + (= + (Var 15 _lpython_return_variable) + (FunctionCall + 2 div + () + [((Var 15 res)) + ((Var 15 k))] + (Real 8) + () + () + ) + () + ) + (Return)] + (Var 15 _lpython_return_variable) + Public + .false. + .false. + () + ), + zero: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + zero + (FunctionType + [(TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 3 x)] + [] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 21 + { + __main__global_stmts: + (ExternalSymbol + 21 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 21 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-global_scope1-354e217.json b/tests/reference/asr-global_scope1-354e217.json new file mode 100644 index 0000000000..2f52991153 --- /dev/null +++ b/tests/reference/asr-global_scope1-354e217.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-global_scope1-354e217", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/global_scope1.py", + "infile_hash": "e7b33a2680429ee47d15af5af7c31ac24cc802d18d5566b568fc8ef4", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-global_scope1-354e217.stdout", + "stdout_hash": "a8135cc1724a7d8f68c2d2136484125b8962b707c21873560dbaa04b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-global_scope1-354e217.stdout b/tests/reference/asr-global_scope1-354e217.stdout new file mode 100644 index 0000000000..350c3d4b39 --- /dev/null +++ b/tests/reference/asr-global_scope1-354e217.stdout @@ -0,0 +1,94 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 3 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 2 i) + (IntegerConstant 5 (Integer 4)) + () + )] + () + Public + .false. + .false. + () + ), + i: + (Variable + 2 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + __main__global_stmts: + (ExternalSymbol + 4 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 4 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-global_syms_01-273906f.json b/tests/reference/asr-global_syms_01-273906f.json new file mode 100644 index 0000000000..223ea28a2c --- /dev/null +++ b/tests/reference/asr-global_syms_01-273906f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-global_syms_01-273906f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/global_syms_01.py", + "infile_hash": "a561c85e452a7be71b45f7b5277fd3ab7ff79fcc596f059f00c9dd45", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-global_syms_01-273906f.stdout", + "stdout_hash": "8a038638305efddca192d6bdb758eb4f5c4e701efc7a21e1cdd14a06", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-global_syms_01-273906f.stdout b/tests/reference/asr-global_syms_01-273906f.stdout new file mode 100644 index 0000000000..317e736a9c --- /dev/null +++ b/tests/reference/asr-global_syms_01-273906f.stdout @@ -0,0 +1,189 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_global_symbols] + [] + [(= + (Var 2 x) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 2 i) + (ListItem + (Var 2 x) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + ) + () + ) + (SubroutineCall + 2 test_global_symbols + () + [] + () + )] + () + Public + .false. + .false. + () + ), + i: + (Variable + 2 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + test_global_symbols: + (Function + (SymbolTable + 3 + { + + }) + test_global_symbols + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(Assert + (IntegerCompare + (Var 2 i) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (ListItem + (Var 2 x) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + x: + (Variable + 2 + x + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-intent_01-66824bc.json b/tests/reference/asr-intent_01-66824bc.json new file mode 100644 index 0000000000..c981754321 --- /dev/null +++ b/tests/reference/asr-intent_01-66824bc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-intent_01-66824bc", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/intent_01.py", + "infile_hash": "0a8fa2940567fccee2cfccd4af40f353b74dbe542590460a195246a5", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-intent_01-66824bc.stdout", + "stdout_hash": "415fb57ee7c986fc49e7c0801edae4e37d6ea06143d27a998c50ab5c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-intent_01-66824bc.stdout b/tests/reference/asr-intent_01-66824bc.stdout new file mode 100644 index 0000000000..d668611200 --- /dev/null +++ b/tests/reference/asr-intent_01-66824bc.stdout @@ -0,0 +1,184 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + Foo: + (StructType + (SymbolTable + 3 + { + p: + (Variable + 3 + p + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + Foo + [] + [p] + Source + Public + .false. + .false. + [(())] + () + () + ), + f: + (Function + (SymbolTable + 4 + { + w: + (Variable + 4 + w + [] + Out + () + () + Default + (Array + (Struct + 2 Foo + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4)))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + InOut + () + () + Default + (List + (UnsignedInteger + 4 + ) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Integer 4) + (Real 8) + (List + (UnsignedInteger + 4 + ) + ) + (Array + (Struct + 2 Foo + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4)))] + PointerToDataArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x) + (Var 4 y) + (Var 4 z) + (Var 4 w)] + [] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 6 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-kwargs_01_error-ab9530d.json b/tests/reference/asr-kwargs_01_error-ab9530d.json new file mode 100644 index 0000000000..6f05aa772d --- /dev/null +++ b/tests/reference/asr-kwargs_01_error-ab9530d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-kwargs_01_error-ab9530d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/kwargs_01_error.py", + "infile_hash": "101436b7097d29f2b8dc97561054d2ffe33d11ae5a54336813c7dada", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-kwargs_01_error-ab9530d.stderr", + "stderr_hash": "9acb6dea7d63917291858cf2cac49e5270e11ea1dd547f66303224c1", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_01_error-ab9530d.stderr b/tests/reference/asr-kwargs_01_error-ab9530d.stderr new file mode 100644 index 0000000000..dbdf5c98eb --- /dev/null +++ b/tests/reference/asr-kwargs_01_error-ab9530d.stderr @@ -0,0 +1,5 @@ +semantic error: func01() got multiple values for argument 'a' + --> tests/errors/kwargs_01_error.py:11:5 + | +11 | func01(arg1, a=int(8)) + | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.json b/tests/reference/asr-kwargs_02_error-7c91f8f.json new file mode 100644 index 0000000000..bac9cf8743 --- /dev/null +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-kwargs_02_error-7c91f8f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/kwargs_02_error.py", + "infile_hash": "9f131c35f01a18365764a32dee072403fcc283705320ef6703627e5c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-kwargs_02_error-7c91f8f.stderr", + "stderr_hash": "d7988f2217bab99a6e782c6cb63f3d2f505b5d59c8976e4e4fab5042", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr new file mode 100644 index 0000000000..738691275d --- /dev/null +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/kwargs_02_error.py:4:12 + | +4 | return complex(float(a), b) + c + | ^^^^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-kwargs_03_error-a68cc46.json b/tests/reference/asr-kwargs_03_error-a68cc46.json new file mode 100644 index 0000000000..2b3ac444fa --- /dev/null +++ b/tests/reference/asr-kwargs_03_error-a68cc46.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-kwargs_03_error-a68cc46", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/kwargs_03_error.py", + "infile_hash": "1cee111472c1f8b7eea276f308ac7a1fea12438606c658bd0757973c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-kwargs_03_error-a68cc46.stderr", + "stderr_hash": "83b858c0d4e17fe2f03b1e47652414c4478d709def5d3fbaa71aad71", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-kwargs_03_error-a68cc46.stderr b/tests/reference/asr-kwargs_03_error-a68cc46.stderr new file mode 100644 index 0000000000..1a811894e0 --- /dev/null +++ b/tests/reference/asr-kwargs_03_error-a68cc46.stderr @@ -0,0 +1,5 @@ +semantic error: Function func01 doesn't have an argument named 'd' + --> tests/errors/kwargs_03_error.py:11:5 + | +11 | func01(arg1, d=int(8)) + | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-lambda_01-1ec3e01.json b/tests/reference/asr-lambda_01-1ec3e01.json new file mode 100644 index 0000000000..31b51267b2 --- /dev/null +++ b/tests/reference/asr-lambda_01-1ec3e01.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-lambda_01-1ec3e01", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/lambda_01.py", + "infile_hash": "0a22dc5de76f7c3f4f97dc4349f62e51261c0a9b3fc5e932926d438e", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-lambda_01-1ec3e01.stderr", + "stderr_hash": "99ca916bd82540da6812ad3149c0026c812efdbc777dbb5fb465e868", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-lambda_01-1ec3e01.stderr b/tests/reference/asr-lambda_01-1ec3e01.stderr new file mode 100644 index 0000000000..482e01b32e --- /dev/null +++ b/tests/reference/asr-lambda_01-1ec3e01.stderr @@ -0,0 +1,5 @@ +semantic error: The number of args to lambda function much match the number of args declared in function type + --> tests/errors/lambda_01.py:5:8 + | +5 | x: Callable[[i32, i32, i32], i32] = lambda p, q, r, s: p + q + r + s + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ diff --git a/tests/reference/asr-list1-770ba33.json b/tests/reference/asr-list1-770ba33.json new file mode 100644 index 0000000000..9a3720e721 --- /dev/null +++ b/tests/reference/asr-list1-770ba33.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-list1-770ba33", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/list1.py", + "infile_hash": "9d6b3f1a83a585d5a7a5e50ff5e1ddd15705fce268208d0cc2749514", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-list1-770ba33.stdout", + "stdout_hash": "6b6e9737c184719a7d269490a7fcdfe22f3c1e69d34e20502528f1ac", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-list1-770ba33.stdout b/tests/reference/asr-list1-770ba33.stdout new file mode 100644 index 0000000000..5042167566 --- /dev/null +++ b/tests/reference/asr-list1-770ba33.stdout @@ -0,0 +1,439 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_List: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + a11: + (Variable + 3 + a11 + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + b11: + (Variable + 3 + b11 + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (List + (List + (Integer 4) + ) + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 3 + d + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + e: + (Variable + 3 + e + [] + Local + () + () + Default + (List + (List + (Character 1 -2 ()) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_List + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 3 a) + (ListConstant + [(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)) + )] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 3 b) + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 3 c) + (ListConstant + [(ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + (IntegerConstant 6 (Integer 4))] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + ) + () + ) + (= + (Var 3 d) + (ListItem + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (Var 3 e) + (ListConstant + [(ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (ListConstant + [(StringConstant + "d" + (Character 1 1 ()) + ) + (StringConstant + "e" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + )] + (List + (List + (Character 1 1 ()) + ) + ) + ) + () + ) + (ListAppend + (Var 3 a) + (IntegerConstant 10 (Integer 4)) + ) + (ListRemove + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + ) + (ListInsert + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 13 (Integer 4)) + ) + (= + (Var 3 a) + (ListSection + (Var 3 a) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + ()) + (List + (Integer 4) + ) + () + ) + () + ) + (= + (Var 3 d) + (IntrinsicScalarFunction + ListPop + [(Var 3 a)] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 3 d) + (IntrinsicScalarFunction + ListPop + [(Var 3 a) + (IntegerConstant 2 (Integer 4))] + 1 + (Integer 4) + () + ) + () + ) + (= + (Var 3 a) + (ListConcat + (Var 3 a) + (ListConstant + [(IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4))] + (List + (Integer 4) + ) + ) + (List + (Integer 4) + ) + () + ) + () + ) + (= + (Var 3 a) + (ListConcat + (ListConstant + [(IntegerConstant 6 (Integer 4)) + (IntegerConstant 7 (Integer 4))] + (List + (Integer 4) + ) + ) + (Var 3 a) + (List + (Integer 4) + ) + () + ) + () + ) + (= + (Var 3 a11) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 3 b11) + (ListConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (Assert + (ListCompare + (Var 3 a11) + Eq + (Var 3 b11) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-loop1-10d3109.json b/tests/reference/asr-loop1-10d3109.json new file mode 100644 index 0000000000..5562e043d0 --- /dev/null +++ b/tests/reference/asr-loop1-10d3109.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop1-10d3109", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/loop1.py", + "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-loop1-10d3109.stdout", + "stdout_hash": "25e0882ec286f388253c8fd367e03f135204a71f5550a7f773938ae6", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-loop1-10d3109.stdout b/tests/reference/asr-loop1-10d3109.stdout new file mode 100644 index 0000000000..222dbd43c5 --- /dev/null +++ b/tests/reference/asr-loop1-10d3109.stdout @@ -0,0 +1,604 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 6 + { + i: + (Variable + 6 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 6 + j + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_factorial_1 + test_factorial_2 + test_factorial_3] + [] + [(= + (Var 6 i) + (FunctionCall + 2 test_factorial_1 + () + [((IntegerConstant 4 (Integer 4)))] + (Integer 4) + () + () + ) + () + ) + (= + (Var 6 i) + (FunctionCall + 2 test_factorial_2 + () + [((IntegerConstant 4 (Integer 4)))] + (Integer 4) + () + () + ) + () + ) + (= + (Var 6 j) + (FunctionCall + 2 test_factorial_3 + () + [((IntegerConstant 5 (Integer 4)))] + (Integer 8) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_factorial_1: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 3 + result + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_factorial_1 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x)] + [(If + (IntegerCompare + (Var 3 x) + Lt + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 3 _lpython_return_variable) + (IntegerConstant 0 (Integer 4)) + () + ) + (Return)] + [] + ) + (= + (Var 3 result) + (IntegerConstant 1 (Integer 4)) + () + ) + (WhileLoop + () + (IntegerCompare + (Var 3 x) + Gt + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 3 result) + (IntegerBinOp + (Var 3 result) + Mul + (Var 3 x) + (Integer 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Var 3 x) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + )] + ) + (= + (Var 3 _lpython_return_variable) + (Var 3 result) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_factorial_2: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 4 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 4 + result + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_factorial_2 + (FunctionType + [(Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x)] + [(= + (Var 4 result) + (IntegerConstant 1 (Integer 4)) + () + ) + (DoLoop + () + ((Var 4 i) + (IntegerConstant 1 (Integer 4)) + (IntegerBinOp + (IntegerBinOp + (Var 4 x) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 4 result) + (IntegerBinOp + (Var 4 result) + Mul + (Var 4 i) + (Integer 4) + () + ) + () + )] + ) + (= + (Var 4 _lpython_return_variable) + (Var 4 result) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_factorial_3: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + result: + (Variable + 5 + result + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 5 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_factorial_3 + (FunctionType + [(Integer 4)] + (Integer 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 x)] + [(= + (Var 5 result) + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + () + ) + (If + (IntegerCompare + (Var 5 x) + Lt + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 5 _lpython_return_variable) + (Var 5 result) + () + ) + (Return)] + [] + ) + (= + (Var 5 result) + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + () + ) + (WhileLoop + () + (IntegerCompare + (Var 5 x) + Gt + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(= + (Var 5 result) + (IntegerBinOp + (Var 5 result) + Mul + (Cast + (Var 5 x) + IntegerToInteger + (Integer 8) + () + ) + (Integer 8) + () + ) + () + ) + (= + (Var 5 x) + (IntegerBinOp + (Var 5 x) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + )] + ) + (= + (Var 5 _lpython_return_variable) + (Var 5 result) + () + ) + (Return)] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-loop3-a579196.json b/tests/reference/asr-loop3-a579196.json new file mode 100644 index 0000000000..fd61395be8 --- /dev/null +++ b/tests/reference/asr-loop3-a579196.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop3-a579196", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/loop3.py", + "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-loop3-a579196.stdout", + "stdout_hash": "871e9f9402932018e5122327d38ca7822eb61596f04e0bdc4e03ad7a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-loop3-a579196.stdout b/tests/reference/asr-loop3-a579196.stdout new file mode 100644 index 0000000000..d192935551 --- /dev/null +++ b/tests/reference/asr-loop3-a579196.stdout @@ -0,0 +1,90 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_pass: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_pass + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + () + ) + (WhileLoop + () + (IntegerCompare + (Var 3 a) + Gt + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-loop4-3d3216e.json b/tests/reference/asr-loop4-3d3216e.json new file mode 100644 index 0000000000..dacb23ebe6 --- /dev/null +++ b/tests/reference/asr-loop4-3d3216e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop4-3d3216e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/loop4.py", + "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-loop4-3d3216e.stdout", + "stdout_hash": "f74b039f6ca87f2d78637403f0039095208cb96167a72af3ada13690", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-loop4-3d3216e.stdout b/tests/reference/asr-loop4-3d3216e.stdout new file mode 100644 index 0000000000..128265c980 --- /dev/null +++ b/tests/reference/asr-loop4-3d3216e.stdout @@ -0,0 +1,176 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 5 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_for] + [] + [(SubroutineCall + 2 test_for + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_for: + (Function + (SymbolTable + 3 + { + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_for + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(DoLoop + () + ((Var 3 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(If + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + [(Cycle + () + )] + [] + ) + (If + (IntegerCompare + (Var 3 i) + Gt + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + [(Exit + () + )] + [] + ) + (If + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + [(Stop + () + )] + [] + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 6 + { + __main__global_stmts: + (ExternalSymbol + 6 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 6 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-loop_01-e7aa06a.json b/tests/reference/asr-loop_01-e7aa06a.json new file mode 100644 index 0000000000..943ce68e64 --- /dev/null +++ b/tests/reference/asr-loop_01-e7aa06a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop_01-e7aa06a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/loop_01.py", + "infile_hash": "fd8dbfec9ebfe2be47e713f169a8bba58de81c0d1b8988dcc86523b2", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-loop_01-e7aa06a.stderr", + "stderr_hash": "256fe74af3480ca97b87c1b6f770cee10753e5f097d5a2d79135e736", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-loop_01-e7aa06a.stderr b/tests/reference/asr-loop_01-e7aa06a.stderr new file mode 100644 index 0000000000..1b50246d4c --- /dev/null +++ b/tests/reference/asr-loop_01-e7aa06a.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in loop start and loop end values, the types must be compatible + --> tests/errors/loop_01.py:5:20 + | +5 | for i in range(15, i16(-1), i16(-1)): + | ^^ ^^^^^^^ type mismatch ('i32' and 'i16') diff --git a/tests/reference/asr-loop_02-5741651.json b/tests/reference/asr-loop_02-5741651.json new file mode 100644 index 0000000000..236ad8ba7a --- /dev/null +++ b/tests/reference/asr-loop_02-5741651.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop_02-5741651", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/loop_02.py", + "infile_hash": "7d28fdea517343528470d43c64f2759fd202ee66764d2d4ddbe5ea27", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-loop_02-5741651.stderr", + "stderr_hash": "a8262496250102a77a9e5718d40aaf1067fb21a18fb047885aa643ac", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-loop_02-5741651.stderr b/tests/reference/asr-loop_02-5741651.stderr new file mode 100644 index 0000000000..c9198f2d37 --- /dev/null +++ b/tests/reference/asr-loop_02-5741651.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in loop start and increment values, the types must be compatible + --> tests/errors/loop_02.py:5:20 + | +5 | for i in range(i16(15), i16(-1), -1): + | ^^^^^^^ ^^ type mismatch ('i16' and 'i32') diff --git a/tests/reference/asr-loop_03-401ab45.json b/tests/reference/asr-loop_03-401ab45.json new file mode 100644 index 0000000000..16313f16a7 --- /dev/null +++ b/tests/reference/asr-loop_03-401ab45.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop_03-401ab45", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/loop_03.py", + "infile_hash": "0dce15506e10f77faf350e3e7bf5dc4f39a6723c74f33eeb1f6342bc", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-loop_03-401ab45.stderr", + "stderr_hash": "cc8945240941626554f3ebeecadc96aa4ee6ea80415352dfefce2786", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-loop_03-401ab45.stderr b/tests/reference/asr-loop_03-401ab45.stderr new file mode 100644 index 0000000000..f558b6c0fd --- /dev/null +++ b/tests/reference/asr-loop_03-401ab45.stderr @@ -0,0 +1,5 @@ +semantic error: Assignment to loop variable `i` is not allowed + --> tests/errors/loop_03.py:5:9 + | +5 | i=i*10 + | ^ diff --git a/tests/reference/asr-modules_02-ec92e6f.json b/tests/reference/asr-modules_02-ec92e6f.json new file mode 100644 index 0000000000..c5fb14dbf6 --- /dev/null +++ b/tests/reference/asr-modules_02-ec92e6f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-modules_02-ec92e6f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/modules_02.py", + "infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-modules_02-ec92e6f.stdout", + "stdout_hash": "20ce6ad550f4e6b83356075795a39dafee13dc48bebf2eaf65d13edd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-modules_02-ec92e6f.stdout b/tests/reference/asr-modules_02-ec92e6f.stdout new file mode 100644 index 0000000000..7497bd6280 --- /dev/null +++ b/tests/reference/asr-modules_02-ec92e6f.stdout @@ -0,0 +1,283 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (ExternalSymbol + 2 + f + 3 f + modules_02b + [] + f + Public + ), + main0: + (Function + (SymbolTable + 7 + { + x: + (Variable + 7 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(= + (Var 7 x) + (IntegerBinOp + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Add + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Mul + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant 25 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (Var 7 x) + Eq + (IntegerConstant 25 (Integer 4)) + (Logical 4) + () + ) + () + ) + (SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [modules_02b] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + modules_02b: + (Module + (SymbolTable + 3 + { + f: + (Function + (SymbolTable + 6 + { + + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 3 g + () + [] + () + ) + (Print + () + [(StringConstant + "f()" + (Character 1 3 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + g: + (ExternalSymbol + 3 + g + 4 g + modules_02c + [] + g + Public + ) + }) + modules_02b + [modules_02c] + .false. + .false. + ), + modules_02c: + (Module + (SymbolTable + 4 + { + g: + (Function + (SymbolTable + 5 + { + + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(Print + () + [(StringConstant + "g()" + (Character 1 3 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + modules_02c + [] + .false. + .false. + ) + }) + [] +) diff --git a/tests/reference/asr-print_02-afbe092.json b/tests/reference/asr-print_02-afbe092.json new file mode 100644 index 0000000000..87677b2e44 --- /dev/null +++ b/tests/reference/asr-print_02-afbe092.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-print_02-afbe092", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/print_02.py", + "infile_hash": "c4513f1b2ab1a2f33a0784fe80b4d32b506c05799b0c920c4f5b0411", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-print_02-afbe092.stdout", + "stdout_hash": "7d720d7ce5e8ce34faf6115b15788289382dd344e4716efc29cb7251", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-print_02-afbe092.stdout b/tests/reference/asr-print_02-afbe092.stdout new file mode 100644 index 0000000000..f8435c5c33 --- /dev/null +++ b/tests/reference/asr-print_02-afbe092.stdout @@ -0,0 +1,2957 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 7 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + test_nested_lists + test_nested_lists2 + test_print_list_tuple] + [] + [(SubroutineCall + 2 f + () + [] + () + ) + (SubroutineCall + 2 test_nested_lists + () + [] + () + ) + (SubroutineCall + 2 test_nested_lists2 + () + [] + () + ) + (SubroutineCall + 2 test_print_list_tuple + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 3 + d + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (ListConstant + [(StringConstant + "ab" + (Character 1 2 ()) + ) + (StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "abcd" + (Character 1 4 ()) + )] + (List + (Character 1 2 ()) + ) + ) + () + ) + (= + (Var 3 b) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 3 c) + (ListConstant + [(RealConstant + 1.230000 + (Real 8) + ) + (RealConstant + 324.300000 + (Real 8) + ) + (RealConstant + 56.431000 + (Real 8) + ) + (RealConstant + 90.500000 + (Real 8) + ) + (RealConstant + 34.100000 + (Real 8) + )] + (List + (Real 8) + ) + ) + () + ) + (= + (Var 3 d) + (ListConstant + [] + (List + (Integer 4) + ) + ) + () + ) + (Print + () + [(Var 3 a)] + () + () + ) + (Print + () + [(Var 3 b)] + () + () + ) + (Print + () + [(Var 3 c)] + () + () + ) + (Print + () + [(Var 3 d)] + () + () + ) + (Print + () + [(Var 3 a) + (Var 3 a) + (Var 3 b) + (Var 3 c) + (Var 3 d)] + () + () + ) + (Print + () + [(Var 3 a) + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + (Var 3 b) + (Var 3 c) + (RealConstant + 1.100000 + (Real 8) + ) + (Var 3 d)] + () + () + ) + (Print + () + [(ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 0 (Integer 4))] + (List + (Integer 4) + ) + )] + () + () + ) + (Print + () + [(ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "d" + (Character 1 1 ()) + ) + (StringConstant + "e" + (Character 1 1 ()) + ) + (StringConstant + "f" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + )] + () + () + ) + (Print + () + [(ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + (Var 3 a) + (Var 3 c)] + () + () + )] + () + Public + .false. + .false. + () + ), + test_nested_lists: + (Function + (SymbolTable + 4 + { + w: + (Variable + 4 + w + [] + Local + () + () + Default + (List + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (List + (List + (List + (Integer 4) + ) + ) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (List + (List + (Real 8) + ) + ) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + Local + () + () + Default + (List + (List + (Character 1 -2 ()) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_nested_lists + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 w) + (ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 2.130000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 98.170000 + (Real 8) + ) + (Real 8) + (RealConstant + -98.170000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 1.110000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + )] + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + )] + (List + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + ) + () + ) + (= + (Var 4 x) + (ListConstant + [(ListConstant + [(ListConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + )] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (IntegerConstant 5 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 5 (Integer 4))] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + ) + (ListConstant + [(ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 2 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + )] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + )] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + )] + (List + (List + (List + (Integer 4) + ) + ) + ) + ) + () + ) + (= + (Var 4 y) + (ListConstant + [(ListConstant + [(RealConstant + 3.140000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 1.001200 + (Real 8) + ) + (Real 8) + (RealConstant + -1.001200 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 2.380000 + (Real 8) + ) + (Real 8) + (RealConstant + -2.380000 + (Real 8) + ) + ) + (RealConstant + 5.510000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + () + ) + (= + (Var 4 z) + (ListConstant + [(ListConstant + [(StringConstant + "bat" + (Character 1 3 ()) + ) + (StringConstant + "ball" + (Character 1 4 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "cat" + (Character 1 3 ()) + ) + (StringConstant + "dog" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "c++" + (Character 1 3 ()) + ) + (StringConstant + "java" + (Character 1 4 ()) + ) + (StringConstant + "python" + (Character 1 6 ()) + )] + (List + (Character 1 1 ()) + ) + )] + (List + (List + (Character 1 3 ()) + ) + ) + ) + () + ) + (Print + () + [(Var 4 w)] + () + () + ) + (Print + () + [(Var 4 x)] + () + () + ) + (Print + () + [(Var 4 y)] + () + () + ) + (Print + () + [(Var 4 z)] + () + () + )] + () + Public + .false. + .false. + () + ), + test_nested_lists2: + (Function + (SymbolTable + 6 + { + p: + (Variable + 6 + p + [] + Local + () + () + Default + (List + (List + (Integer 4) + ) + ) + () + Source + Public + Required + .false. + ), + q: + (Variable + 6 + q + [] + Local + () + () + Default + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + Source + Public + Required + .false. + ), + r: + (Variable + 6 + r + [] + Local + () + () + Default + (List + (List + (List + (Character 1 -2 ()) + ) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_nested_lists2 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 p) + (ListConstant + [(ListConstant + [(IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + (IntegerConstant 6 (Integer 4)) + (IntegerConstant 7 (Integer 4)) + (IntegerConstant 8 (Integer 4)) + (IntegerConstant 9 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 10 (Integer 4)) + (IntegerConstant 11 (Integer 4)) + (IntegerConstant 12 (Integer 4)) + (IntegerConstant 13 (Integer 4)) + (IntegerConstant 14 (Integer 4)) + (IntegerConstant 15 (Integer 4)) + (IntegerConstant 16 (Integer 4)) + (IntegerConstant 17 (Integer 4)) + (IntegerConstant 18 (Integer 4)) + (IntegerConstant 19 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 20 (Integer 4)) + (IntegerConstant 21 (Integer 4)) + (IntegerConstant 22 (Integer 4)) + (IntegerConstant 23 (Integer 4)) + (IntegerConstant 24 (Integer 4)) + (IntegerConstant 25 (Integer 4)) + (IntegerConstant 26 (Integer 4)) + (IntegerConstant 27 (Integer 4)) + (IntegerConstant 28 (Integer 4)) + (IntegerConstant 29 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 30 (Integer 4)) + (IntegerConstant 31 (Integer 4)) + (IntegerConstant 32 (Integer 4)) + (IntegerConstant 33 (Integer 4)) + (IntegerConstant 34 (Integer 4)) + (IntegerConstant 35 (Integer 4)) + (IntegerConstant 36 (Integer 4)) + (IntegerConstant 37 (Integer 4)) + (IntegerConstant 38 (Integer 4)) + (IntegerConstant 39 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 40 (Integer 4)) + (IntegerConstant 41 (Integer 4)) + (IntegerConstant 42 (Integer 4)) + (IntegerConstant 43 (Integer 4)) + (IntegerConstant 44 (Integer 4)) + (IntegerConstant 45 (Integer 4)) + (IntegerConstant 46 (Integer 4)) + (IntegerConstant 47 (Integer 4)) + (IntegerConstant 48 (Integer 4)) + (IntegerConstant 49 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 50 (Integer 4)) + (IntegerConstant 51 (Integer 4)) + (IntegerConstant 52 (Integer 4)) + (IntegerConstant 53 (Integer 4)) + (IntegerConstant 54 (Integer 4)) + (IntegerConstant 55 (Integer 4)) + (IntegerConstant 56 (Integer 4)) + (IntegerConstant 57 (Integer 4)) + (IntegerConstant 58 (Integer 4)) + (IntegerConstant 59 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 60 (Integer 4)) + (IntegerConstant 61 (Integer 4)) + (IntegerConstant 62 (Integer 4)) + (IntegerConstant 63 (Integer 4)) + (IntegerConstant 64 (Integer 4)) + (IntegerConstant 65 (Integer 4)) + (IntegerConstant 66 (Integer 4)) + (IntegerConstant 67 (Integer 4)) + (IntegerConstant 68 (Integer 4)) + (IntegerConstant 69 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 70 (Integer 4)) + (IntegerConstant 71 (Integer 4)) + (IntegerConstant 72 (Integer 4)) + (IntegerConstant 73 (Integer 4)) + (IntegerConstant 74 (Integer 4)) + (IntegerConstant 75 (Integer 4)) + (IntegerConstant 76 (Integer 4)) + (IntegerConstant 77 (Integer 4)) + (IntegerConstant 78 (Integer 4)) + (IntegerConstant 79 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 80 (Integer 4)) + (IntegerConstant 81 (Integer 4)) + (IntegerConstant 82 (Integer 4)) + (IntegerConstant 83 (Integer 4)) + (IntegerConstant 84 (Integer 4)) + (IntegerConstant 85 (Integer 4)) + (IntegerConstant 86 (Integer 4)) + (IntegerConstant 87 (Integer 4)) + (IntegerConstant 88 (Integer 4)) + (IntegerConstant 89 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 90 (Integer 4)) + (IntegerConstant 91 (Integer 4)) + (IntegerConstant 92 (Integer 4)) + (IntegerConstant 93 (Integer 4)) + (IntegerConstant 94 (Integer 4)) + (IntegerConstant 95 (Integer 4)) + (IntegerConstant 96 (Integer 4)) + (IntegerConstant 97 (Integer 4)) + (IntegerConstant 98 (Integer 4)) + (IntegerConstant 99 (Integer 4))] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + ) + () + ) + (= + (Var 6 q) + (ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 74.550000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 77.640000 + (Real 8) + ) + (Real 8) + (RealConstant + -77.640000 + (Real 8) + ) + ) + (RealConstant + 52.350000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 78.250000 + (Real 8) + ) + (Real 8) + (RealConstant + -78.250000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 19.240000 + (Real 8) + ) + (Real 8) + (RealConstant + -19.240000 + (Real 8) + ) + ) + (RealConstant + 81.380000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 7.860000 + (Real 8) + ) + (RealConstant + 12.110000 + (Real 8) + ) + (RealConstant + 27.500000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 98.930000 + (Real 8) + ) + (Real 8) + (RealConstant + -98.930000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 79.620000 + (Real 8) + ) + (Real 8) + (RealConstant + -79.620000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 73.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -73.760000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 42.050000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 90.290000 + (Real 8) + ) + (Real 8) + (RealConstant + -90.290000 + (Real 8) + ) + ) + (RealConstant + 69.950000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 59.320000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 70.780000 + (Real 8) + ) + (Real 8) + (RealConstant + -70.780000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 53.220000 + (Real 8) + ) + (Real 8) + (RealConstant + -53.220000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 53.520000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 93.880000 + (Real 8) + ) + (Real 8) + (RealConstant + -93.880000 + (Real 8) + ) + ) + (RealConstant + 49.650000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 2.180000 + (Real 8) + ) + (RealConstant + 19.910000 + (Real 8) + ) + (RealConstant + 69.240000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 78.510000 + (Real 8) + ) + (RealConstant + 89.690000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 86.680000 + (Real 8) + ) + (Real 8) + (RealConstant + -86.680000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 92.480000 + (Real 8) + ) + (Real 8) + (RealConstant + -92.480000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 80.750000 + (Real 8) + ) + (Real 8) + (RealConstant + -80.750000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 27.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -27.760000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 13.350000 + (Real 8) + ) + (Real 8) + (RealConstant + -13.350000 + (Real 8) + ) + ) + (RealConstant + 12.280000 + (Real 8) + ) + (RealConstant + 79.610000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 48.480000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 10.490000 + (Real 8) + ) + (Real 8) + (RealConstant + -10.490000 + (Real 8) + ) + ) + (RealConstant + 41.100000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 20.330000 + (Real 8) + ) + (RealConstant + 14.520000 + (Real 8) + ) + (RealConstant + 82.560000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 57.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -57.760000 + (Real 8) + ) + ) + (RealConstant + 76.030000 + (Real 8) + ) + (RealConstant + 67.330000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 21.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -21.500000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 11.920000 + (Real 8) + ) + (Real 8) + (RealConstant + -11.920000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 31.840000 + (Real 8) + ) + (Real 8) + (RealConstant + -31.840000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 9.650000 + (Real 8) + ) + (RealConstant + 11.150000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 36.580000 + (Real 8) + ) + (Real 8) + (RealConstant + -36.580000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 56.550000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 70.850000 + (Real 8) + ) + (Real 8) + (RealConstant + -70.850000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 50.670000 + (Real 8) + ) + (Real 8) + (RealConstant + -50.670000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 94.630000 + (Real 8) + ) + (RealConstant + 25.680000 + (Real 8) + ) + (RealConstant + 89.300000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 28.530000 + (Real 8) + ) + (RealConstant + 71.220000 + (Real 8) + ) + (RealConstant + 71.870000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 58.390000 + (Real 8) + ) + (Real 8) + (RealConstant + -58.390000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 6.960000 + (Real 8) + ) + (Real 8) + (RealConstant + -6.960000 + (Real 8) + ) + ) + (RealConstant + 42.980000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 8.950000 + (Real 8) + ) + (Real 8) + (RealConstant + -8.950000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 75.090000 + (Real 8) + ) + (Real 8) + (RealConstant + -75.090000 + (Real 8) + ) + ) + (RealConstant + 37.960000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 31.750000 + (Real 8) + ) + (Real 8) + (RealConstant + -31.750000 + (Real 8) + ) + ) + (RealConstant + 67.330000 + (Real 8) + ) + (RealConstant + 58.170000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 64.010000 + (Real 8) + ) + (Real 8) + (RealConstant + -64.010000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 9.220000 + (Real 8) + ) + (Real 8) + (RealConstant + -9.220000 + (Real 8) + ) + ) + (RealConstant + 9.590000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 15.710000 + (Real 8) + ) + (RealConstant + 82.360000 + (Real 8) + ) + (RealConstant + 51.180000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 100.290000 + (Real 8) + ) + (Real 8) + (RealConstant + -100.290000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 32.720000 + (Real 8) + ) + (Real 8) + (RealConstant + -32.720000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 54.940000 + (Real 8) + ) + (Real 8) + (RealConstant + -54.940000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 0.320000 + (Real 8) + ) + (Real 8) + (RealConstant + -0.320000 + (Real 8) + ) + ) + (RealConstant + 68.810000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 55.090000 + (Real 8) + ) + (Real 8) + (RealConstant + -55.090000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 97.280000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 28.200000 + (Real 8) + ) + (Real 8) + (RealConstant + -28.200000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 62.610000 + (Real 8) + ) + (Real 8) + (RealConstant + -62.610000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + )] + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + () + ) + (= + (Var 6 r) + (ListConstant + [(ListConstant + [(ListConstant + [(StringConstant + "Io" + (Character 1 2 ()) + ) + (StringConstant + "tl" + (Character 1 2 ()) + ) + (StringConstant + "bLvjV" + (Character 1 5 ()) + ) + (StringConstant + "wjFKQ" + (Character 1 5 ()) + ) + (StringConstant + "lY2" + (Character 1 3 ()) + )] + (List + (Character 1 2 ()) + ) + ) + (ListConstant + [(StringConstant + "Be2l6bqE" + (Character 1 8 ()) + ) + (StringConstant + "pQER3utIXA" + (Character 1 10 ()) + ) + (StringConstant + "llZBJj5Cdu" + (Character 1 10 ()) + ) + (StringConstant + "C8" + (Character 1 2 ()) + ) + (StringConstant + "gwTr77PdYR" + (Character 1 10 ()) + )] + (List + (Character 1 8 ()) + ) + ) + (ListConstant + [(StringConstant + "4M6L" + (Character 1 4 ()) + ) + (StringConstant + "ktPdowqERy" + (Character 1 10 ()) + ) + (StringConstant + "KSifqTkR" + (Character 1 8 ()) + ) + (StringConstant + "ZE2p1N78f1" + (Character 1 10 ()) + ) + (StringConstant + "Mi5e87Xw" + (Character 1 8 ()) + )] + (List + (Character 1 4 ()) + ) + ) + (ListConstant + [(StringConstant + "uwfzqDq9g" + (Character 1 9 ()) + ) + (StringConstant + "QaM1s" + (Character 1 5 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "LB" + (Character 1 2 ()) + )] + (List + (Character 1 9 ()) + ) + ) + (ListConstant + [(StringConstant + "OJFRY6k" + (Character 1 7 ()) + ) + (StringConstant + "iz7Oie" + (Character 1 6 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "LUYLF" + (Character 1 5 ()) + ) + (StringConstant + "JBND5FuV7l" + (Character 1 10 ()) + )] + (List + (Character 1 7 ()) + ) + )] + (List + (List + (Character 1 2 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "m" + (Character 1 1 ()) + ) + (StringConstant + "WIQBQfV" + (Character 1 7 ()) + ) + (StringConstant + "jxjDrqxu" + (Character 1 8 ()) + ) + (StringConstant + "kea" + (Character 1 3 ()) + ) + (StringConstant + "mu" + (Character 1 2 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "GI8aOwLMe" + (Character 1 9 ()) + ) + (StringConstant + "Y5m8" + (Character 1 4 ()) + ) + (StringConstant + "a02Rz" + (Character 1 5 ()) + ) + (StringConstant + "xNKCJ" + (Character 1 5 ()) + )] + (List + (Character 1 0 ()) + ) + ) + (ListConstant + [(StringConstant + "LzkhyiJQHP" + (Character 1 10 ()) + ) + (StringConstant + "uzc3xyoXL" + (Character 1 9 ()) + ) + (StringConstant + "sKGnYfpRy" + (Character 1 9 ()) + ) + (StringConstant + "7x" + (Character 1 2 ()) + ) + (StringConstant + "WTVKrnPO" + (Character 1 8 ()) + )] + (List + (Character 1 10 ()) + ) + ) + (ListConstant + [(StringConstant + "TZa6" + (Character 1 4 ()) + ) + (StringConstant + "GXRuyRX" + (Character 1 7 ()) + ) + (StringConstant + "R" + (Character 1 1 ()) + ) + (StringConstant + "JQxS" + (Character 1 4 ()) + ) + (StringConstant + "OH" + (Character 1 2 ()) + )] + (List + (Character 1 4 ()) + ) + ) + (ListConstant + [(StringConstant + "bSVJZ1OQ" + (Character 1 8 ()) + ) + (StringConstant + "M" + (Character 1 1 ()) + ) + (StringConstant + "I9omlF" + (Character 1 6 ()) + ) + (StringConstant + "x7FR" + (Character 1 4 ()) + ) + (StringConstant + "XtpL" + (Character 1 4 ()) + )] + (List + (Character 1 8 ()) + ) + )] + (List + (List + (Character 1 1 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "DKOpK" + (Character 1 5 ()) + ) + (StringConstant + "eg8Nz" + (Character 1 5 ()) + ) + (StringConstant + "ru" + (Character 1 2 ()) + ) + (StringConstant + "Sj" + (Character 1 2 ()) + ) + (StringConstant + "YUDxyI" + (Character 1 6 ()) + )] + (List + (Character 1 5 ()) + ) + ) + (ListConstant + [(StringConstant + "Q5uyhvp" + (Character 1 7 ()) + ) + (StringConstant + "Ydx" + (Character 1 3 ()) + ) + (StringConstant + "p" + (Character 1 1 ()) + ) + (StringConstant + "DLM5RX" + (Character 1 6 ()) + ) + (StringConstant + "pwOujxCO" + (Character 1 8 ()) + )] + (List + (Character 1 7 ()) + ) + ) + (ListConstant + [(StringConstant + "s5GOWnNJV" + (Character 1 9 ()) + ) + (StringConstant + "af" + (Character 1 2 ()) + ) + (StringConstant + "KAkD" + (Character 1 4 ()) + ) + (StringConstant + "4IIZK" + (Character 1 5 ()) + ) + (StringConstant + "JQK040x" + (Character 1 7 ()) + )] + (List + (Character 1 9 ()) + ) + ) + (ListConstant + [(StringConstant + "9vF" + (Character 1 3 ()) + ) + (StringConstant + "9pc7R8v" + (Character 1 7 ()) + ) + (StringConstant + "nDReIU7" + (Character 1 7 ()) + ) + (StringConstant + "K" + (Character 1 1 ()) + ) + (StringConstant + "btn" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "wVeivkdi" + (Character 1 8 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "C" + (Character 1 1 ()) + )] + (List + (Character 1 0 ()) + ) + )] + (List + (List + (Character 1 5 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "vNTtcRXD" + (Character 1 8 ()) + ) + (StringConstant + "rsi" + (Character 1 3 ()) + ) + (StringConstant + "YsoF7mZD" + (Character 1 8 ()) + ) + (StringConstant + "VrPXU50rgA" + (Character 1 10 ()) + ) + (StringConstant + "mG7zqN0G" + (Character 1 8 ()) + )] + (List + (Character 1 8 ()) + ) + ) + (ListConstant + [(StringConstant + "la7cJ" + (Character 1 5 ()) + ) + (StringConstant + "M5rLJ8Go" + (Character 1 8 ()) + ) + (StringConstant + "gb" + (Character 1 2 ()) + ) + (StringConstant + "FjKwYZ7E" + (Character 1 8 ()) + ) + (StringConstant + "uSPD" + (Character 1 4 ()) + )] + (List + (Character 1 5 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "oOa79jWcMx" + (Character 1 10 ()) + ) + (StringConstant + "yyAYZZ" + (Character 1 6 ()) + ) + (StringConstant + "wbvggXm" + (Character 1 7 ()) + ) + (StringConstant + "aE3BkCL4" + (Character 1 8 ()) + )] + (List + (Character 1 0 ()) + ) + ) + (ListConstant + [(StringConstant + "RdP" + (Character 1 3 ()) + ) + (StringConstant + "Hwc0x9RZ" + (Character 1 8 ()) + ) + (StringConstant + "sy" + (Character 1 2 ()) + ) + (StringConstant + "9" + (Character 1 1 ()) + ) + (StringConstant + "W1d9xA2BXe" + (Character 1 10 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "A" + (Character 1 1 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "QnK" + (Character 1 3 ()) + ) + (StringConstant + "N5tzN" + (Character 1 5 ()) + ) + (StringConstant + "ou7Lp" + (Character 1 5 ()) + )] + (List + (Character 1 1 ()) + ) + )] + (List + (List + (Character 1 8 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "DL68rDF" + (Character 1 7 ()) + ) + (StringConstant + "v" + (Character 1 1 ()) + ) + (StringConstant + "kQ3Mxm" + (Character 1 6 ()) + ) + (StringConstant + "g" + (Character 1 1 ()) + ) + (StringConstant + "6KTeF4Eo" + (Character 1 8 ()) + )] + (List + (Character 1 7 ()) + ) + ) + (ListConstant + [(StringConstant + "Hx9" + (Character 1 3 ()) + ) + (StringConstant + "Y1IzQm85Z4" + (Character 1 10 ()) + ) + (StringConstant + "3D8" + (Character 1 3 ()) + ) + (StringConstant + "ZLZ5" + (Character 1 4 ()) + ) + (StringConstant + "rWn" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "LtT" + (Character 1 3 ()) + ) + (StringConstant + "Dh5B" + (Character 1 4 ()) + ) + (StringConstant + "M" + (Character 1 1 ()) + ) + (StringConstant + "F" + (Character 1 1 ()) + ) + (StringConstant + "QTARbY" + (Character 1 6 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "Sh" + (Character 1 2 ()) + ) + (StringConstant + "WL" + (Character 1 2 ()) + ) + (StringConstant + "yvAfWvZSx1" + (Character 1 10 ()) + ) + (StringConstant + "90yx" + (Character 1 4 ()) + ) + (StringConstant + "v" + (Character 1 1 ()) + )] + (List + (Character 1 2 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "7IBW" + (Character 1 4 ()) + ) + (StringConstant + "nI" + (Character 1 2 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "6Cbp5c8RT" + (Character 1 9 ()) + )] + (List + (Character 1 0 ()) + ) + )] + (List + (List + (Character 1 7 ()) + ) + ) + )] + (List + (List + (List + (Character 1 2 ()) + ) + ) + ) + ) + () + ) + (Print + () + [(Var 6 p)] + () + () + ) + (Print + () + [(Var 6 q)] + () + () + ) + (Print + () + [(Var 6 r)] + () + () + )] + () + Public + .false. + .false. + () + ), + test_print_list_tuple: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + Local + () + () + Default + (List + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Tuple + [(List + (Character 1 -2 ()) + ) + (List + (Integer 4) + ) + (Real 8)] + ) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 5 + b1 + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 5 + b2 + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (List + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_print_list_tuple + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 a) + (ListConstant + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 5 (Integer 4)) + (IntegerConstant 6 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + )] + (List + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + ) + () + ) + (= + (Var 5 c) + (ListConstant + [(ListConstant + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (StringConstant + "a" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + (TupleConstant + [(IntegerConstant 2 (Integer 4)) + (StringConstant + "b" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + )] + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + ) + (ListConstant + [(TupleConstant + [(IntegerConstant 3 (Integer 4)) + (StringConstant + "c" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + (TupleConstant + [(IntegerConstant 4 (Integer 4)) + (StringConstant + "d" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + )] + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + )] + (List + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + ) + ) + () + ) + (= + (Var 5 b1) + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "bb" + (Character 1 2 ()) + ) + (StringConstant + "ccc" + (Character 1 3 ()) + ) + (StringConstant + "dddd" + (Character 1 4 ()) + ) + (StringConstant + "eeeee" + (Character 1 5 ()) + )] + (List + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 5 b2) + (ListConstant + [(IntegerConstant 10 (Integer 4)) + (IntegerConstant 20 (Integer 4)) + (IntegerConstant 30 (Integer 4)) + (IntegerConstant 40 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 5 b) + (TupleConstant + [(Var 5 b1) + (Var 5 b2) + (RealConstant + 6.030500 + (Real 8) + )] + (Tuple + [(List + (Character 1 -2 ()) + ) + (List + (Integer 4) + ) + (Real 8)] + ) + ) + () + ) + (Print + () + [(Var 5 a) + (Var 5 b)] + () + () + ) + (Print + () + [(Var 5 c) + (Var 5 b1) + (Var 5 b2) + (RealConstant + 3.420000 + (Real 8) + ) + (StringConstant + "okay" + (Character 1 4 ()) + ) + (LogicalConstant + .true. + (Logical 4) + ) + (IntegerConstant 14483 (Integer 4))] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-print_list_tuple_03-9de3736.json b/tests/reference/asr-print_list_tuple_03-9de3736.json new file mode 100644 index 0000000000..74cc19ed51 --- /dev/null +++ b/tests/reference/asr-print_list_tuple_03-9de3736.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-print_list_tuple_03-9de3736", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/print_list_tuple_03.py", + "infile_hash": "5131d7b6049e22c278ad41494969ff1f70c1dc811313032a9fcf58f3", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-print_list_tuple_03-9de3736.stdout", + "stdout_hash": "bc2f13615265f5b0339b735e2dfb39050221bf4dc5c026f118259d7e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-print_list_tuple_03-9de3736.stdout b/tests/reference/asr-print_list_tuple_03-9de3736.stdout new file mode 100644 index 0000000000..aff4796d0e --- /dev/null +++ b/tests/reference/asr-print_list_tuple_03-9de3736.stdout @@ -0,0 +1,244 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Dict + (Integer 4) + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Dict + (Integer 4) + (List + (Integer 4) + ) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (DictConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + )] + (Dict + (Integer 4) + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + ) + () + ) + (= + (Var 3 y) + (DictConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + [(ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + )] + (Dict + (Integer 4) + (List + (Integer 4) + ) + ) + ) + () + ) + (Print + () + [(DictItem + (Var 3 x) + (IntegerConstant 1 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (DictItem + (Var 3 x) + (IntegerConstant 2 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (DictItem + (Var 3 y) + (IntegerConstant 1 (Integer 4)) + () + (List + (Integer 4) + ) + () + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-set1-b7b913a.json b/tests/reference/asr-set1-b7b913a.json new file mode 100644 index 0000000000..3f8600d01f --- /dev/null +++ b/tests/reference/asr-set1-b7b913a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-set1-b7b913a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/set1.py", + "infile_hash": "63b5dc6a1f9c17099f1b10c8c45fcac1e50319ca8efbf7c283060abb", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-set1-b7b913a.stdout", + "stdout_hash": "5cedd001b9359adb6bbe66fb49cbbcdb2b13fbc5eae198660c91a996", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-set1-b7b913a.stdout b/tests/reference/asr-set1-b7b913a.stdout new file mode 100644 index 0000000000..ed54f5debe --- /dev/null +++ b/tests/reference/asr-set1-b7b913a.stdout @@ -0,0 +1,186 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_Set: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Set + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Set + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_Set + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (SetConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (Set + (Integer 4) + ) + ) + () + ) + (= + (Var 3 a) + (SetConstant + [(IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + (IntegerConstant 5 (Integer 4))] + (Set + (Integer 4) + ) + ) + () + ) + (Expr + (IntrinsicScalarFunction + SetAdd + [(Var 3 a) + (IntegerConstant 9 (Integer 4))] + 0 + () + () + ) + ) + (Expr + (IntrinsicScalarFunction + SetRemove + [(Var 3 a) + (IntegerConstant 4 (Integer 4))] + 0 + () + () + ) + ) + (= + (Var 3 b) + (SetConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + )] + (Set + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 3 s) + (SetPop + (Var 3 b) + (Character 1 -2 ()) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-string_01-78629c4.json b/tests/reference/asr-string_01-78629c4.json new file mode 100644 index 0000000000..8cf78f4a79 --- /dev/null +++ b/tests/reference/asr-string_01-78629c4.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-string_01-78629c4", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/string_01.py", + "infile_hash": "92496679f4475e3351686f6556f0e68411437beed22a447f9a65bfdf", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-string_01-78629c4.stderr", + "stderr_hash": "29aa01d7370a20ada91bdb13c569434f36a0c18309700d946d89fbf0", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-string_01-78629c4.stderr b/tests/reference/asr-string_01-78629c4.stderr new file mode 100644 index 0000000000..4abe3b2eb9 --- /dev/null +++ b/tests/reference/asr-string_01-78629c4.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in index, expected a single integer or slice + --> tests/errors/string_01.py:3:13 + | +3 | print(x[2, 5]) + | ^^^^ type mismatch (found: 'tuple[i32, i32]', expected: 'i32' or slice) diff --git a/tests/reference/asr-string_02-499c9ff.json b/tests/reference/asr-string_02-499c9ff.json new file mode 100644 index 0000000000..4eaad46910 --- /dev/null +++ b/tests/reference/asr-string_02-499c9ff.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-string_02-499c9ff", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/string_02.py", + "infile_hash": "ed6511565e893791a4bd8ea0b4750817bab13cd6dc0731332127bf58", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-string_02-499c9ff.stderr", + "stderr_hash": "85593e60baa6c6f930b7486a92e41fac9943108966abdacb7acb39ef", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-string_02-499c9ff.stderr b/tests/reference/asr-string_02-499c9ff.stderr new file mode 100644 index 0000000000..7ca613cb8c --- /dev/null +++ b/tests/reference/asr-string_02-499c9ff.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/string_02.py:6:15 + | +6 | res:str = x.join(p) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-structs_01-0893e35.json b/tests/reference/asr-structs_01-0893e35.json new file mode 100644 index 0000000000..b415cd4e5b --- /dev/null +++ b/tests/reference/asr-structs_01-0893e35.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_01-0893e35", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_01.py", + "infile_hash": "9342dd6345fb71bbbfb1c41e643530c58493758d08774f838b1c85e0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_01-0893e35.stderr", + "stderr_hash": "6f58b337cbc9cb1832e2ecba47fdad4b64e4484b913e29f61c64dbea", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-0893e35.stderr b/tests/reference/asr-structs_01-0893e35.stderr new file mode 100644 index 0000000000..12892d04eb --- /dev/null +++ b/tests/reference/asr-structs_01-0893e35.stderr @@ -0,0 +1,5 @@ +semantic error: Alignment 5 is not a positive power of 2. + --> tests/errors/structs_01.py:3:17 + | +3 | @packed(aligned=5) + | ^ diff --git a/tests/reference/asr-structs_01-66dc2c9.json b/tests/reference/asr-structs_01-66dc2c9.json new file mode 100644 index 0000000000..d82e944dc9 --- /dev/null +++ b/tests/reference/asr-structs_01-66dc2c9.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_01-66dc2c9", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/structs_01.py", + "infile_hash": "3b94e692a074b226736f068daf39c876f113277a73468bd21c01d3cc", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_01-66dc2c9.stdout", + "stdout_hash": "7996e199fb4e186baf6f87ea3e596a417bcc23ab748eaffa82c89a65", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-66dc2c9.stdout b/tests/reference/asr-structs_01-66dc2c9.stdout new file mode 100644 index 0000000000..f93e577681 --- /dev/null +++ b/tests/reference/asr-structs_01-66dc2c9.stdout @@ -0,0 +1,190 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + S: + (StructType + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + S + [] + [x + y] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 4 + { + s: + (Variable + 4 + s + [] + Local + () + () + Default + (Struct + 2 S + ) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 s) + (StructTypeConstructor + 2 S + [((IntegerConstant 2 (Integer 4))) + (())] + (Struct + 2 S + ) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-structs_01-be14d49.json b/tests/reference/asr-structs_01-be14d49.json new file mode 100644 index 0000000000..72184b64bf --- /dev/null +++ b/tests/reference/asr-structs_01-be14d49.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_01-be14d49", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_01.py", + "infile_hash": "9f36a4abcc3a50ccc10df1f6b04998b7a20041853142c85a2e86b724", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_01-be14d49.stdout", + "stdout_hash": "218ab5e7739164434c7c772962ada9767d7294eabe2a6878facf4e76", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_01-be14d49.stdout b/tests/reference/asr-structs_01-be14d49.stdout new file mode 100644 index 0000000000..a368f08a0f --- /dev/null +++ b/tests/reference/asr-structs_01-be14d49.stdout @@ -0,0 +1,535 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [y + x] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 2 g + () + [] + () + )] + () + Public + .false. + .false. + () + ), + change_struct: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + InOut + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ) + }) + change_struct + (FunctionType + [(Struct + 2 A + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 a)] + [(= + (StructInstanceMember + (Var 5 a) + 3 x + (Integer 4) + () + ) + (IntegerBinOp + (StructInstanceMember + (Var 5 a) + 3 x + (Integer 4) + () + ) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (StructInstanceMember + (Var 5 a) + 3 y + (Real 4) + () + ) + (RealBinOp + (StructInstanceMember + (Var 5 a) + 3 y + (Real 4) + () + ) + Add + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToReal + (Real 4) + (RealConstant + 1.000000 + (Real 4) + ) + ) + (Real 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + In + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Struct + 2 A + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 a)] + [(Print + () + [(StructInstanceMember + (Var 4 a) + 3 x + (Integer 4) + () + )] + () + () + ) + (Print + () + [(StructInstanceMember + (Var 4 a) + 3 y + (Real 4) + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 6 + { + x: + (Variable + 6 + x + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + change_struct] + [] + [(= + (Var 6 x) + (StructTypeConstructor + 2 A + [((Cast + (RealConstant + 3.250000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.250000 + (Real 4) + ) + )) + ((IntegerConstant 3 (Integer 4)))] + (Struct + 2 A + ) + () + ) + () + ) + (SubroutineCall + 2 f + () + [((Var 6 x))] + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 6 x) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 6 x) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 3.250000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (StructInstanceMember + (Var 6 x) + 3 x + (Integer 4) + () + ) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (StructInstanceMember + (Var 6 x) + 3 y + (Real 4) + () + ) + (Cast + (RealConstant + 5.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.500000 + (Real 4) + ) + ) + () + ) + (SubroutineCall + 2 f + () + [((Var 6 x))] + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 6 x) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 6 x) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 5.500000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (SubroutineCall + 2 change_struct + () + [((Var 6 x))] + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 6 x) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 6 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 6 x) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 6.500000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-structs_02-2ab459a.json b/tests/reference/asr-structs_02-2ab459a.json new file mode 100644 index 0000000000..86b6a594f9 --- /dev/null +++ b/tests/reference/asr-structs_02-2ab459a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_02-2ab459a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_02.py", + "infile_hash": "281bc75fb743f18fb6f011b278d7ab8103cc688f5856a59cb1f54895", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_02-2ab459a.stdout", + "stdout_hash": "0b6313bb78db340840b2865b32eac8165152b998c834c91c569bf78f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_02-2ab459a.stdout b/tests/reference/asr-structs_02-2ab459a.stdout new file mode 100644 index 0000000000..035867aff5 --- /dev/null +++ b/tests/reference/asr-structs_02-2ab459a.stdout @@ -0,0 +1,403 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [x + y] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 7 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 2 g + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + In + () + () + Default + (CPtr) + () + BindC + Public + Required + .true. + ), + a1: + (Variable + 4 + a1 + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 4 + a2 + [] + Local + () + () + Default + (Pointer + (Struct + 2 A + ) + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(CPtr)] + () + BindC + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 a)] + [(= + (Var 4 a1) + (StructTypeConstructor + 2 A + [((IntegerConstant 3 (Integer 4))) + ((Cast + (RealConstant + 3.250000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.250000 + (Real 4) + ) + ))] + (Struct + 2 A + ) + () + ) + () + ) + (= + (Var 4 a2) + (GetPointer + (Var 4 a1) + (Pointer + (Struct + 2 A + ) + ) + () + ) + () + ) + (Print + () + [(Var 4 a2) + (GetPointer + (Var 4 a1) + (Pointer + (Struct + 2 A + ) + ) + () + )] + () + () + ) + (= + (Var 4 x) + (StructInstanceMember + (Var 4 a2) + 3 x + (Integer 4) + () + ) + () + ) + (= + (Var 4 y) + (StructInstanceMember + (Var 4 a2) + 3 y + (Real 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 x) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (Var 4 y) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 3.250000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 5 + { + b: + (Variable + 5 + b + [] + Local + () + () + Default + (CPtr) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(= + (Var 5 b) + (PointerNullConstant + (CPtr) + ) + () + ) + (SubroutineCall + 2 f + () + [((Var 5 b))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 8 + { + __main__global_stmts: + (ExternalSymbol + 8 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 8 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-structs_02-f95782c.json b/tests/reference/asr-structs_02-f95782c.json new file mode 100644 index 0000000000..c7ea7537c1 --- /dev/null +++ b/tests/reference/asr-structs_02-f95782c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_02-f95782c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_02.py", + "infile_hash": "bc4446b7b96cad60bb368378e7af4a8f628bfaaecac2063a1bec5c06", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_02-f95782c.stderr", + "stderr_hash": "832411f3c9770493283e58b9017703a7d1cd178f42a19da6f8a38571", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_02-f95782c.stderr b/tests/reference/asr-structs_02-f95782c.stderr new file mode 100644 index 0000000000..e087537e57 --- /dev/null +++ b/tests/reference/asr-structs_02-f95782c.stderr @@ -0,0 +1,5 @@ +semantic error: `s` must be initialized with an instance of struct S + --> tests/errors/structs_02.py:8:5 + | +8 | s: S + | ^^^^ diff --git a/tests/reference/asr-structs_03-0cef911.json b/tests/reference/asr-structs_03-0cef911.json new file mode 100644 index 0000000000..e57082150f --- /dev/null +++ b/tests/reference/asr-structs_03-0cef911.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_03-0cef911", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_03.py", + "infile_hash": "dbd0eac675f958a27a7a4e4a7de3b04402073ecd2d483df75f51eb80", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_03-0cef911.stdout", + "stdout_hash": "b2a00a060603229dc89344c1f93407c95b95ef9980a64171d19aeb57", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_03-0cef911.stdout b/tests/reference/asr-structs_03-0cef911.stdout new file mode 100644 index 0000000000..ed733a3e3c --- /dev/null +++ b/tests/reference/asr-structs_03-0cef911.stdout @@ -0,0 +1,384 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [x + y] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 7 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 2 g + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 4 + { + pa: + (Variable + 4 + pa + [] + In + () + () + Default + (Pointer + (Struct + 2 A + ) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Pointer + (Struct + 2 A + ) + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 pa)] + [(Print + () + [(StructInstanceMember + (Var 4 pa) + 3 x + (Integer 4) + () + )] + () + () + ) + (Print + () + [(StructInstanceMember + (Var 4 pa) + 3 y + (Real 4) + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 5 + { + x: + (Variable + 5 + x + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + xp: + (Variable + 5 + xp + [] + Local + () + () + Default + (Pointer + (Struct + 2 A + ) + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(= + (Var 5 x) + (StructTypeConstructor + 2 A + [((IntegerConstant 3 (Integer 4))) + ((Cast + (RealConstant + 3.250000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.250000 + (Real 4) + ) + ))] + (Struct + 2 A + ) + () + ) + () + ) + (= + (Var 5 xp) + (GetPointer + (Var 5 x) + (Pointer + (Struct + 2 A + ) + ) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 5 xp) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 5 xp) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 3.250000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (StructInstanceMember + (Var 5 xp) + 3 x + (Integer 4) + () + ) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (StructInstanceMember + (Var 5 xp) + 3 y + (Real 4) + () + ) + (Cast + (RealConstant + 5.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.500000 + (Real 4) + ) + ) + () + ) + (SubroutineCall + 2 f + () + [((Var 5 xp))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 8 + { + __main__global_stmts: + (ExternalSymbol + 8 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 8 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-structs_03-754fb64.json b/tests/reference/asr-structs_03-754fb64.json new file mode 100644 index 0000000000..7050595260 --- /dev/null +++ b/tests/reference/asr-structs_03-754fb64.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_03-754fb64", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_03.py", + "infile_hash": "19180d0a7a22141e74e61452cc6cc185f1dd1c4f4315446450ce98db", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_03-754fb64.stderr", + "stderr_hash": "c6410f9948863d922cb0a0cd36613c529ad45fdf556d393d36e2df07", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_03-754fb64.stderr b/tests/reference/asr-structs_03-754fb64.stderr new file mode 100644 index 0000000000..2a1c1c0d91 --- /dev/null +++ b/tests/reference/asr-structs_03-754fb64.stderr @@ -0,0 +1,5 @@ +semantic error: Member 'y' not found in struct + --> tests/errors/structs_03.py:8:14 + | +8 | s: S = S(y=2) + | ^^^ diff --git a/tests/reference/asr-structs_04-387747b.json b/tests/reference/asr-structs_04-387747b.json new file mode 100644 index 0000000000..d09bcbac44 --- /dev/null +++ b/tests/reference/asr-structs_04-387747b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_04-387747b", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_04.py", + "infile_hash": "1e20c2ac044ab88183c50ecb481ac7c50992ed622f8bb94772c6df25", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_04-387747b.stdout", + "stdout_hash": "09d05bf16bc1779c18c3bd66defec27c181a2115e9a0e52affaaf17c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_04-387747b.stdout b/tests/reference/asr-structs_04-387747b.stdout new file mode 100644 index 0000000000..eff3d9f9de --- /dev/null +++ b/tests/reference/asr-structs_04-387747b.stdout @@ -0,0 +1,648 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [y + x] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + B: + (StructType + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + B + [A] + [z + a] + Source + Public + .false. + .false. + [(()) + ((StructTypeConstructor + 2 A + [((Cast + (RealConstant + 0.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000000 + (Real 4) + ) + )) + ((IntegerConstant 0 (Integer 4)))] + (Struct + 2 A + ) + () + ))] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 9 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 2 g + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 5 + { + b: + (Variable + 5 + b + [] + In + () + () + Default + (Struct + 2 B + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Struct + 2 B + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 b)] + [(Print + () + [(StructInstanceMember + (Var 5 b) + 4 z + (Integer 4) + () + ) + (StructInstanceMember + (StructInstanceMember + (Var 5 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 x + (Integer 4) + () + ) + (StructInstanceMember + (StructInstanceMember + (Var 5 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 y + (Real 4) + () + )] + () + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 5 b) + 4 z + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (StructInstanceMember + (Var 5 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (StructInstanceMember + (Var 5 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 3.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 6 + { + a1: + (Variable + 6 + a1 + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 6 + a2 + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 6 + b + [] + Local + () + () + Default + (Struct + 2 B + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(= + (Var 6 a1) + (StructTypeConstructor + 2 A + [((Cast + (RealConstant + 1.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.000000 + (Real 4) + ) + )) + ((IntegerConstant 1 (Integer 4)))] + (Struct + 2 A + ) + () + ) + () + ) + (= + (Var 6 a2) + (StructTypeConstructor + 2 A + [((Cast + (RealConstant + 2.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 2.000000 + (Real 4) + ) + )) + ((IntegerConstant 2 (Integer 4)))] + (Struct + 2 A + ) + () + ) + () + ) + (= + (Var 6 b) + (StructTypeConstructor + 2 B + [((IntegerConstant 1 (Integer 4))) + ((Var 6 a1))] + (Struct + 2 B + ) + () + ) + () + ) + (= + (StructInstanceMember + (Var 6 b) + 4 a + (Struct + 2 A + ) + () + ) + (Var 6 a2) + () + ) + (= + (StructInstanceMember + (Var 6 b) + 4 z + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (StructInstanceMember + (StructInstanceMember + (Var 6 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 x + (Integer 4) + () + ) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (StructInstanceMember + (StructInstanceMember + (Var 6 b) + 4 a + (Struct + 2 A + ) + () + ) + 3 y + (Real 4) + () + ) + (Cast + (RealConstant + 3.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.000000 + (Real 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 6 a1) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 6 a1) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 1.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 6 a2) + 3 x + (Integer 4) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (StructInstanceMember + (Var 6 a2) + 3 y + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 2.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (SubroutineCall + 2 f + () + [((Var 6 b))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 10 + { + __main__global_stmts: + (ExternalSymbol + 10 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 10 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-structs_04-7b864bc.json b/tests/reference/asr-structs_04-7b864bc.json new file mode 100644 index 0000000000..c188040d2f --- /dev/null +++ b/tests/reference/asr-structs_04-7b864bc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_04-7b864bc", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_04.py", + "infile_hash": "5951c49d2d7f143bbe3d67b982770ceb6d709939eb2d5ed544888f16", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_04-7b864bc.stderr", + "stderr_hash": "e4e04a1a30ae38b6587c4c3ad12a7e83839c63938c025a3884f62ef8", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_04-7b864bc.stderr b/tests/reference/asr-structs_04-7b864bc.stderr new file mode 100644 index 0000000000..906b24c606 --- /dev/null +++ b/tests/reference/asr-structs_04-7b864bc.stderr @@ -0,0 +1,5 @@ +semantic error: S() got multiple values for argument 'x' + --> tests/errors/structs_04.py:9:18 + | +9 | s: S = S(24, x=2) + | ^^^ diff --git a/tests/reference/asr-structs_05-fa98307.json b/tests/reference/asr-structs_05-fa98307.json new file mode 100644 index 0000000000..e493825921 --- /dev/null +++ b/tests/reference/asr-structs_05-fa98307.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_05-fa98307", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_05.py", + "infile_hash": "ef1037b0936a63be679efd366920a94463900e80630a070ba440aa78", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_05-fa98307.stderr", + "stderr_hash": "9425960bac284eae21adb4274aa833960c505abd6bd546f896da0216", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_05-fa98307.stderr b/tests/reference/asr-structs_05-fa98307.stderr new file mode 100644 index 0000000000..ffff18de12 --- /dev/null +++ b/tests/reference/asr-structs_05-fa98307.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/structs_05.py:2:1 + | +2 | from numpy import empty + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-structs_06-6e14537.json b/tests/reference/asr-structs_06-6e14537.json new file mode 100644 index 0000000000..7ef7f9dd33 --- /dev/null +++ b/tests/reference/asr-structs_06-6e14537.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_06-6e14537", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_06.py", + "infile_hash": "9f4273c5fb4469837f65003255dcdca067c5c17735d0642757fd069c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_06-6e14537.stderr", + "stderr_hash": "8e0da9c7e84854ce3d6ad79066a9fbb33d82c9fcde3af2a7baeccec8", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_06-6e14537.stderr b/tests/reference/asr-structs_06-6e14537.stderr new file mode 100644 index 0000000000..55d07bfb5e --- /dev/null +++ b/tests/reference/asr-structs_06-6e14537.stderr @@ -0,0 +1,5 @@ +semantic error: Struct constructor has more arguments than the number of struct members + --> tests/errors/structs_06.py:9:12 + | +9 | s: S = S(2, 3, 4, 5) + | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_07-83694b7.json b/tests/reference/asr-structs_07-83694b7.json new file mode 100644 index 0000000000..4c07fec19b --- /dev/null +++ b/tests/reference/asr-structs_07-83694b7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_07-83694b7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_07.py", + "infile_hash": "4e4f15d47dc5d9cdadd653567f6d105365b7fe20b194663c10b3802a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_07-83694b7.stderr", + "stderr_hash": "6b1e1646f11ee384e5dce1ded0d91751f7113eaea7c90da5c1bcf4ff", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_07-83694b7.stderr b/tests/reference/asr-structs_07-83694b7.stderr new file mode 100644 index 0000000000..13f0aaf0e1 --- /dev/null +++ b/tests/reference/asr-structs_07-83694b7.stderr @@ -0,0 +1,5 @@ +semantic error: Not enough arguments to S(), expected 2 + --> tests/errors/structs_07.py:9:12 + | +9 | s: S = S(y=2) + | ^^^^^^ diff --git a/tests/reference/asr-structs_08-fa4dbf0.json b/tests/reference/asr-structs_08-fa4dbf0.json new file mode 100644 index 0000000000..8f133e95a8 --- /dev/null +++ b/tests/reference/asr-structs_08-fa4dbf0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_08-fa4dbf0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_08.py", + "infile_hash": "7779919c90170eb5236c4eeef19bf673996fda618ee8c600b5ecba94", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_08-fa4dbf0.stderr", + "stderr_hash": "cf488d893463c941c43080cebb56591bd17c5bed4cb7acd97353d59a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_08-fa4dbf0.stderr b/tests/reference/asr-structs_08-fa4dbf0.stderr new file mode 100644 index 0000000000..89af7c314c --- /dev/null +++ b/tests/reference/asr-structs_08-fa4dbf0.stderr @@ -0,0 +1,5 @@ +semantic error: Struct constructor has more arguments than the number of struct members + --> tests/errors/structs_08.py:13:29 + | +13 | test_dude3 : StringIO = StringIO(integer_asr, 3, 5, 2) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_09-f3ffe08.json b/tests/reference/asr-structs_09-f3ffe08.json new file mode 100644 index 0000000000..0af164202d --- /dev/null +++ b/tests/reference/asr-structs_09-f3ffe08.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_09-f3ffe08", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_09.py", + "infile_hash": "06fb179f0c0c41124ffc960676a9f32cfe112ab4e39c6f6a7cb2a6e3", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_09-f3ffe08.stderr", + "stderr_hash": "f59ab2d213f6423e0a891e43d5a19e83d4405391b1c7bf481b4b939e", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_09-f3ffe08.stderr b/tests/reference/asr-structs_09-f3ffe08.stderr new file mode 100644 index 0000000000..c7265fdddc --- /dev/null +++ b/tests/reference/asr-structs_09-f3ffe08.stderr @@ -0,0 +1,5 @@ +semantic error: read not present in StringIO dataclass + --> tests/errors/structs_09.py:13:23 + | +13 | bytes_read: i32 = fd.read() + | ^^^^^^^^^ diff --git a/tests/reference/asr-structs_10-cb8a283.json b/tests/reference/asr-structs_10-cb8a283.json new file mode 100644 index 0000000000..6420f7ba94 --- /dev/null +++ b/tests/reference/asr-structs_10-cb8a283.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_10-cb8a283", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/structs_10.py", + "infile_hash": "3959983b756a75ff1711fa9501d33a283a511aae48dd9922ecf7ae20", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-structs_10-cb8a283.stderr", + "stderr_hash": "2b88127fdbc0c9e3798569cdfa4ef5745d6fce6aeba8fc3f6a1ace9f", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_10-cb8a283.stderr b/tests/reference/asr-structs_10-cb8a283.stderr new file mode 100644 index 0000000000..757e06a54e --- /dev/null +++ b/tests/reference/asr-structs_10-cb8a283.stderr @@ -0,0 +1,9 @@ +semantic error: Struct member functions are not supported + --> tests/errors/structs_10.py:7:5 - 8:24 + | +7 | def print_len(self: StringIO): + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... +... + | +8 | print(self._len) + | ...^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-structs_16-44de89a.json b/tests/reference/asr-structs_16-44de89a.json new file mode 100644 index 0000000000..76232fcc54 --- /dev/null +++ b/tests/reference/asr-structs_16-44de89a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-structs_16-44de89a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_16.py", + "infile_hash": "e87ea0ba10cb7fcd6ce2eb6d2e953a26dcd6a843f6cf4e891287dcb1", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-structs_16-44de89a.stdout", + "stdout_hash": "9ebf9426938d92178b3a8fdca450859753b0299d3b2b8cb48272469e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-structs_16-44de89a.stdout b/tests/reference/asr-structs_16-44de89a.stdout new file mode 100644 index 0000000000..3e13df611d --- /dev/null +++ b/tests/reference/asr-structs_16-44de89a.stdout @@ -0,0 +1,327 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + B: + (UnionType + (SymbolTable + 4 + { + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + B + [] + [x + y] + Source + Public + [(()) + (())] + () + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Union + 3 B + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [b + c] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_ordering] + [] + [(SubroutineCall + 2 test_ordering + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_ordering: + (Function + (SymbolTable + 5 + { + A_B: + (ExternalSymbol + 5 + A_B + 3 B + A + [] + B + Public + ), + ad: + (Variable + 5 + ad + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + bd: + (Variable + 5 + bd + [] + Local + () + () + Default + (Union + 5 A_B + ) + () + Source + Public + Required + .false. + ) + }) + test_ordering + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 bd) + (UnionTypeConstructor + 5 A_B + [] + (Union + 5 A_B + ) + () + ) + () + ) + (= + (UnionInstanceMember + (Var 5 bd) + 4 x + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 5 ad) + (StructTypeConstructor + 2 A + [((Var 5 bd)) + ((IntegerConstant 2 (Integer 4)))] + (Struct + 2 A + ) + () + ) + () + ) + (Assert + (IntegerCompare + (UnionInstanceMember + (StructInstanceMember + (Var 5 ad) + 3 b + (Union + 3 B + ) + () + ) + 4 x + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 5 ad) + 3 c + (Integer 4) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-subscript1-1acfc19.json b/tests/reference/asr-subscript1-1acfc19.json new file mode 100644 index 0000000000..acbacd1973 --- /dev/null +++ b/tests/reference/asr-subscript1-1acfc19.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-subscript1-1acfc19", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/subscript1.py", + "infile_hash": "5d229893d3e13ea4463e8ed47eb3798be0b8c28f5ef6b6c773e87b80", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-subscript1-1acfc19.stdout", + "stdout_hash": "cf02a18790b0e93084fa3adbaebdf78297064cc0575c946d00584151", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-subscript1-1acfc19.stdout b/tests/reference/asr-subscript1-1acfc19.stdout new file mode 100644 index 0000000000..9b615dffe7 --- /dev/null +++ b/tests/reference/asr-subscript1-1acfc19.stdout @@ -0,0 +1,335 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_subscript: + (Function + (SymbolTable + 3 + { + A: + (Variable + 3 + A + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + B: + (Variable + 3 + B + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_subscript + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (StringConstant + "abc" + (Character 1 3 ()) + ) + () + ) + (= + (Var 3 s) + (StringItem + (Var 3 s) + (IntegerBinOp + (IntegerConstant 0 (Integer 4)) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + () + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + () + () + () + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + () + () + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + () + () + (IntegerConstant 2 (Integer 4)) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 88 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + () + (IntegerConstant 1 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant -4 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + (IntegerUnaryMinus + (IntegerConstant 89 (Integer 4)) + (Integer 4) + (IntegerConstant -89 (Integer 4)) + ) + () + (IntegerConstant 4 (Integer 4)) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 s) + (StringSection + (Var 3 s) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + () + (Character 1 -2 ()) + () + ) + () + ) + (= + (Var 3 i) + (ArrayItem + (Var 3 A) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + () + ) + (= + (Var 3 B) + (ArraySection + (Var 3 A) + [((IntegerConstant 1 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + ())] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (= + (Var 3 B) + (ArraySection + (Var 3 A) + [((IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-test_annassign_01-2f18669.json b/tests/reference/asr-test_annassign_01-2f18669.json new file mode 100644 index 0000000000..a922445397 --- /dev/null +++ b/tests/reference/asr-test_annassign_01-2f18669.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_annassign_01-2f18669", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_annassign_01.py", + "infile_hash": "68f667b69b25d6a5f7f281a6dc7f2e2912511d8f4f20dbeab8442436", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_annassign_01-2f18669.stderr", + "stderr_hash": "f3609cdad6bdb1be4a138587d5d36d0a28b71e4e51bb1304c2d2a01f", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_01-2f18669.stderr b/tests/reference/asr-test_annassign_01-2f18669.stderr new file mode 100644 index 0000000000..7e8898e7ff --- /dev/null +++ b/tests/reference/asr-test_annassign_01-2f18669.stderr @@ -0,0 +1,5 @@ +semantic error: Unsupported type annotation: Optional + --> tests/errors/test_annassign_01.py:2:8 + | +2 | a: Optional[i32] = 5 + | ^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_02-accf6db.json b/tests/reference/asr-test_annassign_02-accf6db.json new file mode 100644 index 0000000000..0538c63237 --- /dev/null +++ b/tests/reference/asr-test_annassign_02-accf6db.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_annassign_02-accf6db", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_annassign_02.py", + "infile_hash": "419ee1ffc46f3b9fd99f008d4fdde20f4cc65cf82bbd234ad9fcc005", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_annassign_02-accf6db.stderr", + "stderr_hash": "3a426fad190cfcadc94dd971acc709446147d8a63658953bfbb94771", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_02-accf6db.stderr b/tests/reference/asr-test_annassign_02-accf6db.stderr new file mode 100644 index 0000000000..1cde913460 --- /dev/null +++ b/tests/reference/asr-test_annassign_02-accf6db.stderr @@ -0,0 +1,5 @@ +semantic error: Unsupported type annotation: Pattern + --> tests/errors/test_annassign_02.py:2:15 + | +2 | hex_pat : Pattern[str] = r'-?0[xX]+' + | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_03-f8c6160.json b/tests/reference/asr-test_annassign_03-f8c6160.json new file mode 100644 index 0000000000..43585bc3b4 --- /dev/null +++ b/tests/reference/asr-test_annassign_03-f8c6160.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_annassign_03-f8c6160", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_annassign_03.py", + "infile_hash": "aa787a87881a62595216dd4a7710bcf598550c100dda789794eb3c07", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_annassign_03-f8c6160.stderr", + "stderr_hash": "e87d692cc8404a7e66f41d61635f318e20003991138c3db5a0794884", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_03-f8c6160.stderr b/tests/reference/asr-test_annassign_03-f8c6160.stderr new file mode 100644 index 0000000000..5a89637eb4 --- /dev/null +++ b/tests/reference/asr-test_annassign_03-f8c6160.stderr @@ -0,0 +1,5 @@ +semantic error: Intent annotation 'InOut' cannot be used here + --> tests/errors/test_annassign_03.py:6:13 + | +6 | lexer : InOut[LasrLexer] = LasrLexer(5) + | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json new file mode 100644 index 0000000000..b9527150ed --- /dev/null +++ b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_annassign_type_mismatch-7dac7be", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_annassign_type_mismatch.py", + "infile_hash": "ada18a04b70771754e17e884cfa2ec7bd5651d88850ae034049ec7b9", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_annassign_type_mismatch-7dac7be.stderr", + "stderr_hash": "26fc89f95c7dda5f1d9c3cb1af9843880cf693eb7b97125372b11f80", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr new file mode 100644 index 0000000000..6fd7b199ea --- /dev/null +++ b/tests/reference/asr-test_annassign_type_mismatch-7dac7be.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/test_annassign_type_mismatch.py:4:5 + | +4 | x: i32[4] = [1, 2, 3, 4] + | ^ ^^^^^^^^^^^^ type mismatch ('i32[4]' and 'list[i32]') diff --git a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json new file mode 100644 index 0000000000..2bb48c32dd --- /dev/null +++ b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_annassign_type_mismatch2-fc883f7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_annassign_type_mismatch2.py", + "infile_hash": "40a5b3f96c7d228110c29dbb56eb03390c8741550408295a2e82d7b0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_annassign_type_mismatch2-fc883f7.stderr", + "stderr_hash": "873b4521e2155bc92405db41e7745a4fb5441b5d80f94467d7b1b637", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr new file mode 100644 index 0000000000..2a4f9ccd10 --- /dev/null +++ b/tests/reference/asr-test_annassign_type_mismatch2-fc883f7.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/test_annassign_type_mismatch2.py:4:5 + | +4 | x: f64[5] = [1.0, 2.0, 3.0, 4.0, 5.0] + | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('f64[5]' and 'list[f64]') diff --git a/tests/reference/asr-test_append_type_mismatch-030e9c7.json b/tests/reference/asr-test_append_type_mismatch-030e9c7.json new file mode 100644 index 0000000000..e2edd78183 --- /dev/null +++ b/tests/reference/asr-test_append_type_mismatch-030e9c7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_append_type_mismatch-030e9c7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_append_type_mismatch.py", + "infile_hash": "d545fce3cd501b0c1bbf3f4a705a68a6f66356e4e6f9806dd0c4c9da", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_append_type_mismatch-030e9c7.stderr", + "stderr_hash": "6610c87a3c164e9cc8884eaf66397658c311199814689ebd4793c92a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr b/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr new file mode 100644 index 0000000000..a860db8a46 --- /dev/null +++ b/tests/reference/asr-test_append_type_mismatch-030e9c7.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in 'append', the types must be compatible + --> tests/errors/test_append_type_mismatch.py:6:14 + | +6 | l.append('a') + | ^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_assign1-a94d41e.json b/tests/reference/asr-test_assign1-a94d41e.json new file mode 100644 index 0000000000..35e6aa7403 --- /dev/null +++ b/tests/reference/asr-test_assign1-a94d41e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign1-a94d41e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign1.py", + "infile_hash": "597bccf2544fb5784bec1648830e4c4ae337bf6280768569125ee0b1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign1-a94d41e.stderr", + "stderr_hash": "cb4455d360373e13730d3a9fd5e2c551bd0f6640d066ceafd8841f9b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign1-a94d41e.stderr b/tests/reference/asr-test_assign1-a94d41e.stderr new file mode 100644 index 0000000000..abd1f376fa --- /dev/null +++ b/tests/reference/asr-test_assign1-a94d41e.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_assign1.py:6:5 + | +6 | a = b + | ^ ^ type mismatch ('list[i32]' and 'list[str]') diff --git a/tests/reference/asr-test_assign2-fa29029.json b/tests/reference/asr-test_assign2-fa29029.json new file mode 100644 index 0000000000..4603aee52e --- /dev/null +++ b/tests/reference/asr-test_assign2-fa29029.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign2-fa29029", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign2.py", + "infile_hash": "8bc6b05310146f174ce0e1810d03b78ca671a0fabf6699acda9043c8", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign2-fa29029.stderr", + "stderr_hash": "55f02e505bda066604eb94cec8bdc5081c7ec25e219f0ea46851100a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign2-fa29029.stderr b/tests/reference/asr-test_assign2-fa29029.stderr new file mode 100644 index 0000000000..6a0fbd1522 --- /dev/null +++ b/tests/reference/asr-test_assign2-fa29029.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_assign2.py:6:5 + | +6 | a = b + | ^ ^ type mismatch ('set[i32]' and 'set[str]') diff --git a/tests/reference/asr-test_assign3-cc6fc9d.json b/tests/reference/asr-test_assign3-cc6fc9d.json new file mode 100644 index 0000000000..5db5f77a33 --- /dev/null +++ b/tests/reference/asr-test_assign3-cc6fc9d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign3-cc6fc9d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign3.py", + "infile_hash": "4280362df6bea670ff1eddb1afc62ed80438c822bc204ff8759434fe", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign3-cc6fc9d.stderr", + "stderr_hash": "cff7850ce5507a70e7c730dd1ff23d16f8839dedac07d5b60a73a8b8", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign3-cc6fc9d.stderr b/tests/reference/asr-test_assign3-cc6fc9d.stderr new file mode 100644 index 0000000000..abec0f4c51 --- /dev/null +++ b/tests/reference/asr-test_assign3-cc6fc9d.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_assign3.py:6:5 + | +6 | a = b + | ^ ^ type mismatch ('list[i32]' and 'set[i32]') diff --git a/tests/reference/asr-test_assign4-a2136e0.json b/tests/reference/asr-test_assign4-a2136e0.json new file mode 100644 index 0000000000..e09dfa9249 --- /dev/null +++ b/tests/reference/asr-test_assign4-a2136e0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign4-a2136e0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign4.py", + "infile_hash": "9e1e5ce063f88194008db998896cebd0fabe6dcb4cbda27c17de27da", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign4-a2136e0.stderr", + "stderr_hash": "a871819fb4bd2139f16a7407208ea210276e5b12c9f13ae442132483", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign4-a2136e0.stderr b/tests/reference/asr-test_assign4-a2136e0.stderr new file mode 100644 index 0000000000..43d32d2933 --- /dev/null +++ b/tests/reference/asr-test_assign4-a2136e0.stderr @@ -0,0 +1,5 @@ +semantic error: Assigning integer to float is not supported + --> tests/errors/test_assign4.py:7:9 + | +7 | f = x + | ^ diff --git a/tests/reference/asr-test_assign5-694a98f.json b/tests/reference/asr-test_assign5-694a98f.json new file mode 100644 index 0000000000..312c85ffed --- /dev/null +++ b/tests/reference/asr-test_assign5-694a98f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign5-694a98f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign5.py", + "infile_hash": "41144111ae3dad56feed42b1b148334a8faef310fbbabde10f3af8df", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign5-694a98f.stderr", + "stderr_hash": "172b2f13e9b7670cbdd718452713fb15ed4bcd19f6193d328e459fbe", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign5-694a98f.stderr b/tests/reference/asr-test_assign5-694a98f.stderr new file mode 100644 index 0000000000..0847cb828c --- /dev/null +++ b/tests/reference/asr-test_assign5-694a98f.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_assign5.py:6:5 + | +6 | x = y + | ^ ^ type mismatch ('list[list[i32]]' and 'list[list[str]]') diff --git a/tests/reference/asr-test_assign6-05cd64f.json b/tests/reference/asr-test_assign6-05cd64f.json new file mode 100644 index 0000000000..4bab9d7802 --- /dev/null +++ b/tests/reference/asr-test_assign6-05cd64f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign6-05cd64f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign6.py", + "infile_hash": "6837d07201b8680dbb63908d3ad27e4e9bfb1f1ff77b4bd6a77eddcf", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign6-05cd64f.stderr", + "stderr_hash": "5bc5e0f7454a31bb924cf1318c59e73da2446502181b92faffd9f5d4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign6-05cd64f.stderr b/tests/reference/asr-test_assign6-05cd64f.stderr new file mode 100644 index 0000000000..3eb1a1d84e --- /dev/null +++ b/tests/reference/asr-test_assign6-05cd64f.stderr @@ -0,0 +1,5 @@ +semantic error: 'str' object does not support item assignment + --> tests/errors/test_assign6.py:4:5 + | +4 | s[0] = 'f' + | ^^^^ diff --git a/tests/reference/asr-test_assign7-beebac3.json b/tests/reference/asr-test_assign7-beebac3.json new file mode 100644 index 0000000000..e5197e2be8 --- /dev/null +++ b/tests/reference/asr-test_assign7-beebac3.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign7-beebac3", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign7.py", + "infile_hash": "e54f67638add63131760d5eadda7e3944b34addacffa27d6fb45e128", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign7-beebac3.stderr", + "stderr_hash": "109f7da7ac86c0c2add0ff034655336396cb58ebe81570c1d0ce6e81", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign7-beebac3.stderr b/tests/reference/asr-test_assign7-beebac3.stderr new file mode 100644 index 0000000000..87c04ca904 --- /dev/null +++ b/tests/reference/asr-test_assign7-beebac3.stderr @@ -0,0 +1,5 @@ +semantic error: 'tuple[i32, i32]' object does not support item assignment + --> tests/errors/test_assign7.py:4:5 + | +4 | t[0] = 3 + | ^^^^ diff --git a/tests/reference/asr-test_assign8-4b26e63.json b/tests/reference/asr-test_assign8-4b26e63.json new file mode 100644 index 0000000000..3b0ecbbcd1 --- /dev/null +++ b/tests/reference/asr-test_assign8-4b26e63.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign8-4b26e63", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign8.py", + "infile_hash": "e7f5e3dd10847a04fc4634a70fb7908f4360a0b71c1f6718f7beeee9", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign8-4b26e63.stderr", + "stderr_hash": "900fcd6359806b1e7ab41b6c5c4eb252bdbab6e96404912b710a8682", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign8-4b26e63.stderr b/tests/reference/asr-test_assign8-4b26e63.stderr new file mode 100644 index 0000000000..e320bd3600 --- /dev/null +++ b/tests/reference/asr-test_assign8-4b26e63.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_assign8.py:5:13 + | +5 | c = c32(complex(3, 4)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_assign9-51278b8.json b/tests/reference/asr-test_assign9-51278b8.json new file mode 100644 index 0000000000..2f05c4e5e5 --- /dev/null +++ b/tests/reference/asr-test_assign9-51278b8.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_assign9-51278b8", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_assign9.py", + "infile_hash": "3aa4fda6489ce46f10fd95cd257f5d29a59629fc340d6d8ea5e983d8", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_assign9-51278b8.stderr", + "stderr_hash": "602e4fa615e929bad9586849d2a5167741930e56db6373cdca3695d0", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_assign9-51278b8.stderr b/tests/reference/asr-test_assign9-51278b8.stderr new file mode 100644 index 0000000000..f3c3e9716a --- /dev/null +++ b/tests/reference/asr-test_assign9-51278b8.stderr @@ -0,0 +1,5 @@ +semantic error: Assignment to an input function parameter `x` is not allowed + --> tests/errors/test_assign9.py:2:5 + | +2 | x = 2 + | ^ Hint: create a new local variable with a different name diff --git a/tests/reference/asr-test_binop1-50b63f6.json b/tests/reference/asr-test_binop1-50b63f6.json new file mode 100644 index 0000000000..343aa48bf2 --- /dev/null +++ b/tests/reference/asr-test_binop1-50b63f6.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_binop1-50b63f6", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_binop1.py", + "infile_hash": "00f511a03b5e9def195bcd88a2412fbd88205628460356ca2523ea30", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_binop1-50b63f6.stderr", + "stderr_hash": "6883d11d4de52f03fa684252229715e39aa52c830d186f787159faaa", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_binop1-50b63f6.stderr b/tests/reference/asr-test_binop1-50b63f6.stderr new file mode 100644 index 0000000000..67e6ee1aa1 --- /dev/null +++ b/tests/reference/asr-test_binop1-50b63f6.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in binary operator; the types must be compatible + --> tests/errors/test_binop1.py:6:11 + | +6 | print(x+s) + | ^ ^ type mismatch (i32 and str) diff --git a/tests/reference/asr-test_binop2-e5749af.json b/tests/reference/asr-test_binop2-e5749af.json new file mode 100644 index 0000000000..8de84da8ec --- /dev/null +++ b/tests/reference/asr-test_binop2-e5749af.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_binop2-e5749af", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_binop2.py", + "infile_hash": "f59bd668e0e7e0ac665c62d89eee87d8bcaa199e9f11825f38dad655", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_binop2-e5749af.stderr", + "stderr_hash": "3214693e7c1f71d8343f547e7a3ab0167b4f9310540009475d2f1c79", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_binop2-e5749af.stderr b/tests/reference/asr-test_binop2-e5749af.stderr new file mode 100644 index 0000000000..fe0d054eee --- /dev/null +++ b/tests/reference/asr-test_binop2-e5749af.stderr @@ -0,0 +1,5 @@ +semantic error: Division is not supported for string type + --> tests/errors/test_binop2.py:6:11 + | +6 | print(a/b) + | ^ ^ string not supported in division diff --git a/tests/reference/asr-test_binop3-a67201d.json b/tests/reference/asr-test_binop3-a67201d.json new file mode 100644 index 0000000000..b93163a529 --- /dev/null +++ b/tests/reference/asr-test_binop3-a67201d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_binop3-a67201d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_binop3.py", + "infile_hash": "eb43132639edd47d89802b8693880ed350800a88c7c5f94eb93a9b3b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_binop3-a67201d.stderr", + "stderr_hash": "00ec81e32ad3b0d4145714c7224146e9af7fd913aa87aa633667f4f2", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_binop3-a67201d.stderr b/tests/reference/asr-test_binop3-a67201d.stderr new file mode 100644 index 0000000000..ea6ee12b1c --- /dev/null +++ b/tests/reference/asr-test_binop3-a67201d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_binop3.py:5:9 + | +5 | y = complex(5)+100 + | ^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_bit_length-da3a264.json b/tests/reference/asr-test_bit_length-da3a264.json new file mode 100644 index 0000000000..56a237ac34 --- /dev/null +++ b/tests/reference/asr-test_bit_length-da3a264.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_bit_length-da3a264", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_bit_length.py", + "infile_hash": "877db12847eccaf31564c6a969e7703f16c9e03bc9c326e72c74f1e0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_bit_length-da3a264.stderr", + "stderr_hash": "0f371300055a9e3f6c01f73b1e276d9ae8007fd507eb0c75e1bda3ef", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_bit_length-da3a264.stderr b/tests/reference/asr-test_bit_length-da3a264.stderr new file mode 100644 index 0000000000..5820f4cd21 --- /dev/null +++ b/tests/reference/asr-test_bit_length-da3a264.stderr @@ -0,0 +1,5 @@ +semantic error: int.bit_length() takes no arguments + --> tests/errors/test_bit_length.py:4:11 + | +4 | print(x.bit_length(23)) + | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_bitwise_on_complex-dd9568b.json b/tests/reference/asr-test_bitwise_on_complex-dd9568b.json new file mode 100644 index 0000000000..7fa9b4be57 --- /dev/null +++ b/tests/reference/asr-test_bitwise_on_complex-dd9568b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_bitwise_on_complex-dd9568b", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_bitwise_on_complex.py", + "infile_hash": "48f71d8eae47a14316e9e7aba182a4a03ff8cc05ae661b8e6d41dc85", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_bitwise_on_complex-dd9568b.stderr", + "stderr_hash": "58f7acb7f7187308d38c7c97fcd9e34b2022c42be1b6583b95b379af", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr b/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr new file mode 100644 index 0000000000..7bb1052707 --- /dev/null +++ b/tests/reference/asr-test_bitwise_on_complex-dd9568b.stderr @@ -0,0 +1,5 @@ +semantic error: Unsupported binary operation on complex: '|' + --> tests/errors/test_bitwise_on_complex.py:8:11 + | +8 | print(c1 | c2) + | ^^^^^^^ diff --git a/tests/reference/asr-test_bitwise_on_float-2e09b30.json b/tests/reference/asr-test_bitwise_on_float-2e09b30.json new file mode 100644 index 0000000000..df6b412bad --- /dev/null +++ b/tests/reference/asr-test_bitwise_on_float-2e09b30.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_bitwise_on_float-2e09b30", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_bitwise_on_float.py", + "infile_hash": "50e0d4c18ad2fe0db0aedfaa5b3db792db545aeb8ef09a4cb7c4f193", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_bitwise_on_float-2e09b30.stderr", + "stderr_hash": "1e77fcf2484ec7c10436c14ac2a498db59706d30d3c294b89b6b9090", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr b/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr new file mode 100644 index 0000000000..d6733722d6 --- /dev/null +++ b/tests/reference/asr-test_bitwise_on_float-2e09b30.stderr @@ -0,0 +1,5 @@ +semantic error: Unsupported binary operation on floats: '<<' + --> tests/errors/test_bitwise_on_float.py:8:11 + | +8 | print(f1 << f2) + | ^^^^^^^^ diff --git a/tests/reference/asr-test_bool_binop-f856ef0.json b/tests/reference/asr-test_bool_binop-f856ef0.json new file mode 100644 index 0000000000..358216f8de --- /dev/null +++ b/tests/reference/asr-test_bool_binop-f856ef0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_bool_binop-f856ef0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_bool_binop.py", + "infile_hash": "7c44fe2915b3871b3b85edf3ab129d87a75fa4b9acbb597ae801daf9", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_bool_binop-f856ef0.stderr", + "stderr_hash": "7e1f44ed79212fae132aca28b495a511f27ee327b9bf88b797502eff", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stderr b/tests/reference/asr-test_bool_binop-f856ef0.stderr new file mode 100644 index 0000000000..725d3bd642 --- /dev/null +++ b/tests/reference/asr-test_bool_binop-f856ef0.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_bool_binop.py:14:13 + | +14 | i = i32(True // True) + | ^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin-aa64615.json b/tests/reference/asr-test_builtin-aa64615.json new file mode 100644 index 0000000000..475363bfce --- /dev/null +++ b/tests/reference/asr-test_builtin-aa64615.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin-aa64615", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin.py", + "infile_hash": "f3376f18b9927914f7cb97578b40f14d570a48c64648c32a80daef6a", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin-aa64615.stdout", + "stdout_hash": "1a601d371a9968f247d0c93a5437343b5fc47ab795d8d3fd9595eea7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin-aa64615.stdout b/tests/reference/asr-test_builtin-aa64615.stdout new file mode 100644 index 0000000000..c2a0564804 --- /dev/null +++ b/tests/reference/asr-test_builtin-aa64615.stdout @@ -0,0 +1,2149 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_ord + test_chr + more_test] + [] + [(SubroutineCall + 2 test_ord + () + [] + () + ) + (SubroutineCall + 2 test_chr + () + [] + () + ) + (SubroutineCall + 2 more_test + () + [] + () + )] + () + Public + .false. + .false. + () + ), + more_test: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + d: + (Variable + 5 + d + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + p: + (Variable + 5 + p + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + q: + (Variable + 5 + q + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 5 + r + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 5 + s + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + more_test + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 p) + (IntegerConstant 97 (Integer 4)) + () + ) + (= + (Var 5 q) + (IntegerConstant 112 (Integer 4)) + () + ) + (= + (Var 5 r) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 5 s) + (IntegerConstant 65 (Integer 4)) + () + ) + (Print + () + [(StringChr + (Var 5 p) + (Character 1 1 ()) + () + )] + () + () + ) + (Print + () + [(StringChr + (Var 5 q) + (Character 1 1 ()) + () + )] + () + () + ) + (Print + () + [(StringChr + (Var 5 r) + (Character 1 1 ()) + () + )] + () + () + ) + (Print + () + [(StringChr + (Var 5 s) + (Character 1 1 ()) + () + )] + () + () + ) + (= + (Var 5 a) + (StringConstant + "!" + (Character 1 1 ()) + ) + () + ) + (= + (Var 5 b) + (StringConstant + " " + (Character 1 1 ()) + ) + () + ) + (= + (Var 5 c) + (StringConstant + "Z" + (Character 1 1 ()) + ) + () + ) + (= + (Var 5 d) + (StringConstant + "g" + (Character 1 1 ()) + ) + () + ) + (Print + () + [(StringOrd + (Var 5 a) + (Integer 4) + () + )] + () + () + ) + (Print + () + [(StringOrd + (Var 5 b) + (Integer 4) + () + )] + () + () + ) + (Print + () + [(StringOrd + (Var 5 c) + (Integer 4) + () + )] + () + () + ) + (Print + () + [(StringOrd + (Var 5 d) + (Integer 4) + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + test_chr: + (Function + (SymbolTable + 4 + { + capital_a: + (Variable + 4 + capital_a + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + capital_z: + (Variable + 4 + capital_z + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + dollar: + (Variable + 4 + dollar + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + exclamation: + (Variable + 4 + exclamation + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + i: + (Variable + 4 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + left_parenthesis: + (Variable + 4 + left_parenthesis + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + nine: + (Variable + 4 + nine + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + plus: + (Variable + 4 + plus + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + right_brace: + (Variable + 4 + right_brace + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + right_bracket: + (Variable + 4 + right_bracket + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + semicolon: + (Variable + 4 + semicolon + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + small_a: + (Variable + 4 + small_a + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + small_z: + (Variable + 4 + small_z + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + zero: + (Variable + 4 + zero + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_chr + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 i) + (IntegerConstant 33 (Integer 4)) + () + ) + (= + (Var 4 exclamation) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 33 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "!" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "!" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 exclamation) + Eq + (StringConstant + "!" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 36 (Integer 4)) + () + ) + (= + (Var 4 dollar) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 36 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "$" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "$" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 dollar) + Eq + (StringConstant + "$" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 40 (Integer 4)) + () + ) + (= + (Var 4 left_parenthesis) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 40 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "(" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "(" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 left_parenthesis) + Eq + (StringConstant + "(" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 43 (Integer 4)) + () + ) + (= + (Var 4 plus) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 43 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "+" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "+" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 plus) + Eq + (StringConstant + "+" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 48 (Integer 4)) + () + ) + (= + (Var 4 zero) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 48 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "0" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "0" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 zero) + Eq + (StringConstant + "0" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 57 (Integer 4)) + () + ) + (= + (Var 4 nine) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 57 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "9" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "9" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 nine) + Eq + (StringConstant + "9" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 59 (Integer 4)) + () + ) + (= + (Var 4 semicolon) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 59 (Integer 4)) + (Character 1 1 ()) + (StringConstant + ";" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + ";" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 semicolon) + Eq + (StringConstant + ";" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 65 (Integer 4)) + () + ) + (= + (Var 4 capital_a) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 65 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "A" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "A" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 capital_a) + Eq + (StringConstant + "A" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 90 (Integer 4)) + () + ) + (= + (Var 4 capital_z) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 90 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "Z" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "Z" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 capital_z) + Eq + (StringConstant + "Z" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 93 (Integer 4)) + () + ) + (= + (Var 4 right_bracket) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 93 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "]" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "]" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 right_bracket) + Eq + (StringConstant + "]" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 97 (Integer 4)) + () + ) + (= + (Var 4 small_a) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 97 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "a" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "a" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 small_a) + Eq + (StringConstant + "a" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 122 (Integer 4)) + () + ) + (= + (Var 4 small_z) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 122 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "z" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "z" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 small_z) + Eq + (StringConstant + "z" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i) + (IntegerConstant 125 (Integer 4)) + () + ) + (= + (Var 4 right_brace) + (StringChr + (Var 4 i) + (Character 1 1 ()) + () + ) + () + ) + (Assert + (StringCompare + (StringChr + (IntegerConstant 125 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "}" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "}" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Var 4 right_brace) + Eq + (StringConstant + "}" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_ord: + (Function + (SymbolTable + 3 + { + capital_a_unicode: + (Variable + 3 + capital_a_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + capital_z_unicode: + (Variable + 3 + capital_z_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + dollar_unicode: + (Variable + 3 + dollar_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + exclamation_unicode: + (Variable + 3 + exclamation_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + left_parenthesis_unicode: + (Variable + 3 + left_parenthesis_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + nine_unicode: + (Variable + 3 + nine_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + plus_unicode: + (Variable + 3 + plus_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + right_brace_unicode: + (Variable + 3 + right_brace_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + right_bracket_unicode: + (Variable + 3 + right_bracket_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + semicolon_unicode: + (Variable + 3 + semicolon_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + small_a_unicode: + (Variable + 3 + small_a_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + small_z_unicode: + (Variable + 3 + small_z_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + zero_unicode: + (Variable + 3 + zero_unicode + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_ord + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (StringConstant + "!" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 exclamation_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "!" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 33 (Integer 4)) + ) + Eq + (IntegerConstant 33 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 exclamation_unicode) + Eq + (IntegerConstant 33 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "$" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 dollar_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "$" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 36 (Integer 4)) + ) + Eq + (IntegerConstant 36 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 dollar_unicode) + Eq + (IntegerConstant 36 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "(" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 left_parenthesis_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "(" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 40 (Integer 4)) + ) + Eq + (IntegerConstant 40 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 left_parenthesis_unicode) + Eq + (IntegerConstant 40 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "+" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 plus_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "+" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 43 (Integer 4)) + ) + Eq + (IntegerConstant 43 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 plus_unicode) + Eq + (IntegerConstant 43 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "0" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 zero_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "0" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 48 (Integer 4)) + ) + Eq + (IntegerConstant 48 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 zero_unicode) + Eq + (IntegerConstant 48 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "9" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 nine_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "9" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 57 (Integer 4)) + ) + Eq + (IntegerConstant 57 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 nine_unicode) + Eq + (IntegerConstant 57 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + ";" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 semicolon_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + ";" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 59 (Integer 4)) + ) + Eq + (IntegerConstant 59 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 semicolon_unicode) + Eq + (IntegerConstant 59 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "A" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 capital_a_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "A" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 65 (Integer 4)) + ) + Eq + (IntegerConstant 65 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 capital_a_unicode) + Eq + (IntegerConstant 65 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "Z" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 capital_z_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "Z" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 90 (Integer 4)) + ) + Eq + (IntegerConstant 90 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 capital_z_unicode) + Eq + (IntegerConstant 90 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "]" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 right_bracket_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "]" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 93 (Integer 4)) + ) + Eq + (IntegerConstant 93 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 right_bracket_unicode) + Eq + (IntegerConstant 93 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "a" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 small_a_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "a" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 97 (Integer 4)) + ) + Eq + (IntegerConstant 97 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 small_a_unicode) + Eq + (IntegerConstant 97 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "z" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 small_z_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "z" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 122 (Integer 4)) + ) + Eq + (IntegerConstant 122 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 small_z_unicode) + Eq + (IntegerConstant 122 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "}" + (Character 1 1 ()) + ) + () + ) + (= + (Var 3 right_brace_unicode) + (StringOrd + (Var 3 s) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringOrd + (StringConstant + "}" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 125 (Integer 4)) + ) + Eq + (IntegerConstant 125 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 right_brace_unicode) + Eq + (IntegerConstant 125 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.json b/tests/reference/asr-test_builtin_abs-c74d2c9.json new file mode 100644 index 0000000000..ce0899d23b --- /dev/null +++ b/tests/reference/asr-test_builtin_abs-c74d2c9.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_abs-c74d2c9", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_abs.py", + "infile_hash": "8748a0c131b21523ed4b2d019a4fb74af041845397169d44b00ee041", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin_abs-c74d2c9.stdout", + "stdout_hash": "86d0821d3e240a6645d0f7778a81076160e627a1e8a61e4b2c9056b3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_abs-c74d2c9.stdout b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout new file mode 100644 index 0000000000..45fc58f6b9 --- /dev/null +++ b/tests/reference/asr-test_builtin_abs-c74d2c9.stdout @@ -0,0 +1,605 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_abs] + [] + [(SubroutineCall + 2 test_abs + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_abs: + (Function + (SymbolTable + 3 + { + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 3 + i2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + i3: + (Variable + 3 + i3 + [] + Local + () + () + Default + (Integer 1) + () + Source + Public + Required + .false. + ), + i4: + (Variable + 3 + i4 + [] + Local + () + () + Default + (Integer 2) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x2: + (Variable + 3 + x2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + test_abs + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (RealConstant + 5.500000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(Var 3 x)] + 0 + (Real 8) + () + ) + Eq + (RealConstant + 5.500000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 x) + (RealUnaryMinus + (RealConstant + 5.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -5.500000 + (Real 8) + ) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(Var 3 x)] + 0 + (Real 8) + () + ) + Eq + (RealConstant + 5.500000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealConstant + 5.500000 + (Real 8) + )] + 0 + (Real 8) + (RealConstant + 5.500000 + (Real 8) + ) + ) + Eq + (RealConstant + 5.500000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealUnaryMinus + (RealConstant + 5.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -5.500000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 5.500000 + (Real 8) + ) + ) + Eq + (RealConstant + 5.500000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 x2) + (RealUnaryMinus + (Cast + (RealConstant + 5.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.500000 + (Real 4) + ) + ) + (Real 4) + (RealConstant + -5.500000 + (Real 4) + ) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(Var 3 x2)] + 0 + (Real 4) + () + ) + Eq + (Cast + (RealConstant + 5.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.500000 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Var 3 i)] + 0 + (Integer 4) + () + ) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + )] + 0 + (Integer 4) + (IntegerConstant 1 (Integer 4)) + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 i2) + (IntegerUnaryMinus + (Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -6 (Integer 8)) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Var 3 i2)] + 0 + (Integer 8) + () + ) + Eq + (Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i3) + (IntegerUnaryMinus + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 7 (Integer 1)) + ) + (Integer 1) + (IntegerConstant -7 (Integer 1)) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Var 3 i3)] + 0 + (Integer 1) + () + ) + Eq + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 7 (Integer 1)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i4) + (IntegerUnaryMinus + (Cast + (IntegerConstant 8 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 8 (Integer 2)) + ) + (Integer 2) + (IntegerConstant -8 (Integer 2)) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Var 3 i4)] + 0 + (Integer 2) + () + ) + Eq + (Cast + (IntegerConstant 8 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 8 (Integer 2)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Cast + (Var 3 b) + LogicalToInteger + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Abs + [(Cast + (Var 3 b) + LogicalToInteger + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.json b/tests/reference/asr-test_builtin_bin-52ba9fa.json new file mode 100644 index 0000000000..f617a29848 --- /dev/null +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_bin-52ba9fa", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_bin.py", + "infile_hash": "09e09eacf697c95f358b75f6491b766781bae9a5f856c2ad5848e824", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_bin-52ba9fa.stderr", + "stderr_hash": "f96ee9f35d47046bca3a9f0e40b965bf1b0e6654a0a4da0eb7a85e30", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr new file mode 100644 index 0000000000..06b339838a --- /dev/null +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_bin.py:6:12 + | +6 | assert bin(i) == "0b101" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bool-330223a.json b/tests/reference/asr-test_builtin_bool-330223a.json new file mode 100644 index 0000000000..91858355b1 --- /dev/null +++ b/tests/reference/asr-test_builtin_bool-330223a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_bool-330223a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_bool.py", + "infile_hash": "3a740faba0e36b55c179ab0fa08486dc3080332e79c8e38b8f25b4a4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_bool-330223a.stderr", + "stderr_hash": "5cf42029c7abd7dc2dedc535fff29c622c3871ec342b595c426b27f3", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bool-330223a.stderr b/tests/reference/asr-test_builtin_bool-330223a.stderr new file mode 100644 index 0000000000..6061f4823c --- /dev/null +++ b/tests/reference/asr-test_builtin_bool-330223a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_bool.py:56:13 + | +56 | c = c32(complex(2, 3)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_float-20601dd.json b/tests/reference/asr-test_builtin_float-20601dd.json new file mode 100644 index 0000000000..7b0de8b9c0 --- /dev/null +++ b/tests/reference/asr-test_builtin_float-20601dd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_float-20601dd", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_float.py", + "infile_hash": "de536c0af182f8e43780193627c24f1085522e86d37316e13d337196", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin_float-20601dd.stdout", + "stdout_hash": "30bd7a1456c6e4b74a7c6310f2c49c9593924e9728cdba8151b2c15a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_float-20601dd.stdout b/tests/reference/asr-test_builtin_float-20601dd.stdout new file mode 100644 index 0000000000..cee0c2a04c --- /dev/null +++ b/tests/reference/asr-test_builtin_float-20601dd.stdout @@ -0,0 +1,530 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_float] + [] + [(SubroutineCall + 2 test_float + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_float: + (Function + (SymbolTable + 3 + { + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 3 + f2 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_float + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 i) + (IntegerConstant 34 (Integer 4)) + () + ) + (= + (Var 3 f) + (Cast + (RealConstant + 0.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000000 + (Real 4) + ) + ) + () + ) + (Assert + (RealCompare + (RealConstant + 0.000000 + (Real 8) + ) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (IntegerConstant 34 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 34.000000 + (Real 8) + ) + ) + Eq + (RealConstant + 34.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (Var 3 i) + IntegerToReal + (Real 8) + () + ) + Eq + (RealConstant + 34.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ) + () + ) + (Assert + (RealCompare + (Cast + (IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ) + IntegerToReal + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + ) + Eq + (RealUnaryMinus + (RealConstant + 4235.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (Var 3 i) + IntegerToReal + (Real 8) + () + ) + Eq + (RealUnaryMinus + (RealConstant + 4235.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (IntegerConstant 34 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 34.000000 + (Real 8) + ) + ) + Eq + (RealConstant + 34.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ) + IntegerToReal + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + ) + Eq + (RealUnaryMinus + (RealConstant + 4235.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (RealConstant + 0.000000 + (Real 8) + ) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (Var 3 f) + RealToReal + (Real 8) + () + ) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToReal + (Real 8) + (RealConstant + 1.000000 + (Real 8) + ) + ) + Eq + (RealConstant + 1.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToReal + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 f2) + (Cast + (Var 3 b) + LogicalToReal + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (Var 3 f2) + Eq + (RealConstant + 1.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (RealCompare + (Cast + (Var 3 b) + LogicalToReal + (Real 8) + () + ) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_hex-64bd268.json b/tests/reference/asr-test_builtin_hex-64bd268.json new file mode 100644 index 0000000000..2779c11099 --- /dev/null +++ b/tests/reference/asr-test_builtin_hex-64bd268.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_hex-64bd268", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_hex.py", + "infile_hash": "e639f0251477f50376536d317630e3c026354859576a5f1b7b10bd7d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_hex-64bd268.stderr", + "stderr_hash": "22b2ae7d0d34d2406125547149511ab5990a5f2163c186c48c5c4f05", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stderr b/tests/reference/asr-test_builtin_hex-64bd268.stderr new file mode 100644 index 0000000000..40dc59a4e9 --- /dev/null +++ b/tests/reference/asr-test_builtin_hex-64bd268.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_hex.py:6:12 + | +6 | assert hex(i) == "0x22" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.json b/tests/reference/asr-test_builtin_int-8f88fdc.json new file mode 100644 index 0000000000..c108171675 --- /dev/null +++ b/tests/reference/asr-test_builtin_int-8f88fdc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_int-8f88fdc", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_int.py", + "infile_hash": "caea15e7c979280f796e815bd1548613d6b21322c43f4ed1306e1e93", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin_int-8f88fdc.stdout", + "stdout_hash": "ac7c1dc83cf2a510b118f03332645f9503a084c66a9c61ce4833d3e1", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_int-8f88fdc.stdout b/tests/reference/asr-test_builtin_int-8f88fdc.stdout new file mode 100644 index 0000000000..9ce92a9ac8 --- /dev/null +++ b/tests/reference/asr-test_builtin_int-8f88fdc.stdout @@ -0,0 +1,1010 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check_all] + [] + [(SubroutineCall + 2 check_all + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check_all: + (Function + (SymbolTable + 5 + { + + }) + check_all + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_int + test_bool_to_int] + [] + [(SubroutineCall + 2 test_int + () + [] + () + ) + (SubroutineCall + 2 test_bool_to_int + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_bool_to_int: + (Function + (SymbolTable + 4 + { + b: + (Variable + 4 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_bool_to_int + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + Add + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Print + () + [(Var 4 b)] + () + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 4 b) + (IntegerBinOp + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + (Integer 4) + () + ) + Sub + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 4 b) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_int: + (Function + (SymbolTable + 3 + { + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 3 + i2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + test_int + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 f) + (RealConstant + 5.678000 + (Real 8) + ) + () + ) + (= + (Var 3 i) + (IntegerConstant 4 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (IntegerConstant 0 (Integer 8)) + Eq + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (Var 3 i) + IntegerToInteger + (Integer 8) + () + ) + Eq + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i2) + (Cast + (RealConstant + 3.000000 + (Real 8) + ) + RealToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i2) + Eq + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Cast + (RealConstant + 5.678000 + (Real 8) + ) + RealToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + Eq + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (Var 3 f) + RealToInteger + (Integer 8) + () + ) + Eq + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealUnaryMinus + (RealConstant + 183745.230000 + (Real 8) + ) + (Real 8) + (RealConstant + -183745.230000 + (Real 8) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (RealUnaryMinus + (RealConstant + 183745.230000 + (Real 8) + ) + (Real 8) + (RealConstant + -183745.230000 + (Real 8) + ) + ) + RealToInteger + (Integer 8) + (IntegerConstant -183745 (Integer 8)) + ) + Eq + (Cast + (IntegerUnaryMinus + (IntegerConstant 183745 (Integer 4)) + (Integer 4) + (IntegerConstant -183745 (Integer 4)) + ) + IntegerToInteger + (Integer 8) + (IntegerConstant -183745 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (Var 3 f) + RealToInteger + (Integer 8) + () + ) + Eq + (Cast + (IntegerUnaryMinus + (IntegerConstant 183745 (Integer 4)) + (Integer 4) + (IntegerConstant -183745 (Integer 4)) + ) + IntegerToInteger + (Integer 8) + (IntegerConstant -183745 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Cast + (RealConstant + 5.500000 + (Real 8) + ) + RealToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + Eq + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (RealUnaryMinus + (RealConstant + 5.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -5.500000 + (Real 8) + ) + ) + RealToInteger + (Integer 8) + (IntegerConstant -5 (Integer 8)) + ) + Eq + (Cast + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + IntegerToInteger + (Integer 8) + (IntegerConstant -5 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + Eq + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + Eq + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_len-55b0dec.json b/tests/reference/asr-test_builtin_len-55b0dec.json new file mode 100644 index 0000000000..e9002c539a --- /dev/null +++ b/tests/reference/asr-test_builtin_len-55b0dec.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_len-55b0dec", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_len.py", + "infile_hash": "fd1048585d9628ca38f6f21cdcfb3b44c355bbf6df2275a133f82a6f", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin_len-55b0dec.stdout", + "stdout_hash": "2a3e339bcf76aded62305d7667f0f17439bb96609a8106cb933d37e0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_len-55b0dec.stdout b/tests/reference/asr-test_builtin_len-55b0dec.stdout new file mode 100644 index 0000000000..daa809dca7 --- /dev/null +++ b/tests/reference/asr-test_builtin_len-55b0dec.stdout @@ -0,0 +1,691 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 6 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_len] + [] + [(SubroutineCall + 2 test_len + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_len: + (Function + (SymbolTable + 3 + { + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 3 + l + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + l2: + (Variable + 3 + l2 + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + l3: + (Variable + 3 + l3 + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + list_len: + (Variable + 3 + list_len + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + t: + (Variable + 3 + t + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4) + (Character 1 -2 ())] + ) + () + Source + Public + Required + .false. + ), + t2: + (Variable + 3 + t2 + [] + Local + () + () + Default + (Tuple + [(Real 8) + (Logical 4) + (Logical 4) + (Character 1 -2 ()) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ), + t3: + (Variable + 3 + t3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + tmp: + (Variable + 3 + tmp + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_len + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (StringConstant + "abcd" + (Character 1 4 ()) + ) + () + ) + (Assert + (IntegerCompare + (StringLen + (Var 3 s) + (Integer 4) + () + ) + Eq + (IntegerConstant 4 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "" + (Character 1 0 ()) + ) + () + ) + (Assert + (IntegerCompare + (StringLen + (Var 3 s) + (Integer 4) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StringLen + (StringConstant + "abcd" + (Character 1 4 ()) + ) + (Integer 4) + (IntegerConstant 4 (Integer 4)) + ) + Eq + (IntegerConstant 4 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (StringLen + (StringConstant + "" + (Character 1 0 ()) + ) + (Integer 4) + (IntegerConstant 0 (Integer 4)) + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 l) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (ListLen + (Var 3 l) + (Integer 4) + () + ) + Eq + (IntegerConstant 4 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 l2) + (ListConstant + [(RealConstant + 1.200000 + (Real 8) + ) + (RealConstant + 3.400000 + (Real 8) + ) + (RealConstant + 5.600000 + (Real 8) + ) + (RealConstant + 7.800000 + (Real 8) + ) + (RealConstant + 9.000000 + (Real 8) + )] + (List + (Real 8) + ) + ) + () + ) + (Assert + (IntegerCompare + (ListLen + (Var 3 l2) + (Integer 4) + () + ) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 l3) + (ListConstant + [] + (List + (Integer 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (ListLen + (Var 3 l3) + (Integer 4) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (DoLoop + () + ((Var 3 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 50 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 49 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(ListAppend + (Var 3 l3) + (Var 3 i) + )] + ) + (Assert + (IntegerCompare + (ListLen + (Var 3 l3) + (Integer 4) + () + ) + Eq + (IntegerConstant 50 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 list_len) + (ListLen + (ListConstant + [(RealConstant + 1.000000 + (Real 8) + ) + (RealConstant + 2.000000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (Integer 4) + (IntegerConstant 2 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 list_len) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 t) + (TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (StringConstant + "a" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Integer 4) + (Character 1 1 ())] + ) + ) + () + ) + (Assert + (IntegerCompare + (TupleLen + (Var 3 t) + (Integer 4) + (IntegerConstant 3 (Integer 4)) + ) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 t2) + (TupleConstant + [(RealConstant + 1.200000 + (Real 8) + ) + (LogicalConstant + .true. + (Logical 4) + ) + (LogicalConstant + .false. + (Logical 4) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (IntegerConstant 3 (Integer 4))] + (Tuple + [(Real 8) + (Logical 4) + (Logical 4) + (Character 1 1 ()) + (Integer 4)] + ) + ) + () + ) + (Assert + (IntegerCompare + (TupleLen + (Var 3 t2) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 t3) + (TupleLen + (TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4) + (Integer 4) + (Integer 4) + (Integer 4)] + ) + ) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (Var 3 t3) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 tmp) + (ListLen + (Var 3 l) + (Integer 4) + () + ) + () + ) + (DoLoop + () + ((Var 3 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (TupleLen + (Var 3 t2) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 4 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(ListAppend + (Var 3 l) + (Var 3 i) + )] + ) + (Assert + (IntegerCompare + (ListLen + (Var 3 l) + (Integer 4) + () + ) + Eq + (IntegerBinOp + (TupleLen + (Var 3 t2) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Add + (Var 3 tmp) + (Integer 4) + () + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 7 + { + __main__global_stmts: + (ExternalSymbol + 7 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 7 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_oct-20b9066.json b/tests/reference/asr-test_builtin_oct-20b9066.json new file mode 100644 index 0000000000..bb705fd111 --- /dev/null +++ b/tests/reference/asr-test_builtin_oct-20b9066.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_oct-20b9066", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_oct.py", + "infile_hash": "c20249affa4787edf4ef56c881ebbcabdced311b5b908d9da6aceaeb", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_oct-20b9066.stderr", + "stderr_hash": "986b90db11399243e0e1a9788da3876cbd8d7eecd273e46bc9437243", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stderr b/tests/reference/asr-test_builtin_oct-20b9066.stderr new file mode 100644 index 0000000000..8bde6da6dc --- /dev/null +++ b/tests/reference/asr-test_builtin_oct-20b9066.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_oct.py:6:12 + | +6 | assert oct(i) == "0o42" + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json new file mode 100644 index 0000000000..5bb87ef22b --- /dev/null +++ b/tests/reference/asr-test_builtin_pow-f02fcda.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_pow-f02fcda", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_pow.py", + "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_pow-f02fcda.stderr", + "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stderr b/tests/reference/asr-test_builtin_pow-f02fcda.stderr new file mode 100644 index 0000000000..e2d434b6f1 --- /dev/null +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_pow.py:11:16 + | +11 | assert i32(pow(a, b)) == 32 + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_round-7417a21.json b/tests/reference/asr-test_builtin_round-7417a21.json new file mode 100644 index 0000000000..efcd6cc31e --- /dev/null +++ b/tests/reference/asr-test_builtin_round-7417a21.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_round-7417a21", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_round.py", + "infile_hash": "a4ff4032a45ce084eb524069046afb6ec44f1b24a667c84c7605f2c7", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_builtin_round-7417a21.stderr", + "stderr_hash": "a58af3b9f4312b1036b728dc70928fe9c05f87d1b96d92b5c3da881f", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_round-7417a21.stderr b/tests/reference/asr-test_builtin_round-7417a21.stderr new file mode 100644 index 0000000000..570365512c --- /dev/null +++ b/tests/reference/asr-test_builtin_round-7417a21.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_round.py:6:12 + | +6 | assert round(f) == 6 + | ^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_str-580e920.json b/tests/reference/asr-test_builtin_str-580e920.json new file mode 100644 index 0000000000..b7662841c8 --- /dev/null +++ b/tests/reference/asr-test_builtin_str-580e920.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_builtin_str-580e920", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_builtin_str.py", + "infile_hash": "9d41e81d47e010623c74c812d0c41e5d705f7925e699eb2b68f17cfc", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_builtin_str-580e920.stdout", + "stdout_hash": "757004fd20974ca9ccee145fcb6fdcc725839c3eb87ec97919c8115c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_str-580e920.stdout b/tests/reference/asr-test_builtin_str-580e920.stdout new file mode 100644 index 0000000000..7c5852b8a4 --- /dev/null +++ b/tests/reference/asr-test_builtin_str-580e920.stdout @@ -0,0 +1,1471 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_str_int_float + str_conv_for_variables + test_str_slice_step + test_issue_883] + [] + [(SubroutineCall + 2 test_str_int_float + () + [] + () + ) + (SubroutineCall + 2 str_conv_for_variables + () + [] + () + ) + (SubroutineCall + 2 test_str_slice_step + () + [] + () + ) + (SubroutineCall + 2 test_issue_883 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + str_conv_for_variables: + (Function + (SymbolTable + 4 + { + bool_t: + (Variable + 4 + bool_t + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + str_t: + (Variable + 4 + str_t + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + xx: + (Variable + 4 + xx + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + yy: + (Variable + 4 + yy + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + str_conv_for_variables + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 x) + (IntegerConstant 123 (Integer 4)) + () + ) + (Assert + (StringCompare + (StringConstant + "123" + (Character 1 3 ()) + ) + Eq + (Cast + (Var 4 x) + IntegerToCharacter + (Character 1 -2 ()) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (IntegerConstant 12345 (Integer 4)) + () + ) + (Assert + (StringCompare + (StringConstant + "12345" + (Character 1 5 ()) + ) + Eq + (Cast + (Var 4 x) + IntegerToCharacter + (Character 1 -2 ()) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (IntegerUnaryMinus + (IntegerConstant 12 (Integer 4)) + (Integer 4) + (IntegerConstant -12 (Integer 4)) + ) + () + ) + (Assert + (StringCompare + (StringConstant + "-12" + (Character 1 3 ()) + ) + Eq + (Cast + (Var 4 x) + IntegerToCharacter + (Character 1 -2 ()) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (IntegerUnaryMinus + (IntegerConstant 121212 (Integer 4)) + (Integer 4) + (IntegerConstant -121212 (Integer 4)) + ) + () + ) + (Assert + (StringCompare + (StringConstant + "-121212" + (Character 1 7 ()) + ) + Eq + (Cast + (Var 4 x) + IntegerToCharacter + (Character 1 -2 ()) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 xx) + (Cast + (RealConstant + 12.322234 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 12.322234 + (Real 4) + ) + ) + () + ) + (Assert + (StringCompare + (Cast + (Var 4 xx) + RealToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "12.322234" + (Character 1 9 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 yy) + (RealConstant + 12.322234 + (Real 8) + ) + () + ) + (Assert + (StringCompare + (Cast + (Var 4 yy) + RealToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "12.322234" + (Character 1 9 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 bool_t) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (StringCompare + (Cast + (Var 4 bool_t) + LogicalToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "True" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 bool_t) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (StringCompare + (Cast + (Var 4 bool_t) + LogicalToCharacter + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "False" + (Character 1 5 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 4 str_t) + (StringConstant + "just a str" + (Character 1 10 ()) + ) + () + ) + (Assert + (StringCompare + (Var 4 str_t) + Eq + (Var 4 str_t) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_issue_883: + (Function + (SymbolTable + 6 + { + __explicit_iterator: + (Variable + 6 + __explicit_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __tmp_assign_for_loop: + (Variable + 6 + __tmp_assign_for_loop + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + c: + (Variable + 6 + c + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + d: + (Variable + 6 + d + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + i: + (Variable + 6 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 6 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_issue_883 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 s) + (StringConstant + "abcde" + (Character 1 5 ()) + ) + () + ) + (= + (Var 6 d) + (StringConstant + "edcba" + (Character 1 5 ()) + ) + () + ) + (= + (Var 6 i) + (IntegerConstant 0 (Integer 4)) + () + ) + (= + (Var 6 __tmp_assign_for_loop) + (StringSection + (Var 6 s) + () + () + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + () + ) + (DoLoop + () + ((Var 6 __explicit_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (StringLen + (Var 6 __tmp_assign_for_loop) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 6 c) + (StringItem + (Var 6 __tmp_assign_for_loop) + (IntegerBinOp + (Var 6 __explicit_iterator) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Character 1 -2 ()) + () + ) + () + ) + (Print + () + [(Var 6 c)] + () + () + ) + (Assert + (StringCompare + (Var 6 c) + Eq + (StringItem + (Var 6 d) + (IntegerBinOp + (Var 6 i) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Character 1 -2 ()) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 6 i) + (IntegerBinOp + (Var 6 i) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ), + test_str_int_float: + (Function + (SymbolTable + 3 + { + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_str_int_float + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 s) + (Cast + (IntegerConstant 356 (Integer 4)) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "356" + (Character 1 3 ()) + ) + ) + () + ) + (Assert + (StringCompare + (Var 3 s) + Eq + (StringConstant + "356" + (Character 1 3 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (Cast + (IntegerUnaryMinus + (IntegerConstant 567 (Integer 4)) + (Integer 4) + (IntegerConstant -567 (Integer 4)) + ) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "-567" + (Character 1 4 ()) + ) + ) + () + ) + (Assert + (StringCompare + (Var 3 s) + Eq + (StringConstant + "-567" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "4" + (Character 1 1 ()) + ) + ) + Eq + (StringConstant + "4" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Cast + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "-5" + (Character 1 2 ()) + ) + ) + Eq + (StringConstant + "-5" + (Character 1 2 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (StringConstant + "" + (Character 1 0 ()) + ) + Eq + (StringConstant + "" + (Character 1 0 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (StringConstant + "1234" + (Character 1 4 ()) + ) + Eq + (StringConstant + "1234" + (Character 1 4 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "False" + (Character 1 5 ()) + ) + ) + Eq + (StringConstant + "False" + (Character 1 5 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "True" + (Character 1 4 ()) + ) + ) + Eq + (StringConstant + "True" + (Character 1 4 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (StringConstant + "just a str" + (Character 1 10 ()) + ) + Eq + (StringConstant + "just a str" + (Character 1 10 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (StringSection + (Cast + (RealConstant + 12.123400 + (Real 8) + ) + RealToCharacter + (Character 1 -2 ()) + (StringConstant + "12.1234" + (Character 1 7 ()) + ) + ) + () + (IntegerConstant 7 (Integer 4)) + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "12.1234" + (Character 1 7 ()) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_str_slice_step: + (Function + (SymbolTable + 5 + { + end: + (Variable + 5 + end + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 5 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + start: + (Variable + 5 + start + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + step: + (Variable + 5 + step + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_str_slice_step + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 s) + (StringConstant + "abcdefghijk" + (Character 1 11 ()) + ) + () + ) + (= + (Var 5 start) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 5 end) + (IntegerConstant 4 (Integer 4)) + () + ) + (= + (Var 5 step) + (IntegerConstant 1 (Integer 4)) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + () + () + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "abcdefghijk" + (Character 1 11 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "bcd" + (Character 1 3 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + () + (IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "a" + (Character 1 1 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + () + () + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "kjihgfedcba" + (Character 1 11 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 12 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "dgj" + (Character 1 3 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 1 (Integer 4)) + () + (IntegerConstant 3 (Integer 4)) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "behk" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 4 (Integer 4)) + () + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "efghijk" + (Character 1 7 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + () + (IntegerConstant 5 (Integer 4)) + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "abcde" + (Character 1 5 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 9 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "dg" + (Character 1 2 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerConstant 10 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "kige" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 10 (Integer 4)) + (Integer 4) + (IntegerConstant -10 (Integer 4)) + ) + () + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "" + (Character 1 0 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 9 (Integer 4)) + (Integer 4) + (IntegerConstant -9 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "if" + (Character 1 2 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 10 (Integer 4)) + (Integer 4) + (IntegerConstant -10 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "ifc" + (Character 1 3 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (Var 5 start) + (Var 5 end) + (Var 5 step) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "bcd" + (Character 1 3 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (Var 5 start) + (IntegerBinOp + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Mul + (Var 5 end) + (Integer 4) + () + ) + Sub + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + ) + (Var 5 step) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "bcde" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (StringSection + (Var 5 s) + (Var 5 start) + (IntegerBinOp + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Mul + (Var 5 end) + (Integer 4) + () + ) + Sub + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + ) + (IntegerUnaryMinus + (Var 5 step) + (Integer 4) + () + ) + (Character 1 -2 ()) + () + ) + Eq + (StringConstant + "" + (Character 1 0 ()) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_c_interop_01-e374f43.json b/tests/reference/asr-test_c_interop_01-e374f43.json new file mode 100644 index 0000000000..a35f2d0c2b --- /dev/null +++ b/tests/reference/asr-test_c_interop_01-e374f43.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_c_interop_01-e374f43", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_c_interop_01.py", + "infile_hash": "f5363d49163fefe382a94462e7c305a7938ddcc44c4595f8a0c5bc3f", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_c_interop_01-e374f43.stdout", + "stdout_hash": "54f0e7b627f6a658a8ff7c49f02434b2c7e8393c3c9553a884506837", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_c_interop_01-e374f43.stdout b/tests/reference/asr-test_c_interop_01-e374f43.stdout new file mode 100644 index 0000000000..cffa869f5b --- /dev/null +++ b/tests/reference/asr-test_c_interop_01-e374f43.stdout @@ -0,0 +1,711 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_c_callbacks] + [] + [(SubroutineCall + 2 test_c_callbacks + () + [] + () + )] + () + Public + .false. + .false. + () + ), + _lfortran_bgt32: + (Function + (SymbolTable + 5 + { + _lpython_return_variable: + (Variable + 5 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + BindC + Public + Required + .false. + ), + i: + (Variable + 5 + i + [] + In + () + () + Default + (Integer 4) + () + BindC + Public + Required + .true. + ), + j: + (Variable + 5 + j + [] + In + () + () + Default + (Integer 4) + () + BindC + Public + Required + .true. + ) + }) + _lfortran_bgt32 + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 5 i) + (Var 5 j)] + [] + (Var 5 _lpython_return_variable) + Public + .false. + .false. + () + ), + _lfortran_bgt64: + (Function + (SymbolTable + 6 + { + _lpython_return_variable: + (Variable + 6 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + BindC + Public + Required + .false. + ), + i: + (Variable + 6 + i + [] + In + () + () + Default + (Integer 8) + () + BindC + Public + Required + .true. + ), + j: + (Variable + 6 + j + [] + In + () + () + Default + (Integer 8) + () + BindC + Public + Required + .true. + ) + }) + _lfortran_bgt64 + (FunctionType + [(Integer 8) + (Integer 8)] + (Integer 4) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 6 i) + (Var 6 j)] + [] + (Var 6 _lpython_return_variable) + Public + .false. + .false. + () + ), + _lfortran_dsin: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + BindC + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + In + () + () + Default + (Real 8) + () + BindC + Public + Required + .true. + ) + }) + _lfortran_dsin + (FunctionType + [(Real 8)] + (Real 8) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 x)] + [] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + _lfortran_ssin: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 4) + () + BindC + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + In + () + () + Default + (Real 4) + () + BindC + Public + Required + .true. + ) + }) + _lfortran_ssin + (FunctionType + [(Real 4)] + (Real 4) + BindC + Interface + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 4 x)] + [] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_c_callbacks: + (Function + (SymbolTable + 7 + { + pi: + (Variable + 7 + pi + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + test_c_callbacks + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [_lfortran_dsin + _lfortran_ssin + _lfortran_bgt32 + _lfortran_bgt64] + [] + [(= + (Var 7 pi) + (RealConstant + 3.141593 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 2 _lfortran_dsin + () + [((Var 7 pi))] + (Real 8) + () + () + ) + Sub + (RealConstant + 0.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 2 _lfortran_dsin + () + [((RealBinOp + (Var 7 pi) + Div + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ))] + (Real 8) + () + () + ) + Sub + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 2 _lfortran_ssin + () + [((Cast + (Var 7 pi) + RealToReal + (Real 4) + () + ))] + (Real 4) + () + () + ) + Sub + (Cast + (RealConstant + 0.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000000 + (Real 4) + ) + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + Lt + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 2 _lfortran_ssin + () + [((Cast + (RealBinOp + (Var 7 pi) + Div + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + RealToReal + (Real 4) + () + ))] + (Real 4) + () + () + ) + Sub + (Cast + (RealConstant + 1.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.000000 + (Real 4) + ) + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + Lt + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 _lfortran_bgt32 + () + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 _lfortran_bgt32 + () + [((IntegerConstant 4 (Integer 4))) + ((IntegerConstant 3 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 _lfortran_bgt64 + () + [((Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + )) + ((Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 _lfortran_bgt64 + () + [((Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + )) + ((Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_chr-91f4987.json b/tests/reference/asr-test_chr-91f4987.json new file mode 100644 index 0000000000..ca5829edf9 --- /dev/null +++ b/tests/reference/asr-test_chr-91f4987.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_chr-91f4987", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_chr.py", + "infile_hash": "6520b636dd89e03d59caf9be2e7d6ec001e758ec0a92de2286b691bc", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_chr-91f4987.stderr", + "stderr_hash": "87fff5dabdc4a4c52a0f07fd59bcc25ba6a3b29a391b39d404b8e2bc", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_chr-91f4987.stderr b/tests/reference/asr-test_chr-91f4987.stderr new file mode 100644 index 0000000000..18bb9fac87 --- /dev/null +++ b/tests/reference/asr-test_chr-91f4987.stderr @@ -0,0 +1,5 @@ +semantic error: 'f64' object cannot be interpreted as an integer + --> tests/errors/test_chr.py:3:13 + | +3 | s = chr(973.2) + | ^^^^^ diff --git a/tests/reference/asr-test_compare_01-c594bbe.json b/tests/reference/asr-test_compare_01-c594bbe.json new file mode 100644 index 0000000000..4871c78f6e --- /dev/null +++ b/tests/reference/asr-test_compare_01-c594bbe.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_compare_01-c594bbe", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_compare_01.py", + "infile_hash": "8608b530e3b0ed2d0bff0ce0e137537fff92259ffded965d5f03d5dc", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_compare_01-c594bbe.stderr", + "stderr_hash": "65fb5b04ca1f56cae946ed2db3cde1380d0d9976114c340acfbbcf7b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_compare_01-c594bbe.stderr b/tests/reference/asr-test_compare_01-c594bbe.stderr new file mode 100644 index 0000000000..868af63d50 --- /dev/null +++ b/tests/reference/asr-test_compare_01-c594bbe.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in comparison operator, the types must be compatible + --> tests/errors/test_compare_01.py:6:11 + | +6 | print(i16(x) > f32(y)) + | ^^^^^^ ^^^^^^ type mismatch ('i16' and 'f32') diff --git a/tests/reference/asr-test_compare_02-bf2c76e.json b/tests/reference/asr-test_compare_02-bf2c76e.json new file mode 100644 index 0000000000..de5b576dce --- /dev/null +++ b/tests/reference/asr-test_compare_02-bf2c76e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_compare_02-bf2c76e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_compare_02.py", + "infile_hash": "16c5516272fbd5a54c9039bfe614e3813425f92826025c0ed5671341", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_compare_02-bf2c76e.stderr", + "stderr_hash": "b7fd0ded0c7519927e22a838a2b5156d7cb6b3728bb463ecb5907bfd", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_compare_02-bf2c76e.stderr b/tests/reference/asr-test_compare_02-bf2c76e.stderr new file mode 100644 index 0000000000..a8843ae5ee --- /dev/null +++ b/tests/reference/asr-test_compare_02-bf2c76e.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in comparison operator, the types must be compatible + --> tests/errors/test_compare_02.py:6:11 + | +6 | print(x > y) + | ^ ^ type mismatch ('i32' and 'u32') diff --git a/tests/reference/asr-test_complex_01-a6def58.json b/tests/reference/asr-test_complex_01-a6def58.json new file mode 100644 index 0000000000..2a3e22a7fa --- /dev/null +++ b/tests/reference/asr-test_complex_01-a6def58.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_complex_01-a6def58", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_complex_01.py", + "infile_hash": "e580480b37e5bbfcd01d5eb412375a8a3c1ef374b5fedfb661485763", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_complex_01-a6def58.stderr", + "stderr_hash": "5e372192068e09afc8e388039c24decbd5a11c27b4143b5643bebd10", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_complex_01-a6def58.stderr b/tests/reference/asr-test_complex_01-a6def58.stderr new file mode 100644 index 0000000000..f87f59ca76 --- /dev/null +++ b/tests/reference/asr-test_complex_01-a6def58.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_complex_01.py:17:9 + | +17 | x = complex(4.5, 6.7) + | ^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_02-782ba2d.json b/tests/reference/asr-test_complex_02-782ba2d.json new file mode 100644 index 0000000000..3fa259e305 --- /dev/null +++ b/tests/reference/asr-test_complex_02-782ba2d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_complex_02-782ba2d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_complex_02.py", + "infile_hash": "e6ee66d952deccec11d316a09f1d5b4bb4916ceb56a41a11dee03ae9", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_complex_02-782ba2d.stderr", + "stderr_hash": "dc3a153532aa537903852b8334a63d785edb99a11aff4e951c28b5c6", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_complex_02-782ba2d.stderr b/tests/reference/asr-test_complex_02-782ba2d.stderr new file mode 100644 index 0000000000..b61ce381bd --- /dev/null +++ b/tests/reference/asr-test_complex_02-782ba2d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_complex_02.py:5:13 + | +5 | x = c32(complex(3, 4)) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_dict1-a45a075.json b/tests/reference/asr-test_dict1-a45a075.json new file mode 100644 index 0000000000..eeb9ffe3f7 --- /dev/null +++ b/tests/reference/asr-test_dict1-a45a075.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict1-a45a075", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict1.py", + "infile_hash": "cfdb4968d923dac52c9637a8283f1a48ea3bdab2afde206cafaf925a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict1-a45a075.stderr", + "stderr_hash": "a9fbe4acc4f82141b1111e9aef3d3c50f27540d41ff3382fe46da8ea", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict1-a45a075.stderr b/tests/reference/asr-test_dict1-a45a075.stderr new file mode 100644 index 0000000000..01fe7b133f --- /dev/null +++ b/tests/reference/asr-test_dict1-a45a075.stderr @@ -0,0 +1,5 @@ +semantic error: Key type should be 'i32' instead of 'str' + --> tests/errors/test_dict1.py:5:11 + | +5 | z = x["a"] + | ^^^ diff --git a/tests/reference/asr-test_dict10-8c0beff.json b/tests/reference/asr-test_dict10-8c0beff.json new file mode 100644 index 0000000000..2b2342369e --- /dev/null +++ b/tests/reference/asr-test_dict10-8c0beff.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict10-8c0beff", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict10.py", + "infile_hash": "4cd31b5d018919c4889a0316adea871ea25d0587d04bd28d1d8e6cd4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict10-8c0beff.stderr", + "stderr_hash": "06772bed43d8fff0fb889a763afb49307005f50ce26c7a601652e258", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict10-8c0beff.stderr b/tests/reference/asr-test_dict10-8c0beff.stderr new file mode 100644 index 0000000000..58c4edd7d3 --- /dev/null +++ b/tests/reference/asr-test_dict10-8c0beff.stderr @@ -0,0 +1,5 @@ +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict10.py:4:8 + | +4 | d: dict[c32, f64] = {} + | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict11-2ab4e6c.json b/tests/reference/asr-test_dict11-2ab4e6c.json new file mode 100644 index 0000000000..c91886a137 --- /dev/null +++ b/tests/reference/asr-test_dict11-2ab4e6c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict11-2ab4e6c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict11.py", + "infile_hash": "4f1af506664662506acd3ce990f1b72ff744bb873162c9fe32dd9236", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict11-2ab4e6c.stderr", + "stderr_hash": "6ef78d7738e0780fc0f9b9567390798b3d74374b95d0dd156ccbdab4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict11-2ab4e6c.stderr b/tests/reference/asr-test_dict11-2ab4e6c.stderr new file mode 100644 index 0000000000..fcc460b76f --- /dev/null +++ b/tests/reference/asr-test_dict11-2ab4e6c.stderr @@ -0,0 +1,5 @@ +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict11.py:4:8 + | +4 | d: dict[c64, f32] = {} + | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict12-7c74d08.json b/tests/reference/asr-test_dict12-7c74d08.json new file mode 100644 index 0000000000..9922026e7b --- /dev/null +++ b/tests/reference/asr-test_dict12-7c74d08.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict12-7c74d08", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict12.py", + "infile_hash": "4a8a3f88d0c29a68083bc142a792c35b6f13d7bdf1a635f91920baeb", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict12-7c74d08.stderr", + "stderr_hash": "9243262b97e5e6a555eafbbfd93440e86e66a3536cc0fb9902a7e0d2", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict12-7c74d08.stderr b/tests/reference/asr-test_dict12-7c74d08.stderr new file mode 100644 index 0000000000..5f9fb390f6 --- /dev/null +++ b/tests/reference/asr-test_dict12-7c74d08.stderr @@ -0,0 +1,5 @@ +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict12.py:2:11 + | +2 | print({0.0: 1.1}) # constant dict with floating point value as key + | ^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict13-683b290.json b/tests/reference/asr-test_dict13-683b290.json new file mode 100644 index 0000000000..3f08b12f0a --- /dev/null +++ b/tests/reference/asr-test_dict13-683b290.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict13-683b290", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict13.py", + "infile_hash": "ee757d46a81447cf45321822e379e83acbecd32578e300f27fc93d1b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict13-683b290.stderr", + "stderr_hash": "26039da2a42594ace7df2672a7bec3e88607caa7b45e35024b33df62", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict13-683b290.stderr b/tests/reference/asr-test_dict13-683b290.stderr new file mode 100644 index 0000000000..b22b070fa2 --- /dev/null +++ b/tests/reference/asr-test_dict13-683b290.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_dict13.py:2:12 + | +2 | print({complex(0.0, 1.0): 1.1}) # constant dict with complex value as key + | ^^^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_dict2-4587f02.json b/tests/reference/asr-test_dict2-4587f02.json new file mode 100644 index 0000000000..270d51c545 --- /dev/null +++ b/tests/reference/asr-test_dict2-4587f02.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict2-4587f02", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict2.py", + "infile_hash": "300adb7c040d5d2035f7da25a633f6f83b5adc55b572990ad4403a5b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict2-4587f02.stderr", + "stderr_hash": "9de5d75622644a0cb98bdd3f73249772c25c293f508343b31cc34607", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict2-4587f02.stderr b/tests/reference/asr-test_dict2-4587f02.stderr new file mode 100644 index 0000000000..dde39a40a8 --- /dev/null +++ b/tests/reference/asr-test_dict2-4587f02.stderr @@ -0,0 +1,5 @@ +semantic error: Key type should be 'str' instead of 'i32' + --> tests/errors/test_dict2.py:4:7 + | +4 | y[1] = -3 + | ^ diff --git a/tests/reference/asr-test_dict3-d28f38f.json b/tests/reference/asr-test_dict3-d28f38f.json new file mode 100644 index 0000000000..ea944408ea --- /dev/null +++ b/tests/reference/asr-test_dict3-d28f38f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict3-d28f38f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict3.py", + "infile_hash": "c8930919a9c47244ed4c57c1235dd2000650eb61dbfb6f413ae934e0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict3-d28f38f.stderr", + "stderr_hash": "e2cc26634c1ee7aeca96c006b3bd01205200e1a6187e01fde041c3b4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict3-d28f38f.stderr b/tests/reference/asr-test_dict3-d28f38f.stderr new file mode 100644 index 0000000000..da5a97b2ce --- /dev/null +++ b/tests/reference/asr-test_dict3-d28f38f.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in get's key value, the types must be compatible + --> tests/errors/test_dict3.py:5:15 + | +5 | x = y.get(1) + | ^ type mismatch (found: 'i32', expected: 'str') diff --git a/tests/reference/asr-test_dict4-39489fa.json b/tests/reference/asr-test_dict4-39489fa.json new file mode 100644 index 0000000000..dbe64e91c0 --- /dev/null +++ b/tests/reference/asr-test_dict4-39489fa.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict4-39489fa", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict4.py", + "infile_hash": "57a17d3e7e3cc326f2a93d347e449280731ace5ae21a1fb910da5ba1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict4-39489fa.stderr", + "stderr_hash": "fee0e93265feaf634ae62eded08ec63f6c37530369217731b552de61", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict4-39489fa.stderr b/tests/reference/asr-test_dict4-39489fa.stderr new file mode 100644 index 0000000000..1b9e3847a8 --- /dev/null +++ b/tests/reference/asr-test_dict4-39489fa.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/test_dict4.py:2:5 + | +2 | d: dict[i32, i32] = {1: "a", 2: "b"} + | ^ ^^^^^^^^^^^^^^^^ type mismatch ('dict[i32, i32]' and 'dict[i32, str]') diff --git a/tests/reference/asr-test_dict5-c436d37.json b/tests/reference/asr-test_dict5-c436d37.json new file mode 100644 index 0000000000..4c7034730c --- /dev/null +++ b/tests/reference/asr-test_dict5-c436d37.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict5-c436d37", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict5.py", + "infile_hash": "4b1b45fc39df2a77ce477a006b9316550569af0309b0ac99562acf30", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict5-c436d37.stderr", + "stderr_hash": "85918b86a904812b9f151ec636dac3c770446a33ebac2f5910591ea7", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict5-c436d37.stderr b/tests/reference/asr-test_dict5-c436d37.stderr new file mode 100644 index 0000000000..c38b8997ba --- /dev/null +++ b/tests/reference/asr-test_dict5-c436d37.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_dict5.py:3:5 + | +3 | d = {1: "a", 2: "b"} + | ^ ^^^^^^^^^^^^^^^^ type mismatch ('dict[i32, i32]' and 'dict[i32, str]') diff --git a/tests/reference/asr-test_dict6-95e3b14.json b/tests/reference/asr-test_dict6-95e3b14.json new file mode 100644 index 0000000000..02c62b38c2 --- /dev/null +++ b/tests/reference/asr-test_dict6-95e3b14.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict6-95e3b14", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict6.py", + "infile_hash": "96cf7e14615e027428b3f60969ef27fd9dbb07171e9088dfbede5d06", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict6-95e3b14.stderr", + "stderr_hash": "786fd07ddc3919823741b0db9a9ff0ba898b106d677657ea5f80fd2e", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict6-95e3b14.stderr b/tests/reference/asr-test_dict6-95e3b14.stderr new file mode 100644 index 0000000000..9da26030e6 --- /dev/null +++ b/tests/reference/asr-test_dict6-95e3b14.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in pop's key value, the types must be compatible + --> tests/errors/test_dict6.py:5:17 + | +5 | res = d.pop("a") + | ^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_dict7-1415e14.json b/tests/reference/asr-test_dict7-1415e14.json new file mode 100644 index 0000000000..64eb4e7eb3 --- /dev/null +++ b/tests/reference/asr-test_dict7-1415e14.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict7-1415e14", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict7.py", + "infile_hash": "37950c687da9eedd23b6803bade370f46cb40fb89270d032722caf33", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict7-1415e14.stderr", + "stderr_hash": "a51d1d4a46839e1f4258410e979ba83a14abe8c011482e30be2336cd", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict7-1415e14.stderr b/tests/reference/asr-test_dict7-1415e14.stderr new file mode 100644 index 0000000000..7884efa64e --- /dev/null +++ b/tests/reference/asr-test_dict7-1415e14.stderr @@ -0,0 +1,5 @@ +semantic error: unhashable type in dict: 'slice' + --> tests/errors/test_dict7.py:4:11 + | +4 | print(d[1:2]) + | ^^^^^^ diff --git a/tests/reference/asr-test_dict8-d960ce0.json b/tests/reference/asr-test_dict8-d960ce0.json new file mode 100644 index 0000000000..303c677d1d --- /dev/null +++ b/tests/reference/asr-test_dict8-d960ce0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict8-d960ce0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict8.py", + "infile_hash": "a27a4c687822a5d03dba00df1201fac438fd4eb20479020de3563655", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict8-d960ce0.stderr", + "stderr_hash": "c2dcf3e38154f9a69328274fafd4940b8b6296d31f442c01c88eaa0e", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict8-d960ce0.stderr b/tests/reference/asr-test_dict8-d960ce0.stderr new file mode 100644 index 0000000000..050138ffac --- /dev/null +++ b/tests/reference/asr-test_dict8-d960ce0.stderr @@ -0,0 +1,5 @@ +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict8.py:4:8 + | +4 | d: dict[f64, f64] = {} + | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_dict9-907bda7.json b/tests/reference/asr-test_dict9-907bda7.json new file mode 100644 index 0000000000..3603e2ca62 --- /dev/null +++ b/tests/reference/asr-test_dict9-907bda7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_dict9-907bda7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_dict9.py", + "infile_hash": "09f382db99b7d322807aa7fcb8d12673a41ea17047b8adcd5b6302b1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_dict9-907bda7.stderr", + "stderr_hash": "3278571c4f1c492f88f33ca78dcf8fb5051f9e3ca89df7557b7881f6", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_dict9-907bda7.stderr b/tests/reference/asr-test_dict9-907bda7.stderr new file mode 100644 index 0000000000..a1394398fa --- /dev/null +++ b/tests/reference/asr-test_dict9-907bda7.stderr @@ -0,0 +1,5 @@ +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict9.py:4:8 + | +4 | d: dict[f32, f64] = {} + | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_end_sep_keywords-2226a67.json b/tests/reference/asr-test_end_sep_keywords-2226a67.json new file mode 100644 index 0000000000..fe42925e16 --- /dev/null +++ b/tests/reference/asr-test_end_sep_keywords-2226a67.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_end_sep_keywords-2226a67", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/test_end_sep_keywords.py", + "infile_hash": "5ea30711228d4ebb64266988c1a706a3d64f196457b939ed3bf15ecf", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_end_sep_keywords-2226a67.stdout", + "stdout_hash": "4946b03b00e3231e12fb3fc0f79a7b715cedf4e5dc74b3625a3098ae", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_end_sep_keywords-2226a67.stdout b/tests/reference/asr-test_end_sep_keywords-2226a67.stdout new file mode 100644 index 0000000000..bf7c34cdc1 --- /dev/null +++ b/tests/reference/asr-test_end_sep_keywords-2226a67.stdout @@ -0,0 +1,189 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [testEndSepKeywords] + [] + [(SubroutineCall + 2 testEndSepKeywords + () + [] + () + )] + () + Public + .false. + .false. + () + ), + testEndSepKeywords: + (Function + (SymbolTable + 3 + { + + }) + testEndSepKeywords + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(Print + () + [(StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "lmn" + (Character 1 3 ()) + ) + (StringConstant + "pqr" + (Character 1 3 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "lmn" + (Character 1 3 ()) + ) + (StringConstant + "pqr" + (Character 1 3 ()) + )] + (StringConstant + "+" + (Character 1 1 ()) + ) + () + ) + (Print + () + [(StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "lmn" + (Character 1 3 ()) + ) + (StringConstant + "pqr" + (Character 1 3 ()) + )] + () + (StringConstant + "xyz\n" + (Character 1 4 ()) + ) + ) + (Print + () + [(StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "lmn" + (Character 1 3 ()) + ) + (StringConstant + "pqr" + (Character 1 3 ()) + )] + (StringConstant + "+" + (Character 1 1 ()) + ) + (StringConstant + "xyz\n" + (Character 1 4 ()) + ) + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_for2-e5d893f.json b/tests/reference/asr-test_for2-e5d893f.json new file mode 100644 index 0000000000..0067f33cd4 --- /dev/null +++ b/tests/reference/asr-test_for2-e5d893f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_for2-e5d893f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_for2.py", + "infile_hash": "8a05d06e94c344432594db8536e6fed71767f109b03afea0a0b80d87", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_for2-e5d893f.stderr", + "stderr_hash": "07152b2e843a1a3ea9ab8e5c7c620d4ecc9f29ef1408d48055028b95", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_for2-e5d893f.stderr b/tests/reference/asr-test_for2-e5d893f.stderr new file mode 100644 index 0000000000..db88c88721 --- /dev/null +++ b/tests/reference/asr-test_for2-e5d893f.stderr @@ -0,0 +1,9 @@ +semantic error: For loop increment type should be Integer. + --> tests/errors/test_for2.py:3:5 - 4:16 + | +3 | for i in range(0.0, 1.0, 0.4): + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... +... + | +4 | print(i) + | ...^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_func_args-a898a72.json b/tests/reference/asr-test_func_args-a898a72.json new file mode 100644 index 0000000000..52ff1af35d --- /dev/null +++ b/tests/reference/asr-test_func_args-a898a72.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_func_args-a898a72", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_func_args.py", + "infile_hash": "5fae2ad01849e5ba3fca0a85455a92199a779be76b908fed30fb6b7d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_func_args-a898a72.stderr", + "stderr_hash": "b498b34cd18395e17ab982dc47abb832c01bd16ede103fad53068304", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_func_args-a898a72.stderr b/tests/reference/asr-test_func_args-a898a72.stderr new file mode 100644 index 0000000000..ec5891080a --- /dev/null +++ b/tests/reference/asr-test_func_args-a898a72.stderr @@ -0,0 +1,5 @@ +semantic error: Number of arguments does not match in the function call + --> tests/errors/test_func_args.py:11:11 + | +11 | ans = fib(35, 10) + | ^^^^^^^^^^^ (found: '2', expected: '1') diff --git a/tests/reference/asr-test_import_01-b859c43.json b/tests/reference/asr-test_import_01-b859c43.json new file mode 100644 index 0000000000..4c1f0a511b --- /dev/null +++ b/tests/reference/asr-test_import_01-b859c43.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_import_01-b859c43", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_import_01.py", + "infile_hash": "291b8bf62b25eaad7edd1fb6e4bd22d21c1dda6e488fa68562a98e99", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_import_01-b859c43.stderr", + "stderr_hash": "ef59d49c8273cdd97e830cac94b3cc620fb24b07ce00c3394081c9c5", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_import_01-b859c43.stderr b/tests/reference/asr-test_import_01-b859c43.stderr new file mode 100644 index 0000000000..a2a50d4911 --- /dev/null +++ b/tests/reference/asr-test_import_01-b859c43.stderr @@ -0,0 +1,10 @@ +semantic error: Type mismatch in procedure call; the types must be compatible + --> tests/errors/test_import_01.py:4:22 + | +4 | X: Const[f64] = test(5.0) + | ^^^ type mismatch (passed argument type is f64 but required type is i32) + + --> tests/errors/test_import/test_import_1.py:3:13 + | +3 | def test(x: i32) -> i32: + | ^^^ type mismatch (passed argument type is f64 but required type is i32) diff --git a/tests/reference/asr-test_import_02-55b47fa.json b/tests/reference/asr-test_import_02-55b47fa.json new file mode 100644 index 0000000000..04b0cf247e --- /dev/null +++ b/tests/reference/asr-test_import_02-55b47fa.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_import_02-55b47fa", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_import_02.py", + "infile_hash": "a3326a7bd9f6acc935235e1c0ff9cf4c26eda5f4052af774a148856c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_import_02-55b47fa.stderr", + "stderr_hash": "b30859152322cc22b1593d3af229c7b28fbc8bc03eb6542fec3a3c91", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_import_02-55b47fa.stderr b/tests/reference/asr-test_import_02-55b47fa.stderr new file mode 100644 index 0000000000..2c4a4fd389 --- /dev/null +++ b/tests/reference/asr-test_import_02-55b47fa.stderr @@ -0,0 +1,11 @@ +warning: The module 'test_import_2' located in tests/errors/test_import/test_import_2.py cannot be loaded + --> tests/errors/test_import_02.py:1:1 + | +1 | from test_import.test_import_2 import X + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/test_import/test_import_2.py:3:1 + | +3 | X: Const[i32] = 1.23 + | ^ ^^^^ type mismatch ('i32' and 'f64') diff --git a/tests/reference/asr-test_len1-839a615.json b/tests/reference/asr-test_len1-839a615.json new file mode 100644 index 0000000000..ee88e63b6e --- /dev/null +++ b/tests/reference/asr-test_len1-839a615.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_len1-839a615", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_len1.py", + "infile_hash": "a233dd883c545df2d1f853fc95c6ed9a68122fcfbd822cf96804a1ca", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_len1-839a615.stderr", + "stderr_hash": "50478fbc4d3bc86e9bf6cf012d810f31885d5e654423a0384557f919", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_len1-839a615.stderr b/tests/reference/asr-test_len1-839a615.stderr new file mode 100644 index 0000000000..2a491e7a48 --- /dev/null +++ b/tests/reference/asr-test_len1-839a615.stderr @@ -0,0 +1,5 @@ +semantic error: len() is only supported for `str`, `set`, `dict`, `list` and `tuple` + --> tests/errors/test_len1.py:4:11 + | +4 | print(len(x)) + | ^^^^^^ diff --git a/tests/reference/asr-test_list1-73fd538.json b/tests/reference/asr-test_list1-73fd538.json new file mode 100644 index 0000000000..33b0c94fc7 --- /dev/null +++ b/tests/reference/asr-test_list1-73fd538.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list1-73fd538", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list1.py", + "infile_hash": "bab0faf6c848b07f8cbce0ed060c0f067f38963ce247d150559a75b4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list1-73fd538.stderr", + "stderr_hash": "8c791203aa1be4c1cb8911aaaf447a5e706cc00d17dfeba0b17c283b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list1-73fd538.stderr b/tests/reference/asr-test_list1-73fd538.stderr new file mode 100644 index 0000000000..a9f4fd03cf --- /dev/null +++ b/tests/reference/asr-test_list1-73fd538.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in 'remove', the types must be compatible + --> tests/errors/test_list1.py:6:14 + | +6 | a.remove('error') + | ^^^^^^^ type mismatch (found: 'str', expected: 'i32') diff --git a/tests/reference/asr-test_list2-10ffdd7.json b/tests/reference/asr-test_list2-10ffdd7.json new file mode 100644 index 0000000000..0510d548d4 --- /dev/null +++ b/tests/reference/asr-test_list2-10ffdd7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list2-10ffdd7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list2.py", + "infile_hash": "1922554710c3c0cc93710512c5634e4a06f14e5e28dc169b6eac3fe2", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list2-10ffdd7.stderr", + "stderr_hash": "be192bc4655f28313c415c7180d676e0383f0acb7e4de75a6b3d1a37", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list2-10ffdd7.stderr b/tests/reference/asr-test_list2-10ffdd7.stderr new file mode 100644 index 0000000000..0607fb8266 --- /dev/null +++ b/tests/reference/asr-test_list2-10ffdd7.stderr @@ -0,0 +1,5 @@ +semantic error: append() takes exactly one argument + --> tests/errors/test_list2.py:6:5 + | +6 | a.append(4, 5) + | ^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_list3-5f4d2a8.json b/tests/reference/asr-test_list3-5f4d2a8.json new file mode 100644 index 0000000000..09d515e69a --- /dev/null +++ b/tests/reference/asr-test_list3-5f4d2a8.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list3-5f4d2a8", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list3.py", + "infile_hash": "f512b77e66fe356108135243473cf9441bc532310547070a9aeef3e9", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list3-5f4d2a8.stderr", + "stderr_hash": "3e8e102841bfe5ae8524aa793b39cdf33de7e7073744a01f0049b424", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list3-5f4d2a8.stderr b/tests/reference/asr-test_list3-5f4d2a8.stderr new file mode 100644 index 0000000000..45d1ab0536 --- /dev/null +++ b/tests/reference/asr-test_list3-5f4d2a8.stderr @@ -0,0 +1,5 @@ +semantic error: Argument to list.pop must be an integer + --> tests/errors/test_list3.py:5:9 + | +5 | x = a.pop(2.2) + | ^^^^^^^^^^ diff --git a/tests/reference/asr-test_list4-d18a7e3.json b/tests/reference/asr-test_list4-d18a7e3.json new file mode 100644 index 0000000000..af9e9f1da7 --- /dev/null +++ b/tests/reference/asr-test_list4-d18a7e3.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list4-d18a7e3", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list4.py", + "infile_hash": "d93fc79d9b95b91ea6dd5190f2320d2c84f25ff9c108dff9d13086c1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list4-d18a7e3.stderr", + "stderr_hash": "98922e9f57ab8e9d7af05424e9fdb93a9a1722114f5abb816439b161", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list4-d18a7e3.stderr b/tests/reference/asr-test_list4-d18a7e3.stderr new file mode 100644 index 0000000000..b3b4683868 --- /dev/null +++ b/tests/reference/asr-test_list4-d18a7e3.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in index, expected a single integer or slice + --> tests/errors/test_list4.py:7:11 + | +7 | x = a[0.2] + | ^^^ type mismatch (found: 'f64', expected: 'i32' or slice) diff --git a/tests/reference/asr-test_list_concat-41d186f.json b/tests/reference/asr-test_list_concat-41d186f.json new file mode 100644 index 0000000000..ff64ae4aac --- /dev/null +++ b/tests/reference/asr-test_list_concat-41d186f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list_concat-41d186f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list_concat.py", + "infile_hash": "2dbbc047f2ededbe3c1cdebe412647006e9e7a7043514ad12857b7ec", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list_concat-41d186f.stderr", + "stderr_hash": "b0a3cfa79525db1ed6aa4ed1f47b11e4852da5a59e043d32a7814ede", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list_concat-41d186f.stderr b/tests/reference/asr-test_list_concat-41d186f.stderr new file mode 100644 index 0000000000..bdfcab29af --- /dev/null +++ b/tests/reference/asr-test_list_concat-41d186f.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in shorthand operator, the types must be compatible + --> tests/errors/test_list_concat.py:8:3 + | +8 | a += b + | ^ ^ type mismatch ('list[i32]' and 'list[f64]') diff --git a/tests/reference/asr-test_list_count-4b42498.json b/tests/reference/asr-test_list_count-4b42498.json new file mode 100644 index 0000000000..f4864b55fb --- /dev/null +++ b/tests/reference/asr-test_list_count-4b42498.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list_count-4b42498", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list_count.py", + "infile_hash": "01975bd7c4bba02fd811de536b218167da99b532fa955b7bf8339779", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list_count-4b42498.stderr", + "stderr_hash": "f26efcc623b68ca43ef871eb01c8e3cbd1ae464baaa491c6e4969696", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list_count-4b42498.stderr b/tests/reference/asr-test_list_count-4b42498.stderr new file mode 100644 index 0000000000..ad60a50f0e --- /dev/null +++ b/tests/reference/asr-test_list_count-4b42498.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in 'count', the types must be compatible + --> tests/errors/test_list_count.py:6:13 + | +6 | a.count(1.0) + | ^^^ type mismatch (found: 'f64', expected: 'i32') diff --git a/tests/reference/asr-test_list_slicing-984fbf0.json b/tests/reference/asr-test_list_slicing-984fbf0.json new file mode 100644 index 0000000000..d525b6d6c9 --- /dev/null +++ b/tests/reference/asr-test_list_slicing-984fbf0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_list_slicing-984fbf0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_list_slicing.py", + "infile_hash": "7dfe8cfa4697e4ce8bf18e24c5b11b969e8329febc711d83d2fba746", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_list_slicing-984fbf0.stderr", + "stderr_hash": "6763533f9c1730429d50f58b653595bfeef48c4d19943c36d037d023", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_list_slicing-984fbf0.stderr b/tests/reference/asr-test_list_slicing-984fbf0.stderr new file mode 100644 index 0000000000..dc773c9f70 --- /dev/null +++ b/tests/reference/asr-test_list_slicing-984fbf0.stderr @@ -0,0 +1,5 @@ +semantic error: slice step cannot be zero + --> tests/errors/test_list_slicing.py:6:18 + | +6 | print(l[0:10:0]) + | ^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.json b/tests/reference/asr-test_max_min-3c2fc51.json new file mode 100644 index 0000000000..7c51d764ca --- /dev/null +++ b/tests/reference/asr-test_max_min-3c2fc51.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_max_min-3c2fc51", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_max_min.py", + "infile_hash": "1aba932852adf8cc5dbff4a6ff83aa5de030dba5a5721eeace90a5d4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_max_min-3c2fc51.stderr", + "stderr_hash": "bc3642925ccc0f3f61e37e0bd20fc7100fddbfb37c06a3609ff78daf", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_max_min-3c2fc51.stderr b/tests/reference/asr-test_max_min-3c2fc51.stderr new file mode 100644 index 0000000000..15c4a4ff5a --- /dev/null +++ b/tests/reference/asr-test_max_min-3c2fc51.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_max_min.py:7:12 + | +7 | assert max(a, b) == b + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_03-e600a49.json b/tests/reference/asr-test_numpy_03-e600a49.json new file mode 100644 index 0000000000..11537ffe29 --- /dev/null +++ b/tests/reference/asr-test_numpy_03-e600a49.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_numpy_03-e600a49", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_numpy_03.py", + "infile_hash": "5c3ea7436668441c056bd576ea77cdfb49e44a5f0e95088d0f62184e", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_numpy_03-e600a49.stderr", + "stderr_hash": "934ed2ca36b7a4e431b1e4fc8dbd37edd550f7dbb5d9dca7ed49ce61", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_03-e600a49.stderr b/tests/reference/asr-test_numpy_03-e600a49.stderr new file mode 100644 index 0000000000..74f788b4cf --- /dev/null +++ b/tests/reference/asr-test_numpy_03-e600a49.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/test_numpy_03.py:2:1 + | +2 | from numpy import reshape, empty, int32, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_04-ecbb614.json b/tests/reference/asr-test_numpy_04-ecbb614.json new file mode 100644 index 0000000000..a0e2dcecdb --- /dev/null +++ b/tests/reference/asr-test_numpy_04-ecbb614.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_numpy_04-ecbb614", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_numpy_04.py", + "infile_hash": "0fbd0a4280966dd9a917d3a005887954325fb1ea5468fd28dcae930f", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_numpy_04-ecbb614.stderr", + "stderr_hash": "8f73238d34192a66d0659b3cc8e5f8a5339755da83a50790689cf53b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stderr b/tests/reference/asr-test_numpy_04-ecbb614.stderr new file mode 100644 index 0000000000..7bc395d1fc --- /dev/null +++ b/tests/reference/asr-test_numpy_04-ecbb614.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/test_numpy_04.py:2:1 + | +2 | from numpy import array + | ^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_operator_01-0f232bf.json b/tests/reference/asr-test_operator_01-0f232bf.json new file mode 100644 index 0000000000..9cb9b85ba8 --- /dev/null +++ b/tests/reference/asr-test_operator_01-0f232bf.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_operator_01-0f232bf", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_operator_01.py", + "infile_hash": "fe3fc1c23c2f63265b758b4d5d757943c1462811c5bc5e7a14abb64d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_operator_01-0f232bf.stderr", + "stderr_hash": "6f529c2fc1fc5a489879c5d684c3415269794e563be85d62098aed7c", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_operator_01-0f232bf.stderr b/tests/reference/asr-test_operator_01-0f232bf.stderr new file mode 100644 index 0000000000..1a939f05a8 --- /dev/null +++ b/tests/reference/asr-test_operator_01-0f232bf.stderr @@ -0,0 +1,5 @@ +semantic error: Unary operator '-' not supported for type struct A + --> tests/errors/test_operator_01.py:9:11 + | +9 | print(-a) + | ^^ diff --git a/tests/reference/asr-test_ord-316ce61.json b/tests/reference/asr-test_ord-316ce61.json new file mode 100644 index 0000000000..362e582d03 --- /dev/null +++ b/tests/reference/asr-test_ord-316ce61.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_ord-316ce61", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_ord.py", + "infile_hash": "5ea1a821ece44ef24e91e5ba66152fd1c27bb3724d2cad2e7e2d96f2", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_ord-316ce61.stderr", + "stderr_hash": "dda39c93777d64449510b35e893d516cd53ac299cd2b5f19b08464bd", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_ord-316ce61.stderr b/tests/reference/asr-test_ord-316ce61.stderr new file mode 100644 index 0000000000..45103fea10 --- /dev/null +++ b/tests/reference/asr-test_ord-316ce61.stderr @@ -0,0 +1,5 @@ +semantic error: ord() is only supported for `str` of length 1 + --> tests/errors/test_ord.py:3:13 + | +3 | i = ord('ab') + | ^^^^ diff --git a/tests/reference/asr-test_pointer_types-1bf0d01.json b/tests/reference/asr-test_pointer_types-1bf0d01.json new file mode 100644 index 0000000000..a832067275 --- /dev/null +++ b/tests/reference/asr-test_pointer_types-1bf0d01.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pointer_types-1bf0d01", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pointer_types.py", + "infile_hash": "c5290af854c1f4a76252d27a2ae05f309ae55b9d6fc6ee533989cec7", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pointer_types-1bf0d01.stderr", + "stderr_hash": "3fcd692a6b79b6b3f22fc7a2957df19219fc817446aa6d46f47d049f", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pointer_types-1bf0d01.stderr b/tests/reference/asr-test_pointer_types-1bf0d01.stderr new file mode 100644 index 0000000000..4a61aeb2e6 --- /dev/null +++ b/tests/reference/asr-test_pointer_types-1bf0d01.stderr @@ -0,0 +1,5 @@ +semantic error: Casting not supported for different pointer types. Received target pointer type, Pointer[i16[:]] and value pointer type, Pointer[i32[:]] + --> tests/errors/test_pointer_types.py:8:5 + | +8 | yptr1 = pointer(y) + | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_pow-3f5d550.json b/tests/reference/asr-test_pow-3f5d550.json new file mode 100644 index 0000000000..95344abe65 --- /dev/null +++ b/tests/reference/asr-test_pow-3f5d550.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pow-3f5d550", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pow.py", + "infile_hash": "073bf734150500a8b5e46940a9b0440e7e0fe30d0e2789ca049cef17", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pow-3f5d550.stderr", + "stderr_hash": "13a950a0d1f29b9a7cf4484858b22246b086a24919ca22f6b1d410b3", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pow-3f5d550.stderr b/tests/reference/asr-test_pow-3f5d550.stderr new file mode 100644 index 0000000000..c955d6b4bc --- /dev/null +++ b/tests/reference/asr-test_pow-3f5d550.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_pow.py:2:11 + | +2 | print(pow(2, 2)) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow1-581ef42.json b/tests/reference/asr-test_pow1-581ef42.json new file mode 100644 index 0000000000..2ef657f3ac --- /dev/null +++ b/tests/reference/asr-test_pow1-581ef42.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pow1-581ef42", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pow1.py", + "infile_hash": "a7ce7888e7e99bc753e16822749aaae4ee63641675990b3e2a34de10", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pow1-581ef42.stderr", + "stderr_hash": "32fe0eecb3687de0e976228815c25c96f3dc3e8f6491adb21c105ee6", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pow1-581ef42.stderr b/tests/reference/asr-test_pow1-581ef42.stderr new file mode 100644 index 0000000000..f1693701de --- /dev/null +++ b/tests/reference/asr-test_pow1-581ef42.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_pow1.py:4:11 + | +4 | print(pow(x,3)) + | ^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow2-0dcbd7d.json b/tests/reference/asr-test_pow2-0dcbd7d.json new file mode 100644 index 0000000000..129acc3859 --- /dev/null +++ b/tests/reference/asr-test_pow2-0dcbd7d.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pow2-0dcbd7d", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pow2.py", + "infile_hash": "0df16d4f512305265cb2924e18db5753a4c422da3a7624f74f71d26f", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pow2-0dcbd7d.stderr", + "stderr_hash": "54113068b55d3eab93cd04927b2fbf6a384a4a0ed64f02aa6ea18f9b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pow2-0dcbd7d.stderr b/tests/reference/asr-test_pow2-0dcbd7d.stderr new file mode 100644 index 0000000000..edc4007245 --- /dev/null +++ b/tests/reference/asr-test_pow2-0dcbd7d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_pow2.py:12:11 + | +12 | print(pow(a, b, c, d)) + | ^^^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow3-79749ed.json b/tests/reference/asr-test_pow3-79749ed.json new file mode 100644 index 0000000000..7c5d30d4da --- /dev/null +++ b/tests/reference/asr-test_pow3-79749ed.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pow3-79749ed", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pow3.py", + "infile_hash": "884bdc831e2b2d01c30a2dd841307fd5674ab65e0c3819d17e3db500", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pow3-79749ed.stderr", + "stderr_hash": "199c8dc10f23e2053ec5498131683383bb4b20bf06b05bf1c5f7d747", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pow3-79749ed.stderr b/tests/reference/asr-test_pow3-79749ed.stderr new file mode 100644 index 0000000000..3a157a0866 --- /dev/null +++ b/tests/reference/asr-test_pow3-79749ed.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_pow3.py:8:11 + | +8 | print(pow(x, a)) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_pow4-ef60978.json b/tests/reference/asr-test_pow4-ef60978.json new file mode 100644 index 0000000000..8cfd3c1460 --- /dev/null +++ b/tests/reference/asr-test_pow4-ef60978.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_pow4-ef60978", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_pow4.py", + "infile_hash": "af9b11ec50a82de28afac31faa4a78bdbeb5f317537fc37860b139cd", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_pow4-ef60978.stderr", + "stderr_hash": "e4796a76ca15b125485b820d259be4ce20ed67f403953372685b98d5", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_pow4-ef60978.stderr b/tests/reference/asr-test_pow4-ef60978.stderr new file mode 100644 index 0000000000..2dc752cd36 --- /dev/null +++ b/tests/reference/asr-test_pow4-ef60978.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/errors/test_pow4.py:10:11 + | +10 | print(pow(x, a, b)) + | ^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr-test_print1-f1f36f1.json b/tests/reference/asr-test_print1-f1f36f1.json new file mode 100644 index 0000000000..0c4988e3a3 --- /dev/null +++ b/tests/reference/asr-test_print1-f1f36f1.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_print1-f1f36f1", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_print1.py", + "infile_hash": "824e91278f3717dbe58ef4c18f8df06f9c7d4644ca6f3a65cccdc9e0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_print1-f1f36f1.stderr", + "stderr_hash": "da6324bcc282ecb93fe6784b206f8a9d8f04ae56341339b13de71bd4", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_print1-f1f36f1.stderr b/tests/reference/asr-test_print1-f1f36f1.stderr new file mode 100644 index 0000000000..b28bc75a72 --- /dev/null +++ b/tests/reference/asr-test_print1-f1f36f1.stderr @@ -0,0 +1,5 @@ +semantic error: Separator is expected to be of string type + --> tests/errors/test_print1.py:2:25 + | +2 | print("a", "b", sep=2) + | ^ Expected string, found: integer diff --git a/tests/reference/asr-test_print2-64acb15.json b/tests/reference/asr-test_print2-64acb15.json new file mode 100644 index 0000000000..050b4cc698 --- /dev/null +++ b/tests/reference/asr-test_print2-64acb15.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_print2-64acb15", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_print2.py", + "infile_hash": "af07d17d5b3f16db024a3e893923988349c8f6c8bf1a6c5507d56a6d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_print2-64acb15.stderr", + "stderr_hash": "e92bba85b957e7034c5172981b3b27ed7b3f0ac62167d82175890bc9", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_print2-64acb15.stderr b/tests/reference/asr-test_print2-64acb15.stderr new file mode 100644 index 0000000000..6ed1c334b1 --- /dev/null +++ b/tests/reference/asr-test_print2-64acb15.stderr @@ -0,0 +1,5 @@ +semantic error: End is expected to be of string type + --> tests/errors/test_print2.py:2:26 + | +2 | print("a", "b", end=1) + | ^ Expected string, found: integer diff --git a/tests/reference/asr-test_return1-2603c9e.json b/tests/reference/asr-test_return1-2603c9e.json new file mode 100644 index 0000000000..cc65ed1a6a --- /dev/null +++ b/tests/reference/asr-test_return1-2603c9e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_return1-2603c9e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_return1.py", + "infile_hash": "ec68add4e9e8059a274ba97c4349b3a8f1a43a381eb6ab330995681e", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_return1-2603c9e.stderr", + "stderr_hash": "6449cc5e148acf72281e7ef604decd32889ceb27b87052fe8ff8eb50", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_return1-2603c9e.stderr b/tests/reference/asr-test_return1-2603c9e.stderr new file mode 100644 index 0000000000..82fec8d42d --- /dev/null +++ b/tests/reference/asr-test_return1-2603c9e.stderr @@ -0,0 +1,5 @@ +semantic error: Type Mismatch in return, found ('f64' and 'i32') + --> tests/errors/test_return1.py:4:5 + | +4 | return x + | ^^^^^^^^ diff --git a/tests/reference/asr-test_return2-add829b.json b/tests/reference/asr-test_return2-add829b.json new file mode 100644 index 0000000000..abdb4461f7 --- /dev/null +++ b/tests/reference/asr-test_return2-add829b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_return2-add829b", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_return2.py", + "infile_hash": "6423d00b6ef8b232c393994d190121f76befdc32a2e5da21d655458b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_return2-add829b.stderr", + "stderr_hash": "493f7a8431e00a1bfeb1756b0718b0a40458883c8b9eb379f0c5b536", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_return2-add829b.stderr b/tests/reference/asr-test_return2-add829b.stderr new file mode 100644 index 0000000000..a9070a952d --- /dev/null +++ b/tests/reference/asr-test_return2-add829b.stderr @@ -0,0 +1,5 @@ +semantic error: Return type of function is not defined + --> tests/errors/test_return2.py:4:5 + | +4 | return x + | ^^^^^^^^ diff --git a/tests/reference/asr-test_set1-11379c7.json b/tests/reference/asr-test_set1-11379c7.json new file mode 100644 index 0000000000..417bba61b8 --- /dev/null +++ b/tests/reference/asr-test_set1-11379c7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_set1-11379c7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_set1.py", + "infile_hash": "54179c34d3818cd0b57d582c930226ce5443a43386ae981aab02e50b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_set1-11379c7.stderr", + "stderr_hash": "64dea3d94817d0666cf71481546f7ec61639f47a3b696fe96ae287c6", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_set1-11379c7.stderr b/tests/reference/asr-test_set1-11379c7.stderr new file mode 100644 index 0000000000..f5851bc83d --- /dev/null +++ b/tests/reference/asr-test_set1-11379c7.stderr @@ -0,0 +1,5 @@ +semantic error: Argument to set.add must be of same type as set's element type + --> tests/errors/test_set1.py:6:5 + | +6 | a.add('err') + | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set2-d91a6f0.json b/tests/reference/asr-test_set2-d91a6f0.json new file mode 100644 index 0000000000..4c1d7ad258 --- /dev/null +++ b/tests/reference/asr-test_set2-d91a6f0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_set2-d91a6f0", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_set2.py", + "infile_hash": "2d561d934090bedc052b2ef17bc3ac9b59ed94298fd39cbea2c9ba15", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_set2-d91a6f0.stderr", + "stderr_hash": "36a3e507b04f030fc4e281ffe82947765ef640b6c558030957bd3e90", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_set2-d91a6f0.stderr b/tests/reference/asr-test_set2-d91a6f0.stderr new file mode 100644 index 0000000000..29a2683c11 --- /dev/null +++ b/tests/reference/asr-test_set2-d91a6f0.stderr @@ -0,0 +1,5 @@ +semantic error: Call to set.remove must have exactly one argument + --> tests/errors/test_set2.py:6:5 + | +6 | a.remove('error', 'error2') + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set3-f9bbffb.json b/tests/reference/asr-test_set3-f9bbffb.json new file mode 100644 index 0000000000..877113068e --- /dev/null +++ b/tests/reference/asr-test_set3-f9bbffb.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_set3-f9bbffb", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_set3.py", + "infile_hash": "c4e83ae667bdaa458fd271a51e15d6c5f9a666f006e31de27a897571", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_set3-f9bbffb.stderr", + "stderr_hash": "1ec6cfef0827e97a905c5927de43b74452777394b1f5110e94e5cf97", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_set3-f9bbffb.stderr b/tests/reference/asr-test_set3-f9bbffb.stderr new file mode 100644 index 0000000000..ecc3bf6177 --- /dev/null +++ b/tests/reference/asr-test_set3-f9bbffb.stderr @@ -0,0 +1,5 @@ +semantic error: pop() takes no arguments (1 given) + --> tests/errors/test_set3.py:5:9 + | +5 | i = s.pop(3) + | ^^^^^^^^ diff --git a/tests/reference/asr-test_set4-53fea39.json b/tests/reference/asr-test_set4-53fea39.json new file mode 100644 index 0000000000..aad37eb089 --- /dev/null +++ b/tests/reference/asr-test_set4-53fea39.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_set4-53fea39", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_set4.py", + "infile_hash": "3d78c7ad82aa32c3a4cc5f1a7d44e53b81639194f55672ddc99b4d2d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_set4-53fea39.stderr", + "stderr_hash": "d9646bd3609c55ff39f57ca435fedc7dabed530caf28caddc9e58a06", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_set4-53fea39.stderr b/tests/reference/asr-test_set4-53fea39.stderr new file mode 100644 index 0000000000..9ce2e3863c --- /dev/null +++ b/tests/reference/asr-test_set4-53fea39.stderr @@ -0,0 +1,5 @@ +semantic error: Call to set.add must have exactly one argument + --> tests/errors/test_set4.py:6:5 + | +6 | a.add(3, 4) + | ^^^^^^^^^^^ diff --git a/tests/reference/asr-test_set_indexing-a1c21b8.json b/tests/reference/asr-test_set_indexing-a1c21b8.json new file mode 100644 index 0000000000..6bb6e96be3 --- /dev/null +++ b/tests/reference/asr-test_set_indexing-a1c21b8.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_set_indexing-a1c21b8", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_set_indexing.py", + "infile_hash": "24f02fc93b8ed20f1c9ea7ae862faa087d070ec288577b90b90b3bc5", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_set_indexing-a1c21b8.stderr", + "stderr_hash": "fe69096aca9c3be072acac0e28081e5378f30d4ba335176abc76c555", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_set_indexing-a1c21b8.stderr b/tests/reference/asr-test_set_indexing-a1c21b8.stderr new file mode 100644 index 0000000000..1a7be88156 --- /dev/null +++ b/tests/reference/asr-test_set_indexing-a1c21b8.stderr @@ -0,0 +1,5 @@ +semantic error: 'set' object is not subscriptable + --> tests/errors/test_set_indexing.py:7:9 + | +7 | a = s[0] + | ^^^^ diff --git a/tests/reference/asr-test_str_capitalize-9f8dfa9.json b/tests/reference/asr-test_str_capitalize-9f8dfa9.json new file mode 100644 index 0000000000..88a959a54d --- /dev/null +++ b/tests/reference/asr-test_str_capitalize-9f8dfa9.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_capitalize-9f8dfa9", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_capitalize.py", + "infile_hash": "692d46b579b69174d3f9bc7091d1b79d6e003fd14bc669a6f93dcb80", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_capitalize-9f8dfa9.stderr", + "stderr_hash": "7dea3deffeee54e7f479d4c0dbcd7b5aab3b1a28e4a568adfb52cf51", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr b/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr new file mode 100644 index 0000000000..c04687d572 --- /dev/null +++ b/tests/reference/asr-test_str_capitalize-9f8dfa9.stderr @@ -0,0 +1,5 @@ +semantic error: str.capitalize() takes no arguments + --> tests/errors/test_str_capitalize.py:4:9 + | +4 | s = s.capitalize(23) + | ^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_str_indexing-b200a4e.json b/tests/reference/asr-test_str_indexing-b200a4e.json new file mode 100644 index 0000000000..1193d8bad7 --- /dev/null +++ b/tests/reference/asr-test_str_indexing-b200a4e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_indexing-b200a4e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_indexing.py", + "infile_hash": "d237030704fd7f04d4cad59083ca0d663561f9be6f3407e3ed04ed78", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_indexing-b200a4e.stderr", + "stderr_hash": "eddc45a6ba83dc10551fd9685b6ea1096828ae29f6b9cce07cfe5de1", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_indexing-b200a4e.stderr b/tests/reference/asr-test_str_indexing-b200a4e.stderr new file mode 100644 index 0000000000..fb521217df --- /dev/null +++ b/tests/reference/asr-test_str_indexing-b200a4e.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in index, expected a single integer or slice + --> tests/errors/test_str_indexing.py:4:13 + | +4 | print(s[1.2]) + | ^^^ type mismatch (found: 'f64', expected: 'i32' or slice) diff --git a/tests/reference/asr-test_str_slicing-eca1381.json b/tests/reference/asr-test_str_slicing-eca1381.json new file mode 100644 index 0000000000..684a869d6a --- /dev/null +++ b/tests/reference/asr-test_str_slicing-eca1381.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_slicing-eca1381", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_slicing.py", + "infile_hash": "24041d5ae8086e162ce7fa574ad5877102af8f718ad33bea7006260d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_slicing-eca1381.stderr", + "stderr_hash": "7374319e4378d1cc717e1bab3f68f207cb90c40c168d5700c77d189b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing-eca1381.stderr b/tests/reference/asr-test_str_slicing-eca1381.stderr new file mode 100644 index 0000000000..d50b2ffd94 --- /dev/null +++ b/tests/reference/asr-test_str_slicing-eca1381.stderr @@ -0,0 +1,5 @@ +semantic error: slice indices must be integers or None + --> tests/errors/test_str_slicing.py:4:15 + | +4 | print(s[1:2.2]) + | ^^^ diff --git a/tests/reference/asr-test_str_slicing2-2f07e9a.json b/tests/reference/asr-test_str_slicing2-2f07e9a.json new file mode 100644 index 0000000000..dc63e9a7b0 --- /dev/null +++ b/tests/reference/asr-test_str_slicing2-2f07e9a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_slicing2-2f07e9a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_slicing2.py", + "infile_hash": "eb9027d2b6ec0aba9cc78aeedc1b0b36972ff36b076fecf547eeb014", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_slicing2-2f07e9a.stderr", + "stderr_hash": "48a9286126c2333bdf5237358bd4ad27acac4a16a78069c9bd36d089", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing2-2f07e9a.stderr b/tests/reference/asr-test_str_slicing2-2f07e9a.stderr new file mode 100644 index 0000000000..94a5f03259 --- /dev/null +++ b/tests/reference/asr-test_str_slicing2-2f07e9a.stderr @@ -0,0 +1,5 @@ +semantic error: slice indices must be integers or None + --> tests/errors/test_str_slicing2.py:4:13 + | +4 | print(s[1.5:3]) + | ^^^ diff --git a/tests/reference/asr-test_str_slicing3-fe6a03c.json b/tests/reference/asr-test_str_slicing3-fe6a03c.json new file mode 100644 index 0000000000..d1fe49fdfe --- /dev/null +++ b/tests/reference/asr-test_str_slicing3-fe6a03c.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_slicing3-fe6a03c", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_slicing3.py", + "infile_hash": "b223abc3ec96fe91876fa188259f151d61383687776e8975df45b139", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_slicing3-fe6a03c.stderr", + "stderr_hash": "5f7553d1509bed25d5137abc4fc2cb1d2cb983a1fab81d8d178ed197", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing3-fe6a03c.stderr b/tests/reference/asr-test_str_slicing3-fe6a03c.stderr new file mode 100644 index 0000000000..b1180c30ae --- /dev/null +++ b/tests/reference/asr-test_str_slicing3-fe6a03c.stderr @@ -0,0 +1,5 @@ +semantic error: slice indices must be integers or None + --> tests/errors/test_str_slicing3.py:4:17 + | +4 | print(s[1:3:0.5]) + | ^^^ diff --git a/tests/reference/asr-test_str_slicing4-a0c7a69.json b/tests/reference/asr-test_str_slicing4-a0c7a69.json new file mode 100644 index 0000000000..ceff8659bb --- /dev/null +++ b/tests/reference/asr-test_str_slicing4-a0c7a69.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_slicing4-a0c7a69", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_slicing4.py", + "infile_hash": "7bd3e8d21550f50244ee88e383dbd42cde33f03c516cfcaaeaaadd71", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_slicing4-a0c7a69.stderr", + "stderr_hash": "a5dd047df86649936606a0b134d10e76c6aacb224319be4aefd64bfe", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_slicing4-a0c7a69.stderr b/tests/reference/asr-test_str_slicing4-a0c7a69.stderr new file mode 100644 index 0000000000..8709b99ee8 --- /dev/null +++ b/tests/reference/asr-test_str_slicing4-a0c7a69.stderr @@ -0,0 +1,5 @@ +semantic error: slice step cannot be zero + --> tests/errors/test_str_slicing4.py:4:17 + | +4 | print(s[0:1:0]) + | ^ diff --git a/tests/reference/asr-test_str_to_int-61553e7.json b/tests/reference/asr-test_str_to_int-61553e7.json new file mode 100644 index 0000000000..ac1093b9c8 --- /dev/null +++ b/tests/reference/asr-test_str_to_int-61553e7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_str_to_int-61553e7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_str_to_int.py", + "infile_hash": "da0ed82ada98ef2757178c4997af53abc82f4761a0e683a613216c64", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_str_to_int-61553e7.stderr", + "stderr_hash": "1998e37d9abe044f164c73ea1e000ce748ed43af5ea14c2eb4715f11", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_str_to_int-61553e7.stderr b/tests/reference/asr-test_str_to_int-61553e7.stderr new file mode 100644 index 0000000000..785d95ba7f --- /dev/null +++ b/tests/reference/asr-test_str_to_int-61553e7.stderr @@ -0,0 +1,5 @@ +semantic error: invalid literal for int() with base 10: '3abc' + --> tests/errors/test_str_to_int.py:2:15 + | +2 | print(int('3abc')) + | ^^^^^^ diff --git a/tests/reference/asr-test_tuple1-7abe88f.json b/tests/reference/asr-test_tuple1-7abe88f.json new file mode 100644 index 0000000000..e308970eea --- /dev/null +++ b/tests/reference/asr-test_tuple1-7abe88f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_tuple1-7abe88f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_tuple1.py", + "infile_hash": "4716ea56ce9d57a0d88ffeb9fca4e09204f7a2c1166a5315c4d1245c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_tuple1-7abe88f.stderr", + "stderr_hash": "56df3d46c63077fcdd09c3b54b63e6e096d7d39b2f8cfb61dab0930a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple1-7abe88f.stderr b/tests/reference/asr-test_tuple1-7abe88f.stderr new file mode 100644 index 0000000000..c66cc64946 --- /dev/null +++ b/tests/reference/asr-test_tuple1-7abe88f.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in assignment, the types must be compatible + --> tests/errors/test_tuple1.py:3:3 + | +3 | t = (1, 2) + | ^ ^^^^^^ type mismatch ('tuple[i32, str]' and 'tuple[i32, i32]') diff --git a/tests/reference/asr-test_tuple2-b046610.json b/tests/reference/asr-test_tuple2-b046610.json new file mode 100644 index 0000000000..051ed20bfb --- /dev/null +++ b/tests/reference/asr-test_tuple2-b046610.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_tuple2-b046610", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_tuple2.py", + "infile_hash": "84aa4ecdd21f5d633975d08f6927a7d336c47a31c2fd2bc42cae1c7b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_tuple2-b046610.stderr", + "stderr_hash": "1e22bbde9c9fdc171314f1158dcac6bf6373d94e00c9878f66d7b667", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple2-b046610.stderr b/tests/reference/asr-test_tuple2-b046610.stderr new file mode 100644 index 0000000000..e99518093e --- /dev/null +++ b/tests/reference/asr-test_tuple2-b046610.stderr @@ -0,0 +1,5 @@ +semantic error: Runtime Indexing with tuple[i32, i32, i32] is not possible. + --> tests/errors/test_tuple2.py:4:11 + | +4 | print(t[x]) + | ^^^^ diff --git a/tests/reference/asr-test_tuple3-19fa47f.json b/tests/reference/asr-test_tuple3-19fa47f.json new file mode 100644 index 0000000000..0a703f17d4 --- /dev/null +++ b/tests/reference/asr-test_tuple3-19fa47f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_tuple3-19fa47f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_tuple3.py", + "infile_hash": "cfa12cc4d8456bfd45e77cc49c5e8d2417181a1443cdaaf8b15c0528", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_tuple3-19fa47f.stderr", + "stderr_hash": "780d951c4bfa3476ee84d16d9a89c5a9255691b270bfb312d974608e", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_tuple3-19fa47f.stderr b/tests/reference/asr-test_tuple3-19fa47f.stderr new file mode 100644 index 0000000000..fe438fb382 --- /dev/null +++ b/tests/reference/asr-test_tuple3-19fa47f.stderr @@ -0,0 +1,5 @@ +semantic error: Tuple index out of bounds + --> tests/errors/test_tuple3.py:3:11 + | +3 | print(t[-4]) + | ^^^^^ diff --git a/tests/reference/asr-test_type_mismatch_01-09e8af3.json b/tests/reference/asr-test_type_mismatch_01-09e8af3.json new file mode 100644 index 0000000000..ce2513c935 --- /dev/null +++ b/tests/reference/asr-test_type_mismatch_01-09e8af3.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_type_mismatch_01-09e8af3", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_type_mismatch_01.py", + "infile_hash": "58baa8f4a5094bfa977527f92814a375ceea1f9a99c08e43bdd18ad4", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_type_mismatch_01-09e8af3.stderr", + "stderr_hash": "78ff11b22438e133b740e778063db612841fb15ef00f8599bdf8602c", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr b/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr new file mode 100644 index 0000000000..3dc100fad6 --- /dev/null +++ b/tests/reference/asr-test_type_mismatch_01-09e8af3.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in shorthand operator, the types must be compatible + --> tests/errors/test_type_mismatch_01.py:6:5 + | +6 | a /= b + | ^ ^ type mismatch ('i32' and 'f64') diff --git a/tests/reference/asr-test_unary_op_03-e799eae.json b/tests/reference/asr-test_unary_op_03-e799eae.json new file mode 100644 index 0000000000..e3cad84dd5 --- /dev/null +++ b/tests/reference/asr-test_unary_op_03-e799eae.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_unary_op_03-e799eae", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_unary_op_03.py", + "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-test_unary_op_03-e799eae.stdout", + "stdout_hash": "4511db7e0936003a81bcb4c6b4c1cbc60070f29a9fd7dd04e8d3d137", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-test_unary_op_03-e799eae.stdout b/tests/reference/asr-test_unary_op_03-e799eae.stdout new file mode 100644 index 0000000000..e4cdc4204f --- /dev/null +++ b/tests/reference/asr-test_unary_op_03-e799eae.stdout @@ -0,0 +1,191 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + res: + (Variable + 3 + res + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 i) + (IntegerConstant 5 (Integer 4)) + () + ) + (= + (Var 3 res) + (IntegerBitNot + (Var 3 i) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 res) + Eq + (IntegerUnaryMinus + (IntegerConstant 6 (Integer 4)) + (Integer 4) + (IntegerConstant -6 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 235346 (Integer 4)) + (Integer 4) + (IntegerConstant -235346 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBitNot + (Var 3 i) + (Integer 4) + () + ) + Eq + (IntegerConstant 235345 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_unsupported_type-0d813dd.json b/tests/reference/asr-test_unsupported_type-0d813dd.json new file mode 100644 index 0000000000..357b39f378 --- /dev/null +++ b/tests/reference/asr-test_unsupported_type-0d813dd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_unsupported_type-0d813dd", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_unsupported_type.py", + "infile_hash": "ff3af4fffe097c4ecd6ab673301b37806aefdd77c661d5b4afbbfc5d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_unsupported_type-0d813dd.stderr", + "stderr_hash": "1675de57db132a5a4a589070d7c54ff23a57532bd967ccb416ff8c2a", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_unsupported_type-0d813dd.stderr b/tests/reference/asr-test_unsupported_type-0d813dd.stderr new file mode 100644 index 0000000000..2ea17a3b18 --- /dev/null +++ b/tests/reference/asr-test_unsupported_type-0d813dd.stderr @@ -0,0 +1,5 @@ +semantic error: Unsupported type annotation: i128 + --> tests/errors/test_unsupported_type.py:2:8 + | +2 | i: i128 + | ^^^^ diff --git a/tests/reference/asr-test_zero_division-3dd84e8.json b/tests/reference/asr-test_zero_division-3dd84e8.json new file mode 100644 index 0000000000..129e181bef --- /dev/null +++ b/tests/reference/asr-test_zero_division-3dd84e8.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_zero_division-3dd84e8", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_zero_division.py", + "infile_hash": "cef09721d9ea9f3846f213e1b1718f2aac2edba08d555af776293504", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_zero_division-3dd84e8.stderr", + "stderr_hash": "9403e36c7ace95241bf1d59a108732b298fbee5425c44455fb81ac77", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division-3dd84e8.stderr b/tests/reference/asr-test_zero_division-3dd84e8.stderr new file mode 100644 index 0000000000..7403437c96 --- /dev/null +++ b/tests/reference/asr-test_zero_division-3dd84e8.stderr @@ -0,0 +1,5 @@ +semantic error: integer division by zero is not allowed + --> tests/errors/test_zero_division.py:4:16 + | +4 | print(i // 0) + | ^ integer division by zero diff --git a/tests/reference/asr-test_zero_division2-d84989f.json b/tests/reference/asr-test_zero_division2-d84989f.json new file mode 100644 index 0000000000..b9a7de7d1e --- /dev/null +++ b/tests/reference/asr-test_zero_division2-d84989f.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_zero_division2-d84989f", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_zero_division2.py", + "infile_hash": "0ddca188fc2e8d665c5af0d438e34ed8afe255611320caa3a27ed483", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_zero_division2-d84989f.stderr", + "stderr_hash": "09fcb9f6244ddf2c2d14cd76ec91274cffd240e24e2b2f1c0697c8b5", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division2-d84989f.stderr b/tests/reference/asr-test_zero_division2-d84989f.stderr new file mode 100644 index 0000000000..8dc523a2a5 --- /dev/null +++ b/tests/reference/asr-test_zero_division2-d84989f.stderr @@ -0,0 +1,5 @@ +semantic error: float floor division by zero is not allowed + --> tests/errors/test_zero_division2.py:4:16 + | +4 | print(v // 0.0) + | ^^^ float floor division by zero diff --git a/tests/reference/asr-test_zero_division3-29efb9e.json b/tests/reference/asr-test_zero_division3-29efb9e.json new file mode 100644 index 0000000000..0c4f4b3d5d --- /dev/null +++ b/tests/reference/asr-test_zero_division3-29efb9e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_zero_division3-29efb9e", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_zero_division3.py", + "infile_hash": "41a589085cd6154cb97f8ed0febadf7c0741f083daa7c9dbbbdde9ca", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_zero_division3-29efb9e.stderr", + "stderr_hash": "061f891a72cebaa335b5db060b27e04f21f6a09d150f78f1a572c135", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division3-29efb9e.stderr b/tests/reference/asr-test_zero_division3-29efb9e.stderr new file mode 100644 index 0000000000..519946bb81 --- /dev/null +++ b/tests/reference/asr-test_zero_division3-29efb9e.stderr @@ -0,0 +1,5 @@ +semantic error: division by zero is not allowed + --> tests/errors/test_zero_division3.py:3:13 + | +3 | print(i/0) + | ^ division by zero diff --git a/tests/reference/asr-test_zero_division4-bf4af64.json b/tests/reference/asr-test_zero_division4-bf4af64.json new file mode 100644 index 0000000000..e1f6ce6bc0 --- /dev/null +++ b/tests/reference/asr-test_zero_division4-bf4af64.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-test_zero_division4-bf4af64", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/test_zero_division4.py", + "infile_hash": "87b6a224572c853741dd70f25b05b257d214bd3269a7e71af117057c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-test_zero_division4-bf4af64.stderr", + "stderr_hash": "1d16ac2d95ab997ff9b94f4028d8741121e41471445179d185264884", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division4-bf4af64.stderr b/tests/reference/asr-test_zero_division4-bf4af64.stderr new file mode 100644 index 0000000000..bdf0d76816 --- /dev/null +++ b/tests/reference/asr-test_zero_division4-bf4af64.stderr @@ -0,0 +1,5 @@ +semantic error: division by zero is not allowed + --> tests/errors/test_zero_division4.py:5:13 + | +5 | print(f/0.0) + | ^^^ division by zero diff --git a/tests/reference/asr-tuple1-09972ab.json b/tests/reference/asr-tuple1-09972ab.json new file mode 100644 index 0000000000..a8e83fae28 --- /dev/null +++ b/tests/reference/asr-tuple1-09972ab.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-tuple1-09972ab", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/tuple1.py", + "infile_hash": "0ad9c210f19f9e560890c7a67ed06f4a710bbc8535c0097c35736028", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-tuple1-09972ab.stdout", + "stdout_hash": "fcbdc7bd437d77534509c9da987f7b735c1bd319de51956b28924f73", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-tuple1-09972ab.stdout b/tests/reference/asr-tuple1-09972ab.stdout new file mode 100644 index 0000000000..d4bcbe5dad --- /dev/null +++ b/tests/reference/asr-tuple1-09972ab.stdout @@ -0,0 +1,587 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_Tuple: + (Function + (SymbolTable + 3 + { + a1: + (Variable + 3 + a1 + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ), + a11: + (Variable + 3 + a11 + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 3 + a2 + [] + Local + () + () + Default + (Tuple + [(Character 1 -2 ()) + (Character 1 -2 ()) + (Character 1 -2 ())] + ) + () + Source + Public + Required + .false. + ), + a3: + (Variable + 3 + a3 + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4) + (Real 4) + (Character 1 -2 ())] + ) + () + Source + Public + Required + .false. + ), + a4: + (Variable + 3 + a4 + [] + Local + () + () + Default + (Tuple + [(Tuple + [(Integer 4) + (Integer 4) + (Integer 4)] + ) + (Tuple + [(Integer 4) + (Integer 4) + (Integer 4)] + )] + ) + () + Source + Public + Required + .false. + ), + a5: + (Variable + 3 + 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 + 3 + b0 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b11: + (Variable + 3 + b11 + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ), + float_mem: + (Variable + 3 + float_mem + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + float_mem1: + (Variable + 3 + float_mem1 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + float_mem2: + (Variable + 3 + float_mem2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + test_Tuple + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a1) + (TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4) + (Integer 4)] + ) + ) + () + ) + (= + (Var 3 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 3 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 3 float_mem) + (Cast + (RealConstant + 0.450000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.450000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 a3) + (TupleConstant + [(IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Var 3 float_mem) + (StringConstant + "d" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Integer 4) + (Real 4) + (Character 1 1 ())] + ) + ) + () + ) + (= + (Var 3 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 3 float_mem1) + (Cast + (RealConstant + 3.400000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.400000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 float_mem2) + (Cast + (RealConstant + 5.600000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.600000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 a5) + (TupleConstant + [(TupleConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (Var 3 float_mem1)] + (Tuple + [(Character 1 1 ()) + (Character 1 1 ()) + (Real 4)] + ) + ) + (TupleConstant + [(StringConstant + "c" + (Character 1 1 ()) + ) + (IntegerConstant 3 (Integer 4)) + (Var 3 float_mem2)] + (Tuple + [(Character 1 1 ()) + (Integer 4) + (Real 4)] + ) + )] + (Tuple + [(Tuple + [(Character 1 1 ()) + (Character 1 1 ()) + (Real 4)] + ) + (Tuple + [(Character 1 1 ()) + (Integer 4) + (Real 4)] + )] + ) + ) + () + ) + (= + (Var 3 b0) + (TupleItem + (Var 3 a1) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + ) + () + ) + (= + (TupleConstant + [(Var 3 b0) + (Var 3 b1)] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(TupleItem + (Var 3 a1) + (IntegerConstant 2 (Integer 4)) + (Integer 4) + () + ) + (TupleItem + (Var 3 a1) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + )] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + ) + (= + (Var 3 a11) + (TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + ) + (= + (Var 3 b11) + (TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + ) + (Assert + (TupleCompare + (Var 3 a11) + Eq + (Var 3 b11) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-type_mismatch-61052c7.json b/tests/reference/asr-type_mismatch-61052c7.json new file mode 100644 index 0000000000..80ce9f69b3 --- /dev/null +++ b/tests/reference/asr-type_mismatch-61052c7.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-type_mismatch-61052c7", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/type_mismatch.py", + "infile_hash": "45ee4815e13c9fc4d58572a2f4ec01f5546e1f67878a2913bda89e5c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-type_mismatch-61052c7.stderr", + "stderr_hash": "8c0de9edb133ff8cfa5c0e7c6b2a8d425c5d84a5ec98844eb367040c", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-type_mismatch-61052c7.stderr b/tests/reference/asr-type_mismatch-61052c7.stderr new file mode 100644 index 0000000000..6a402fb67c --- /dev/null +++ b/tests/reference/asr-type_mismatch-61052c7.stderr @@ -0,0 +1,5 @@ +semantic error: Type mismatch in shorthand operator, the types must be compatible + --> tests/errors/type_mismatch.py:8:5 + | +8 | a *= b + | ^ ^ type mismatch ('i32' and 'f32') diff --git a/tests/reference/asr-unsigned_01-892b178.json b/tests/reference/asr-unsigned_01-892b178.json new file mode 100644 index 0000000000..0a797a2c11 --- /dev/null +++ b/tests/reference/asr-unsigned_01-892b178.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-unsigned_01-892b178", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/unsigned_01.py", + "infile_hash": "c176f4ec65c0b5ca7c2c95b2e35d65f22b4cef342baad15c2dd5ef24", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-unsigned_01-892b178.stderr", + "stderr_hash": "54c7cfbd16c73cbe802a3492cd9c9e8d2fb25035192d229232c377b2", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_01-892b178.stderr b/tests/reference/asr-unsigned_01-892b178.stderr new file mode 100644 index 0000000000..c3526cf36e --- /dev/null +++ b/tests/reference/asr-unsigned_01-892b178.stderr @@ -0,0 +1,5 @@ +semantic error: Cannot cast negative value to unsigned integer + --> tests/errors/unsigned_01.py:3:10 + | +3 | i: u16 = u16(-5) + | ^^^^^^^ diff --git a/tests/reference/asr-unsigned_02-6563e58.json b/tests/reference/asr-unsigned_02-6563e58.json new file mode 100644 index 0000000000..40e7b2a0f0 --- /dev/null +++ b/tests/reference/asr-unsigned_02-6563e58.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-unsigned_02-6563e58", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/unsigned_02.py", + "infile_hash": "7892abcbe7cecdbddc7362fd0940986bf64458880ccd198c16dd2a6e", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-unsigned_02-6563e58.stderr", + "stderr_hash": "93f2cf309dfa7f13d56df9184615fde6a832b79510d8541f95ad5a70", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_02-6563e58.stderr b/tests/reference/asr-unsigned_02-6563e58.stderr new file mode 100644 index 0000000000..d00c5647fd --- /dev/null +++ b/tests/reference/asr-unsigned_02-6563e58.stderr @@ -0,0 +1,5 @@ +semantic error: The result of the unary minus `-` operation is negative, thus out of range for u16 + --> tests/errors/unsigned_02.py:3:10 + | +3 | i: u16 = -u16(5) + | ^^^^^^^ use -i32(u) for signed result diff --git a/tests/reference/asr-unsigned_03-f785652.json b/tests/reference/asr-unsigned_03-f785652.json new file mode 100644 index 0000000000..6929c59a27 --- /dev/null +++ b/tests/reference/asr-unsigned_03-f785652.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-unsigned_03-f785652", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/unsigned_03.py", + "infile_hash": "72dd2c6e17b137b6b9f66deeaab0af4ebe3044cb16009e0fab25f05a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-unsigned_03-f785652.stderr", + "stderr_hash": "d90013a25d9aaa91fbbf2b1193cd06be94a4e716f0fe99771cde5601", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_03-f785652.stderr b/tests/reference/asr-unsigned_03-f785652.stderr new file mode 100644 index 0000000000..a68ae96697 --- /dev/null +++ b/tests/reference/asr-unsigned_03-f785652.stderr @@ -0,0 +1,5 @@ +semantic error: The result of the unary minus `-` operation is negative, thus out of range for u64 + --> tests/errors/unsigned_03.py:3:7 + | +3 | print(-u64(u32(10))) + | ^^^^^^^^^^^^^ use -i64(u) for signed result diff --git a/tests/reference/asr-unsigned_04-c856d3a.json b/tests/reference/asr-unsigned_04-c856d3a.json new file mode 100644 index 0000000000..3753e9ae30 --- /dev/null +++ b/tests/reference/asr-unsigned_04-c856d3a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-unsigned_04-c856d3a", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/errors/unsigned_04.py", + "infile_hash": "d1c2f82e9578ce3f2364f4bbd3177bc0ae72357c644953418eaffe4c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-unsigned_04-c856d3a.stderr", + "stderr_hash": "3dcdf2e97f8c5f2816bed266587c7c3743f666cf2a4602f65e8ec9b8", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-unsigned_04-c856d3a.stderr b/tests/reference/asr-unsigned_04-c856d3a.stderr new file mode 100644 index 0000000000..8547a0848c --- /dev/null +++ b/tests/reference/asr-unsigned_04-c856d3a.stderr @@ -0,0 +1,5 @@ +semantic error: The result of the bitnot ~ operation is negative, thus out of range for u16 + --> tests/errors/unsigned_04.py:4:5 + | +4 | i = ~i + | ^^ use ~i32(u) for signed result or bitnot_u16(u) for unsigned result diff --git a/tests/reference/asr-vec_01-66ac423.json b/tests/reference/asr-vec_01-66ac423.json new file mode 100644 index 0000000000..abd51bc145 --- /dev/null +++ b/tests/reference/asr-vec_01-66ac423.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-vec_01-66ac423", + "cmd": "lpython --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/vec_01.py", + "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-vec_01-66ac423.stderr", + "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-vec_01-66ac423.stderr b/tests/reference/asr-vec_01-66ac423.stderr new file mode 100644 index 0000000000..0371022cc6 --- /dev/null +++ b/tests/reference/asr-vec_01-66ac423.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/vec_01.py:2:1 + | +2 | from numpy import empty, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/asr_json-modules_02-53952e6.json b/tests/reference/asr_json-modules_02-53952e6.json new file mode 100644 index 0000000000..9948a65e7c --- /dev/null +++ b/tests/reference/asr_json-modules_02-53952e6.json @@ -0,0 +1,13 @@ +{ + "basename": "asr_json-modules_02-53952e6", + "cmd": "lpython --show-asr --json --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/modules_02.py", + "infile_hash": "dcb00ac27cbbcdec61d81f1df9e852ba81a2197e7804ec89cab76e44", + "outfile": null, + "outfile_hash": null, + "stdout": "asr_json-modules_02-53952e6.stdout", + "stdout_hash": "c97d528fedb41f6d0e8bfa0cee1c0c9333844130b7694cb0cd5e2c4c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr_json-modules_02-53952e6.stdout b/tests/reference/asr_json-modules_02-53952e6.stdout new file mode 100644 index 0000000000..f04f24c482 --- /dev/null +++ b/tests/reference/asr_json-modules_02-53952e6.stdout @@ -0,0 +1,1000 @@ +{ + "node": "TranslationUnit", + "fields": { + "symtab": { + "node": "SymbolTable1", + "fields": { + "__main__": { + "node": "Module", + "fields": { + "symtab": { + "node": "SymbolTable2", + "fields": { + "__main__global_stmts": { + "node": "Function", + "fields": { + "symtab": { + "node": "SymbolTable8", + "fields": {} + }, + "name": "__main__global_stmts", + "function_signature": { + "node": "FunctionType", + "fields": { + "arg_types": [], + "return_var_type": [], + "abi": "Source", + "deftype": "Implementation", + "bindc_name": [], + "elemental": false, + "pure": false, + "module": false, + "inline": false, + "static": false, + "restrictions": [], + "is_restriction": false + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + }, + "dependencies": [ + "main0" + ], + "args": [], + "body": [ + { + "node": "SubroutineCall", + "fields": { + "name": "main0 (SymbolTable2)", + "original_name": [], + "args": [], + "dt": [] + }, + "loc": { + "first": 119, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 10, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + } + ], + "return_var": [], + "access": "Public", + "deterministic": false, + "side_effect_free": false, + "module_file": [] + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + }, + "f": { + "node": "ExternalSymbol", + "fields": { + "parent_symtab": 2, + "name": "f", + "external": "f (SymbolTable3)", + "module_name": "modules_02b", + "scope_names": [], + "original_name": "f", + "access": "Public" + }, + "loc": { + "first": 24, + "last": 24, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 25, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 1, + "last_column": 25 + } + }, + "main0": { + "node": "Function", + "fields": { + "symtab": { + "node": "SymbolTable7", + "fields": { + "x": { + "node": "Variable", + "fields": { + "parent_symtab": 7, + "name": "x", + "dependencies": [], + "intent": "Local", + "symbolic_value": [], + "value": [], + "storage": "Default", + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 71, + "last": 73, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 5, + "first_column": 8, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 5, + "last_column": 10 + } + }, + "type_declaration": [], + "abi": "Source", + "access": "Public", + "presence": "Required", + "value_attr": false + }, + "loc": { + "first": 68, + "last": 73, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 5, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 5, + "last_column": 10 + } + } + } + }, + "name": "main0", + "function_signature": { + "node": "FunctionType", + "fields": { + "arg_types": [], + "return_var_type": [], + "abi": "Source", + "deftype": "Implementation", + "bindc_name": [], + "elemental": false, + "pure": false, + "module": false, + "inline": false, + "static": false, + "restrictions": [], + "is_restriction": false + }, + "loc": { + "first": 51, + "last": 116, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 4, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 8, + "last_column": 7 + } + }, + "dependencies": [ + "f" + ], + "args": [], + "body": [ + { + "node": "Assignment", + "fields": { + "target": { + "node": "Var", + "fields": { + "v": "x (SymbolTable7)" + }, + "loc": { + "first": 79, + "last": 79, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 5 + } + }, + "value": { + "node": "IntegerBinOp", + "fields": { + "left": { + "node": "IntegerBinOp", + "fields": { + "left": { + "node": "IntegerConstant", + "fields": { + "n": 2, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + } + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + }, + "op": "Add", + "right": { + "node": "IntegerConstant", + "fields": { + "n": 3, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 86, + "last": 86, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 12, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 12 + } + } + }, + "loc": { + "first": 86, + "last": 86, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 12, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 12 + } + }, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + }, + "value": { + "node": "IntegerConstant", + "fields": { + "n": 5, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + } + }, + "loc": { + "first": 84, + "last": 86, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 12 + } + } + }, + "loc": { + "first": 84, + "last": 86, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 12 + } + }, + "op": "Mul", + "right": { + "node": "IntegerConstant", + "fields": { + "n": 5, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 89, + "last": 89, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 15, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 15 + } + } + }, + "loc": { + "first": 89, + "last": 89, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 15, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 15 + } + }, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + }, + "value": { + "node": "IntegerConstant", + "fields": { + "n": 25, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 84, + "last": 84, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 10, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 10 + } + } + }, + "loc": { + "first": 83, + "last": 89, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 9, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 15 + } + } + }, + "loc": { + "first": 83, + "last": 89, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 9, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 15 + } + }, + "overloaded": [] + }, + "loc": { + "first": 79, + "last": 89, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 6, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 6, + "last_column": 15 + } + }, + { + "node": "Assert", + "fields": { + "test": { + "node": "IntegerCompare", + "fields": { + "left": { + "node": "Var", + "fields": { + "v": "x (SymbolTable7)" + }, + "loc": { + "first": 102, + "last": 102, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 12, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 12 + } + }, + "op": "Eq", + "right": { + "node": "IntegerConstant", + "fields": { + "n": 25, + "type": { + "node": "Integer", + "fields": { + "kind": 4 + }, + "loc": { + "first": 107, + "last": 108, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 17, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 18 + } + } + }, + "loc": { + "first": 107, + "last": 108, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 17, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 18 + } + }, + "type": { + "node": "Logical", + "fields": { + "kind": 4 + }, + "loc": { + "first": 102, + "last": 108, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 12, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 18 + } + }, + "value": [] + }, + "loc": { + "first": 102, + "last": 108, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 12, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 18 + } + }, + "msg": [] + }, + "loc": { + "first": 95, + "last": 108, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 7, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 7, + "last_column": 18 + } + }, + { + "node": "SubroutineCall", + "fields": { + "name": "f (SymbolTable2)", + "original_name": [], + "args": [], + "dt": [] + }, + "loc": { + "first": 114, + "last": 116, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 8, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 8, + "last_column": 7 + } + } + ], + "return_var": [], + "access": "Public", + "deterministic": false, + "side_effect_free": false, + "module_file": [] + }, + "loc": { + "first": 51, + "last": 116, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 4, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 8, + "last_column": 7 + } + } + } + }, + "name": "__main__", + "dependencies": [ + "modules_02b" + ], + "loaded_from_mod": false, + "intrinsic": false + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + }, + "main_program": { + "node": "Program", + "fields": { + "symtab": { + "node": "SymbolTable9", + "fields": { + "__main__global_stmts": { + "node": "ExternalSymbol", + "fields": { + "parent_symtab": 9, + "name": "__main__global_stmts", + "external": "__main__global_stmts (SymbolTable2)", + "module_name": "__main__", + "scope_names": [], + "original_name": "__main__global_stmts", + "access": "Public" + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + } + } + }, + "name": "main_program", + "dependencies": [ + "__main__" + ], + "body": [ + { + "node": "SubroutineCall", + "fields": { + "name": "__main__global_stmts (SymbolTable9)", + "original_name": "__main__global_stmts (SymbolTable2)", + "args": [], + "dt": [] + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + } + ] + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } + }, + "modules_02b": { + "node": "Module", + "fields": { + "symtab": { + "node": "SymbolTable3", + "fields": { + "f": { + "node": "Function", + "fields": { + "symtab": { + "node": "SymbolTable6", + "fields": {} + }, + "name": "f", + "function_signature": { + "node": "FunctionType", + "fields": { + "arg_types": [], + "return_var_type": [], + "abi": "Source", + "deftype": "Implementation", + "bindc_name": [], + "elemental": false, + "pure": false, + "module": false, + "inline": false, + "static": false, + "restrictions": [], + "is_restriction": false + }, + "loc": { + "first": 154, + "last": 186, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 3, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 16 + } + }, + "dependencies": [ + "g" + ], + "args": [], + "body": [ + { + "node": "SubroutineCall", + "fields": { + "name": "g (SymbolTable3)", + "original_name": [], + "args": [], + "dt": [] + }, + "loc": { + "first": 167, + "last": 169, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 4, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 4, + "last_column": 7 + } + }, + { + "node": "Print", + "fields": { + "fmt": [], + "values": [ + { + "node": "StringConstant", + "fields": { + "s": "f()", + "type": { + "node": "Character", + "fields": { + "kind": 1, + "len": 3, + "len_expr": [] + }, + "loc": { + "first": 181, + "last": 185, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 5, + "first_column": 11, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 15 + } + } + }, + "loc": { + "first": 181, + "last": 185, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 5, + "first_column": 11, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 15 + } + } + ], + "separator": [], + "end": [] + }, + "loc": { + "first": 175, + "last": 186, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 5, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 16 + } + } + ], + "return_var": [], + "access": "Public", + "deterministic": false, + "side_effect_free": false, + "module_file": [] + }, + "loc": { + "first": 154, + "last": 186, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 3, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 16 + } + }, + "g": { + "node": "ExternalSymbol", + "fields": { + "parent_symtab": 3, + "name": "g", + "external": "g (SymbolTable4)", + "module_name": "modules_02c", + "scope_names": [], + "original_name": "g", + "access": "Public" + }, + "loc": { + "first": 151, + "last": 151, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 1, + "first_column": 25, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 1, + "last_column": 25 + } + } + } + }, + "name": "modules_02b", + "dependencies": [ + "modules_02c" + ], + "loaded_from_mod": false, + "intrinsic": false + }, + "loc": { + "first": 127, + "last": 186, + "first_filename": "tests/../integration_tests/modules_02b.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02b.py", + "last_line": 5, + "last_column": 16 + } + }, + "modules_02c": { + "node": "Module", + "fields": { + "symtab": { + "node": "SymbolTable4", + "fields": { + "g": { + "node": "Function", + "fields": { + "symtab": { + "node": "SymbolTable5", + "fields": {} + }, + "name": "g", + "function_signature": { + "node": "FunctionType", + "fields": { + "arg_types": [], + "return_var_type": [], + "abi": "Source", + "deftype": "Implementation", + "bindc_name": [], + "elemental": false, + "pure": false, + "module": false, + "inline": false, + "static": false, + "restrictions": [], + "is_restriction": false + }, + "loc": { + "first": 188, + "last": 212, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 16 + } + }, + "dependencies": [], + "args": [], + "body": [ + { + "node": "Print", + "fields": { + "fmt": [], + "values": [ + { + "node": "StringConstant", + "fields": { + "s": "g()", + "type": { + "node": "Character", + "fields": { + "kind": 1, + "len": 3, + "len_expr": [] + }, + "loc": { + "first": 207, + "last": 211, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 2, + "first_column": 11, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 15 + } + } + }, + "loc": { + "first": 207, + "last": 211, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 2, + "first_column": 11, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 15 + } + } + ], + "separator": [], + "end": [] + }, + "loc": { + "first": 201, + "last": 212, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 2, + "first_column": 5, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 16 + } + } + ], + "return_var": [], + "access": "Public", + "deterministic": false, + "side_effect_free": false, + "module_file": [] + }, + "loc": { + "first": 188, + "last": 212, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 16 + } + } + } + }, + "name": "modules_02c", + "dependencies": [], + "loaded_from_mod": false, + "intrinsic": false + }, + "loc": { + "first": 188, + "last": 212, + "first_filename": "tests/../integration_tests/modules_02c.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02c.py", + "last_line": 2, + "last_column": 16 + } + } + } + }, + "items": [] + }, + "loc": { + "first": 0, + "last": 125, + "first_filename": "tests/../integration_tests/modules_02.py", + "first_line": 1, + "first_column": 1, + "last_filename": "tests/../integration_tests/modules_02.py", + "last_line": 10, + "last_column": 7 + } +} diff --git a/tests/reference/ast-assert1-b0154ee.json b/tests/reference/ast-assert1-b0154ee.json new file mode 100644 index 0000000000..8158218cc4 --- /dev/null +++ b/tests/reference/ast-assert1-b0154ee.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-assert1-b0154ee", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/assert1.py", + "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-assert1-b0154ee.stdout", + "stdout_hash": "f5e00f32dc7ae2feda2e3c495b42ae3f193a79baf8b42e313373aa4b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-assert1-b0154ee.stdout b/tests/reference/ast-assert1-b0154ee.stdout new file mode 100644 index 0000000000..d147d125e1 --- /dev/null +++ b/tests/reference/ast-assert1-b0154ee.stdout @@ -0,0 +1,70 @@ +(Module + [(FunctionDef + test_assert + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (Assert + (Compare + (Name + a + Load + ) + Eq + [(ConstantInt + 5 + () + )] + ) + (ConstantStr + "a is not 5" + () + ) + ) + (Assert + (Compare + (Name + a + Load + ) + NotEq + [(ConstantInt + 10 + () + )] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-assign1-2a4c9ed.json b/tests/reference/ast-assign1-2a4c9ed.json new file mode 100644 index 0000000000..49bfe84ecb --- /dev/null +++ b/tests/reference/ast-assign1-2a4c9ed.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-assign1-2a4c9ed", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/assign1.py", + "infile_hash": "3b82a73e457bd65e85828b72d56596ca927e7c661e333691f154912b", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-assign1-2a4c9ed.stdout", + "stdout_hash": "96e9236f069321ffb388a891be45a46f55c581bd96d509685be54f86", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-assign1-2a4c9ed.stdout b/tests/reference/ast-assign1-2a4c9ed.stdout new file mode 100644 index 0000000000..54b54de3e8 --- /dev/null +++ b/tests/reference/ast-assign1-2a4c9ed.stdout @@ -0,0 +1,151 @@ +(Module + [(FunctionDef + test_augassign + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + r + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + s + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + r + Store + )] + (ConstantInt + 0 + () + ) + () + ) + (AugAssign + (Name + r + Store + ) + Add + (ConstantInt + 4 + () + ) + ) + (Assign + [(Name + s + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (AugAssign + (Name + r + Store + ) + Mult + (Name + s + Load + ) + ) + (AugAssign + (Name + r + Store + ) + Sub + (ConstantInt + 2 + () + ) + ) + (Assign + [(Name + s + Store + )] + (ConstantInt + 10 + () + ) + () + ) + (AugAssign + (Name + r + Store + ) + Div + (Name + s + Load + ) + ) + (AnnAssign + (Name + a + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantStr + "" + () + ) + () + ) + (AugAssign + (Name + a + Store + ) + Add + (ConstantStr + "test" + () + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-complex1-800b4bb.json b/tests/reference/ast-complex1-800b4bb.json new file mode 100644 index 0000000000..e71d8dddfa --- /dev/null +++ b/tests/reference/ast-complex1-800b4bb.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-complex1-800b4bb", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/complex1.py", + "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-complex1-800b4bb.stdout", + "stdout_hash": "30482dce2a68624ef71ed52e4c4ce4122e1f2efddcef40bee2a3b10e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-complex1-800b4bb.stdout b/tests/reference/ast-complex1-800b4bb.stdout new file mode 100644 index 0000000000..8044437ea0 --- /dev/null +++ b/tests/reference/ast-complex1-800b4bb.stdout @@ -0,0 +1,686 @@ +(Module + [(ImportFrom + lpython + [(c32 + ()) + (c64 + ())] + 0 + ) + (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 + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantFloat + 3.400000 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantFloat + 5.000000 + () + ) + (ConstantFloat + 4.300000 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantInt + 1 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c1 + Store + )] + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantInt + 3 + () + ) + (ConstantInt + 4 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c2 + Store + )] + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantFloat + 4.500000 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + c3 + Store + )] + (Call + (Name + complex + Load + ) + [(ConstantFloat + 3.000000 + () + ) + (ConstantFloat + 4.000000 + () + )] + [] + ) + () + ) + (Assign + [(Name + b + Store + )] + (Compare + (Name + c1 + Load + ) + NotEq + [(Name + c2 + Load + )] + ) + () + ) + (Assign + [(Name + b + Store + )] + (Compare + (Call + (Name + c64 + Load + ) + [(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 + )] + (Call + (Name + c32 + Load + ) + [(BinOp + (Call + (Name + complex + Load + ) + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + Pow + (Call + (Name + complex + Load + ) + [(ConstantFloat + 3.345340 + () + ) + (ConstantFloat + 4.867868 + () + )] + [] + ) + )] + [] + ) + () + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + c32 + Load + ) + [(BinOp + (Call + (Name + complex + Load + ) + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + Mult + (Call + (Name + complex + Load + ) + [(ConstantInt + 3 + () + ) + (ConstantInt + 4 + () + )] + [] + ) + )] + [] + ) + () + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + c32 + Load + ) + [(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 + (Call + (Name + c64 + Load + ) + [(ConstantInt + 2 + () + )] + [] + ) + Add + (ConstantComplex + 0.000000 + 3.000000 + () + ) + ) + () + ) + (Assign + [(Name + y + Store + )] + (BinOp + (Call + (Name + c64 + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + Add + (ConstantComplex + 0.000000 + 5.000000 + () + ) + ) + () + ) + (Assign + [(Name + z + Store + )] + (Call + (Name + c32 + Load + ) + [(BinOp + (Name + x + Load + ) + Add + (Name + y + Load + ) + )] + [] + ) + () + ) + (Assign + [(Name + z + Store + )] + (Call + (Name + c32 + Load + ) + [(BinOp + (Name + x + Load + ) + Sub + (Name + y + Load + ) + )] + [] + ) + () + ) + (Assign + [(Name + z + Store + )] + (Call + (Name + c32 + Load + ) + [(BinOp + (Call + (Name + c64 + Load + ) + [(ConstantInt + 2 + () + )] + [] + ) + Mult + (Name + x + Load + ) + )] + [] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-constants1-91cb6ff.json b/tests/reference/ast-constants1-91cb6ff.json new file mode 100644 index 0000000000..f84e32ca40 --- /dev/null +++ b/tests/reference/ast-constants1-91cb6ff.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-constants1-91cb6ff", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/constants1.py", + "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-constants1-91cb6ff.stdout", + "stdout_hash": "8c7b5384e18cfcea4b080c39a4d367fc8a57a6785ad936454005d6b1", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-constants1-91cb6ff.stdout b/tests/reference/ast-constants1-91cb6ff.stdout new file mode 100644 index 0000000000..086dd9ff27 --- /dev/null +++ b/tests/reference/ast-constants1-91cb6ff.stdout @@ -0,0 +1,1820 @@ +(Module + [(ImportFrom + lpython + [(f32 + ()) + (i32 + ()) + (i64 + ()) + (f64 + ())] + 0 + ) + (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 + ) + [(Call + (Name + i32 + Load + ) + [(ConstantBool + .false. + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + abs + Load + ) + [(Call + (Name + i32 + Load + ) + [(ConstantBool + .true. + () + )] + [] + )] + [] + ) + () + ) + (AnnAssign + (Name + b + Store + ) + (Name + f32 + Load + ) + () + 1 + ) + (Assign + [(Name + b + Store + )] + (Call + (Name + f32 + Load + ) + [(Call + (Name + abs + Load + ) + [(ConstantFloat + 3.450000 + () + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + b + Store + )] + (Call + (Name + f32 + Load + ) + [(Call + (Name + abs + Load + ) + [(UnaryOp + USub + (ConstantFloat + 5346.340000 + () + ) + )] + [] + )] + [] + ) + () + ) + (Assign + [(Name + b + Store + )] + (Call + (Name + f32 + Load + ) + [(Call + (Name + abs + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantFloat + 3.450000 + () + ) + (ConstantFloat + 5.600000 + () + )] + [] + )] + [] + )] + [] + ) + () + )] + [] + () + () + ) + (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.400000 + () + )] + Load + ) + (Tuple + [(ConstantStr + "c" + () + ) + (ConstantInt + 3 + () + ) + (ConstantFloat + 5.600000 + () + )] + 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.300000 + () + )] + [] + ) + () + ) + (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 + ) + [(ConstantFloat + 5.600000 + () + )] + [] + ) + () + ) + (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.560000 + () + )] + [] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + int + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + int + Load + ) + [(UnaryOp + USub + (ConstantFloat + 5.000010 + () + ) + )] + [] + ) + () + ) + (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.560000 + () + )] + [] + ) + () + ) + (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-dictionary1-1a7e00a.json b/tests/reference/ast-dictionary1-1a7e00a.json new file mode 100644 index 0000000000..ba29488d33 --- /dev/null +++ b/tests/reference/ast-dictionary1-1a7e00a.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-dictionary1-1a7e00a", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/dictionary1.py", + "infile_hash": "f164e8dbe52a04e4fd541d6ff6edae2994d683074087d8785a1759e4", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-dictionary1-1a7e00a.stdout", + "stdout_hash": "c347af8c0abbed4664f354dc24c1bd061218c0584aef27889fbf1745", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-dictionary1-1a7e00a.stdout b/tests/reference/ast-dictionary1-1a7e00a.stdout new file mode 100644 index 0000000000..d300e7a74d --- /dev/null +++ b/tests/reference/ast-dictionary1-1a7e00a.stdout @@ -0,0 +1,618 @@ +(Module + [(FunctionDef + test_Dict + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (Dict + [(ConstantInt + 1 + () + ) + (ConstantInt + 3 + () + )] + [(ConstantInt + 2 + () + ) + (ConstantInt + 4 + () + )] + ) + () + ) + (AnnAssign + (Name + y + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + str + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + )] + ) + () + ) + (AnnAssign + (Name + z + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + z + Store + )] + (Subscript + (Name + y + Load + ) + (ConstantStr + "a" + () + ) + Load + ) + () + ) + (Assign + [(Name + z + Store + )] + (Subscript + (Name + y + Load + ) + (ConstantStr + "b" + () + ) + Load + ) + () + ) + (Assign + [(Name + z + Store + )] + (Subscript + (Name + x + Load + ) + (ConstantInt + 1 + () + ) + Load + ) + () + )] + [] + () + () + ) + (FunctionDef + test_dict_insert + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + y + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + str + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + )] + ) + () + ) + (Assign + [(Subscript + (Name + y + Load + ) + (ConstantStr + "c" + () + ) + Store + )] + (UnaryOp + USub + (ConstantInt + 3 + () + ) + ) + () + )] + [] + () + () + ) + (FunctionDef + test_dict_get + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + y + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + str + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + )] + ) + () + ) + (AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + y + Load + ) + get + Load + ) + [(ConstantStr + "a" + () + )] + [] + ) + () + ) + (Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + y + Load + ) + get + Load + ) + [(ConstantStr + "a" + () + ) + (ConstantInt + 0 + () + )] + [] + ) + () + )] + [] + () + () + ) + (FunctionDef + test_dict_pop + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + y + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + str + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + ) + () + ) + (AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + y + Load + ) + pop + Load + ) + [(ConstantStr + "a" + () + )] + [] + ) + () + )] + [] + () + () + ) + (FunctionDef + f + ([] + [(x + (Subscript + (Name + InOut + Load + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + Load + ) + ())] + [] + [] + [] + [] + []) + [(Assign + [(Subscript + (Name + x + Load + ) + (ConstantInt + 2 + () + ) + Store + )] + (ConstantInt + 4 + () + ) + () + )] + [] + () + () + ) + (FunctionDef + test_issue_204 + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Expr + (Call + (Name + f + Load + ) + [(Name + x + Load + )] + [] + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.json b/tests/reference/ast-doconcurrentloop_01-ed7017b.json new file mode 100644 index 0000000000..f535d23ee8 --- /dev/null +++ b/tests/reference/ast-doconcurrentloop_01-ed7017b.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-doconcurrentloop_01-ed7017b", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/doconcurrentloop_01.py", + "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-doconcurrentloop_01-ed7017b.stdout", + "stdout_hash": "3967d9e6602dfb4fd3fdab3718811979d4745dc0a97060f9b281e0e9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout b/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout new file mode 100644 index 0000000000..7b22ef73a0 --- /dev/null +++ b/tests/reference/ast-doconcurrentloop_01-ed7017b.stdout @@ -0,0 +1,437 @@ +(Module + [(ImportFrom + lpython + [(f32 + ()) + (i32 + ())] + 0 + ) + (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 + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 10.000000 + () + )] + [] + ) + () + ) + (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 + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 5.000000 + () + )] + [] + ) + () + ) + (Assign + [(Subscript + (Name + b + Load + ) + (Name + i + Load + ) + Store + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 5.000000 + () + )] + [] + ) + () + )] + [] + "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-ellipsis1-4f6c4dd.json b/tests/reference/ast-ellipsis1-4f6c4dd.json new file mode 100644 index 0000000000..1e53be9f78 --- /dev/null +++ b/tests/reference/ast-ellipsis1-4f6c4dd.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-ellipsis1-4f6c4dd", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/parser/ellipsis1.py", + "infile_hash": "24df29cba718c679016f3758a2eccafbeb9cfebd56265fd8da16bee1", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-ellipsis1-4f6c4dd.stdout", + "stdout_hash": "6d6aef7896c1a43a27f489cb283c508b2bf1238ff6ad0c807b58b9e7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-ellipsis1-4f6c4dd.stdout b/tests/reference/ast-ellipsis1-4f6c4dd.stdout new file mode 100644 index 0000000000..f2c9284c1a --- /dev/null +++ b/tests/reference/ast-ellipsis1-4f6c4dd.stdout @@ -0,0 +1,427 @@ +(Module + [(Import + [(numpy + np)] + ) + (ImportFrom + typing + [(Callable + ())] + 0 + ) + (Assign + [(Name + array + Store + )] + (Call + (Attribute + (Attribute + (Name + np + Load + ) + random + Load + ) + rand + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + array + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (ConstantInt + 0 + () + )] + Load + ) + Load + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + array + Load + ) + (Tuple + [(Name + Ellipsis + Load + ) + (ConstantInt + 0 + () + )] + Load + ) + Load + )] + [] + ) + ) + (FunctionDef + inject + ([] + [(get_next_item + (Subscript + (Name + Callable + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (Name + str + Load + )] + Load + ) + Load + ) + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + ) + (FunctionDef + foo + ([] + [(x + (ConstantEllipsis + () + ) + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + ) + (ClassDef + flow + [] + [] + [(FunctionDef + __understand__ + ([] + [(self + () + ()) + (name + (Name + str + Load + ) + ()) + (value + (ConstantEllipsis + () + ) + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + )] + [] + ) + (FunctionDef + foo + ([] + [(x + () + ())] + [] + [] + [] + [] + [(ConstantEllipsis + () + )]) + [(Return + (Name + x + Load + ) + )] + [] + () + () + ) + (FunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (ClassDef + Todo + [] + [] + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (Assign + [(Name + x + Store + )] + (List + [(ConstantInt + 1 + () + ) + (List + [(ConstantInt + 2 + () + ) + (List + [(ConstantEllipsis + () + )] + Load + ) + (ConstantInt + 3 + () + )] + Load + )] + Load + ) + () + ) + (Assign + [(Name + l + Store + )] + (List + [(ConstantEllipsis + () + ) + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + () + ) + (If + (Compare + (Name + x + Load + ) + Is + [(ConstantEllipsis + () + )] + ) + [(Pass)] + [] + ) + (FunctionDef + partial + ([] + [(func + (Subscript + (Name + Callable + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (Name + str + Load + )] + Load + ) + Load + ) + ())] + [(args + () + ())] + [] + [] + [] + []) + [(Pass)] + [] + (Subscript + (Name + Callable + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (Name + str + Load + )] + Load + ) + Load + ) + () + ) + (ClassDef + xyz + [] + [] + [(AnnAssign + (Name + abc + Store + ) + (Name + str + Load + ) + (ConstantEllipsis + () + ) + 1 + ) + (FunctionDef + __init__ + ([] + [(self + () + ()) + (name + (Name + str + Load + ) + ())] + [] + [] + [] + [] + [(ConstantEllipsis + () + )]) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + )] + [] + )] + [] +) diff --git a/tests/reference/ast-expr1-1e8f7b1.json b/tests/reference/ast-expr1-1e8f7b1.json new file mode 100644 index 0000000000..004b2a39e0 --- /dev/null +++ b/tests/reference/ast-expr1-1e8f7b1.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr1-1e8f7b1", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr1.py", + "infile_hash": "a0c9e93e40f29b7d4541f8c513de490a892abf78a34700478d1827dd", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr1-1e8f7b1.stdout", + "stdout_hash": "8de807242a73633d63f3e92bed88eacdd9f283f479d9adf11fefb1fd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr1-1e8f7b1.stdout b/tests/reference/ast-expr1-1e8f7b1.stdout new file mode 100644 index 0000000000..c123e471ca --- /dev/null +++ b/tests/reference/ast-expr1-1e8f7b1.stdout @@ -0,0 +1,124 @@ +(Module + [(FunctionDef + test_namedexpr + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + y + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (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 + () + ) + () + )] + [] + ) + (While + (NamedExpr + (Name + a + Store + ) + (ConstantInt + 1 + () + ) + ) + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )] + [] + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr10-a8d646d.json b/tests/reference/ast-expr10-a8d646d.json new file mode 100644 index 0000000000..8f0222f7aa --- /dev/null +++ b/tests/reference/ast-expr10-a8d646d.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr10-a8d646d", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr10.py", + "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr10-a8d646d.stdout", + "stdout_hash": "b807dc54b7741e61fd091d70d83c68d7c58c2c38fd5a22b279217916", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr10-a8d646d.stdout b/tests/reference/ast-expr10-a8d646d.stdout new file mode 100644 index 0000000000..53ef4ebca1 --- /dev/null +++ b/tests/reference/ast-expr10-a8d646d.stdout @@ -0,0 +1,434 @@ +(Module + [(ImportFrom + lpython + [(i32 + ()) + (f32 + ()) + (c32 + ())] + 0 + ) + (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 + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 1.000000 + () + )] + [] + ) + ) + () + ) + (Assign + [(Name + f + Store + )] + (UnaryOp + USub + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 183745.534000 + () + )] + [] + ) + ) + () + ) + (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 + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + [] + )] + [] + ) + ) + () + ) + (Assign + [(Name + c + Store + )] + (UnaryOp + USub + (Call + (Name + c32 + Load + ) + [(Call + (Name + complex + Load + ) + [(ConstantInt + 3 + () + ) + (ConstantFloat + 65.000000 + () + )] + [] + )] + [] + ) + ) + () + ) + (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-expr11-1d29f78.json b/tests/reference/ast-expr11-1d29f78.json new file mode 100644 index 0000000000..d3ebc1ed40 --- /dev/null +++ b/tests/reference/ast-expr11-1d29f78.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr11-1d29f78", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr11.py", + "infile_hash": "940f2d32759315dfb8d54ea50819f2bfef9737e486615703609fd47a", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr11-1d29f78.stdout", + "stdout_hash": "60719c0d166865f8157e6479a6bd6fc7d300b2d2eff48d8b1553fc8c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr11-1d29f78.stdout b/tests/reference/ast-expr11-1d29f78.stdout new file mode 100644 index 0000000000..be341c23d1 --- /dev/null +++ b/tests/reference/ast-expr11-1d29f78.stdout @@ -0,0 +1,149 @@ +(Module + [(FunctionDef + test_StrOp_repeat + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + s + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantStr + "a" + () + ) + Mult + (ConstantInt + 2 + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantStr + "a" + () + ) + Mult + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantStr + "test" + () + ) + Mult + (ConstantInt + 5 + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantInt + 4 + () + ) + Mult + (ConstantStr + "bb" + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (UnaryOp + USub + (ConstantInt + 40 + () + ) + ) + Mult + (ConstantStr + "bb" + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (BinOp + (ConstantInt + 3 + () + ) + Mult + (ConstantStr + "a" + () + ) + ) + Mult + (ConstantInt + 3 + () + ) + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr12-adaecda.json b/tests/reference/ast-expr12-adaecda.json new file mode 100644 index 0000000000..6fa2133b08 --- /dev/null +++ b/tests/reference/ast-expr12-adaecda.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr12-adaecda", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr12.py", + "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr12-adaecda.stdout", + "stdout_hash": "b4fdb14f66196f4692126efb3b349707d3f862d6c045b61125af41cb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr12-adaecda.stdout b/tests/reference/ast-expr12-adaecda.stdout new file mode 100644 index 0000000000..38eaedd025 --- /dev/null +++ b/tests/reference/ast-expr12-adaecda.stdout @@ -0,0 +1,149 @@ +(Module + [(FunctionDef + test + ([] + [(a + (Name + i32 + Load + ) + ()) + (b + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(Return + (BinOp + (Name + a + Load + ) + Pow + (Name + b + Load + ) + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + check + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + test + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + () + ) + (Return + (Name + a + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + main0 + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (Call + (Name + check + Load + ) + [] + [] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + main0 + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-expr13-c35ace1.json b/tests/reference/ast-expr13-c35ace1.json new file mode 100644 index 0000000000..8da96d5109 --- /dev/null +++ b/tests/reference/ast-expr13-c35ace1.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr13-c35ace1", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr13.py", + "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr13-c35ace1.stdout", + "stdout_hash": "e92fa43a3f8dd1bdf555b71e6f5a263a5a5c10a8f63582fb57d04ce6", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr13-c35ace1.stdout b/tests/reference/ast-expr13-c35ace1.stdout new file mode 100644 index 0000000000..3fd56b3af2 --- /dev/null +++ b/tests/reference/ast-expr13-c35ace1.stdout @@ -0,0 +1,374 @@ +(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.600000 + () + ) + GtE + [(ConstantFloat + 5.599990 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Compare + (ConstantFloat + 3.300000 + () + ) + Eq + [(ConstantFloat + 3.300000 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Compare + (ConstantFloat + 3.300000 + () + ) + NotEq + [(ConstantFloat + 3.400000 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Compare + (Call + (Name + complex + Load + ) + [(ConstantInt + 3 + () + ) + (ConstantInt + 4 + () + )] + [] + ) + Eq + [(Call + (Name + complex + Load + ) + [(ConstantFloat + 3.000000 + () + ) + (ConstantFloat + 4.000000 + () + )] + [] + )] + ) + () + ) + (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-expr2-6642d4a.json b/tests/reference/ast-expr2-6642d4a.json new file mode 100644 index 0000000000..779b2b5411 --- /dev/null +++ b/tests/reference/ast-expr2-6642d4a.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr2-6642d4a", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr2.py", + "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr2-6642d4a.stdout", + "stdout_hash": "cf996ecb8e3abdced429c59eedcbd9943bf59bbf22dcfd79ef94f799", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr2-6642d4a.stdout b/tests/reference/ast-expr2-6642d4a.stdout new file mode 100644 index 0000000000..73a7f49c76 --- /dev/null +++ b/tests/reference/ast-expr2-6642d4a.stdout @@ -0,0 +1,184 @@ +(Module + [(FunctionDef + test_boolOp + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (AnnAssign + (Name + b + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantBool + .false. + () + ) + () + ) + (Assign + [(Name + b + Store + )] + (ConstantBool + .true. + () + ) + () + ) + (Assign + [(Name + a + Store + )] + (BoolOp + And + [(Name + a + Load + ) + (Name + b + Load + )] + ) + () + ) + (Assign + [(Name + b + Store + )] + (BoolOp + Or + [(Name + a + Load + ) + (ConstantBool + .true. + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (BoolOp + Or + [(Name + a + Load + ) + (Name + b + Load + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (BoolOp + And + [(Name + a + Load + ) + (Compare + (Name + b + Load + ) + Eq + [(Name + b + Load + )] + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (BoolOp + And + [(Name + a + Load + ) + (Compare + (Name + b + Load + ) + NotEq + [(Name + b + Load + )] + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (BoolOp + Or + [(Name + b + Load + ) + (Name + b + Load + )] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr4-49316cb.json b/tests/reference/ast-expr4-49316cb.json new file mode 100644 index 0000000000..f60410170c --- /dev/null +++ b/tests/reference/ast-expr4-49316cb.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr4-49316cb", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr4.py", + "infile_hash": "5cba7a5d589f54fc31463e48903d5b46604fb64e3e64ba215339047c", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr4-49316cb.stdout", + "stdout_hash": "8f1ed7fd76dff70c8cca71bda8f528f3e12bda9bb716e3e32ed58657", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr4-49316cb.stdout b/tests/reference/ast-expr4-49316cb.stdout new file mode 100644 index 0000000000..e74c2e02ca --- /dev/null +++ b/tests/reference/ast-expr4-49316cb.stdout @@ -0,0 +1,72 @@ +(Module + [(FunctionDef + test_del + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + b + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantInt + 4 + () + ) + () + ) + (Assign + [(Name + b + Store + )] + (ConstantInt + 20 + () + ) + () + ) + (Delete + [(Name + a + Del + ) + (Name + b + Del + )] + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr5-bbc6e71.json b/tests/reference/ast-expr5-bbc6e71.json new file mode 100644 index 0000000000..93662179fd --- /dev/null +++ b/tests/reference/ast-expr5-bbc6e71.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr5-bbc6e71", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr5.py", + "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr5-bbc6e71.stdout", + "stdout_hash": "f856520f5cd00933d05c95de857ee6527c9a5ed476070c6d13857a40", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr5-bbc6e71.stdout b/tests/reference/ast-expr5-bbc6e71.stdout new file mode 100644 index 0000000000..c87b636101 --- /dev/null +++ b/tests/reference/ast-expr5-bbc6e71.stdout @@ -0,0 +1,89 @@ +(Module + [(FunctionDef + test_StrOp_concat + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + s + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantStr + "3" + () + ) + Add + (ConstantStr + "4" + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (ConstantStr + "a " + () + ) + Add + (ConstantStr + "test" + () + ) + ) + () + ) + (Assign + [(Name + s + Store + )] + (BinOp + (BinOp + (ConstantStr + "test" + () + ) + Add + (ConstantStr + "test" + () + ) + ) + Add + (ConstantStr + "test" + () + ) + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr6-0b12a67.json b/tests/reference/ast-expr6-0b12a67.json new file mode 100644 index 0000000000..5b9e9c3ec4 --- /dev/null +++ b/tests/reference/ast-expr6-0b12a67.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr6-0b12a67", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr6.py", + "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr6-0b12a67.stdout", + "stdout_hash": "52edb5a692f7bc13f8c9642228f19a7e93960271cd3513a26a97df5d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr6-0b12a67.stdout b/tests/reference/ast-expr6-0b12a67.stdout new file mode 100644 index 0000000000..860f7cd954 --- /dev/null +++ b/tests/reference/ast-expr6-0b12a67.stdout @@ -0,0 +1,119 @@ +(Module + [(FunctionDef + test_ifexp + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + b + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + c + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantInt + 2 + () + ) + () + ) + (Assign + [(Name + b + Store + )] + (IfExp + (Compare + (Name + a + Load + ) + Eq + [(ConstantInt + 2 + () + )] + ) + (ConstantInt + 6 + () + ) + (ConstantInt + 8 + () + ) + ) + () + ) + (Assign + [(Name + c + Store + )] + (IfExp + (Compare + (Name + b + Load + ) + Gt + [(ConstantInt + 5 + () + )] + ) + (ConstantBool + .true. + () + ) + (ConstantBool + .false. + () + ) + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-expr7-fe52776.json b/tests/reference/ast-expr7-fe52776.json new file mode 100644 index 0000000000..f24345a89e --- /dev/null +++ b/tests/reference/ast-expr7-fe52776.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr7-fe52776", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr7.py", + "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr7-fe52776.stdout", + "stdout_hash": "5bf8b877e7cfee7d365d1c03622cced374fd006625e861154c8edc1b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr7-fe52776.stdout b/tests/reference/ast-expr7-fe52776.stdout new file mode 100644 index 0000000000..29e6e4a147 --- /dev/null +++ b/tests/reference/ast-expr7-fe52776.stdout @@ -0,0 +1,204 @@ +(Module + [(ImportFrom + lpython + [(i32 + ())] + 0 + ) + (FunctionDef + test_pow + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + i32 + Load + ) + [(Call + (Name + pow + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + )] + [] + )] + [] + ) + () + )] + [] + () + () + ) + (FunctionDef + test_pow_1 + ([] + [(a + (Name + i32 + Load + ) + ()) + (b + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + res + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + res + Store + )] + (Call + (Name + i32 + Load + ) + [(Call + (Name + pow + Load + ) + [(Name + a + Load + ) + (Name + b + Load + )] + [] + )] + [] + ) + () + ) + (Return + (Name + res + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + main0 + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + test_pow + Load + ) + [] + [] + ) + ) + (AnnAssign + (Name + c + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + c + Store + )] + (Call + (Name + test_pow_1 + Load + ) + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + main0 + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-expr8-7db6b28.json b/tests/reference/ast-expr8-7db6b28.json new file mode 100644 index 0000000000..cdac33386b --- /dev/null +++ b/tests/reference/ast-expr8-7db6b28.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr8-7db6b28", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr8.py", + "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr8-7db6b28.stdout", + "stdout_hash": "b739c4d505f4e1c1a01c7ceaf6230f3a489bd9285a056bfda3a995c2", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr8-7db6b28.stdout b/tests/reference/ast-expr8-7db6b28.stdout new file mode 100644 index 0000000000..ea6c8d1606 --- /dev/null +++ b/tests/reference/ast-expr8-7db6b28.stdout @@ -0,0 +1,352 @@ +(Module + [(ImportFrom + lpython + [(i32 + ()) + (f32 + ())] + 0 + ) + (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 + )] + (Call + (Name + f32 + Load + ) + [(BinOp + (ConstantFloat + 2.000000 + () + ) + Pow + (ConstantFloat + 3.500000 + () + ) + )] + [] + ) + () + ) + (Assign + [(Name + x + Store + )] + (BinOp + (ConstantInt + 54 + () + ) + Sub + (ConstantInt + 100 + () + ) + ) + () + ) + (Assign + [(Name + x2 + Store + )] + (Call + (Name + f32 + Load + ) + [(BinOp + (BinOp + (ConstantFloat + 3.454000 + () + ) + Sub + (ConstantFloat + 765.430000 + () + ) + ) + Add + (ConstantFloat + 534.600000 + () + ) + )] + [] + ) + () + ) + (Assign + [(Name + x2 + Store + )] + (Call + (Name + f32 + Load + ) + [(BinOp + (ConstantFloat + 5346.565000 + () + ) + Mult + (ConstantFloat + 3.450000 + () + ) + )] + [] + ) + () + ) + (Assign + [(Name + x2 + Store + )] + (Call + (Name + f32 + Load + ) + [(BinOp + (ConstantFloat + 5346.565000 + () + ) + Pow + (ConstantFloat + 3.450000 + () + ) + )] + [] + ) + () + ) + (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 + )] + (Call + (Name + i32 + Load + ) + [(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-expr9-d184496.json b/tests/reference/ast-expr9-d184496.json new file mode 100644 index 0000000000..bc5e3f36d2 --- /dev/null +++ b/tests/reference/ast-expr9-d184496.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr9-d184496", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr9.py", + "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr9-d184496.stdout", + "stdout_hash": "75772c0465dba8aaa9f5cebf3c35558b77827a9b29570828744d84d9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr9-d184496.stdout b/tests/reference/ast-expr9-d184496.stdout new file mode 100644 index 0000000000..bae64591f4 --- /dev/null +++ b/tests/reference/ast-expr9-d184496.stdout @@ -0,0 +1,231 @@ +(Module + [(FunctionDef + test_return_1 + ([] + [(a + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (Return + (Name + x + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + test_return_2 + ([] + [(a + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (ConstantStr + "test" + () + ) + () + ) + (Return + (Name + x + Load + ) + )] + [] + (Name + str + Load + ) + () + ) + (FunctionDef + test_return_3 + ([] + [(a + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(Return + (Name + a + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + main0 + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + i + Store + )] + (Call + (Name + test_return_1 + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + () + ) + (AnnAssign + (Name + s + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + s + Store + )] + (Call + (Name + test_return_2 + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + () + ) + (Assign + [(Name + i + Store + )] + (Call + (Name + test_return_3 + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + main0 + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-expr_01-d0927f9.json b/tests/reference/ast-expr_01-d0927f9.json new file mode 100644 index 0000000000..45b1c2df0e --- /dev/null +++ b/tests/reference/ast-expr_01-d0927f9.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-expr_01-d0927f9", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/expr_01.py", + "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-expr_01-d0927f9.stdout", + "stdout_hash": "ba3af72a124b03f3aa21ae8a31d25ef05ee2f442dcf6b9759a659c98", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-expr_01-d0927f9.stdout b/tests/reference/ast-expr_01-d0927f9.stdout new file mode 100644 index 0000000000..2fa44042d3 --- /dev/null +++ b/tests/reference/ast-expr_01-d0927f9.stdout @@ -0,0 +1,112 @@ +(Module + [(FunctionDef + main0 + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + x2 + Store + ) + (Name + i64 + Load + ) + () + 1 + ) + (AnnAssign + (Name + y + Store + ) + (Name + f32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + y2 + Store + ) + (Name + f64 + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (BinOp + (BinOp + (ConstantInt + 2 + () + ) + Add + (ConstantInt + 3 + () + ) + ) + Mult + (ConstantInt + 5 + () + ) + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + x + Load + )] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + main0 + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-global1-b2690cf.json b/tests/reference/ast-global1-b2690cf.json new file mode 100644 index 0000000000..a5a57d4dcb --- /dev/null +++ b/tests/reference/ast-global1-b2690cf.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-global1-b2690cf", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/parser/global1.py", + "infile_hash": "cdbcc3f545f865cfc6e412f53fc6fd7cccdbc0d33b66e45460f3e916", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-global1-b2690cf.stdout", + "stdout_hash": "b0b999497a27625582a6dedfa024dba012a6ac1103ac427c49cc7d9d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-global1-b2690cf.stdout b/tests/reference/ast-global1-b2690cf.stdout new file mode 100644 index 0000000000..9011e976ad --- /dev/null +++ b/tests/reference/ast-global1-b2690cf.stdout @@ -0,0 +1,219 @@ +(Module + [(Assign + [(Name + x + Store + )] + (ConstantStr + "global " + () + ) + () + ) + (FunctionDef + outer + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + x + Store + )] + (ConstantStr + "local" + () + ) + () + ) + (FunctionDef + inner + ([] + [] + [] + [] + [] + [] + []) + [(Nonlocal + [x] + ) + (Assign + [(Name + x + Store + )] + (ConstantStr + "nonlocal" + () + ) + () + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "nonlocal" + () + )] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + inner + Load + ) + [] + [] + ) + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "nonlocal" + () + )] + ) + () + )] + [] + () + () + ) + (FunctionDef + test_1 + ([] + [] + [] + [] + [] + [] + []) + [(Global + [x] + ) + (Assign + [(Name + y + Store + )] + (ConstantStr + "local" + () + ) + () + ) + (Assign + [(Name + x + Store + )] + (BinOp + (Name + x + Load + ) + Mult + (ConstantInt + 2 + () + ) + ) + () + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "global global " + () + )] + ) + () + ) + (Assert + (Compare + (Name + y + Load + ) + Eq + [(ConstantStr + "local" + () + )] + ) + () + )] + [] + () + () + ) + (FunctionDef + check + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + test_1 + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Name + outer + Load + ) + [] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + check + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-global_scope1-1d68a6c.json b/tests/reference/ast-global_scope1-1d68a6c.json new file mode 100644 index 0000000000..44e3204dee --- /dev/null +++ b/tests/reference/ast-global_scope1-1d68a6c.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-global_scope1-1d68a6c", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/global_scope1.py", + "infile_hash": "e7b33a2680429ee47d15af5af7c31ac24cc802d18d5566b568fc8ef4", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-global_scope1-1d68a6c.stdout", + "stdout_hash": "3311aec1626b395dc1c35208afdb7e3ddab90ac70a8a43f4f3e31325", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-global_scope1-1d68a6c.stdout b/tests/reference/ast-global_scope1-1d68a6c.stdout new file mode 100644 index 0000000000..7d099d64fc --- /dev/null +++ b/tests/reference/ast-global_scope1-1d68a6c.stdout @@ -0,0 +1,26 @@ +(Module + [(AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + i + Store + )] + (ConstantInt + 5 + () + ) + () + )] + [] +) diff --git a/tests/reference/ast-list1-9ce2da0.json b/tests/reference/ast-list1-9ce2da0.json new file mode 100644 index 0000000000..af1c5005eb --- /dev/null +++ b/tests/reference/ast-list1-9ce2da0.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-list1-9ce2da0", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/list1.py", + "infile_hash": "9d6b3f1a83a585d5a7a5e50ff5e1ddd15705fce268208d0cc2749514", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-list1-9ce2da0.stdout", + "stdout_hash": "fea2e7f56f26d3848224a3ca52219f76e456b2f4066e1156c22896f5", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-list1-9ce2da0.stdout b/tests/reference/ast-list1-9ce2da0.stdout new file mode 100644 index 0000000000..cb4dd75a96 --- /dev/null +++ b/tests/reference/ast-list1-9ce2da0.stdout @@ -0,0 +1,539 @@ +(Module + [(FunctionDef + test_List + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Subscript + (Name + list + Load + ) + (Name + i32 + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + () + ) + (Assign + [(Name + a + Store + )] + (List + [(UnaryOp + USub + (ConstantInt + 3 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + )] + Load + ) + () + ) + (AnnAssign + (Name + b + Store + ) + (Subscript + (Name + list + Load + ) + (Name + str + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + b + Store + )] + (List + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (ConstantStr + "c" + () + )] + Load + ) + () + ) + (AnnAssign + (Name + c + Store + ) + (Subscript + (Name + list + Load + ) + (Subscript + (Name + list + Load + ) + (Name + i32 + Load + ) + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + c + Store + )] + (List + [(List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + (List + [(ConstantInt + 4 + () + ) + (ConstantInt + 5 + () + ) + (ConstantInt + 6 + () + )] + Load + )] + Load + ) + () + ) + (AnnAssign + (Name + d + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + d + Store + )] + (Subscript + (Name + a + Load + ) + (ConstantInt + 2 + () + ) + Load + ) + () + ) + (AnnAssign + (Name + e + Store + ) + (Subscript + (Name + list + Load + ) + (Subscript + (Name + list + Load + ) + (Name + str + Load + ) + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + e + Store + )] + (List + [(List + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (ConstantStr + "c" + () + )] + Load + ) + (List + [(ConstantStr + "d" + () + ) + (ConstantStr + "e" + () + )] + Load + )] + Load + ) + () + ) + (Expr + (Call + (Attribute + (Name + a + Load + ) + append + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + a + Load + ) + remove + Load + ) + [(ConstantInt + 1 + () + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + a + Load + ) + insert + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 13 + () + )] + [] + ) + ) + (Assign + [(Name + a + Store + )] + (Subscript + (Name + a + Load + ) + (Slice + (ConstantInt + 0 + () + ) + (ConstantInt + 2 + () + ) + () + ) + Load + ) + () + ) + (Assign + [(Name + d + Store + )] + (Call + (Attribute + (Name + a + Load + ) + pop + Load + ) + [] + [] + ) + () + ) + (Assign + [(Name + d + Store + )] + (Call + (Attribute + (Name + a + Load + ) + pop + Load + ) + [(ConstantInt + 2 + () + )] + [] + ) + () + ) + (AugAssign + (Name + a + Store + ) + Add + (List + [(ConstantInt + 4 + () + ) + (ConstantInt + 5 + () + )] + Load + ) + ) + (Assign + [(Name + a + Store + )] + (BinOp + (List + [(ConstantInt + 6 + () + ) + (ConstantInt + 7 + () + )] + Load + ) + Add + (Name + a + Load + ) + ) + () + ) + (AnnAssign + (Name + a11 + Store + ) + (Subscript + (Name + list + Load + ) + (Name + i32 + Load + ) + Load + ) + () + 1 + ) + (AnnAssign + (Name + b11 + Store + ) + (Subscript + (Name + list + Load + ) + (Name + i32 + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + a11 + Store + )] + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + () + ) + (Assign + [(Name + b11 + Store + )] + (List + [(ConstantInt + 3 + () + ) + (ConstantInt + 4 + () + )] + Load + ) + () + ) + (Assert + (Compare + (Name + a11 + Load + ) + Eq + [(Name + b11 + Load + )] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-loop1-194a137.json b/tests/reference/ast-loop1-194a137.json new file mode 100644 index 0000000000..44f8695ff2 --- /dev/null +++ b/tests/reference/ast-loop1-194a137.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-loop1-194a137", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/loop1.py", + "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-loop1-194a137.stdout", + "stdout_hash": "f4a9db8f60a56098bbd7f524f0e0a64fdad95cbe3ca44412879489e3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-loop1-194a137.stdout b/tests/reference/ast-loop1-194a137.stdout new file mode 100644 index 0000000000..4618763828 --- /dev/null +++ b/tests/reference/ast-loop1-194a137.stdout @@ -0,0 +1,480 @@ +(Module + [(ImportFrom + lpython + [(i32 + ()) + (i64 + ())] + 0 + ) + (FunctionDef + test_factorial_1 + ([] + [(x + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(If + (Compare + (Name + x + Load + ) + Lt + [(ConstantInt + 0 + () + )] + ) + [(Return + (ConstantInt + 0 + () + ) + )] + [] + ) + (AnnAssign + (Name + result + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + result + Store + )] + (ConstantInt + 1 + () + ) + () + ) + (While + (Compare + (Name + x + Load + ) + Gt + [(ConstantInt + 0 + () + )] + ) + [(Assign + [(Name + result + Store + )] + (BinOp + (Name + result + Load + ) + Mult + (Name + x + Load + ) + ) + () + ) + (AugAssign + (Name + x + Store + ) + Sub + (ConstantInt + 1 + () + ) + )] + [] + ) + (Return + (Name + result + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + test_factorial_2 + ([] + [(x + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + result + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + result + Store + )] + (ConstantInt + 1 + () + ) + () + ) + (AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 1 + () + ) + (BinOp + (Name + x + Load + ) + Add + (ConstantInt + 1 + () + ) + )] + [] + ) + [(Assign + [(Name + result + Store + )] + (BinOp + (Name + result + Load + ) + Mult + (Name + i + Load + ) + ) + () + )] + [] + () + ) + (Return + (Name + result + Load + ) + )] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + test_factorial_3 + ([] + [(x + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + result + Store + ) + (Name + i64 + Load + ) + () + 1 + ) + (Assign + [(Name + result + Store + )] + (Call + (Name + i64 + Load + ) + [(ConstantInt + 0 + () + )] + [] + ) + () + ) + (If + (Compare + (Name + x + Load + ) + Lt + [(ConstantInt + 0 + () + )] + ) + [(Return + (Name + result + Load + ) + )] + [] + ) + (Assign + [(Name + result + Store + )] + (Call + (Name + i64 + Load + ) + [(ConstantInt + 1 + () + )] + [] + ) + () + ) + (While + (Compare + (Name + x + Load + ) + Gt + [(ConstantInt + 0 + () + )] + ) + [(Assign + [(Name + result + Store + )] + (BinOp + (Name + result + Load + ) + Mult + (Call + (Name + i64 + Load + ) + [(Name + x + Load + )] + [] + ) + ) + () + ) + (AugAssign + (Name + x + Store + ) + Sub + (ConstantInt + 1 + () + ) + )] + [] + ) + (Return + (Name + result + Load + ) + )] + [] + (Name + i64 + Load + ) + () + ) + (FunctionDef + main0 + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + i + Store + )] + (Call + (Name + test_factorial_1 + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + () + ) + (Assign + [(Name + i + Store + )] + (Call + (Name + test_factorial_2 + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + () + ) + (AnnAssign + (Name + j + Store + ) + (Name + i64 + Load + ) + () + 1 + ) + (Assign + [(Name + j + Store + )] + (Call + (Name + test_factorial_3 + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + main0 + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast-loop3-f7e0393.json b/tests/reference/ast-loop3-f7e0393.json new file mode 100644 index 0000000000..1dc5625553 --- /dev/null +++ b/tests/reference/ast-loop3-f7e0393.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-loop3-f7e0393", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/loop3.py", + "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-loop3-f7e0393.stdout", + "stdout_hash": "edf8630a987fb8f9e62d064eb7c1d37f08f896b1453a141fd4db15cf", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-loop3-f7e0393.stdout b/tests/reference/ast-loop3-f7e0393.stdout new file mode 100644 index 0000000000..956b2b5e86 --- /dev/null +++ b/tests/reference/ast-loop3-f7e0393.stdout @@ -0,0 +1,54 @@ +(Module + [(FunctionDef + test_pass + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (ConstantInt + 1 + () + ) + () + ) + (While + (Compare + (Name + a + Load + ) + Gt + [(ConstantInt + 0 + () + )] + ) + [(Pass)] + [] + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-set1-ebd6ee0.json b/tests/reference/ast-set1-ebd6ee0.json new file mode 100644 index 0000000000..a04c792797 --- /dev/null +++ b/tests/reference/ast-set1-ebd6ee0.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-set1-ebd6ee0", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/set1.py", + "infile_hash": "63b5dc6a1f9c17099f1b10c8c45fcac1e50319ca8efbf7c283060abb", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-set1-ebd6ee0.stdout", + "stdout_hash": "f2003da3359a1713befbdd7bd1c789dcec22ac91a6d1f5b25cac1c77", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-set1-ebd6ee0.stdout b/tests/reference/ast-set1-ebd6ee0.stdout new file mode 100644 index 0000000000..d8617e4d12 --- /dev/null +++ b/tests/reference/ast-set1-ebd6ee0.stdout @@ -0,0 +1,190 @@ +(Module + [(FunctionDef + test_Set + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + a + Store + ) + (Subscript + (Name + set + Load + ) + (Name + i32 + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + a + Store + )] + (Set + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Set + [(ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + (ConstantInt + 4 + () + ) + (ConstantInt + 5 + () + ) + (ConstantInt + 5 + () + )] + ) + () + ) + (Expr + (Call + (Attribute + (Name + a + Load + ) + add + Load + ) + [(ConstantInt + 9 + () + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + a + Load + ) + remove + Load + ) + [(ConstantInt + 4 + () + )] + [] + ) + ) + (AnnAssign + (Name + b + Store + ) + (Subscript + (Name + set + Load + ) + (Name + str + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + b + Store + )] + (Set + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (ConstantStr + "c" + () + )] + ) + () + ) + (AnnAssign + (Name + s + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + s + Store + )] + (Call + (Attribute + (Name + b + Load + ) + pop + Load + ) + [] + [] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-subscript1-bd5584b.json b/tests/reference/ast-subscript1-bd5584b.json new file mode 100644 index 0000000000..2c3b5acfa5 --- /dev/null +++ b/tests/reference/ast-subscript1-bd5584b.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-subscript1-bd5584b", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/subscript1.py", + "infile_hash": "5d229893d3e13ea4463e8ed47eb3798be0b8c28f5ef6b6c773e87b80", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-subscript1-bd5584b.stdout", + "stdout_hash": "452c89181fdd389e48053af79eb944114e567a8a2e2d3b04c73721bd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-subscript1-bd5584b.stdout b/tests/reference/ast-subscript1-bd5584b.stdout new file mode 100644 index 0000000000..89a8bf37c6 --- /dev/null +++ b/tests/reference/ast-subscript1-bd5584b.stdout @@ -0,0 +1,415 @@ +(Module + [(FunctionDef + test_subscript + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + s + Store + ) + (Name + str + Load + ) + () + 1 + ) + (Assign + [(Name + s + Store + )] + (ConstantStr + "abc" + () + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + () + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + () + () + () + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + () + () + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + () + () + (ConstantInt + 2 + () + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 88 + () + ) + (ConstantInt + 1 + () + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + () + (ConstantInt + 1 + () + ) + (UnaryOp + USub + (ConstantInt + 4 + () + ) + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + (UnaryOp + USub + (ConstantInt + 89 + () + ) + ) + () + (ConstantInt + 4 + () + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + (UnaryOp + USub + (ConstantInt + 3 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 3 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 3 + () + ) + ) + ) + Load + ) + () + ) + (Assign + [(Name + s + Store + )] + (Subscript + (Name + s + Load + ) + (Slice + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + () + ) + Load + ) + () + ) + (AnnAssign + (Name + A + Store + ) + (Subscript + (Name + i32 + Load + ) + (ConstantInt + 5 + () + ) + Load + ) + () + 1 + ) + (AnnAssign + (Name + B + Store + ) + (Subscript + (Name + i32 + Load + ) + (ConstantInt + 2 + () + ) + Load + ) + () + 1 + ) + (AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + i + Store + )] + (Subscript + (Name + A + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + () + ) + (Assign + [(Name + B + Store + )] + (Subscript + (Name + A + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 3 + () + ) + () + ) + Load + ) + () + ) + (Assign + [(Name + B + Store + )] + (Subscript + (Name + A + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + ) + Load + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast-tuple1-2fb5396.json b/tests/reference/ast-tuple1-2fb5396.json new file mode 100644 index 0000000000..feb6e53223 --- /dev/null +++ b/tests/reference/ast-tuple1-2fb5396.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-tuple1-2fb5396", + "cmd": "lpython --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/tuple1.py", + "infile_hash": "0ad9c210f19f9e560890c7a67ed06f4a710bbc8535c0097c35736028", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-tuple1-2fb5396.stdout", + "stdout_hash": "b8f815cc5c9d9732bca16340aca88fd5b4453cf499a305fb0b036316", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-tuple1-2fb5396.stdout b/tests/reference/ast-tuple1-2fb5396.stdout new file mode 100644 index 0000000000..e50cc5b28c --- /dev/null +++ b/tests/reference/ast-tuple1-2fb5396.stdout @@ -0,0 +1,702 @@ +(Module + [(ImportFrom + lpython + [(i32 + ()) + (f32 + ())] + 0 + ) + (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 + ) + (AnnAssign + (Name + float_mem + Store + ) + (Name + f32 + Load + ) + () + 1 + ) + (Assign + [(Name + float_mem + Store + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 0.450000 + () + )] + [] + ) + () + ) + (Assign + [(Name + a3 + Store + )] + (Tuple + [(UnaryOp + USub + (ConstantInt + 2 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (Name + float_mem + Load + ) + (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 + ) + (AnnAssign + (Name + float_mem1 + Store + ) + (Name + f32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + float_mem2 + Store + ) + (Name + f32 + Load + ) + () + 1 + ) + (Assign + [(Name + float_mem1 + Store + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 3.400000 + () + )] + [] + ) + () + ) + (Assign + [(Name + float_mem2 + Store + )] + (Call + (Name + f32 + Load + ) + [(ConstantFloat + 5.600000 + () + )] + [] + ) + () + ) + (Assign + [(Name + a5 + Store + )] + (Tuple + [(Tuple + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (Name + float_mem1 + Load + )] + Load + ) + (Tuple + [(ConstantStr + "c" + () + ) + (ConstantInt + 3 + () + ) + (Name + float_mem2 + Load + )] + 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 + ) + () + ) + (AnnAssign + (Name + a11 + Store + ) + (Subscript + (Name + tuple + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (AnnAssign + (Name + b11 + Store + ) + (Subscript + (Name + tuple + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + a11 + Store + )] + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + () + ) + (Assign + [(Name + b11 + Store + )] + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + () + ) + (Assert + (Compare + (Name + a11 + Load + ) + Eq + [(Name + b11 + Load + )] + ) + () + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-async1-b3d07ed.json b/tests/reference/ast_new-async1-b3d07ed.json new file mode 100644 index 0000000000..78595a5beb --- /dev/null +++ b/tests/reference/ast_new-async1-b3d07ed.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-async1-b3d07ed", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/async1.py", + "infile_hash": "7c5dba5bb5fe728a9452de16f8164730885146b2d93e49be8642d96a", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-async1-b3d07ed.stdout", + "stdout_hash": "1f809509a8c0637d93e82cf35a231a0f5e001a0b4bb2cfb37cc962ad", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-async1-b3d07ed.stdout b/tests/reference/ast_new-async1-b3d07ed.stdout new file mode 100644 index 0000000000..bf824f2524 --- /dev/null +++ b/tests/reference/ast_new-async1-b3d07ed.stdout @@ -0,0 +1,752 @@ +(Module + [(AsyncFunctionDef + func + ([] + [(param1 + () + ()) + (param2 + () + ())] + [] + [] + [] + [] + []) + [(Expr + (Await + (Call + (Attribute + (Name + asyncio + Load + ) + sleep + Load + ) + [(ConstantInt + 1 + () + )] + [] + ) + ) + ) + (Expr + (Call + (Name + do_something + Load + ) + [] + [] + ) + ) + (AsyncFor + (Name + x + Store + ) + (Name + y + Load + ) + [(Expr + (Call + (Name + do_something + Load + ) + [(Name + x + Load + )] + [] + ) + )] + [] + () + ) + (AsyncWith + [((Call + (Name + open + Load + ) + [(ConstantStr + "examples/expr2.py" + () + ) + (ConstantStr + "r" + () + )] + [] + ) + (Name + file + Store + ))] + [(Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + file + Load + ) + read + Load + ) + [] + [] + ) + () + )] + () + )] + [] + () + () + ) + (AsyncFunctionDef + test_01 + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + results + Store + )] + (Await + (Call + (Attribute + (Name + tasks + Load + ) + gather + Load + ) + [(Starred + (ListComp + (Call + (Attribute + (Name + ag + Load + ) + aclose + Load + ) + [] + [] + ) + [((Name + ag + Store + ) + (Name + closing_agens + Load + ) + [] + 0)] + ) + Load + )] + [(return_exceptions + (ConstantBool + .true. + () + ))] + ) + ) + () + ) + (With + [((Await + (Name + lock + Load + ) + ) + ())] + [(Pass)] + () + ) + (AugAssign + (Name + data + Store + ) + Add + (Await + (Call + (Attribute + (Attribute + (Name + self + Load + ) + loop + Load + ) + sock_recv + Load + ) + [(Name + sock + Load + ) + (Name + DATA_SIZE + Load + )] + [] + ) + ) + ) + (Return + (Await + (Call + (Attribute + (Name + self + Load + ) + run_in_executor + Load + ) + [(ConstantNone + () + ) + (Name + getaddr_func + Load + ) + (Name + host + Load + ) + (Name + port + Load + ) + (Name + family + Load + ) + (Name + type + Load + ) + (Name + proto + Load + ) + (Name + flags + Load + )] + [] + ) + ) + )] + [] + () + () + ) + (AsyncFunctionDef + test_02 + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + items + Store + )] + (ListComp + (Await + (Call + (Attribute + (Name + q + Load + ) + get + Load + ) + [] + [] + ) + ) + [((Name + _ + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 3 + () + )] + [] + ) + [] + 0)] + ) + () + ) + (Expr + (SetComp + (Await + (Name + c + Load + ) + ) + [((Name + c + Store + ) + (List + [(Call + (Name + f + Load + ) + [(ConstantInt + 1 + () + )] + [] + ) + (Call + (Name + f + Load + ) + [(ConstantInt + 41 + () + )] + [] + )] + Load + ) + [] + 0)] + ) + ) + (Expr + (DictComp + (Name + i + Load + ) + (Await + (Name + c + Load + ) + ) + [((Tuple + [(Name + i + Store + ) + (Name + c + Store + )] + Store + ) + (Call + (Name + enumerate + Load + ) + [(List + [(Call + (Name + f + Load + ) + [(ConstantInt + 1 + () + )] + [] + ) + (Call + (Name + f + Load + ) + [(ConstantInt + 41 + () + )] + [] + )] + Load + )] + [] + ) + [] + 0)] + ) + ) + (Expr + (ListComp + (Name + s + Load + ) + [((Name + c + Store + ) + (List + [(Call + (Name + f + Load + ) + [(ConstantStr + "" + () + )] + [] + ) + (Call + (Name + f + Load + ) + [(ConstantStr + "abc" + () + )] + [] + ) + (Call + (Name + f + Load + ) + [(ConstantStr + "" + () + )] + [] + ) + (Call + (Name + f + Load + ) + [(List + [(ConstantStr + "de" + () + ) + (ConstantStr + "fg" + () + )] + Load + )] + [] + )] + Load + ) + [] + 0) + ((Name + s + Store + ) + (Await + (Name + c + Load + ) + ) + [] + 0)] + ) + ) + (Return + (GeneratorExp + (BinOp + (Name + i + Load + ) + Mult + (ConstantInt + 2 + () + ) + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(Name + n + Load + )] + [] + ) + [(Await + (Call + (Name + wrap + Load + ) + [(Name + i + Load + )] + [] + ) + )] + 0)] + ) + )] + [] + () + () + ) + (AsyncFunctionDef + t + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Attribute + (Name + results + Load + ) + append + Load + ) + [(Await + (Call + (Name + anext + Load + ) + [(Name + g + Load + )] + [] + ) + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + self + Load + ) + assertIn + Load + ) + [(ConstantStr + "..." + () + ) + (Call + (Name + repr + Load + ) + [(Await + (Call + (Attribute + (Name + asyncio + Load + ) + wait_for + Load + ) + [(Call + (Name + func + Load + ) + [] + [] + )] + [(timeout + (ConstantInt + 10 + () + ))] + ) + )] + [] + )] + [] + ) + ) + (Assign + [(Name + x + Store + )] + (UnaryOp + USub + (Await + (Call + (Name + bar + Load + ) + [] + [] + ) + ) + ) + () + ) + (Return + (BinOp + (BinOp + (BinOp + (BinOp + (Await + (Call + (Name + bar + Load + ) + [] + [] + ) + ) + Add + (Await + (Call + (Call + (Name + wrap + Load + ) + [] + [] + ) + [] + [] + ) + ) + ) + Add + (Await + (Call + (Call + (Call + (Subscript + (Name + db + Load + ) + (ConstantStr + "b" + () + ) + Load + ) + [] + [] + ) + [] + [] + ) + [] + [] + ) + ) + ) + Add + (BinOp + (Await + (Call + (Name + bar + Load + ) + [] + [] + ) + ) + Mult + (ConstantInt + 1000 + () + ) + ) + ) + Add + (Await + (Call + (Call + (Attribute + (Name + DB + Load + ) + b + Load + ) + [] + [] + ) + [] + [] + ) + ) + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-boolOp1-478328f.json b/tests/reference/ast_new-boolOp1-478328f.json new file mode 100644 index 0000000000..561331afd8 --- /dev/null +++ b/tests/reference/ast_new-boolOp1-478328f.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-boolOp1-478328f", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/boolOp1.py", + "infile_hash": "d3c477215f26d7a7e09c7de32d3e716585796d1674cba2ea692fe161", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-boolOp1-478328f.stdout", + "stdout_hash": "e17703190ca113a29b38292421ba27f4d2d8e235a51115e9d3a2710f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-boolOp1-478328f.stdout b/tests/reference/ast_new-boolOp1-478328f.stdout new file mode 100644 index 0000000000..665f42a764 --- /dev/null +++ b/tests/reference/ast_new-boolOp1-478328f.stdout @@ -0,0 +1,206 @@ +(Module + [(Expr + (BoolOp + And + [(Name + a + Load + ) + (Name + b + Load + )] + ) + ) + (Expr + (BoolOp + Or + [(BoolOp + And + [(Name + a + Load + ) + (Name + b + Load + )] + ) + (Name + c + Load + )] + ) + ) + (Expr + (BoolOp + Or + [(Name + a + Load + ) + (Name + b + Load + )] + ) + ) + (Expr + (BoolOp + Or + [(Name + a + Load + ) + (BoolOp + And + [(Name + b + Load + ) + (Name + c + Load + )] + )] + ) + ) + (Expr + (BoolOp + Or + [(BoolOp + And + [(BoolOp + And + [(Name + a + Load + ) + (Name + b + Load + )] + ) + (Name + c + Load + )] + ) + (BoolOp + Or + [(BoolOp + Or + [(Name + x + Load + ) + (BoolOp + And + [(Name + y + Load + ) + (BoolOp + Or + [(Name + z + Load + ) + (Name + i + Load + )] + )] + )] + ) + (Name + j + Load + )] + )] + ) + ) + (Expr + (BoolOp + And + [(BoolOp + Or + [(BoolOp + And + [(BoolOp + And + [(Name + a + Load + ) + (BoolOp + And + [(Name + b + Load + ) + (BoolOp + Or + [(Name + c + Load + ) + (Name + d + Load + )] + )] + )] + ) + (BoolOp + And + [(Name + e + Load + ) + (Name + f + Load + )] + )] + ) + (Name + x + Load + )] + ) + (Name + y + Load + )] + ) + ) + (Expr + (BoolOp + Or + [(BoolOp + Or + [(Name + a + Load + ) + (BoolOp + And + [(Name + b + Load + ) + (Name + c + Load + )] + )] + ) + (Name + z + Load + )] + ) + )] + [] +) diff --git a/tests/reference/ast_new-class_def1-fe69291.json b/tests/reference/ast_new-class_def1-fe69291.json new file mode 100644 index 0000000000..77bc5ba91c --- /dev/null +++ b/tests/reference/ast_new-class_def1-fe69291.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-class_def1-fe69291", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/class_def1.py", + "infile_hash": "e904e820fab9d596d2675abf65e19fc2b5fb6ecf950a902a0ec537fb", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-class_def1-fe69291.stdout", + "stdout_hash": "9802c1d135072a26d8cc97d779d5c89b93317138aa7903dde7d42fb0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-class_def1-fe69291.stdout b/tests/reference/ast_new-class_def1-fe69291.stdout new file mode 100644 index 0000000000..8f8913cfba --- /dev/null +++ b/tests/reference/ast_new-class_def1-fe69291.stdout @@ -0,0 +1,500 @@ +(Module + [(ClassDef + Person + [] + [] + [(FunctionDef + __init__ + ([] + [(self + () + ()) + (name + () + ()) + (age + () + ())] + [] + [] + [] + [] + []) + [(Assign + [(Attribute + (Name + self + Load + ) + name + Store + )] + (Name + name + Load + ) + () + ) + (Assign + [(Attribute + (Name + self + Load + ) + age + Store + )] + (Name + age + Load + ) + () + )] + [] + () + () + ) + (FunctionDef + print_name + ([] + [(self + () + ())] + [] + [] + [] + [] + []) + [(Pass) + (Expr + (Call + (Name + print + Load + ) + [(BinOp + (ConstantStr + "Hello my name is " + () + ) + Add + (Attribute + (Name + self + Load + ) + name + Load + ) + )] + [] + ) + )] + [] + () + () + )] + [] + ) + (ClassDef + Dog + [] + [] + [(FunctionDef + __init__ + ([] + [(self + () + ()) + (name + () + ())] + [] + [] + [] + [] + []) + [(Assign + [(Attribute + (Name + self + Load + ) + name + Store + )] + (Name + name + Load + ) + () + ) + (Assign + [(Attribute + (Name + self + Load + ) + tricks + Store + )] + (List + [] + Load + ) + () + )] + [] + () + () + ) + (FunctionDef + add_trick + ([] + [(self + () + ()) + (trick + () + ())] + [] + [] + [] + [] + []) + [(Expr + (Call + (Attribute + (Attribute + (Name + self + Load + ) + tricks + Load + ) + append + Load + ) + [(Name + trick + Load + )] + [] + ) + )] + [] + () + () + )] + [] + ) + (ClassDef + Mapping + [] + [] + [(FunctionDef + __init__ + ([] + [(self + () + ()) + (iterable + () + ())] + [] + [] + [] + [] + []) + [(Assign + [(Attribute + (Name + self + Load + ) + items_list + Store + )] + (List + [] + Load + ) + () + ) + (Expr + (Call + (Attribute + (Name + self + Load + ) + __update + Load + ) + [(Name + iterable + Load + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + update + ([] + [(self + () + ()) + (iterable + () + ())] + [] + [] + [] + [] + []) + [(For + (Name + item + Store + ) + (Name + iterable + Load + ) + [(Expr + (Call + (Attribute + (Attribute + (Name + self + Load + ) + items_list + Load + ) + append + Load + ) + [(Name + item + Load + )] + [] + ) + )] + [] + () + )] + [] + () + () + ) + (Assign + [(Name + __update + Store + )] + (Name + update + Load + ) + () + )] + [] + ) + (ClassDef + MappingSubclass + [(Name + Mapping + Load + )] + [] + [(FunctionDef + update + ([] + [(self + () + ()) + (keys + () + ()) + (values + () + ())] + [] + [] + [] + [] + []) + [(For + (Name + item + Store + ) + (Call + (Name + zip + Load + ) + [(Name + keys + Load + ) + (Name + values + Load + )] + [] + ) + [(Expr + (Call + (Attribute + (Attribute + (Name + self + Load + ) + items_list + Load + ) + append + Load + ) + [(Name + item + Load + )] + [] + ) + )] + [] + () + )] + [] + () + () + )] + [] + ) + (FunctionDef + check + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + p + Store + )] + (Call + (Name + Person + Load + ) + [(ConstantStr + "John" + () + ) + (ConstantInt + 36 + () + )] + [] + ) + () + ) + (Assign + [(Name + d + Store + )] + (Call + (Name + Dog + Load + ) + [(ConstantStr + "Fido" + () + )] + [] + ) + () + ) + (Expr + (Call + (Attribute + (Name + d + Load + ) + add_trick + Load + ) + [(ConstantStr + "roll over" + () + )] + [] + ) + ) + (Assign + [(Name + m + Store + )] + (Call + (Name + Mapping + Load + ) + [(ConstantStr + "x" + () + )] + [] + ) + () + ) + (Expr + (Call + (Attribute + (Name + m + Load + ) + update + Load + ) + [(ConstantStr + "y" + () + )] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + check + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast_new-class_def2-c6db986.json b/tests/reference/ast_new-class_def2-c6db986.json new file mode 100644 index 0000000000..e03cb049fb --- /dev/null +++ b/tests/reference/ast_new-class_def2-c6db986.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-class_def2-c6db986", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/class_def2.py", + "infile_hash": "e7ad3c230a50dbe235499e6cc7ca8a93c59142bbc91b640edbd072af", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-class_def2-c6db986.stdout", + "stdout_hash": "25cb94d2ea083f3e06cf057b1c074808a51365717dca131ce67f06f6", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-class_def2-c6db986.stdout b/tests/reference/ast_new-class_def2-c6db986.stdout new file mode 100644 index 0000000000..3412c6b551 --- /dev/null +++ b/tests/reference/ast_new-class_def2-c6db986.stdout @@ -0,0 +1,201 @@ +(Module + [(ClassDef + _DTypeDict + [(Name + _DTypeDictBase + Load + )] + [(total + (ConstantBool + .false. + () + ))] + [(Pass)] + [] + ) + (ClassDef + test_01 + [] + [] + [(Pass)] + [] + ) + (ClassDef + test_02 + [(Name + x + Load + ) + (Name + y + Load + )] + [] + [(Pass)] + [] + ) + (ClassDef + test_03 + [(Name + x + Load + )] + [(y + (ConstantInt + 1 + () + )) + (z + (ConstantStr + "123" + () + ))] + [(Pass)] + [] + ) + (ClassDef + test_04 + [(ConstantInt + 100 + () + )] + [(() + (Name + x + Load + ))] + [(Pass)] + [] + ) + (ClassDef + test_05 + [(Starred + (Name + x + Load + ) + Load + )] + [(() + (Name + y + Load + ))] + [(Pass)] + [] + ) + (ClassDef + test_06 + [(Starred + (Name + x + Load + ) + Load + ) + (Name + y + Load + )] + [] + [(Pass)] + [] + ) + (ClassDef + test_07 + [(Starred + (Name + x + Load + ) + Load + ) + (Starred + (Name + y + Load + ) + Load + )] + [] + [(Pass)] + [] + ) + (ClassDef + test_08 + [] + [(() + (Name + x + Load + )) + (() + (Name + y + Load + ))] + [(Pass)] + [] + ) + (ClassDef + test_08 + [(Name + x + Load + )] + [] + [(Pass)] + [] + ) + (ClassDef + sub + [(Attribute + (Name + np + Load + ) + ndarray + Load + )] + [] + [(Pass)] + [] + ) + (ClassDef + name + [] + [] + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (ClassDef + MMatrix + [(Name + MaskedArray + Load + ) + (Attribute + (Name + np + Load + ) + matrix + Load + )] + [] + [(Expr + (ConstantEllipsis + () + ) + )] + [] + )] + [(TypeIgnore + 0 + "[misc]" + )] +) diff --git a/tests/reference/ast_new-comment2-f0984d5.json b/tests/reference/ast_new-comment2-f0984d5.json new file mode 100644 index 0000000000..1309f6159f --- /dev/null +++ b/tests/reference/ast_new-comment2-f0984d5.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-comment2-f0984d5", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/tokens/comment2.py", + "infile_hash": "b62404a5d774f0b18fcad6fb1dac8733334ce3593a77d34bcbb05019", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-comment2-f0984d5.stdout", + "stdout_hash": "4dd8b313619df81c518cdfbddd523b3486b2ad5406ff720dde825af9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-comment2-f0984d5.stdout b/tests/reference/ast_new-comment2-f0984d5.stdout new file mode 100644 index 0000000000..9a9e90f873 --- /dev/null +++ b/tests/reference/ast_new-comment2-f0984d5.stdout @@ -0,0 +1,150 @@ +(Module + [(FunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(If + (Name + foo + Load + ) + [(If + (Name + bar + Load + ) + [(Pass)] + [] + )] + [(Pass)] + ) + (Return + () + )] + [] + () + () + ) + (FunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + print + Load + ) + [] + [] + ) + )] + [] + () + () + ) + (FunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + print + Load + ) + [] + [] + ) + )] + [] + () + () + ) + (FunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + print + Load + ) + [] + [] + ) + ) + (Pass)] + [] + () + () + ) + (FunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(If + (Name + foo + Load + ) + [(Pass) + (Pass) + (If + (Name + bar + Load + ) + [(Pass)] + [] + ) + (Pass)] + [] + ) + (Pass)] + [] + () + () + ) + (Assign + [(Name + x + Store + )] + (List + [(Name + a + Load + )] + Load + ) + () + )] + [] +) diff --git a/tests/reference/ast_new-comprehension1-69cf2af.json b/tests/reference/ast_new-comprehension1-69cf2af.json new file mode 100644 index 0000000000..1e1b460b96 --- /dev/null +++ b/tests/reference/ast_new-comprehension1-69cf2af.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-comprehension1-69cf2af", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/comprehension1.py", + "infile_hash": "2e5d7d233befce4f5cbf334234537fe4f11e8b6e8d057974579aed89", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-comprehension1-69cf2af.stdout", + "stdout_hash": "dd4d6e66646c90be9ebc7070964a2f42ca21d5c782bfddbf89ce854b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-comprehension1-69cf2af.stdout b/tests/reference/ast_new-comprehension1-69cf2af.stdout new file mode 100644 index 0000000000..83f9d88428 --- /dev/null +++ b/tests/reference/ast_new-comprehension1-69cf2af.stdout @@ -0,0 +1,1363 @@ +(Module + [(Assign + [(Name + fruits + Store + )] + (ListComp + (Name + f + Load + ) + [((Name + f + Store + ) + (Name + fruit_list + Load + ) + [(Call + (Attribute + (Name + f + Load + ) + startswith + Load + ) + [(ConstantStr + "a" + () + )] + [] + )] + 0)] + ) + () + ) + (Assign + [(Name + fruit_list + Store + )] + (ListComp + (Name + fruit + Load + ) + [((Name + fruit + Store + ) + (Name + fruits + Load + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + sum_cord + Store + )] + (ListComp + (BinOp + (Name + x + Load + ) + Add + (Name + y + Load + ) + ) + [((Tuple + [(Name + x + Store + ) + (Name + y + Store + )] + Store + ) + (Name + points + Load + ) + [(BoolOp + And + [(Compare + (Name + x + Load + ) + Gt + [(ConstantInt + 0 + () + )] + ) + (Compare + (Name + y + Load + ) + Gt + [(ConstantInt + 0 + () + )] + )] + )] + 0)] + ) + () + ) + (Assign + [(Name + transform_1 + Store + )] + (ListComp + (BinOp + (BinOp + (ConstantInt + 2 + () + ) + Mult + (Name + x + Load + ) + ) + Add + (ConstantInt + 6 + () + ) + ) + [((Name + x + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + distance_orig + Store + )] + (ListComp + (BinOp + (BinOp + (BinOp + (Name + x + Load + ) + Pow + (ConstantInt + 2 + () + ) + ) + Add + (BinOp + (Name + y + Load + ) + Pow + (ConstantInt + 2 + () + ) + ) + ) + Add + (BinOp + (Name + z + Load + ) + Pow + (ConstantInt + 2 + () + ) + ) + ) + [((Tuple + [(Name + x + Store + ) + (Name + y + Store + ) + (Name + z + Store + )] + Store + ) + (Name + points + Load + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + odd_elements + Store + )] + (ListComp + (Name + i + Load + ) + [((Name + i + Store + ) + (Name + main_list + Load + ) + [(BinOp + (Name + i + Load + ) + BitAnd + (ConstantInt + 1 + () + ) + )] + 0)] + ) + () + ) + (Assign + [(Name + first_ten_elements + Store + )] + (ListComp + (Name + i + Load + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + another_ten_elements + Store + )] + (ListComp + (Name + i + Load + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + comp + Store + )] + (ListComp + (BinOp + (Name + i + Load + ) + Pow + (ConstantInt + 2 + () + ) + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(BoolOp + And + [(Compare + (Name + i + Load + ) + NotIn + [(List + [(ConstantInt + 3 + () + ) + (ConstantInt + 5 + () + ) + (ConstantInt + 7 + () + )] + Load + )] + ) + (Compare + (Name + i + Load + ) + In + [(Name + list3 + Load + )] + )] + )] + 0)] + ) + () + ) + (Assign + [(Name + items + Store + )] + (ListComp + (Name + name + Load + ) + [((Tuple + [(Name + name + Store + ) + (Name + value + Store + )] + Store + ) + (Call + (Attribute + (Call + (Name + vars + Load + ) + [(Name + argparse + Load + )] + [] + ) + items + Load + ) + [] + [] + ) + [(UnaryOp + Not + (BoolOp + Or + [(Call + (Attribute + (Name + name + Load + ) + startswith + Load + ) + [(ConstantStr + "_" + () + )] + [] + ) + (Compare + (Name + name + Load + ) + Eq + [(ConstantStr + "ngettext" + () + )] + )] + ) + ) + (UnaryOp + Not + (Call + (Attribute + (Name + inspect + Load + ) + ismodule + Load + ) + [(Name + value + Load + )] + [] + ) + )] + 0)] + ) + () + ) + (Expr + (ListComp + (ConstantInt + 0 + () + ) + [((Subscript + (Name + tgt + Load + ) + (ConstantInt + 0 + () + ) + Store + ) + (Call + (Name + source + Load + ) + [] + [] + ) + [] + 1)] + ) + ) + (Assign + [(Name + prm_tup + Store + )] + (Call + (Name + tuple + Load + ) + [(GeneratorExp + (Call + (Name + next + Load + ) + [(Name + parameters + Load + )] + [] + ) + [((Name + _ + Store + ) + (Attribute + (Name + i + Load + ) + __parameters__ + Load + ) + [] + 0)] + )] + [] + ) + () + ) + (Assign + [(Name + args + Store + )] + (Call + (Attribute + (ConstantStr + ", " + () + ) + join + Load + ) + [(GeneratorExp + (Call + (Name + _to_str + Load + ) + [(Name + i + Load + )] + [] + ) + [((Name + i + Store + ) + (Attribute + (Name + self + Load + ) + __args__ + Load + ) + [] + 0)] + )] + [] + ) + () + ) + (Assign + [(Name + rest + Store + )] + (Call + (Name + tuple + Load + ) + [(GeneratorExp + (Name + i + Load + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(Attribute + (Name + a + Load + ) + ndim + Load + )] + [] + ) + [(Compare + (Name + i + Load + ) + NotIn + [(Name + axis + Load + )] + )] + 0)] + )] + [] + ) + () + ) + (Expr + (GeneratorExp + (Call + (Name + sstr + Load + ) + [(Name + x + Load + )] + [] + ) + [((List + [(Name + x + Store + )] + Store + ) + (Attribute + (Attribute + (Name + self + Load + ) + _module + Load + ) + gens + Load + ) + [] + 0)] + ) + ) + (Expr + (Call + (Name + func + Load + ) + [(Starred + (ListComp + (List + [(BinOp + (Name + x + Load + ) + Mult + (Name + y + Load + ) + )] + Load + ) + [((List + [(Name + x + Store + )] + Store + ) + (Attribute + (Attribute + (Name + self + Load + ) + _module + Load + ) + gens + Load + ) + [] + 0) + ((List + [(Name + y + Store + )] + Store + ) + (Attribute + (Attribute + (Name + J + Load + ) + _module + Load + ) + gens + Load + ) + [] + 0)] + ) + Load + )] + [] + ) + ) + (Expr + (GeneratorExp + (Name + x + Load + ) + [((List + [(Name + a + Store + ) + (Name + b + Store + )] + Store + ) + (Name + y + Load + ) + [] + 0)] + ) + ) + (Expr + (GeneratorExp + (Name + x + Load + ) + [((List + [(Name + a + Store + ) + (Tuple + [(Name + b + Store + ) + (Name + c + Store + )] + Store + )] + Store + ) + (Name + y + Load + ) + [] + 0)] + ) + ) + (Expr + (GeneratorExp + (Name + x + Load + ) + [((List + [(Tuple + [(Name + b + Store + ) + (Name + c + Store + )] + Store + )] + Store + ) + (Name + y + Load + ) + [] + 0)] + ) + ) + (Expr + (GeneratorExp + (Name + x + Load + ) + [((List + [] + Store + ) + (Name + y + Load + ) + [] + 0)] + ) + ) + (Expr + (GeneratorExp + (Subscript + (Name + string + Load + ) + (Name + i + Load + ) + Load + ) + [((Name + i + Store + ) + (Call + (Name + range + Load + ) + [(BinOp + (Call + (Name + len + Load + ) + [(Name + string + Load + )] + [] + ) + Sub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + )] + [] + ) + [] + 0)] + ) + ) + (Assign + [(Name + k + Store + )] + (GeneratorExp + (BinOp + (Name + j + Load + ) + Add + (Name + k + Load + ) + ) + [((Tuple + [(Name + j + Store + ) + (Name + k + Store + )] + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(Compare + (Name + j + Load + ) + Gt + [(ConstantInt + 0 + () + )] + )] + 0)] + ) + () + ) + (Expr + (GeneratorExp + (BinOp + (BinOp + (Name + left + Load + ) + Add + (Name + size + Load + ) + ) + Add + (Name + right + Load + ) + ) + [((Tuple + [(Name + size + Store + ) + (Tuple + [(Name + left + Store + ) + (Name + right + Store + )] + Store + )] + Store + ) + (Call + (Name + zip + Load + ) + [(Attribute + (Name + array + Load + ) + shape + Load + ) + (Name + pad_width + Load + )] + [] + ) + [] + 0)] + ) + ) + (Assign + [(Name + viter + Store + )] + (GeneratorExp + (Tuple + [(Name + i + Load + ) + (Name + j + Load + )] + Load + ) + [((Tuple + [(Tuple + [(Name + i + Store + ) + (Name + _ + Store + )] + Store + ) + (Tuple + [(Name + j + Store + ) + (Name + _ + Store + )] + Store + )] + Store + ) + (Call + (Name + zip + Load + ) + [(Subscript + (Name + newargs + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + ) + (Subscript + (Name + args + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + )] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + newSet + Store + )] + (SetComp + (BinOp + (Name + element + Load + ) + Mult + (ConstantInt + 3 + () + ) + ) + [((Name + element + Store + ) + (Name + myList + Load + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + newSet + Store + )] + (SetComp + (BinOp + (Name + element + Load + ) + Mult + (ConstantInt + 3 + () + ) + ) + [((Name + element + Store + ) + (Name + myList + Load + ) + [(Compare + (BinOp + (Name + element + Load + ) + Mod + (ConstantInt + 2 + () + ) + ) + Eq + [(ConstantInt + 0 + () + )] + )] + 0)] + ) + () + ) + (Expr + (DictComp + (Name + x + Load + ) + (BinOp + (Name + x + Load + ) + Pow + (ConstantInt + 3 + () + ) + ) + [((Name + x + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(Compare + (BinOp + (BinOp + (Name + x + Load + ) + Pow + (ConstantInt + 3 + () + ) + ) + Mod + (ConstantInt + 4 + () + ) + ) + Eq + [(ConstantInt + 0 + () + )] + )] + 0)] + ) + ) + (Assign + [(Name + square_dict + Store + )] + (DictComp + (Name + num + Load + ) + (BinOp + (Name + num + Load + ) + Mult + (Name + num + Load + ) + ) + [((Name + num + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 1 + () + ) + (ConstantInt + 11 + () + )] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + error_names + Store + )] + (ListComp + (Subscript + (Call + (Attribute + (Name + test_full_name + Load + ) + split + Load + ) + [(ConstantStr + " " + () + )] + [] + ) + (ConstantInt + 0 + () + ) + Load + ) + [((Tuple + [(Name + test_full_name + Store + ) + (Starred + (Name + _ + Store + ) + Store + )] + Store + ) + (Name + errors + Load + ) + [] + 0)] + ) + () + )] + [] +) diff --git a/tests/reference/ast_new-conditional_expr1-07ccb9e.json b/tests/reference/ast_new-conditional_expr1-07ccb9e.json new file mode 100644 index 0000000000..e90a4839bd --- /dev/null +++ b/tests/reference/ast_new-conditional_expr1-07ccb9e.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-conditional_expr1-07ccb9e", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/conditional_expr1.py", + "infile_hash": "5846a6c58bf238c4276f733b5fc9876a948ed63558444210d9f79c55", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-conditional_expr1-07ccb9e.stdout", + "stdout_hash": "92adfc3fb76aa117fdee246478837474332ec5de543e164920e3ec40", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout b/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout new file mode 100644 index 0000000000..74739c7294 --- /dev/null +++ b/tests/reference/ast_new-conditional_expr1-07ccb9e.stdout @@ -0,0 +1,1069 @@ +(Module + [(Assign + [(Name + b + Store + )] + (IfExp + (Compare + (Name + a + Load + ) + Eq + [(ConstantInt + 2 + () + )] + ) + (ConstantInt + 6 + () + ) + (ConstantInt + 8 + () + ) + ) + () + ) + (Expr + (IfExp + (ConstantBool + .true. + () + ) + (ConstantStr + "true" + () + ) + (ConstantStr + "false" + () + ) + ) + ) + (Assign + [(Name + result + Store + )] + (IfExp + (UnaryOp + Not + (Compare + (Name + a + Load + ) + Gt + [(Name + b + Load + )] + ) + ) + (Name + x + Load + ) + (Name + y + Load + ) + ) + () + ) + (Expr + (IfExp + (Compare + (Name + a + Load + ) + Gt + [(Name + b + Load + )] + ) + (Call + (Name + print + Load + ) + [(Name + a + Load + ) + (ConstantStr + "is greater" + () + )] + [] + ) + (Call + (Name + print + Load + ) + [(Name + b + Load + ) + (ConstantStr + "is Greater" + () + )] + [] + ) + ) + ) + (Expr + (Call + (Name + x + Load + ) + [(IfExp + (ConstantBool + .true. + () + ) + (ConstantStr + "True" + () + ) + (ConstantStr + "False" + () + ) + )] + [] + ) + ) + (Assign + [(Name + test + Store + )] + (IfExp + (Name + a + Load + ) + (Call + (Name + x + Load + ) + [(ConstantInt + 123 + () + )] + [] + ) + (Attribute + (Name + b + Load + ) + c + Load + ) + ) + () + ) + (Assign + [(Name + res + Store + )] + (Call + (Attribute + (Name + test + Load + ) + x + Load + ) + [(IfExp + (Compare + (Name + z + Load + ) + Is + [(ConstantNone + () + )] + ) + (ConstantStr + "" + () + ) + (Name + var + Load + ) + )] + [] + ) + () + ) + (Assign + [(Name + size + Store + )] + (BinOp + (Call + (Name + sum + Load + ) + [(GeneratorExp + (IfExp + (Compare + (Call + (Name + ord + Load + ) + [(Name + c + Load + )] + [] + ) + Gt + [(ConstantInt + 65535 + () + )] + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 1 + () + ) + ) + [((Name + c + Store + ) + (Name + init + Load + ) + [] + 0)] + )] + [] + ) + Add + (ConstantInt + 1 + () + ) + ) + () + ) + (Expr + (Tuple + [(Name + x + Load + ) + (Name + y + Load + ) + (IfExp + (Name + a + Load + ) + (ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + )] + Load + ) + ) + (AugAssign + (Name + x + Store + ) + Add + (IfExp + (Name + true + Load + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (ConstantInt + 1 + () + ) + ) + ) + (Expr + (Call + (IfExp + (Compare + (Name + tktype + Load + ) + In + [(Name + whentrue + Load + )] + ) + (Attribute + (Name + self + Load + ) + assertTrue + Load + ) + (Attribute + (Name + self + Load + ) + assertFalse + Load + ) + ) + [(Call + (Name + func + Load + ) + [] + [] + )] + [] + ) + ) + (Assign + [(Name + x + Store + )] + (SetComp + (IfExp + (Compare + (Call + (Name + len + Load + ) + [(Attribute + (Name + f + Load + ) + parts + Load + )] + [] + ) + Gt + [(ConstantInt + 1 + () + )] + ) + (Subscript + (Attribute + (Name + f + Load + ) + parts + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + (Attribute + (Call + (Attribute + (Name + f + Load + ) + with_suffix + Load + ) + [(ConstantStr + "" + () + )] + [] + ) + name + Load + ) + ) + [((Name + f + Store + ) + (Call + (Name + always_iterable + Load + ) + [(Attribute + (Name + dist + Load + ) + files + Load + )] + [] + ) + [(Compare + (Attribute + (Name + f + Load + ) + suffix + Load + ) + Eq + [(ConstantStr + ".py" + () + )] + )] + 0)] + ) + () + ) + (Assign + [(Name + return_value + Store + )] + (DictComp + (Name + key + Load + ) + (IfExp + (UnaryOp + Not + (Call + (Name + isinstance + Load + ) + [(Name + value + Load + ) + (Name + str + Load + )] + [] + ) + ) + (Name + value + Load + ) + (Call + (Name + eval + Load + ) + [(Name + value + Load + ) + (Name + globals + Load + ) + (Name + locals + Load + )] + [] + ) + ) + [((Tuple + [(Name + key + Store + ) + (Name + value + Store + )] + Store + ) + (Call + (Attribute + (Name + ann + Load + ) + items + Load + ) + [] + [] + ) + [] + 0)] + ) + () + ) + (Assign + [(Name + kwonly_sig + Store + )] + (BinOp + (Name + msg + Load + ) + Mod + (Tuple + [(IfExp + (Compare + (Name + given + Load + ) + NotEq + [(ConstantInt + 1 + () + )] + ) + (ConstantStr + "s" + () + ) + (ConstantStr + "" + () + ) + ) + (Name + kwonly_given + Load + ) + (IfExp + (Compare + (Name + kwonly_given + Load + ) + NotEq + [(ConstantInt + 1 + () + )] + ) + (ConstantStr + "s" + () + ) + (ConstantStr + "" + () + ) + )] + Load + ) + ) + () + ) + (Expr + (Call + (Attribute + (Name + struct + Load + ) + pack_into + Load + ) + [(Call + (Attribute + (ConstantStr + "" + () + ) + join + Load + ) + [(Name + _formats + Load + )] + [] + ) + (Attribute + (Attribute + (Name + self + Load + ) + shm + Load + ) + buf + Load + ) + (Attribute + (Name + self + Load + ) + _offset_data_start + Load + ) + (Starred + (GeneratorExp + (IfExp + (Call + (Name + isinstance + Load + ) + [(Name + v + Load + ) + (Name + str + Load + )] + [] + ) + (Call + (Attribute + (Name + v + Load + ) + encode + Load + ) + [(Name + _enc + Load + )] + [] + ) + (Name + v + Load + ) + ) + [((Name + v + Store + ) + (Name + sequence + Load + ) + [] + 0)] + ) + Load + )] + [] + ) + ) + (For + (Name + name + Store + ) + (IfExp + (Compare + (Name + entries + Load + ) + Is + [(ConstantNone + () + )] + ) + (Name + dirs + Load + ) + (Call + (Name + zip + Load + ) + [(Name + dirs + Load + ) + (Name + entries + Load + )] + [] + ) + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + ) + (If + (IfExp + (Compare + (Name + n + Load + ) + Eq + [(ConstantInt + 0 + () + )] + ) + (BoolOp + Or + [(Name + root + Load + ) + (Name + drv + Load + )] + ) + (Compare + (Call + (Name + cf + Load + ) + [(Subscript + (Name + abs_parts + Load + ) + (Slice + () + (Name + n + Load + ) + () + ) + Load + )] + [] + ) + NotEq + [(Call + (Name + cf + Load + ) + [(Name + to_abs_parts + Load + )] + [] + )] + ) + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (Assign + [(Tuple + [(Name + x + Store + ) + (Name + y + Store + )] + Store + )] + (Tuple + [(Name + thing + Load + ) + (IfExp + (Call + (Name + isinstance + Load + ) + [(Name + name + Load + ) + (Name + str + Load + )] + [] + ) + (Name + name + Load + ) + (ConstantNone + () + ) + )] + Load + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(BinOp + (ConstantStr + "%*d%s " + () + ) + Mod + (Tuple + [(Name + offset_width + Load + ) + (Name + start + Load + ) + (IfExp + (Compare + (Name + start + Load + ) + In + [(Name + labels + Load + )] + ) + (ConstantStr + ":" + () + ) + (ConstantStr + "." + () + ) + )] + Load + ) + )] + [(end + (BinOp + (ConstantStr + " " + () + ) + Mult + (BinOp + (Name + level + Load + ) + Sub + (ConstantInt + 1 + () + ) + ) + ))] + ) + ) + (Assign + [(Name + Signals + Store + )] + (Dict + [(Name + C + Load + ) + (Name + P + Load + )] + [(IfExp + (Name + C + Load + ) + (Call + (Name + tuple + Load + ) + [(Call + (Attribute + (Attribute + (Call + (Attribute + (Name + C + Load + ) + getcontext + Load + ) + [] + [] + ) + flags + Load + ) + keys + Load + ) + [] + [] + )] + [] + ) + (ConstantNone + () + ) + ) + (Call + (Name + tuple + Load + ) + [(Call + (Attribute + (Attribute + (Call + (Attribute + (Name + P + Load + ) + getcontext + Load + ) + [] + [] + ) + flags + Load + ) + keys + Load + ) + [] + [] + )] + [] + )] + ) + () + ) + (Assign + [(Name + chunks + Store + )] + (ListComp + (IfExp + (Name + cond2 + Load + ) + (IfExp + (Name + cond1 + Load + ) + (ConstantBytes + "b'z'" + () + ) + (ConstantBytes + "b'y'" + () + ) + ) + (Name + x + Load + ) + ) + [((Name + word + Store + ) + (Name + words + Load + ) + [] + 0)] + ) + () + )] + [] +) diff --git a/tests/reference/ast_new-dictionary1-445e718.json b/tests/reference/ast_new-dictionary1-445e718.json new file mode 100644 index 0000000000..5d739b9a9b --- /dev/null +++ b/tests/reference/ast_new-dictionary1-445e718.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-dictionary1-445e718", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/dictionary1.py", + "infile_hash": "68922e77dbabe06c271463150653684880d3c28d88caa44109b2e202", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-dictionary1-445e718.stdout", + "stdout_hash": "dfae0ace6e4267478ecfd053f2be4a56fddf1f635099b4f6695d250b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-dictionary1-445e718.stdout b/tests/reference/ast_new-dictionary1-445e718.stdout new file mode 100644 index 0000000000..f468f9e1f4 --- /dev/null +++ b/tests/reference/ast_new-dictionary1-445e718.stdout @@ -0,0 +1,299 @@ +(Module + [(FunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + x + Store + )] + (Dict + [] + [] + ) + () + ) + (Assign + [(Name + dict + Store + )] + (Dict + [(ConstantStr + "brand" + () + ) + (ConstantStr + "electric" + () + ) + (ConstantStr + "year" + () + ) + (ConstantStr + "colors" + () + )] + [(ConstantStr + "Ford" + () + ) + (ConstantBool + .false. + () + ) + (ConstantInt + 1964 + () + ) + (List + [(ConstantStr + "red" + () + ) + (ConstantStr + "white" + () + )] + Load + )] + ) + () + ) + (Assign + [(Name + num + Store + )] + (Dict + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + [(ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + ) + () + ) + (AnnAssign + (Name + y + Store + ) + (Subscript + (Name + dict + Load + ) + (Tuple + [(Name + str + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + )] + ) + () + ) + (Assign + [(Name + y + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + (UnaryOp + USub + (ConstantInt + 2 + () + ) + )] + ) + () + ) + (Assign + [(Subscript + (Name + y + Load + ) + (ConstantStr + "a" + () + ) + Store + )] + (ConstantInt + 123 + () + ) + () + ) + (Assign + [(Name + a + Store + )] + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + ) + () + ) + (Assign + [(Name + x + Store + )] + (Dict + [(ConstantStr + "markdown2.tpl" + () + )] + [(ConstantStr + " Text\n " + () + )] + ) + () + ) + (Assign + [(Name + x + Store + )] + (Dict + [(ConstantNone + () + ) + (Name + y + Load + ) + (ConstantNone + () + ) + (ConstantNone + () + )] + [(Name + x + Load + ) + (ConstantStr + "Text" + () + ) + (Name + z + Load + ) + (ConstantStr + "None" + () + )] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + test + Load + ) + [] + [] + ) + )] + [(TypeIgnore + 0 + "" + )] +) diff --git a/tests/reference/ast_new-ellipsis2-3a9750b.json b/tests/reference/ast_new-ellipsis2-3a9750b.json new file mode 100644 index 0000000000..90701cb0d6 --- /dev/null +++ b/tests/reference/ast_new-ellipsis2-3a9750b.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-ellipsis2-3a9750b", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/ellipsis2.py", + "infile_hash": "2e6669bafe4247887d3cd6d9f479ef9c02de96d2a018df4a716ae259", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-ellipsis2-3a9750b.stdout", + "stdout_hash": "c31c7abbb37cfb16b2e919f083ffc3839162529f9e18e82dc3a1ed7c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-ellipsis2-3a9750b.stdout b/tests/reference/ast_new-ellipsis2-3a9750b.stdout new file mode 100644 index 0000000000..a86c90395c --- /dev/null +++ b/tests/reference/ast_new-ellipsis2-3a9750b.stdout @@ -0,0 +1,336 @@ +(Module + [(Import + [(numpy + np)] + ) + (ImportFrom + typing + [(Callable + ())] + 0 + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantEllipsis + () + )] + [] + ) + ) + (Assign + [(Name + array + Store + )] + (Call + (Attribute + (Attribute + (Name + np + Load + ) + random + Load + ) + rand + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + array + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (ConstantInt + 0 + () + )] + Load + ) + Load + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + array + Load + ) + (Tuple + [(Name + Ellipsis + Load + ) + (ConstantInt + 0 + () + )] + Load + ) + Load + )] + [] + ) + ) + (FunctionDef + test1 + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + test2 + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + x + Store + )] + (List + [(ConstantInt + 1 + () + ) + (List + [(ConstantInt + 2 + () + ) + (List + [(ConstantEllipsis + () + )] + Load + ) + (ConstantInt + 3 + () + )] + Load + )] + Load + ) + () + ) + (Assign + [(Name + l + Store + )] + (List + [(ConstantEllipsis + () + ) + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + () + ) + (Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + ) + (Assign + [(Name + array + Store + )] + (Call + (Attribute + (Attribute + (Name + np + Load + ) + random + Load + ) + rand + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 2 + () + )] + [] + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + array + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (ConstantInt + 0 + () + )] + Load + ) + Load + )] + [] + ) + ) + (FunctionDef + foo + ([] + [(x + (ConstantEllipsis + () + ) + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + ) + (FunctionDef + inject + ([] + [(get_next_item + (Subscript + (Name + Callable + Load + ) + (Tuple + [(ConstantEllipsis + () + ) + (Name + str + Load + )] + Load + ) + Load + ) + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (ConstantNone + () + ) + () + )] + [] +) diff --git a/tests/reference/ast_new-for1-887432e.json b/tests/reference/ast_new-for1-887432e.json new file mode 100644 index 0000000000..3e2c929fae --- /dev/null +++ b/tests/reference/ast_new-for1-887432e.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-for1-887432e", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/for1.py", + "infile_hash": "8f9e8ef938c302e9ec566be988c563e0378002ac96687c46d7d9c137", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-for1-887432e.stdout", + "stdout_hash": "f9f49679cca12cff7db1a7828457e033b55aae6dd408b3a4326d1d7e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-for1-887432e.stdout b/tests/reference/ast_new-for1-887432e.stdout new file mode 100644 index 0000000000..ac3f1c279f --- /dev/null +++ b/tests/reference/ast_new-for1-887432e.stdout @@ -0,0 +1,485 @@ +(Module + [(ImportFrom + lpython + [(i32 + ())] + 0 + ) + (For + (Name + x + Store + ) + (Name + fruits + Load + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + x + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + x + Store + ) + (Name + fruits + Load + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + x + Load + )] + [] + ) + ) + (If + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "banana" + () + )] + ) + [(Break)] + [] + )] + [] + () + ) + (For + (Name + x + Store + ) + (ConstantStr + "banana" + () + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + x + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 6 + () + )] + [] + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + i + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 2 + () + ) + (ConstantInt + 30 + () + ) + (ConstantInt + 3 + () + )] + [] + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + i + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(If + (Compare + (Name + i + Load + ) + Eq + [(ConstantInt + 3 + () + )] + ) + [(Continue)] + [] + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + i + Load + )] + [] + ) + )] + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Finally Completed!" + () + )] + [] + ) + )] + () + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(For + (Name + j + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + i + Load + ) + (Name + j + Load + )] + [] + ) + )] + [] + () + )] + [] + () + ) + (AnnAssign + (Name + sum + Store + ) + (Name + i32 + Load + ) + (ConstantInt + 0 + () + ) + 1 + ) + (For + (Name + j + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(AugAssign + (Name + sum + Store + ) + Add + (Name + j + Load + ) + )] + [] + () + ) + (For + (Tuple + [(Name + _ + Store + ) + (Name + x + Store + )] + Store + ) + (Name + y + Load + ) + [(Pass)] + [] + () + ) + (For + (Tuple + [(Name + x + Store + ) + (Name + y + Store + )] + Store + ) + (Name + z + Load + ) + [(Pass)] + [] + () + ) + (For + (Tuple + [(Name + i + Store + ) + (Name + a + Store + )] + Store + ) + (Call + (Name + enumerate + Load + ) + [(List + [(ConstantInt + 4 + () + ) + (ConstantInt + 5 + () + ) + (ConstantInt + 6 + () + ) + (ConstantInt + 7 + () + )] + Load + )] + [] + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + i + Load + ) + (ConstantStr + ": " + () + ) + (Name + a + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(Pass)] + [] + "int" + ) + (For + (Name + j + Store + ) + (Name + k + Load + ) + [(Pass)] + [] + "List[str]" + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(Pass)] + [(Pass)] + "int" + )] + [] +) diff --git a/tests/reference/ast_new-for2-af08901.json b/tests/reference/ast_new-for2-af08901.json new file mode 100644 index 0000000000..ff9c17f689 --- /dev/null +++ b/tests/reference/ast_new-for2-af08901.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-for2-af08901", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/for2.py", + "infile_hash": "32c45d5c5edc44504a3fa5d24c6c1660977d2ceceeef311ee5a37410", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-for2-af08901.stdout", + "stdout_hash": "ac6e50517c5d609747b66c75e15bfa69ada7f0f41ebeb943da9b3167", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-for2-af08901.stdout b/tests/reference/ast_new-for2-af08901.stdout new file mode 100644 index 0000000000..c495f51677 --- /dev/null +++ b/tests/reference/ast_new-for2-af08901.stdout @@ -0,0 +1,504 @@ +(Module + [(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" + ) + (AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(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 + ) + (Compare + (Name + a + Load + ) + In + [(Name + list1 + Load + )] + ) + [(Pass)] + [] + () + ) + (For + (Name + item + Store + ) + (Name + list1 + Load + ) + [(If + (Compare + (Name + item + Load + ) + In + [(Name + list2 + Load + )] + ) + [(Pass)] + [] + )] + [] + () + ) + (If + (BoolOp + Or + [(BoolOp + And + [(Compare + (Name + a + Load + ) + In + [(Name + list1 + Load + )] + ) + (Compare + (Name + b + Load + ) + NotIn + [(Name + list2 + Load + )] + )] + ) + (Compare + (Name + c + Load + ) + In + [(Name + list3 + Load + )] + )] + ) + [(Pass)] + [] + ) + (For + (Name + f + Store + ) + (Tuple + [(Name + a + Load + ) + (Name + b + Load + ) + (Name + c + Load + ) + (Name + d + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (For + (Name + x + Store + ) + (Tuple + [(Name + a + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (For + (Name + x + Store + ) + (Tuple + [(Name + a + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (For + (Name + x + Store + ) + (Tuple + [(Name + a + Load + ) + (Name + b + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (AsyncFunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(AsyncFor + (Name + x + Store + ) + (Tuple + [(Name + a + Load + ) + (Name + b + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (AsyncFor + (Name + x + Store + ) + (Tuple + [(Name + a + Load + )] + Load + ) + [(Pass)] + [] + () + )] + [] + () + () + ) + (For + (Name + a + Store + ) + (Tuple + [(Name + b + Load + ) + (Name + c + Load + )] + Load + ) + [(Expr + (BinOp + (Name + a + Load + ) + Pow + (ConstantInt + 2 + () + ) + ) + ) + (Pass)] + [] + () + ) + (AsyncFor + (Name + a + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 5 + () + )] + [] + ) + [(Expr + (Call + (Name + print + Load + ) + [(Name + a + Load + )] + [] + ) + )] + [] + () + ) + (For + (Name + like_function + Store + ) + (Tuple + [(Attribute + (Name + np + Load + ) + zeros_like + Load + ) + (Attribute + (Name + np + Load + ) + ones_like + Load + ) + (Attribute + (Name + np + Load + ) + empty_like + Load + )] + Load + ) + [(Pass)] + [] + () + ) + (For + (Tuple + [(Name + a + Store + )] + Store + ) + (Name + t + Load + ) + [(Pass)] + [] + () + )] + [] +) diff --git a/tests/reference/ast_new-function_def1-1a872df.json b/tests/reference/ast_new-function_def1-1a872df.json new file mode 100644 index 0000000000..ff54698350 --- /dev/null +++ b/tests/reference/ast_new-function_def1-1a872df.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-function_def1-1a872df", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/function_def1.py", + "infile_hash": "1afa1fb49c292eabdb1a8798f8b0642d878f3a67f8f069ab0bac4574", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-function_def1-1a872df.stdout", + "stdout_hash": "0110165ec922436f3a1dcf21de9d64353f410bb4b5dab943df168d79", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def1-1a872df.stdout b/tests/reference/ast_new-function_def1-1a872df.stdout new file mode 100644 index 0000000000..982d9d5371 --- /dev/null +++ b/tests/reference/ast_new-function_def1-1a872df.stdout @@ -0,0 +1,558 @@ +(Module + [(ImportFrom + lpython + [(i32 + ()) + (overload + ())] + 0 + ) + (FunctionDef + greet + ([] + [(name + () + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantStr + "\n This function greets to\n the person passed in as\n a parameter\n " + () + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(BinOp + (BinOp + (ConstantStr + "Hello, " + () + ) + Add + (Name + name + Load + ) + ) + Add + (ConstantStr + ". Good morning!" + () + ) + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + absolute_value + ([] + [(num + () + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantStr + "This function returns the absolute\n value of the entered number" + () + ) + ) + (If + (Compare + (Name + num + Load + ) + GtE + [(ConstantInt + 0 + () + )] + ) + [(Return + (Name + num + Load + ) + )] + [(Return + (UnaryOp + USub + (Name + num + Load + ) + ) + )] + )] + [] + () + () + ) + (FunctionDef + combine + ([] + [(fname + () + ()) + (lname + () + ())] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + print + Load + ) + [(BinOp + (BinOp + (Name + fname + Load + ) + Add + (ConstantStr + " " + () + ) + ) + Add + (Name + lname + Load + ) + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + tri_recursion + ([] + [(k + () + ())] + [] + [] + [] + [] + []) + [(If + (Compare + (Name + k + Load + ) + Gt + [(ConstantInt + 0 + () + )] + ) + [(Assign + [(Name + result + Store + )] + (BinOp + (Name + k + Load + ) + Add + (Call + (Name + tri_recursion + Load + ) + [(BinOp + (Name + k + Load + ) + Sub + (ConstantInt + 1 + () + ) + )] + [] + ) + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + result + Load + )] + [] + ) + )] + [(Assign + [(Name + result + Store + )] + (ConstantInt + 0 + () + ) + () + )] + ) + (Return + (Name + result + Load + ) + )] + [] + () + () + ) + (FunctionDef + test + ([] + [(a + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + []) + [(Return + (BinOp + (Name + a + Load + ) + Add + (ConstantInt + 10 + () + ) + ) + )] + [(Name + overload + Load + )] + (Name + i32 + Load + ) + () + ) + (FunctionDef + test + ([] + [(a + (Name + i64 + Load + ) + ())] + [] + [] + [] + [] + []) + [(Return + (BinOp + (Name + a + Load + ) + Add + (ConstantInt + 10 + () + ) + ) + )] + [(Name + overload + Load + )] + (Name + i64 + Load + ) + () + ) + (FunctionDef + test + ([] + [(a + (Name + bool + Load + ) + ())] + [] + [] + [] + [] + []) + [(If + (Name + a + Load + ) + [(Return + (ConstantInt + 10 + () + ) + )] + [] + ) + (Return + (UnaryOp + USub + (ConstantInt + 10 + () + ) + ) + )] + [(Name + overload + Load + )] + (Name + i32 + Load + ) + () + ) + (FunctionDef + check + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + greet + Load + ) + [(ConstantStr + "Xyz" + () + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(Call + (Name + absolute_value + Load + ) + [(ConstantInt + 2 + () + )] + [] + )] + [] + ) + ) + (Expr + (Call + (Name + combine + Load + ) + [(ConstantStr + "LPython" + () + ) + (ConstantStr + "Compiler" + () + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Recursion Example Results: " + () + )] + [] + ) + ) + (Expr + (Call + (Name + tri_recursion + Load + ) + [(ConstantInt + 6 + () + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(Call + (Name + test + Load + ) + [(ConstantInt + 15 + () + )] + [] + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(Call + (Name + test + Load + ) + [(ConstantBool + .true. + () + )] + [] + )] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + check + Load + ) + [] + [] + ) + ) + (FunctionDef + print_args + ([] + [] + [(args + () + ())] + [] + [] + [] + []) + [(Expr + (Call + (Name + print + Load + ) + [(Name + args + Load + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + print_kwargs + ([] + [] + [] + [] + [] + [(kwargs + () + ())] + []) + [(Expr + (Call + (Name + print + Load + ) + [(Name + kwargs + Load + )] + [] + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-function_def2-52c4587.json b/tests/reference/ast_new-function_def2-52c4587.json new file mode 100644 index 0000000000..6a84a1afa5 --- /dev/null +++ b/tests/reference/ast_new-function_def2-52c4587.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-function_def2-52c4587", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/function_def2.py", + "infile_hash": "7530fc0c8839061b935134cf72ca1ed46d0f2e5ec1b7053ef68b011b", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-function_def2-52c4587.stdout", + "stdout_hash": "701f1ddbc26053b77201943dc8be23c2cb86b979a207ebf11d5c0772", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def2-52c4587.stdout b/tests/reference/ast_new-function_def2-52c4587.stdout new file mode 100644 index 0000000000..6102745649 --- /dev/null +++ b/tests/reference/ast_new-function_def2-52c4587.stdout @@ -0,0 +1,1315 @@ +(Module + [(FunctionDef + test_01 + ([] + [] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_02 + ([] + [] + [(x + (Name + i32 + Load + ) + ())] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_03 + ([] + [] + [(x + () + ())] + [(y + () + ()) + (z + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_04 + ([] + [] + [(x + () + ())] + [(y + () + ()) + (z + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [(args + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_05 + ([] + [] + [(x + () + ())] + [] + [] + [(args + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_06 + ([] + [] + [] + [] + [] + [(args + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_07 + ([] + [(x + (Name + i32 + Load + ) + ()) + (y + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_08 + ([] + [(x + () + ())] + [(y + () + ())] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_09 + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_10 + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [(args + (Name + i32 + Load + ) + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_11 + ([] + [(x + () + ())] + [(y + () + ())] + [] + [] + [(args + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_12 + ([] + [(x + () + ())] + [] + [] + [] + [(args + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_13 + ([] + [(x + (Name + i32 + Load + ) + ()) + (y + (Name + i32 + Load + ) + ())] + [] + [] + [] + [] + [(ConstantInt + 1 + () + ) + (ConstantInt + 1 + () + )]) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_14 + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [(args + (Name + i32 + Load + ) + ())] + []) + [(Pass)] + [] + (Name + i32 + Load + ) + () + ) + (FunctionDef + test_15 + ([(a + () + ())] + [] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_16 + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_17 + ([(a + () + ())] + [] + [(b + () + ())] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_18 + ([(a + (Name + i32 + Load + ) + ())] + [] + [(b + (Name + i64 + Load + ) + ())] + [(c + (Name + i32 + Load + ) + ()) + (d + (Name + i32 + Load + ) + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_19 + ([(a + () + ())] + [] + [(b + () + ())] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_20 + ([(a + () + ())] + [] + [] + [] + [] + [(b + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_21 + ([(a + () + ())] + [] + [(b + () + ())] + [] + [] + [(c + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_22 + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_23 + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [] + [] + [] + [(d + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_24 + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [] + [] + [(e + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_25 + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [(e + () + ())] + [(ConstantNone + () + )] + [(f + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_26 + ([] + [] + [] + [(a + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_27 + ([] + [] + [] + [(a + () + ())] + [(ConstantNone + () + )] + [(b + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_28 + ([] + [(a + () + ())] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_29 + ([] + [(a + () + ())] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [(c + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_30 + ([(a + () + ())] + [] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_31 + ([(a + () + ())] + [(b + () + ())] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_32 + ([(a + () + ())] + [] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_33 + ([(a + () + ())] + [(b + () + ())] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + [(Pass)] + [] + () + () + ) + (Expr + (Call + (Name + test + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Name + x + Load + )] + [(y + (ConstantInt + 1 + () + )) + (z + (ConstantStr + "123" + () + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(ConstantInt + 100 + () + )] + [(() + (Name + x + Load + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + x + Load + ) + Load + )] + [(() + (Name + y + Load + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + x + Load + ) + Load + ) + (Name + y + Load + )] + [] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + x + Load + ) + Load + ) + (Starred + (Name + y + Load + ) + Load + )] + [] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [] + [(() + (Name + x + Load + )) + (() + (Name + y + Load + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + x + Load + ) + Load + )] + [(y + (ConstantInt + 1 + () + )) + (z + (ConstantInt + 2 + () + )) + (() + (Name + a + Load + )) + (b + (ConstantInt + 1 + () + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + x + Load + ) + Load + )] + [(() + (Name + a + Load + )) + (b + (ConstantStr + "1" + () + ))] + ) + ) + (Expr + (Call + (Name + test + Load + ) + [(Starred + (Name + y + Load + ) + Load + )] + [(x + (ConstantInt + 1 + () + )) + (z + (ConstantInt + 2 + () + )) + (() + (Name + a + Load + )) + (b + (ConstantStr + "1" + () + ))] + ) + ) + (Expr + (Call + (Attribute + (Name + lp + Load + ) + test + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + lp + Load + ) + test + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + lp + Load + ) + test + Load + ) + [(Name + x + Load + )] + [(y + (ConstantInt + 1 + () + )) + (z + (ConstantStr + "123" + () + ))] + ) + ) + (Expr + (Subscript + (Call + (Name + test + Load + ) + [] + [] + ) + (ConstantStr + "version" + () + ) + Load + ) + ) + (Expr + (Subscript + (Call + (Name + test + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + (ConstantStr + "version" + () + ) + Load + ) + ) + (Expr + (Subscript + (Call + (Name + test + Load + ) + [(Name + x + Load + ) + (Starred + (Name + y + Load + ) + Load + )] + [] + ) + (Slice + () + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (Subscript + (Call + (Name + test + Load + ) + [] + [] + ) + (ConstantInt + 1 + () + ) + Load + ) + (ConstantInt + 1 + () + ) + Load + ) + ) + (Expr + (Call + (Subscript + (Name + x + Load + ) + (ConstantStr + "numpystr" + () + ) + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Subscript + (Name + x + Load + ) + (ConstantStr + "int" + () + ) + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Subscript + (Name + x + Load + ) + (Name + func + Load + ) + Load + ) + [(Starred + (Name + args + Load + ) + Load + )] + [(() + (Name + kwargs + Load + ))] + ) + ) + (Expr + (Call + (Subscript + (Name + test + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + [(Starred + (Subscript + (Name + test + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + ) + Load + )] + [] + ) + ) + (Expr + (Call + (BinOp + (Name + obj + Load + ) + Mult + (Attribute + (Attribute + (Name + self + Load + ) + _arr + Load + ) + ndim + Load + ) + ) + [(Starred + (Attribute + (Attribute + (Name + self + Load + ) + _arr + Load + ) + shape + Load + ) + Load + )] + [] + ) + ) + (Expr + (Call + (Name + traverse + Load + ) + [(Tuple + [(Name + index + Load + ) + (Name + value + Load + )] + Load + ) + (Name + visit + Load + ) + (Starred + (Name + args + Load + ) + Load + )] + [(result + (Name + result + Load + )) + (() + (Name + kwargs + Load + ))] + ) + )] + [] +) diff --git a/tests/reference/ast_new-function_def3-f66064a.json b/tests/reference/ast_new-function_def3-f66064a.json new file mode 100644 index 0000000000..ef5687d117 --- /dev/null +++ b/tests/reference/ast_new-function_def3-f66064a.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-function_def3-f66064a", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/function_def3.py", + "infile_hash": "eb7900aec51ff71ffb02799ef3191ea93aa8dc68a4d12bcab18135be", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-function_def3-f66064a.stdout", + "stdout_hash": "5e5db40257c0c509b0496cf33a9ed0d4d7da8b4c16428b4c2fb264b0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-function_def3-f66064a.stdout b/tests/reference/ast_new-function_def3-f66064a.stdout new file mode 100644 index 0000000000..c9869c9776 --- /dev/null +++ b/tests/reference/ast_new-function_def3-f66064a.stdout @@ -0,0 +1,538 @@ +(Module + [(FunctionDef + main0 + ([] + [(i + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + example + ([] + [(text + () + ()) + (width + () + ()) + (fill_char + () + ())] + [] + [] + [] + [] + [(ConstantInt + 80 + () + ) + (ConstantStr + "-" + () + )]) + [(Return + () + )] + [] + () + "(...) -> str" + ) + (Expr + (Call + (Name + example + Load + ) + [(Name + text + Load + )] + [(width + (ConstantInt + 80 + () + )) + (fill_char + (ConstantStr + "-" + () + ))] + ) + ) + (FunctionDef + test_1 + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_2 + ([] + [(y + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + func + ([] + [(a + () + "str") + (b + () + "int") + (c + (Name + str + Load + ) + "str")] + [] + [] + [] + [] + [(ConstantInt + 80 + () + ) + (ConstantStr + "-" + () + )]) + [(Pass)] + [] + () + () + ) + (FunctionDef + abc + ([] + [(a + () + ()) + (b + () + "int") + (c + () + "list[str]")] + [] + [] + [] + [] + [(List + [(ConstantStr + "-" + () + )] + Load + )]) + [(Return + () + )] + [] + () + "(...) -> str" + ) + (FunctionDef + test_01 + ([] + [(a + () + "int") + (b + () + ())] + [] + [] + [] + [] + [(ConstantInt + 0 + () + )]) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_02 + ([] + [(a + () + "int") + (b + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + quantiles + ([(dist + () + ())] + [] + [] + [(n + () + ())] + [(ConstantNone + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + quantiles + ([(dist + () + ())] + [] + [] + [(n + () + ()) + (method + () + ())] + [(ConstantInt + 4 + () + ) + (ConstantStr + "exclusive" + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + func + ([(self + () + ()) + (param1 + () + ()) + (param2 + () + ())] + [(param3 + () + ())] + [] + [(param4 + () + ()) + (param5 + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + func + ([(self + () + ()) + (param1 + () + ()) + (param2 + () + ())] + [(param3 + () + ())] + [] + [(param4 + () + ()) + (param5 + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + [(ConstantInt + 7 + () + )]) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + func + ([(self + () + ()) + (param1 + () + ()) + (param2 + () + ())] + [(param3 + () + ()) + (param3_1 + () + ())] + [] + [(param4 + () + ()) + (param5 + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + [(ConstantInt + 2 + () + )]) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + add + ([] + [(a + () + ()) + (b + () + ())] + [] + [(c + () + ()) + (d + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + func + ([] + [] + [] + [(param4 + () + ()) + (param5 + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + func + ([] + [] + [] + [(param4 + () + ()) + (param5 + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (AsyncFunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + a + Store + )] + (Name + b + Load + ) + () + ) + (Return + (Tuple + [(Name + a + Load + )] + Load + ) + )] + [] + () + () + ) + (FunctionDef + dtype + ([] + [(self + () + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + (Name + _DType_co + Load + ) + () + )] + [(TypeIgnore + 0 + "[misc]" + ) + (TypeIgnore + 0 + "" + )] +) diff --git a/tests/reference/ast_new-global1-38edfbd.json b/tests/reference/ast_new-global1-38edfbd.json new file mode 100644 index 0000000000..e064ef2044 --- /dev/null +++ b/tests/reference/ast_new-global1-38edfbd.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-global1-38edfbd", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/global1.py", + "infile_hash": "cdbcc3f545f865cfc6e412f53fc6fd7cccdbc0d33b66e45460f3e916", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-global1-38edfbd.stdout", + "stdout_hash": "b0b999497a27625582a6dedfa024dba012a6ac1103ac427c49cc7d9d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-global1-38edfbd.stdout b/tests/reference/ast_new-global1-38edfbd.stdout new file mode 100644 index 0000000000..9011e976ad --- /dev/null +++ b/tests/reference/ast_new-global1-38edfbd.stdout @@ -0,0 +1,219 @@ +(Module + [(Assign + [(Name + x + Store + )] + (ConstantStr + "global " + () + ) + () + ) + (FunctionDef + outer + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + x + Store + )] + (ConstantStr + "local" + () + ) + () + ) + (FunctionDef + inner + ([] + [] + [] + [] + [] + [] + []) + [(Nonlocal + [x] + ) + (Assign + [(Name + x + Store + )] + (ConstantStr + "nonlocal" + () + ) + () + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "nonlocal" + () + )] + ) + () + )] + [] + () + () + ) + (Expr + (Call + (Name + inner + Load + ) + [] + [] + ) + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "nonlocal" + () + )] + ) + () + )] + [] + () + () + ) + (FunctionDef + test_1 + ([] + [] + [] + [] + [] + [] + []) + [(Global + [x] + ) + (Assign + [(Name + y + Store + )] + (ConstantStr + "local" + () + ) + () + ) + (Assign + [(Name + x + Store + )] + (BinOp + (Name + x + Load + ) + Mult + (ConstantInt + 2 + () + ) + ) + () + ) + (Assert + (Compare + (Name + x + Load + ) + Eq + [(ConstantStr + "global global " + () + )] + ) + () + ) + (Assert + (Compare + (Name + y + Load + ) + Eq + [(ConstantStr + "local" + () + )] + ) + () + )] + [] + () + () + ) + (FunctionDef + check + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Call + (Name + test_1 + Load + ) + [] + [] + ) + ) + (Expr + (Call + (Name + outer + Load + ) + [] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + check + Load + ) + [] + [] + ) + )] + [] +) diff --git a/tests/reference/ast_new-if1-db43586.json b/tests/reference/ast_new-if1-db43586.json new file mode 100644 index 0000000000..61c6c14427 --- /dev/null +++ b/tests/reference/ast_new-if1-db43586.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-if1-db43586", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/if1.py", + "infile_hash": "22ff1df9592cea862ebc5a2a03f872b87d7ef6cf7101670e8fc566da", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-if1-db43586.stdout", + "stdout_hash": "c21dfca87b12c05bb7230f342ad43cdee10fd7a574dcd2733d8736c8", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-if1-db43586.stdout b/tests/reference/ast_new-if1-db43586.stdout new file mode 100644 index 0000000000..47f33b7a1f --- /dev/null +++ b/tests/reference/ast_new-if1-db43586.stdout @@ -0,0 +1,458 @@ +(Module + [(Assign + [(Name + x + Store + )] + (ConstantInt + 10 + () + ) + () + ) + (Assign + [(Name + y + Store + )] + (ConstantInt + 14 + () + ) + () + ) + (Assign + [(Name + z + Store + )] + (ConstantInt + 12 + () + ) + () + ) + (If + (BoolOp + And + [(Compare + (Name + x + Load + ) + GtE + [(Name + y + Load + )] + ) + (Compare + (Name + x + Load + ) + GtE + [(Name + z + Load + )] + )] + ) + [(Assign + [(Name + largest + Store + )] + (Name + x + Load + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Largest: " + () + ) + (Name + x + Load + )] + [] + ) + )] + [(If + (BoolOp + And + [(Compare + (Name + y + Load + ) + GtE + [(Name + x + Load + )] + ) + (Compare + (Name + y + Load + ) + GtE + [(Name + z + Load + )] + )] + ) + [(Assign + [(Name + largest + Store + )] + (Name + y + Load + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Largest: " + () + ) + (Name + y + Load + )] + [] + ) + )] + [(Assign + [(Name + largest + Store + )] + (Name + z + Load + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Largest: " + () + ) + (Name + z + Load + )] + [] + ) + )] + )] + ) + (If + (Compare + (Name + y + Load + ) + Gt + [(ConstantInt + 10 + () + )] + ) + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Above ten," + () + )] + [] + ) + ) + (If + (Compare + (Name + y + Load + ) + Gt + [(ConstantInt + 20 + () + )] + ) + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "and also above 20!" + () + )] + [] + ) + )] + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "but not above 20." + () + )] + [] + ) + )] + )] + [] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + ) + (AugAssign + (Name + a + Store + ) + Add + (Name + b + Load + ) + )] + [] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + ) + (AugAssign + (Name + a + Store + ) + Add + (Name + b + Load + ) + )] + [] + ) + (If + (Name + b + Load + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [(Assign + [(Name + a + Store + )] + (Name + b + Load + ) + () + )] + ) + (If + (Name + b + Load + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [(Assign + [(Name + a + Store + )] + (Name + b + Load + ) + () + )] + ) + (If + (Name + b + Load + ) + [(Pass)] + [(Assign + [(Name + a + Store + )] + (Name + b + Load + ) + () + )] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Pass)] + [] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Pass)] + [] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Assign + [(Name + x + Store + )] + (BinOp + (Name + a + Load + ) + Add + (Name + b + Load + ) + ) + () + ) + (Break)] + [] + ) + (If + (Compare + (Name + a + Load + ) + Eq + [(Name + b + Load + )] + ) + [(Assign + [(Name + x + Store + )] + (BinOp + (Name + a + Load + ) + Add + (Name + b + Load + ) + ) + () + ) + (Break)] + [] + )] + [] +) diff --git a/tests/reference/ast_new-if2-c3b6022.json b/tests/reference/ast_new-if2-c3b6022.json new file mode 100644 index 0000000000..f9c4d553f4 --- /dev/null +++ b/tests/reference/ast_new-if2-c3b6022.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-if2-c3b6022", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/if2.py", + "infile_hash": "8568c759d82b43b471520eb7eb42d2ccbdfea5ceb59bd27671342206", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-if2-c3b6022.stdout", + "stdout_hash": "cef89f96f75c68381a475911818e03cbcb78bff27d91b5d356fc667b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-if2-c3b6022.stdout b/tests/reference/ast_new-if2-c3b6022.stdout new file mode 100644 index 0000000000..584a5f9094 --- /dev/null +++ b/tests/reference/ast_new-if2-c3b6022.stdout @@ -0,0 +1,364 @@ +(Module + [(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)] + [] + ) + (If + (Compare + (Name + field + Load + ) + In + [(List + [(ConstantStr + "vararg" + () + ) + (ConstantStr + "kwarg" + () + )] + Load + )] + ) + [(If + (Compare + (Name + value + Load + ) + Is + [(ConstantNone + () + )] + ) + [(Pass)] + [] + )] + [] + ) + (If + (Compare + (Name + a + Load + ) + In + [(Name + list1 + Load + )] + ) + [(Pass)] + [] + ) + (If + (BoolOp + Or + [(BoolOp + Or + [(Compare + (Attribute + (Name + x + Load + ) + shape + Load + ) + Eq + [(Tuple + [] + Load + )] + ) + (Compare + (Attribute + (Name + y + Load + ) + shape + Load + ) + Eq + [(Tuple + [] + Load + )] + )] + ) + (Compare + (Subscript + (Attribute + (Name + x + Load + ) + shape + Load + ) + (ConstantInt + 1 + () + ) + Load + ) + NotEq + [(Subscript + (Attribute + (Name + y + Load + ) + shape + Load + ) + (ConstantInt + 0 + () + ) + Load + )] + )] + ) + [(Assert + (Compare + (Subscript + (Name + arr + Load + ) + (Tuple + [] + Load + ) + Load + ) + Is + [(Name + ArrayLike + Load + )] + ) + () + ) + (Pass)] + [] + ) + (AsyncFor + (Tuple + [(Name + i1 + Store + ) + (Name + i2 + Store + )] + Store + ) + (Call + (Name + AsyncIter + Load + ) + [] + [] + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + )] + [] +) diff --git a/tests/reference/ast_new-import1-f643fd3.json b/tests/reference/ast_new-import1-f643fd3.json new file mode 100644 index 0000000000..2d9ee2fae2 --- /dev/null +++ b/tests/reference/ast_new-import1-f643fd3.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-import1-f643fd3", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/import1.py", + "infile_hash": "be84cf9989667702a391da31494811cc4a2a0a2f7a6be764bcedc4bf", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-import1-f643fd3.stdout", + "stdout_hash": "ac5f443b72953c6b307da4cdd6d5c3976c3db1591a9703223614dd72", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-import1-f643fd3.stdout b/tests/reference/ast_new-import1-f643fd3.stdout new file mode 100644 index 0000000000..16c491648c --- /dev/null +++ b/tests/reference/ast_new-import1-f643fd3.stdout @@ -0,0 +1,185 @@ +(Module + [(Import + [(os + ())] + ) + (Import + [(random + r)] + ) + (Import + [(random + r) + (abc + a)] + ) + (Import + [(x.y.z + ())] + ) + (Import + [(x.y.z + xyz)] + ) + (ImportFrom + lpython + [(i8 + ()) + (i16 + ()) + (i32 + ()) + (i64 + ()) + (f32 + ()) + (f64 + ()) + (c32 + ()) + (c64 + ()) + (overload + ()) + (ccall + ()) + (TypeVar + ())] + 0 + ) + (ImportFrom + __future__ + [(division + ())] + 0 + ) + (ImportFrom + math + [(* + ())] + 0 + ) + (ImportFrom + math + [(sin + ()) + (cos + ()) + (tan + ())] + 0 + ) + (ImportFrom + math + [(sin + ()) + (cos + ())] + 0 + ) + (ImportFrom + math + [(factorial + fact)] + 0 + ) + (ImportFrom + x.y + [(z + ())] + 0 + ) + (ImportFrom + () + [(a + ())] + 1 + ) + (ImportFrom + a.b + [(a + ())] + 1 + ) + (ImportFrom + a.b + [(* + ())] + 1 + ) + (ImportFrom + abc + [(a + ())] + 1 + ) + (ImportFrom + abc + [(a + ()) + (b + ()) + (c + ())] + 1 + ) + (ImportFrom + x + [(a + ()) + (b + ()) + (c + ()) + (d + ())] + 0 + ) + (ImportFrom + x + [(a + ()) + (b + ()) + (c + ()) + (d + ())] + 0 + ) + (ImportFrom + x + [(a + ()) + (b + ()) + (c + ()) + (d + ())] + 0 + ) + (ImportFrom + x + [(a + ()) + (b + ())] + 0 + ) + (ImportFrom + x + [(a + ()) + (b + ())] + 0 + ) + (ImportFrom + x + [(a + ())] + 0 + )] + [] +) diff --git a/tests/reference/ast_new-lambda1-260d046.json b/tests/reference/ast_new-lambda1-260d046.json new file mode 100644 index 0000000000..5acaaa551c --- /dev/null +++ b/tests/reference/ast_new-lambda1-260d046.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-lambda1-260d046", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/lambda1.py", + "infile_hash": "0d9e4ba965ad635b7081019955a0f6d3d54b4f04f17239c454364d83", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-lambda1-260d046.stdout", + "stdout_hash": "9efeee85a5a565024e5487cec1f868ce923dba161bfb2e7a0d24431f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-lambda1-260d046.stdout b/tests/reference/ast_new-lambda1-260d046.stdout new file mode 100644 index 0000000000..0757477c6b --- /dev/null +++ b/tests/reference/ast_new-lambda1-260d046.stdout @@ -0,0 +1,1093 @@ +(Module + [(If + (Compare + (Name + x + Load + ) + Is + [(ConstantInt + 0 + () + )] + ) + [(Assign + [(Name + x + Store + )] + (Lambda + ([] + [(a + () + ())] + [] + [] + [] + [] + []) + (ConstantStr + "``{a}```" + () + ) + ) + () + )] + [(Assign + [(Name + y + Store + )] + (Lambda + ([] + [(b + () + ()) + (c + () + ())] + [] + [] + [] + [] + []) + (Call + (Name + x + Load + ) + [(Name + a + Load + )] + [] + ) + ) + () + )] + ) + (Assign + [(Name + x + Store + )] + (Call + (Name + sorted + Load + ) + [(Name + x + Load + )] + [(key + (Lambda + ([] + [(f + () + ())] + [] + [] + [] + [] + []) + (Subscript + (Name + f + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + ))] + ) + () + ) + (Assign + [(Name + add + Store + )] + (Lambda + ([] + [(x + () + ()) + (y + () + ())] + [] + [] + [] + [] + []) + (BinOp + (Call + (Attribute + (Name + np + Load + ) + add + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + Mod + (ConstantInt + 5 + () + ) + ) + ) + () + ) + (Expr + (Call + (Attribute + (Name + var + Load + ) + sort + Load + ) + [] + [(key + (Lambda + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + (Subscript + (Name + x + Load + ) + (ConstantInt + 2 + () + ) + Load + ) + ))] + ) + ) + (FunctionDef + __lt__ + ([] + [(self + () + ()) + (other + () + ())] + [] + [] + [] + [] + []) + [(Return + (Call + (Attribute + (Name + self + Load + ) + _compare + Load + ) + [(Name + other + Load + ) + (Lambda + ([] + [(s + () + ()) + (o + () + ())] + [] + [] + [] + [] + []) + (Compare + (Name + s + Load + ) + Lt + [(Name + o + Load + )] + ) + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + formatargspec + ([] + [(args + () + ()) + (varargs + () + ()) + (varkw + () + ()) + (defaults + () + ()) + (formatarg + () + ()) + (formatvarargs + () + ()) + (formatvarkw + () + ()) + (formatvalue + () + ()) + (join + () + ())] + [] + [] + [] + [] + [(ConstantInt + 0 + () + ) + (ConstantInt + 0 + () + ) + (ConstantInt + 0 + () + ) + (Name + str + Load + ) + (Lambda + ([] + [(name + () + ())] + [] + [] + [] + [] + []) + (BinOp + (ConstantStr + "*" + () + ) + Add + (Name + name + Load + ) + ) + ) + (Lambda + ([] + [(name + () + ())] + [] + [] + [] + [] + []) + (BinOp + (ConstantStr + "**" + () + ) + Add + (Name + name + Load + ) + ) + ) + (Lambda + ([] + [(value + () + ())] + [] + [] + [] + [] + []) + (BinOp + (ConstantStr + "=" + () + ) + Add + (Call + (Name + repr + Load + ) + [(Name + value + Load + )] + [] + ) + ) + ) + (Name + joinseq + Load + )]) + [(Pass)] + [] + () + () + ) + (FunctionDef + __init__ + ([] + [(self + () + ()) + (float_conv + () + ()) + (int_conv + () + ()) + (float_to_float + () + ()) + (float_to_str + () + ()) + (title + () + ())] + [] + [] + [] + [] + [(Name + float + Load + ) + (Name + int + Load + ) + (Name + float + Load + ) + (Lambda + ([] + [(v + () + ())] + [] + [] + [] + [] + []) + (BinOp + (ConstantStr + "%24.16e" + () + ) + Mod + (Name + v + Load + ) + ) + ) + (ConstantStr + "Python floating point numbe" + () + )]) + [(Pass)] + [] + () + () + ) + (FunctionDef + test_deprecated + ([] + [(self + () + ()) + (func + () + ())] + [] + [] + [] + [] + []) + [(Expr + (Call + (Attribute + (Name + self + Load + ) + assert_deprecated + Load + ) + [(Lambda + ([] + [] + [] + [] + [] + [] + []) + (Call + (Name + func + Load + ) + [(List + [(ConstantFloat + 0.000000 + () + ) + (ConstantFloat + 1.000000 + () + )] + Load + ) + (ConstantFloat + 0.000000 + () + )] + [(interpolation + (ConstantStr + "linear" + () + ))] + ) + )] + [] + ) + ) + (Expr + (Call + (Attribute + (Name + self + Load + ) + assert_deprecated + Load + ) + [(Lambda + ([] + [] + [] + [] + [] + [] + []) + (Call + (Name + func + Load + ) + [(List + [(ConstantFloat + 0.000000 + () + ) + (ConstantFloat + 1.000000 + () + )] + Load + ) + (ConstantFloat + 0.000000 + () + )] + [(interpolation + (ConstantStr + "nearest" + () + ))] + ) + )] + [] + ) + )] + [] + () + () + ) + (FunctionDef + indirect + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Return + (Lambda + ([] + [] + [] + [] + [] + [] + []) + (Name + x + Load + ) + ) + )] + [] + () + () + ) + (FunctionDef + _discovered_machar + ([] + [(ftype + () + ())] + [] + [] + [] + [] + []) + [(Assign + [(Name + params + Store + )] + (Subscript + (Name + _MACHAR_PARAMS + Load + ) + (Name + ftype + Load + ) + Load + ) + () + ) + (Return + (Call + (Name + MachAr + Load + ) + [(Lambda + ([] + [(v + () + ())] + [] + [] + [] + [] + []) + (Call + (Name + array + Load + ) + [(List + [(Name + v + Load + )] + Load + ) + (Name + ftype + Load + )] + [] + ) + ) + (Lambda + ([] + [(v + () + ())] + [] + [] + [] + [] + []) + (Subscript + (Call + (Name + _fr0 + Load + ) + [(Call + (Attribute + (Name + v + Load + ) + astype + Load + ) + [(Subscript + (Name + params + Load + ) + (ConstantStr + "itype" + () + ) + Load + )] + [] + )] + [] + ) + (ConstantInt + 0 + () + ) + Load + ) + ) + (Lambda + ([] + [(v + () + ())] + [] + [] + [] + [] + []) + (Call + (Name + array + Load + ) + [(Subscript + (Call + (Name + _fr0 + Load + ) + [(Name + v + Load + )] + [] + ) + (ConstantInt + 0 + () + ) + Load + ) + (Name + ftype + Load + )] + [] + ) + ) + (Lambda + ([] + [(v + () + ())] + [] + [] + [] + [] + []) + (BinOp + (Subscript + (Name + params + Load + ) + (ConstantStr + "fmt" + () + ) + Load + ) + Mod + (Call + (Name + array + Load + ) + [(Subscript + (Call + (Name + _fr0 + Load + ) + [(Name + v + Load + )] + [] + ) + (ConstantInt + 0 + () + ) + Load + ) + (Name + ftype + Load + )] + [] + ) + ) + ) + (Subscript + (Name + params + Load + ) + (ConstantStr + "title" + () + ) + Load + )] + [] + ) + )] + [] + () + () + ) + (Expr + (Call + (Name + assert_raises + Load + ) + [(Name + IndexError + Load + ) + (Lambda + ([] + [] + [] + [] + [] + [] + []) + (Subscript + (Name + a + Load + ) + (Slice + () + (ConstantInt + 4 + () + ) + () + ) + Load + ) + )] + [] + ) + ) + (Expr + (Call + (Name + assert_equal + Load + ) + [(Call + (Attribute + (Name + np + Load + ) + array2string + Load + ) + [(Name + x + Load + )] + [(formatter + (Dict + [(ConstantStr + "int" + () + )] + [(Lambda + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + (Call + (Name + oct + Load + ) + [(Name + x + Load + )] + [] + ) + )] + ))] + ) + (Name + x_oct + Load + )] + [] + ) + ) + (Expr + (Call + (Name + assert_equal + Load + ) + [(Call + (Attribute + (Name + np + Load + ) + array2string + Load + ) + [(Name + a + Load + )] + [(separator + (ConstantStr + ", " + () + )) + (formatter + (Dict + [(ConstantStr + "datetime" + () + )] + [(Lambda + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + (BinOp + (ConstantStr + "'%s'" + () + ) + Mod + (Call + (Attribute + (Name + np + Load + ) + datetime_as_string + Load + ) + [(Name + x + Load + )] + [(timezone + (ConstantStr + "UTC" + () + ))] + ) + ) + )] + ))] + ) + (ConstantStr + "['2011-03-16T13:55Z', '1920-01-01T03:12Z']" + () + )] + [] + ) + ) + (Expr + (Call + (Name + assert_raises_fpe + Load + ) + [(ConstantStr + "underflow" + () + ) + (Lambda + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + (BinOp + (Name + a + Load + ) + Div + (Name + b + Load + ) + ) + ) + (Name + sy16 + Load + ) + (Name + by16 + Load + )] + [] + ) + ) + (Assign + [(Name + MyArr + Store + )] + (Call + (Name + type + Load + ) + [(ConstantStr + "MyArr" + () + ) + (Dict + [(Name + protocol + Load + ) + (ConstantStr + "__float__" + () + )] + [(Call + (Name + getattr + Load + ) + [(Name + blueprint + Load + ) + (Name + protocol + Load + )] + [] + ) + (Lambda + ([] + [(_ + () + ())] + [] + [] + [] + [] + []) + (ConstantFloat + 0.500000 + () + ) + )] + )] + [] + ) + () + )] + [] +) diff --git a/tests/reference/ast_new-lambda2-d84336e.json b/tests/reference/ast_new-lambda2-d84336e.json new file mode 100644 index 0000000000..42cda2aa2a --- /dev/null +++ b/tests/reference/ast_new-lambda2-d84336e.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-lambda2-d84336e", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/lambda2.py", + "infile_hash": "f115bc76bd599a545ebe065ec72d392374a97a52e434c079ec05e606", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-lambda2-d84336e.stdout", + "stdout_hash": "b16a532dd4c0c68c374093e9f11bbc4b3f97736a10aa82634c0cbce9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-lambda2-d84336e.stdout b/tests/reference/ast_new-lambda2-d84336e.stdout new file mode 100644 index 0000000000..096851e48d --- /dev/null +++ b/tests/reference/ast_new-lambda2-d84336e.stdout @@ -0,0 +1,968 @@ +(Module + [(Expr + (Call + (Name + verify_matching_signatures + Load + ) + [(Lambda + ([] + [(x + () + ())] + [] + [] + [] + [] + [(ConstantInt + 0 + () + )]) + (ConstantInt + 0 + () + ) + ) + (Lambda + ([] + [(x + () + ())] + [] + [] + [] + [] + [(ConstantInt + 0 + () + )]) + (ConstantInt + 0 + () + ) + )] + [] + ) + ) + (Assign + [(Name + input_func + Store + )] + (Lambda + ([] + [(prompt + () + ())] + [] + [] + [] + [] + [(ConstantStr + "" + () + )]) + (Call + (Name + next + Load + ) + [(Name + gen + Load + )] + [] + ) + ) + () + ) + (Assign + [(Subscript + (Name + cast + Load + ) + (Name + key + Load + ) + Store + )] + (Lambda + ([] + [(x + () + ()) + (k + () + ())] + [] + [] + [] + [] + [(Name + key + Load + )]) + (Call + (Attribute + (Call + (Name + array + Load + ) + [(Name + x + Load + )] + [(copy + (ConstantBool + .false. + () + ))] + ) + astype + Load + ) + [(Name + k + Load + )] + [] + ) + ) + () + ) + (Assign + [(Name + x + Store + )] + (Lambda + ([] + [(func + () + ()) + (attr + () + ())] + [] + [] + [] + [] + [(Attribute + (Name + self + Load + ) + _try_call + Load + ) + (Name + attr + Load + )]) + (Call + (Name + func + Load + ) + [(Name + attr + Load + )] + [] + ) + ) + () + ) + (Assign + [(Name + fpos32 + Store + )] + (Lambda + ([] + [(x + () + ())] + [] + [] + [] + [(k + () + ())] + []) + (Call + (Attribute + (Name + np + Load + ) + format_float_positional + Load + ) + [(Call + (Attribute + (Name + np + Load + ) + float32 + Load + ) + [(Name + x + Load + )] + [] + )] + [(() + (Name + k + Load + ))] + ) + ) + () + ) + (Assign + [(Name + m + Store + )] + (Lambda + ([] + [(self + () + ())] + [(args + () + ())] + [] + [] + [(kw + () + ())] + []) + (Call + (Name + func + Load + ) + [(Name + self + Load + ) + (Starred + (Name + args + Load + ) + Load + )] + [(() + (Name + kw + Load + ))] + ) + ) + () + ) + (Expr + (Call + (Attribute + (Name + stack + Load + ) + push + Load + ) + [(Lambda + ([] + [] + [(exc + () + ())] + [] + [] + [] + []) + (Subscript + (Dict + [] + [] + ) + (ConstantInt + 1 + () + ) + Load + ) + )] + [] + ) + ) + (Expr + (Lambda + ([] + [] + [(x + () + ())] + [(y + () + ()) + (z + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [] + [(x + () + ())] + [(y + () + ()) + (z + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [] + [(x + () + ())] + [] + [] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [] + [] + [] + [] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ()) + (y + () + ())] + [] + [] + [] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [(y + () + ())] + [] + [] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [(y + () + ())] + [] + [] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [] + [] + [] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(x + () + ())] + [(y + () + ())] + [(z + () + ())] + [(ConstantNone + () + )] + [(args + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [] + [] + [] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [(b + () + ())] + [] + [] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [(b + () + ())] + [(c + () + ()) + (d + () + ())] + [(ConstantNone + () + ) + (ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [(b + () + ())] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [] + [] + [] + [(b + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [(b + () + ())] + [] + [] + [(c + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [] + [] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [] + [] + [] + [(d + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [] + [] + [(e + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ()) + (c + () + ())] + [(d + () + ())] + [(e + () + ())] + [(ConstantNone + () + )] + [(f + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [] + [] + [(a + () + ())] + [(ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [] + [] + [(a + () + ())] + [(ConstantNone + () + )] + [(b + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(a + () + ())] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([] + [(a + () + ())] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [(c + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [] + [(b + () + ())] + [(ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ())] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + (Name + test + Load + ) + ) + ) + (Expr + (Lambda + ([(a + () + ())] + [(b + () + ())] + [] + [(c + () + ())] + [(ConstantNone + () + )] + [(d + () + ())] + []) + (Name + test + Load + ) + ) + )] + [] +) diff --git a/tests/reference/ast_new-match_stmt1-9e84d24.json b/tests/reference/ast_new-match_stmt1-9e84d24.json new file mode 100644 index 0000000000..6e096f25ea --- /dev/null +++ b/tests/reference/ast_new-match_stmt1-9e84d24.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-match_stmt1-9e84d24", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/match_stmt1.py", + "infile_hash": "59820be702cda5062ce26ffbf5abe667a01d0e37f8a0658aa458d65f", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-match_stmt1-9e84d24.stdout", + "stdout_hash": "8e43bb4b05ebab0df9520dac9908702af0d2e7f63ddb42bf93baf0a0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-match_stmt1-9e84d24.stdout b/tests/reference/ast_new-match_stmt1-9e84d24.stdout new file mode 100644 index 0000000000..f368aa9399 --- /dev/null +++ b/tests/reference/ast_new-match_stmt1-9e84d24.stdout @@ -0,0 +1,2245 @@ +(Module + [(Match + (ConstantInt + 0 + () + ) + [((MatchValue + (ConstantInt + 0 + () + ) + ) + (ConstantBool + .false. + () + ) + [(Assign + [(Name + x + Store + )] + (ConstantBool + .false. + () + ) + () + )]) + ((MatchValue + (ConstantInt + 0 + () + ) + ) + (ConstantBool + .true. + () + ) + [(Assign + [(Name + x + Store + )] + (ConstantBool + .true. + () + ) + () + )]) + ((MatchAs + () + x + ) + (Name + x + Load + ) + [(Assign + [(Name + z + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchAs + (MatchAs + () + _ + ) + y + ) + (BoolOp + And + [(Compare + (Name + y + Load + ) + Eq + [(Name + x + Load + )] + ) + (Name + y + Load + )] + ) + [(Assign + [(Name + z + Store + )] + (ConstantInt + 1 + () + ) + () + )])] + ) + (Match + (Name + match + Load + ) + [((MatchAs + () + case + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Call + (Name + match + Load + ) + [] + [] + ) + [((MatchClass + (Name + case + Load + ) + [] + [] + [] + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Name + case + Load + ) + [((MatchAs + () + match + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Name + x + Load + ) + [((MatchAs + (MatchValue + (Attribute + (Name + A + Load + ) + y + Load + ) + ) + z + ) + () + [(Pass)]) + ((MatchAs + (MatchValue + (ConstantInt + 0 + () + ) + ) + z + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchAs + (MatchSequence + [(MatchAs + () + p + ) + (MatchAs + () + q + )] + ) + x + ) + () + [(Assign + [(Name + out + Store + )] + (Call + (Name + locals + Load + ) + [] + [] + ) + () + )]) + ((MatchValue + (Attribute + (Name + A + Load + ) + B + Load + ) + ) + () + [(Assign + [(Name + z + Store + )] + (ConstantInt + 2 + () + ) + () + )]) + ((MatchValue + (Attribute + (Attribute + (Attribute + (Name + A + Load + ) + B + Load + ) + C + Load + ) + D + Load + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (ConstantInt + 0 + () + ) + [((MatchOr + [(MatchAs + (MatchValue + (ConstantInt + 0 + () + ) + ) + z + ) + (MatchAs + (MatchValue + (ConstantInt + 1 + () + ) + ) + z + ) + (MatchAs + (MatchValue + (ConstantInt + 2 + () + ) + ) + z + )] + ) + (Compare + (Name + z + Load + ) + Eq + [(BinOp + (Name + x + Load + ) + Mod + (ConstantInt + 2 + () + ) + )] + ) + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchSequence + [(MatchAs + (MatchAs + (MatchSequence + [(MatchAs + (MatchAs + () + a + ) + b + ) + (MatchAs + (MatchAs + () + c + ) + d + )] + ) + e + ) + w + ) + (MatchAs + (MatchAs + (MatchSequence + [(MatchAs + (MatchAs + () + f + ) + g + ) + (MatchAs + () + h + )] + ) + i + ) + z + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchOr + [(MatchValue + (ConstantInt + 0 + () + ) + ) + (MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchValue + (ConstantInt + 3 + () + ) + )] + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantBool + .true. + () + ) + () + )]) + ((MatchOr + [(MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchOr + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + ) + (MatchSingleton + (ConstantBool + .false. + () + ) + )] + )] + () + ) + (MatchMapping + [(ConstantInt + 1 + () + )] + [(MatchSequence + [(MatchSequence + [] + )] + )] + () + ) + (MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + )] + () + ) + (MatchSequence + [] + ) + (MatchValue + (ConstantStr + "X" + () + ) + ) + (MatchMapping + [] + [] + () + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )]) + ((MatchOr + [(MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchOr + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + ) + (MatchSingleton + (ConstantBool + .false. + () + ) + )] + )] + () + ) + (MatchMapping + [(ConstantInt + 1 + () + )] + [(MatchSequence + [(MatchSequence + [] + )] + )] + () + ) + (MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + )] + () + ) + (MatchSequence + [] + ) + (MatchValue + (ConstantStr + "X" + () + ) + ) + (MatchMapping + [] + [] + () + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )]) + ((MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + )] + () + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchMapping + [(ConstantInt + 0 + () + ) + (ConstantInt + 1 + () + )] + [(MatchSequence + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + ) + (MatchMapping + [] + [] + () + )] + ) + (MatchSequence + [(MatchSequence + [] + )] + )] + () + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )]) + ((MatchMapping + [] + [] + z + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )]) + ((MatchMapping + [(ConstantInt + 1 + () + )] + [(MatchValue + (ConstantInt + 2 + () + ) + )] + z + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )])] + ) + (Match + (Tuple + [(ConstantInt + 0 + () + ) + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + [((MatchSequence + [(MatchValue + (ConstantInt + 0 + () + ) + ) + (MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchStar + x + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchSequence + [(MatchStar + _ + ) + (MatchAs + () + _ + )] + ) + () + [(Assign + [(Name + z + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchMapping + [(ConstantInt + 0 + () + )] + [(MatchAs + (MatchOr + [(MatchValue + (ConstantInt + 0 + () + ) + ) + (MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + )] + ) + z + )] + () + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Name + x + Load + ) + [((MatchSequence + [] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 2 + () + ) + () + )]) + ((MatchSequence + [] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchValue + (UnaryOp + USub + (ConstantFloat + 1.500000 + () + ) + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchValue + (UnaryOp + USub + (ConstantComplex + 0.000000 + 0.000000 + () + ) + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchValue + (BinOp + (UnaryOp + USub + (ConstantInt + 0 + () + ) + ) + Add + (ConstantComplex + 0.000000 + 0.000000 + () + ) + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchValue + (ConstantBytes + "b'x'" + () + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 4 + () + ) + () + )])] + ) + (Match + (Tuple + [(Name + x + Load + )] + Load + ) + [((MatchSequence + [(MatchAs + () + y + )] + ) + () + [(Assign + [(Name + z + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchSequence + [(MatchStar + x + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Tuple + [(Name + w + Load + ) + (Name + x + Load + )] + Load + ) + [((MatchSequence + [(MatchAs + () + y + ) + (MatchAs + () + z + )] + ) + () + [(Assign + [(Name + v + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Tuple + [(ConstantInt + 0 + () + ) + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + [((MatchSequence + [(MatchValue + (ConstantInt + 0 + () + ) + ) + (MatchStar + x + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchSequence + [(MatchValue + (ConstantInt + 0 + () + ) + ) + (MatchStar + x + ) + (MatchValue + (ConstantInt + 1 + () + ) + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )]) + ((MatchSequence + [(MatchStar + x + ) + (MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchValue + (ConstantInt + 2 + () + ) + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 2 + () + ) + () + )]) + ((MatchSequence + [(MatchStar + x + )] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 2 + () + ) + () + )])] + ) + (Match + (Tuple + [(NamedExpr + (Name + w + Store + ) + (Name + x + Load + ) + )] + Load + ) + [((MatchSequence + [(MatchAs + (MatchAs + () + y + ) + v + )] + ) + () + [(Assign + [(Name + z + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchClass + (Name + bool + Load + ) + [(MatchAs + () + z + )] + [] + [] + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchClass + (Name + Point + Load + ) + [(MatchValue + (ConstantInt + 1 + () + ) + )] + [y] + [(MatchAs + () + var + )] + ) + () + [(Assign + [(Name + x + Store + )] + (Name + var + Load + ) + () + )]) + ((MatchClass + (Name + Point + Load + ) + [] + [x + y] + [(MatchValue + (ConstantInt + 1 + () + ) + ) + (MatchAs + () + var + )] + ) + () + [(Assign + [(Name + x + Store + )] + (Name + var + Load + ) + () + )]) + ((MatchSequence + [(MatchClass + (Name + Point + Load + ) + [(MatchAs + () + x + ) + (MatchAs + () + y + )] + [] + [] + )] + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantStr + "string" + () + ) + () + )]) + ((MatchClass + (Name + Point + Load + ) + [(MatchClass + (Name + int + Load + ) + [(MatchAs + () + xx + )] + [] + [] + )] + [y] + [(MatchValue + (ConstantStr + "hello" + () + ) + )] + ) + () + [(Assign + [(Name + out + Store + )] + (Call + (Name + locals + Load + ) + [] + [] + ) + () + )])] + ) + (Match + (Tuple + [(ConstantEllipsis + () + ) + (ConstantEllipsis + () + )] + Load + ) + [((MatchSequence + [(MatchAs + () + a + ) + (MatchAs + () + b + )] + ) + () + [(Assign + [(Name + out + Store + )] + (Call + (Name + locals + Load + ) + [] + [] + ) + () + )])] + ) + (Match + (Dict + [(ConstantStr + "k" + () + ) + (ConstantStr + "l" + () + )] + [(ConstantEllipsis + () + ) + (ConstantEllipsis + () + )] + ) + [((MatchMapping + [(ConstantStr + "k" + () + ) + (ConstantStr + "l" + () + )] + [(MatchAs + () + a + ) + (MatchAs + () + b + )] + () + ) + () + [(Assign + [(Name + out + Store + )] + (Call + (Name + locals + Load + ) + [] + [] + ) + () + )])] + ) + (Match + (Name + x + Load + ) + [((MatchSingleton + (ConstantBool + .false. + () + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 0 + () + ) + () + )]) + ((MatchSingleton + (ConstantBool + .true. + () + ) + ) + () + [(Assign + [(Name + y + Store + )] + (ConstantInt + 1 + () + ) + () + )])] + ) + (FunctionDef + t + ([] + [] + [] + [] + [] + [] + []) + [(Match + (Name + status + Load + ) + [((MatchValue + (ConstantInt + 400 + () + ) + ) + () + [(Return + (ConstantStr + "Bad request" + () + ) + )]) + ((MatchOr + [(MatchValue + (ConstantInt + 401 + () + ) + ) + (MatchValue + (ConstantInt + 403 + () + ) + ) + (MatchValue + (ConstantInt + 404 + () + ) + )] + ) + () + [(Return + (ConstantStr + "Not allowed" + () + ) + )]) + ((MatchValue + (ConstantInt + 418 + () + ) + ) + () + [(Return + (ConstantStr + "I'm a teapot" + () + ) + )])] + )] + [] + () + () + ) + (FunctionDef + _get_slots + ([] + [(cls + () + ())] + [] + [] + [] + [] + []) + [(Match + (Name + x + Load + ) + [((MatchSingleton + (ConstantNone + () + ) + ) + () + [(Return + () + )]) + ((MatchClass + (Name + str + Load + ) + [(MatchAs + () + slot + )] + [] + [] + ) + () + [(Expr + (Yield + (Name + slot + Load + ) + ) + )]) + ((MatchAs + () + iterable + ) + (UnaryOp + Not + (Call + (Name + hasattr + Load + ) + [(Name + iterable + Load + ) + (ConstantStr + "__next__" + () + )] + [] + ) + ) + [(Expr + (YieldFrom + (Name + iterable + Load + ) + ) + )]) + ((MatchAs + () + _ + ) + () + [(Raise + (Call + (Name + TypeError + Load + ) + [(JoinedStr + [(ConstantStr + "Slots of '" + () + ) + (FormattedValue + (Name + cls.__name__ + Load + ) + -1 + () + ) + (ConstantStr + "' cannot be determined" + () + )] + )] + [] + ) + () + )])] + )] + [] + () + () + ) + (FunctionDef + check_mapping_then_sequence + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Match + (Name + x + Load + ) + [((MatchSequence + [(MatchStar + _ + )] + ) + () + [(Return + (ConstantStr + "seq" + () + ) + )]) + ((MatchMapping + [] + [] + () + ) + () + [(Return + (ConstantStr + "map" + () + ) + )])] + )] + [(Name + staticmethod + Load + )] + () + () + ) + (FunctionDef + file_handler_v1 + ([] + [(command + () + ())] + [] + [] + [] + [] + []) + [(Match + (Call + (Attribute + (Name + command + Load + ) + split + Load + ) + [] + [] + ) + [((MatchSequence + [(MatchValue + (ConstantStr + "show" + () + ) + )] + ) + () + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "List all files and directories: " + () + )] + [] + ) + )]) + ((MatchSequence + [(MatchValue + (ConstantStr + "remove" + () + ) + ) + (MatchStar + files + )] + ) + () + [(Expr + (Call + (Name + print + Load + ) + [(Call + (Attribute + (ConstantStr + "Removing files: {}" + () + ) + format + Load + ) + [(Name + files + Load + )] + [] + )] + [] + ) + )]) + ((MatchAs + () + _ + ) + () + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Command not recognized" + () + )] + [] + ) + )])] + )] + [] + () + () + ) + (Match + (Tuple + [] + Load + ) + [((MatchSequence + [] + ) + () + [(Assign + [(Name + x + Store + )] + (ConstantInt + 0 + () + ) + () + )])] + ) + (Match + (Tuple + [] + Load + ) + [((MatchSequence + [] + ) + () + [(Pass)])] + ) + (FunctionDef + case + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (FunctionDef + match + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (For + (Name + match + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(Pass)] + [] + () + ) + (For + (Name + case + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 10 + () + )] + [] + ) + [(Pass)] + [] + () + ) + (ClassDef + match + [] + [] + [(Pass)] + [] + ) + (ClassDef + case + [] + [] + [(Pass)] + [] + ) + (AnnAssign + (Name + match + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (AnnAssign + (Name + case + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (Assign + [(Name + match + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (Assign + [(Name + case + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (Assign + [(Name + match + Store + )] + (Dict + [(ConstantInt + 2 + () + )] + [(ConstantInt + 3 + () + )] + ) + () + ) + (Assign + [(Name + match + Store + )] + (Subscript + (Name + A + Load + ) + (Tuple + [(ConstantInt + 1 + () + ) + (Slice + () + () + () + )] + Load + ) + Load + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Subscript + (Name + match + Load + ) + (Slice + (ConstantInt + 2 + () + ) + (ConstantInt + 8 + () + ) + () + ) + Load + )] + [] + ) + ) + (Assign + [(Name + match + Store + )] + (ConstantInt + 5 + () + ) + () + ) + (Assign + [(Name + a + Store + )] + (Dict + [(Name + match + Load + )] + [(ConstantInt + 3 + () + )] + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + a + Load + )] + [] + ) + ) + (Assign + [(Name + case + Store + )] + (Dict + [(ConstantStr + "ok" + () + )] + [(ConstantInt + 5 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Dict + [(Subscript + (Name + case + Load + ) + (ConstantStr + "ok" + () + ) + Load + )] + [(ConstantInt + 6 + () + )] + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + a + Load + )] + [] + ) + ) + (Assign + [(Name + match + Store + )] + (Dict + [(ConstantInt + 2 + () + )] + [(ConstantInt + 3 + () + )] + ) + () + ) + (Expr + (Subscript + (Name + match + Load + ) + (Slice + (ConstantInt + 2 + () + ) + (ConstantInt + 8 + () + ) + () + ) + Load + ) + )] + [] +) diff --git a/tests/reference/ast_new-slice1-9c440e3.json b/tests/reference/ast_new-slice1-9c440e3.json new file mode 100644 index 0000000000..5efa42035d --- /dev/null +++ b/tests/reference/ast_new-slice1-9c440e3.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-slice1-9c440e3", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/slice1.py", + "infile_hash": "b682e6a952b39d1b9310299340035aed5d4c6916814c1293d0aa9977", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-slice1-9c440e3.stdout", + "stdout_hash": "f2c5ce2eeecd08f73104a45cfb87a2bcabc55ca3a65e3c751c207beb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-slice1-9c440e3.stdout b/tests/reference/ast_new-slice1-9c440e3.stdout new file mode 100644 index 0000000000..2a2e4db3a5 --- /dev/null +++ b/tests/reference/ast_new-slice1-9c440e3.stdout @@ -0,0 +1,291 @@ +(Module + [(Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + (ConstantInt + 2 + () + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + () + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + () + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + () + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + (ConstantInt + 2 + () + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + ) + ) + (Expr + (Subscript + (ConstantStr + "LPython" + () + ) + (Slice + () + () + () + ) + Load + ) + ) + (Assign + [(Name + List + Store + )] + (List + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (ConstantStr + "c" + () + ) + (ConstantStr + "d" + () + )] + Load + ) + () + ) + (Assign + [(Name + List + Store + )] + (List + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + ) + (ConstantStr + "c" + () + ) + (ConstantStr + "d" + () + )] + Load + ) + () + ) + (Expr + (Subscript + (Name + List + Load + ) + (Slice + () + () + (UnaryOp + USub + (ConstantInt + 2 + () + ) + ) + ) + Load + ) + )] + [] +) diff --git a/tests/reference/ast_new-statements1-e081093.json b/tests/reference/ast_new-statements1-e081093.json new file mode 100644 index 0000000000..5676cb70c4 --- /dev/null +++ b/tests/reference/ast_new-statements1-e081093.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-statements1-e081093", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/statements1.py", + "infile_hash": "98dd16a7e41cfca5cce2fd716fa5888ad5b970cd368e6171f1e66306", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-statements1-e081093.stdout", + "stdout_hash": "9425fb51c6f0e2ed284e0ba59bb2efee1a86541d77150d20c02fd5fc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-statements1-e081093.stdout b/tests/reference/ast_new-statements1-e081093.stdout new file mode 100644 index 0000000000..421e1c8067 --- /dev/null +++ b/tests/reference/ast_new-statements1-e081093.stdout @@ -0,0 +1,1695 @@ +(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 + ) + () + ) + (Assign + [(Name + obj + Store + )] + (Tuple + [(Name + obj + Load + )] + Load + ) + () + ) + (AugAssign + (Name + x + Store + ) + Add + (ConstantInt + 1 + () + ) + ) + (AugAssign + (Name + x + Store + ) + Add + (Tuple + [(Name + y + Load + ) + (Name + z + Load + )] + Load + ) + ) + (AugAssign + (Name + x + Store + ) + Add + (Tuple + [(Tuple + [(Name + y + Load + ) + (Name + z + Load + )] + Load + )] + Load + ) + ) + (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 + (ConstantInt + 32768 + () + ) + ) + (Expr + (ConstantInt + 12 + () + ) + ) + (Expr + (ConstantInt + 23440334322333 + () + ) + ) + (Expr + (ConstantFloat + 123.000000 + () + ) + ) + (Expr + (ConstantFloat + 123.450000 + () + ) + ) + (Expr + (ConstantFloat + 123400000000.000000 + () + ) + ) + (Expr + (BinOp + (ConstantInt + 12 + () + ) + Add + (ConstantComplex + 0.000000 + 3.000000 + () + ) + ) + ) + (Expr + (BinOp + (ConstantFloat + 0.120000 + () + ) + Add + (ConstantComplex + 0.000000 + 0.001000 + () + ) + ) + ) + (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 + )] + ) + ) + (Expr + (Compare + (ConstantStr + "hello" + () + ) + In + [(Name + x + Load + )] + ) + ) + (Expr + (Compare + (ConstantStr + "a" + () + ) + In + [(Call + (Attribute + (Name + a + Load + ) + func + Load + ) + [] + [] + )] + ) + ) + (Expr + (Compare + (ConstantStr + "lo" + () + ) + In + [(ConstantStr + "hello" + () + )] + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (ConstantInt + 1 + () + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (Tuple + [(ConstantInt + 1 + () + )] + Load + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (Slice + () + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + () + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + a + Load + ) + b + Load + ) + (Slice + () + () + () + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + y + Load + ) + z + Load + ) + (Slice + (ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + y + Load + ) + z + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + (ConstantInt + 3 + () + ) + ) + Load + ) + ) + (Expr + (Subscript + (Attribute + (Name + y + Load + ) + z + Load + ) + (Slice + (ConstantInt + 1 + () + ) + () + () + ) + 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 + () + )] + ) + () + ) + (Assign + [(Name + a + Store + )] + (Set + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + ) + () + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + (Compare + (Name + x + Load + ) + Eq + [(Name + y + Load + )] + ) + 1 + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + output + Store + )] + (Compare + (Name + x + Load + ) + Eq + [(Name + y + Load + )] + ) + () + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + (Compare + (Name + x + Load + ) + Gt + [(Name + y + Load + )] + ) + 1 + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + output + Store + )] + (Compare + (Name + x + Load + ) + Gt + [(Name + y + Load + )] + ) + () + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + (Compare + (List + [(Name + x + Load + )] + Load + ) + NotIn + [(List + [(Name + y + Load + )] + Load + )] + ) + 1 + ) + (AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + output + Store + )] + (Compare + (List + [(Name + x + Load + )] + Load + ) + NotIn + [(List + [(Name + y + Load + )] + Load + )] + ) + () + ) + (FunctionDef + comparison_return + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + [(Return + (Compare + (Name + a + Load + ) + Gt + [(Name + b + Load + )] + ) + )] + [] + () + () + ) + (FunctionDef + comparison_return + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + [(Return + (Compare + (List + [(Name + a + Load + )] + Load + ) + In + [(List + [(Name + b + Load + )] + Load + )] + ) + )] + [] + () + () + ) + (FunctionDef + comparison_return + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + output + Store + ) + (Name + bool + Load + ) + () + 1 + ) + (Assign + [(Name + output + Store + )] + (Compare + (List + [(Name + a + Load + )] + Load + ) + NotIn + [(List + [(Name + b + Load + )] + Load + )] + ) + () + ) + (Return + (Name + output + Load + ) + )] + [] + () + () + ) + (FunctionDef + comparison_return + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + [(Assign + [(Name + output + Store + )] + (Compare + (List + [(Name + a + Load + )] + Load + ) + NotIn + [(List + [(Name + b + Load + )] + Load + )] + ) + () + ) + (Return + (Name + output + Load + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-statements2-c4cdc5f.json b/tests/reference/ast_new-statements2-c4cdc5f.json new file mode 100644 index 0000000000..efb47d87e7 --- /dev/null +++ b/tests/reference/ast_new-statements2-c4cdc5f.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-statements2-c4cdc5f", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/statements2.py", + "infile_hash": "8c96f6788e951a113e775f497394a372018d04b4f7f910d304471017", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-statements2-c4cdc5f.stdout", + "stdout_hash": "d79c678d3b5de63e5d424a2015595bfc3a686fc5c7ba0802aed6f3af", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-statements2-c4cdc5f.stdout b/tests/reference/ast_new-statements2-c4cdc5f.stdout new file mode 100644 index 0000000000..c18d65316e --- /dev/null +++ b/tests/reference/ast_new-statements2-c4cdc5f.stdout @@ -0,0 +1,507 @@ +(Module + [(Expr + (Call + (Call + (Call + (Name + getattr + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + [(Name + a + Load + ) + (Name + b + Load + )] + [] + ) + [(ConstantInt + 5 + () + )] + [(a + (Name + a + Load + )) + (b + (ConstantInt + 0 + () + ))] + ) + ) + (Expr + (Call + (Call + (Name + func + Load + ) + [(Name + a + Load + ) + (Name + _op + Load + )] + [] + ) + [(Name + s + Load + )] + [] + ) + ) + (Expr + (Call + (Call + (Name + test + Load + ) + [] + [] + ) + [] + [] + ) + ) + (Assign + [(Name + a + Store + )] + (Subscript + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + (ConstantInt + 0 + () + ) + Load + ) + () + ) + (Assign + [(Tuple + [(Name + a + Store + ) + (Name + b + Store + )] + Store + )] + (Subscript + (BinOp + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + Add + (List + [(ConstantInt + 0 + () + ) + (ConstantInt + 0 + () + )] + Load + ) + ) + (Slice + () + (ConstantInt + 2 + () + ) + () + ) + Load + ) + () + ) + (Assign + [(Tuple + [(Name + a + Store + ) + (Name + b + Store + )] + Store + )] + (Subscript + (BinOp + (Call + (Attribute + (Name + c + Load + ) + d + Load + ) + [] + [] + ) + Add + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 0 + () + )] + Load + ) + ) + (Slice + () + () + () + ) + Load + ) + () + ) + (Expr + (Subscript + (Dict + [(ConstantStr + "a" + () + ) + (ConstantStr + "b" + () + )] + [(Name + a + Load + ) + (Name + b + Load + )] + ) + (Name + val + Load + ) + Load + ) + ) + (If + (Compare + (Subscript + (Subscript + (Name + args + Load + ) + (Name + i + Load + ) + Load + ) + (Slice + () + (ConstantInt + 1 + () + ) + () + ) + Load + ) + In + [(List + [(ConstantStr + "" + () + ) + (ConstantStr + "." + () + )] + Load + )] + ) + [(Pass)] + [] + ) + (Assign + [(Name + x + Store + )] + (List + [(Subscript + (ListComp + (BinOp + (UnaryOp + USub + (Name + c + Load + ) + ) + Mod + (Name + self + Load + ) + ) + [((Name + c + Store + ) + (Call + (Name + reversed + Load + ) + [(Attribute + (Attribute + (Name + T + Load + ) + rep + Load + ) + rep + Load + )] + [] + ) + [] + 0)] + ) + (Slice + () + (UnaryOp + USub + (ConstantInt + 1 + () + ) + ) + () + ) + Load + )] + Load + ) + () + ) + (Expr + (Subscript + (ListComp + (Name + x + Load + ) + [((Name + x + Store + ) + (Name + G + Load + ) + [(Call + (Attribute + (Attribute + (Name + self + Load + ) + ring + Load + ) + is_unit + Load + ) + [(Subscript + (Name + x + Load + ) + (ConstantInt + 0 + () + ) + Load + )] + [] + )] + 0)] + ) + (ConstantInt + 0 + () + ) + Load + ) + ) + (If + (Compare + (Name + x + Load + ) + NotIn + [(Name + z + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (If + (Compare + (Name + x + Load + ) + NotIn + [(Name + z + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (If + (Compare + (Name + x + Load + ) + NotIn + [(Name + z + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (If + (Compare + (Name + x + Load + ) + NotIn + [(Name + z + Load + )] + ) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + ) + (FunctionDef + imatmul + ([] + [(a + () + ()) + (b + () + ())] + [] + [] + [] + [] + []) + [(Expr + (ConstantStr + "Same as a @= b." + () + ) + ) + (AugAssign + (Name + a + Store + ) + MatMult + (Name + b + Load + ) + ) + (Return + (Name + a + Load + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-string1-96b90b3.json b/tests/reference/ast_new-string1-96b90b3.json new file mode 100644 index 0000000000..49a78caf38 --- /dev/null +++ b/tests/reference/ast_new-string1-96b90b3.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-string1-96b90b3", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/string1.py", + "infile_hash": "278e24162e6d88441f13d84bab068f1862b4fa490bf95e145fb71318", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-string1-96b90b3.stdout", + "stdout_hash": "51806e5893017a386c0ce7a4f3260c7605cabd5ea4e6a16aa300d8c2", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-string1-96b90b3.stdout b/tests/reference/ast_new-string1-96b90b3.stdout new file mode 100644 index 0000000000..cc011f29f2 --- /dev/null +++ b/tests/reference/ast_new-string1-96b90b3.stdout @@ -0,0 +1,520 @@ +(Module + [(Expr + (JoinedStr + [(ConstantStr + "Hello, " + () + ) + (FormattedValue + (Name + first_name + Load + ) + -1 + () + ) + (ConstantStr + " " + () + ) + (FormattedValue + (Name + last_name + Load + ) + -1 + () + ) + (ConstantStr + ". You are " + () + ) + (FormattedValue + (Name + age + Load + ) + -1 + () + ) + (ConstantStr + " years old." + () + )] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(JoinedStr + [(FormattedValue + (Name + __file__ + Load + ) + -1 + () + ) + (ConstantStr + " executed in " + () + ) + (FormattedValue + (Name + elapsed + Load + ) + -1 + () + ) + (ConstantStr + " seconds." + () + )] + )] + [] + ) + ) + (Expr + (ConstantStr + "\nsometext\nanotherline\n" + () + ) + ) + (Expr + (ConstantBytes + "b'Some text goes here.'" + () + ) + ) + (Expr + (ConstantBytes + "b'\nMultiple texts goes here.\n'" + () + ) + ) + (Expr + (ConstantStr + "\nText\n" + () + ) + ) + (Expr + (ConstantStr + "Text" + () + ) + ) + (Expr + (ConstantStr + "a\\tb\\nA\\tB" + () + ) + ) + (Expr + (ConstantStr + "1,2,3 # comment" + "u" + ) + ) + (Expr + (ConstantStr + "Text" + "u" + ) + ) + (Expr + (ConstantStr + "Text" + () + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "\nText " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + ) + (ConstantStr + "\n" + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + id + Load + ) + -1 + () + )] + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (ConstantBytes + "b'\nText\n'" + () + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (ConstantBytes + "b'\nText\n'" + () + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (ConstantBytes + "b'Text'" + () + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "\\N" + () + ) + (FormattedValue + (Name + AMPERSAND + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text" + () + ) + (FormattedValue + (Name + a + Load + ) + -1 + () + ) + (ConstantStr + ", " + () + ) + (FormattedValue + (Name + b + Load + ) + -1 + () + ) + (ConstantStr + "Text " + () + ) + (FormattedValue + (Name + a + Load + ) + -1 + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text" + () + ) + (FormattedValue + (Name + a + Load + ) + -1 + () + ) + (ConstantStr + ", " + () + ) + (FormattedValue + (Name + b + Load + ) + -1 + () + ) + (ConstantStr + "Text" + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text" + () + ) + (FormattedValue + (Name + b + Load + ) + -1 + () + ) + (ConstantStr + ", Text" + () + )] + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text " + () + ) + (FormattedValue + (Name + a + Load + ) + -1 + () + ) + (ConstantStr + "Text" + () + )] + ) + ) + (Expr + (ConstantStr + "TextText" + () + ) + ) + (Expr + (ConstantStr + "TextText" + () + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "Text" + () + ) + (FormattedValue + (Name + a + Load + ) + -1 + () + ) + (ConstantStr + " Text" + () + )] + ) + ) + (Expr + (ConstantBytes + "b'TextText'" + () + ) + ) + (Expr + (ConstantStr + "\\n" + () + ) + ) + (Expr + (ConstantStr + "\nText\n123\\n\\t\n" + () + ) + ) + (Expr + (ConstantBytes + "b'\\n'" + () + ) + ) + (Expr + (JoinedStr + [(ConstantStr + "\\n" + () + )] + ) + ) + (Expr + (ConstantBytes + "b'\n'" + () + ) + ) + (Expr + (ConstantBytes + "b'\n\n\\n'" + () + ) + )] + [] +) diff --git a/tests/reference/ast_new-string2-44323ea.json b/tests/reference/ast_new-string2-44323ea.json new file mode 100644 index 0000000000..3bcc6c58df --- /dev/null +++ b/tests/reference/ast_new-string2-44323ea.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-string2-44323ea", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/string2.py", + "infile_hash": "58397718a6e0dc5cc453081e82ad1b2ca378639dfb516c3f28d34323", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-string2-44323ea.stdout", + "stdout_hash": "52d1edc0e332527fc6e077ed895f9d01a6eb79b3fb43405319864a1c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-string2-44323ea.stdout b/tests/reference/ast_new-string2-44323ea.stdout new file mode 100644 index 0000000000..d72c5709ff --- /dev/null +++ b/tests/reference/ast_new-string2-44323ea.stdout @@ -0,0 +1,118 @@ +(Module + [(Expr + (ConstantStr + "\"\\" + () + ) + ) + (Expr + (ConstantStr + "\n\\" + () + ) + ) + (Expr + (ConstantStr + "\\" + () + ) + ) + (Expr + (ConstantStr + " \\" + () + ) + ) + (Expr + (ConstantStr + "\\ " + () + ) + ) + (Expr + (ConstantStr + "" + () + ) + ) + (Expr + (ConstantStr + "\\|" + () + ) + ) + (Expr + (ConstantStr + "I said 'Wow' " + () + ) + ) + (Expr + (ConstantStr + "I said \"hi\" " + () + ) + ) + (Expr + (ConstantStr + "I said \\\"hi\" " + () + ) + ) + (Expr + (ConstantStr + "I said '\\'hi\\hey' " + () + ) + ) + (Expr + (ConstantStr + "ab" + () + ) + ) + (Expr + (ConstantStr + "ab" + () + ) + ) + (Expr + (ConstantStr + "Text\\\\" + () + ) + ) + (Expr + (ConstantStr + "" + () + ) + ) + (Expr + (Call + (Name + x + Load + ) + [(ConstantStr + "class a:\n def test():\n return r\"\\LaTeX\"\n" + () + )] + [] + ) + ) + (Expr + (ConstantStr + "\n \"\\\\\"\n" + () + ) + ) + (Expr + (ConstantStr + "\n '\\'\n" + () + ) + )] + [] +) diff --git a/tests/reference/ast_new-string3-37f35a0.json b/tests/reference/ast_new-string3-37f35a0.json new file mode 100644 index 0000000000..bd16a6a8a7 --- /dev/null +++ b/tests/reference/ast_new-string3-37f35a0.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-string3-37f35a0", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/string3.py", + "infile_hash": "61a3cd7139d6c429a037d74fe12b8f8305cabe9b91218082851dd7ca", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-string3-37f35a0.stdout", + "stdout_hash": "9d8ca937b551799ff4908f347ff6685917d0bfc41977c5316af4e108", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-string3-37f35a0.stdout b/tests/reference/ast_new-string3-37f35a0.stdout new file mode 100644 index 0000000000..6d104153f6 --- /dev/null +++ b/tests/reference/ast_new-string3-37f35a0.stdout @@ -0,0 +1,129 @@ +(Module + [(Expr + (ConstantStr + "\n" + () + ) + ) + (Expr + (ConstantStr + "\r" + () + ) + ) + (Expr + (ConstantStr + "\t" + () + ) + ) + (Expr + (ConstantStr + "'" + () + ) + ) + (Expr + (ConstantStr + "\"" + () + ) + ) + (Expr + (ConstantStr + "\\" + () + ) + ) + (Expr + (ConstantStr + "\n\r\t'\"\\" + () + ) + ) + (Expr + (ConstantStr + "\n" + () + ) + ) + (Expr + (ConstantStr + "\r" + () + ) + ) + (Expr + (ConstantStr + "\t" + () + ) + ) + (Expr + (ConstantStr + "'" + () + ) + ) + (Expr + (ConstantStr + "\"" + () + ) + ) + (Expr + (ConstantStr + "\\" + () + ) + ) + (Expr + (ConstantStr + "\n\r\t'\"\\" + () + ) + ) + (Expr + (ConstantStr + "hi\n" + () + ) + ) + (Expr + (ConstantStr + "hi\r\n\t" + () + ) + ) + (Expr + (ConstantStr + "1234\n\t\\jdlasf\t" + () + ) + ) + (Expr + (ConstantStr + "Hi this is a \"test case\"." + () + ) + ) + (Expr + (ConstantStr + "\nThis is \n\nabcd123\nThis is \r\nefgh\n" + () + ) + ) + (Expr + (ConstantStr + "This is \n\n" + () + ) + ) + (Expr + (ConstantStr + "hi dsjfklad" + () + ) + )] + [] +) diff --git a/tests/reference/ast_new-try1-a9a22cf.json b/tests/reference/ast_new-try1-a9a22cf.json new file mode 100644 index 0000000000..a252588d6f --- /dev/null +++ b/tests/reference/ast_new-try1-a9a22cf.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-try1-a9a22cf", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/try1.py", + "infile_hash": "a7fac6105109bebf6a38bd317f4bbf5876e2dd62a341c71232791619", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-try1-a9a22cf.stdout", + "stdout_hash": "2d208d18296ba0b82463ef7c49b2dedaed5d5600b0956f27084b454e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-try1-a9a22cf.stdout b/tests/reference/ast_new-try1-a9a22cf.stdout new file mode 100644 index 0000000000..8e8c909961 --- /dev/null +++ b/tests/reference/ast_new-try1-a9a22cf.stdout @@ -0,0 +1,301 @@ +(Module + [(For + (Name + i + Store + ) + (Call + (Name + range + Load + ) + [(ConstantInt + 3 + () + ) + (ConstantInt + 0 + () + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + )] + [] + ) + [(Try + [(Expr + (Call + (Name + print + Load + ) + [] + [] + ) + )] + [(ExceptHandler + (Name + IOError + Load + ) + () + [(If + (Compare + (Name + i + Load + ) + Eq + [(ConstantInt + 1 + () + )] + ) + [(Raise + () + () + )] + [] + ) + (Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "retry" + () + )] + [] + ) + )] + )] + [(Break)] + [] + )] + [] + () + ) + (Try + [(Pass)] + [(ExceptHandler + (Name + ValueError + Load + ) + () + [(Pass)] + ) + (ExceptHandler + (Name + TypeError + Load + ) + () + [(Pass)] + ) + (ExceptHandler + (Name + ZeroDivisionError + Load + ) + () + [(Pass)] + ) + (ExceptHandler + () + () + [(Pass)] + )] + [] + [] + ) + (Try + [(Assign + [(Name + a + Store + )] + (ConstantInt + 1 + () + ) + () + ) + (If + (Compare + (Name + a + Load + ) + LtE + [(ConstantInt + 0 + () + )] + ) + [(Raise + (Call + (Name + ValueError + Load + ) + [(ConstantStr + "That is not a positive number!" + () + )] + [] + ) + () + )] + [] + )] + [(ExceptHandler + (Name + ValueError + Load + ) + ve + [(Expr + (Call + (Name + print + Load + ) + [(Name + ve + Load + )] + [] + ) + )] + )] + [] + [] + ) + (Try + [(Raise + (Name + KeyboardInterrupt + Load + ) + () + )] + [] + [] + [(Expr + (Call + (Name + print + Load + ) + [(ConstantStr + "Goodbye, world!" + () + )] + [] + ) + )] + ) + (Try + [(Expr + (ConstantEllipsis + () + ) + )] + [(ExceptHandler + (Name + Exception + Load + ) + e + [(Expr + (ConstantEllipsis + () + ) + )] + )] + [] + [] + ) + (Try + [(Expr + (ConstantEllipsis + () + ) + )] + [(ExceptHandler + () + () + [(Expr + (ConstantEllipsis + () + ) + )] + )] + [(Expr + (ConstantEllipsis + () + ) + )] + [(Expr + (ConstantEllipsis + () + ) + )] + ) + (Try + [(Expr + (Call + (Attribute + (Name + shutil + Load + ) + rmtree + Load + ) + [(Call + (Attribute + (Attribute + (Name + os + Load + ) + path + Load + ) + join + Load + ) + [(Name + asv_build_cache + Load + ) + (Name + c + Load + )] + [] + )] + [] + ) + )] + [(ExceptHandler + (Name + OSError + Load + ) + () + [(Pass)] + )] + [] + [] + )] + [] +) diff --git a/tests/reference/ast_new-tuple1-29c08af.json b/tests/reference/ast_new-tuple1-29c08af.json new file mode 100644 index 0000000000..c23dd5efe2 --- /dev/null +++ b/tests/reference/ast_new-tuple1-29c08af.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-tuple1-29c08af", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/tuple1.py", + "infile_hash": "a598d163f33a7eb37376592c8018780cb4024618f4a8024bd728ff15", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-tuple1-29c08af.stdout", + "stdout_hash": "ba3dcb7011c5466eb869001acbc2c1a89c60f15e59dcdf8e7974baab", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-tuple1-29c08af.stdout b/tests/reference/ast_new-tuple1-29c08af.stdout new file mode 100644 index 0000000000..7b546c6ad3 --- /dev/null +++ b/tests/reference/ast_new-tuple1-29c08af.stdout @@ -0,0 +1,650 @@ +(Module + [(Assign + [(Name + a + Store + )] + (BinOp + (Tuple + [(ConstantInt + 1 + () + )] + Load + ) + Add + (ConstantInt + 4 + () + ) + ) + () + ) + (Assign + [(Name + a + Store + )] + (BinOp + (BinOp + (ConstantInt + 3 + () + ) + Mult + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + ) + Add + (ConstantInt + 4 + () + ) + ) + () + ) + (Expr + (Call + (Name + f + Load + ) + [(Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + )] + [] + ) + ) + (Expr + (Call + (Name + f + Load + ) + [(Tuple + [(Name + x + Load + )] + Load + )] + [] + ) + ) + (Assign + [(Name + a + Store + )] + (Call + (Name + len + Load + ) + [(Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + )] + [] + ) + () + ) + (Assign + [(Name + a4 + Store + )] + (Tuple + [(Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + (Tuple + [(ConstantInt + 4 + () + ) + (ConstantInt + 5 + () + ) + (ConstantInt + 6 + () + )] + Load + )] + Load + ) + () + ) + (Expr + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + ) + (Expr + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + ) + (Expr + (BinOp + (Tuple + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + )] + Load + ) + Mult + (ConstantInt + 3 + () + ) + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(BinOp + (ConstantStr + "%s%s%s" + () + ) + Mod + (Tuple + [(Name + a + Load + ) + (Name + b + Load + ) + (Name + c + Load + )] + Load + ) + )] + [] + ) + ) + (Expr + (Call + (Name + print + Load + ) + [(BinOp + (ConstantStr + "%s%s%s" + () + ) + Mod + (Tuple + [(BinOp + (ConstantInt + 10 + () + ) + Add + (Name + x + Load + ) + ) + (Name + y + Load + ) + (BinOp + (Name + z + Load + ) + Add + (ConstantInt + 20 + () + ) + )] + Load + ) + )] + [] + ) + ) + (If + (Compare + (Attribute + (Name + sys + Load + ) + version_info + Load + ) + GtE + [(Tuple + [(ConstantInt + 3 + () + ) + (ConstantInt + 9 + () + )] + Load + )] + ) + [(Pass)] + [] + ) + (Assign + [(Name + NDArray + Store + )] + (Call + (Name + _GenericAlias + Load + ) + [(Attribute + (Name + np + Load + ) + ndarray + Load + ) + (Tuple + [(Name + Any + Load + ) + (Name + _DType + Load + )] + Load + )] + [] + ) + () + ) + (FunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(Pass)] + [(Call + (Attribute + (Attribute + (Name + pytest + Load + ) + mark + Load + ) + parametrize + Load + ) + [(ConstantStr + "shape" + () + ) + (List + [(ConstantInt + 5 + () + ) + (Tuple + [(ConstantInt + 3 + () + ) + (ConstantInt + 3 + () + ) + (ConstantInt + 3 + () + )] + Load + )] + Load + )] + [] + )] + () + () + ) + (Assign + [(Name + _promotion_table + Store + )] + (Dict + [(Tuple + [(Name + int8 + Load + ) + (Name + int8 + Load + )] + Load + )] + [(Name + int8 + Load + )] + ) + () + ) + (Expr + (Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + ) + ) + (Expr + (Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + ) + ) + (Expr + (Tuple + [(Call + (Name + assert_ + Load + ) + [(Call + (Attribute + (Name + np + Load + ) + isnan + Load + ) + [(Name + div + Load + )] + [] + )] + [] + ) + (BinOp + (ConstantStr + "dt: %s, rem: %s" + () + ) + Mod + (Tuple + [(Name + dt + Load + ) + (Name + rem + Load + )] + Load + ) + )] + Load + ) + ) + (Expr + (Call + (Name + sum + Load + ) + [(ListComp + (Subscript + (Tuple + [(ConstantInt + 1 + () + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + )] + Load + ) + (BinOp + (Name + i + Load + ) + Mod + (ConstantInt + 2 + () + ) + ) + Load + ) + [((Name + i + Store + ) + (Name + x + Load + ) + [] + 0)] + )] + [] + ) + ) + (Expr + (Call + (Name + sum + Load + ) + [(ListComp + (Subscript + (Tuple + [(ConstantInt + 1 + () + ) + (UnaryOp + USub + (ConstantInt + 1 + () + ) + )] + Load + ) + (BinOp + (Name + i + Load + ) + Mod + (ConstantInt + 2 + () + ) + ) + Load + ) + [((Name + i + Store + ) + (Name + x + Load + ) + [] + 0)] + )] + [] + ) + ) + (Assign + [(Name + a + Store + )] + (Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + ) + () + ) + (AnnAssign + (Name + t + Store + ) + (Subscript + (Name + tuple + Load + ) + (Tuple + [(Name + i32 + Load + ) + (Name + i32 + Load + )] + Load + ) + Load + ) + (Tuple + [(ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + 1 + )] + [(TypeIgnore + 0 + "" + )] +) diff --git a/tests/reference/ast_new-type_comment1-710ea6c.json b/tests/reference/ast_new-type_comment1-710ea6c.json new file mode 100644 index 0000000000..5cabf43401 --- /dev/null +++ b/tests/reference/ast_new-type_comment1-710ea6c.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-type_comment1-710ea6c", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/type_comment1.py", + "infile_hash": "068e12017f2d2c484023dba5e6d127d0ef53e3e4148ce40452c1284b", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-type_comment1-710ea6c.stdout", + "stdout_hash": "ef1c4024c790cdf5ef3262c9b94f127a5d546dcc24932b87d98ed980", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-type_comment1-710ea6c.stdout b/tests/reference/ast_new-type_comment1-710ea6c.stdout new file mode 100644 index 0000000000..f388bf722c --- /dev/null +++ b/tests/reference/ast_new-type_comment1-710ea6c.stdout @@ -0,0 +1,175 @@ +(Module + [(Import + [(pytest + ())] + ) + (FunctionDef + ndarray_func + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Return + (Name + x + Load + ) + )] + [] + () + "(np.ndarray) -> np.ndarray" + ) + (FunctionDef + test + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Return + (Name + x + Load + ) + )] + [(Name + decorator1 + Load + ) + (Name + decorator2 + Load + ) + (Name + decorator3 + Load + )] + () + "(np.ndarray) -> np.ndarray" + ) + (FunctionDef + test + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + ) + (FunctionDef + main + ([] + [] + [] + [] + [] + [] + []) + [(Pass)] + [] + () + () + ) + (Expr + (Call + (Name + x + Load + ) + [(Name + x + Load + ) + (Name + y + Load + )] + [] + ) + ) + (ImportFrom + sympy.simplify + [(collect + ()) + (powsimp + ()) + (separatevars + ()) + (simplify + ())] + 0 + ) + (Expr + (Await + (Call + (Name + test + Load + ) + [(Name + x + Load + ) + (Name + y + Load + ) + (Name + z + Load + )] + [] + ) + ) + )] + [(TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + ) + (TypeIgnore + 0 + "" + )] +) diff --git a/tests/reference/ast_new-unicode-d3199dc.json b/tests/reference/ast_new-unicode-d3199dc.json new file mode 100644 index 0000000000..953033c69f --- /dev/null +++ b/tests/reference/ast_new-unicode-d3199dc.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-unicode-d3199dc", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/unicode.py", + "infile_hash": "6b3cd163f80b29c927ea2538095688bb9d903c15b5e4a782dc821db5", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-unicode-d3199dc.stdout", + "stdout_hash": "094e93359015843e391595911489ad12bf6abeb7fdc92649bb97ca3a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-unicode-d3199dc.stdout b/tests/reference/ast_new-unicode-d3199dc.stdout new file mode 100644 index 0000000000..25bedb5aa2 --- /dev/null +++ b/tests/reference/ast_new-unicode-d3199dc.stdout @@ -0,0 +1,96 @@ +(Module + [(FunctionDef + test_frompyfunc_name + ([] + [(self + () + ())] + [] + [] + [] + [] + []) + [(FunctionDef + cassé + ([] + [(x + () + ())] + [] + [] + [] + [] + []) + [(Return + (Name + x + Load + ) + )] + [] + () + () + )] + [] + () + () + ) + (Assign + [(Name + ℙƴtℌøἤ + Store + )] + (ConstantInt + 1 + () + ) + () + ) + (Expr + (Call + (Name + print + Load + ) + [(Name + ℙƴtℌøἤ + Load + )] + [] + ) + ) + (If + (Compare + (Name + 诶 + Load + ) + NotEq + [(ConstantInt + 2 + () + )] + ) + [(Pass)] + [] + ) + (FunctionDef + क१ + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (ConstantEllipsis + () + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/ast_new-while1-a4c6382.json b/tests/reference/ast_new-while1-a4c6382.json new file mode 100644 index 0000000000..b007957ac4 --- /dev/null +++ b/tests/reference/ast_new-while1-a4c6382.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-while1-a4c6382", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/while1.py", + "infile_hash": "d013884f95378177c308b9e8cc762e1f1a57ff5b49ea7aae5461901e", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-while1-a4c6382.stdout", + "stdout_hash": "90f2e03370e7ea2eb4cfc10b32b6c7b24b4abb61491c46e5e23b8629", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-while1-a4c6382.stdout b/tests/reference/ast_new-while1-a4c6382.stdout new file mode 100644 index 0000000000..4bbcf5b705 --- /dev/null +++ b/tests/reference/ast_new-while1-a4c6382.stdout @@ -0,0 +1,84 @@ +(Module + [(ImportFrom + lpython + [(i32 + ())] + 0 + ) + (AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + (ConstantInt + 10 + () + ) + 1 + ) + (While + (Compare + (Name + i + Load + ) + Lt + [(ConstantInt + 3 + () + )] + ) + [(Pass)] + [] + ) + (While + (Compare + (Name + i + Load + ) + Lt + [(ConstantInt + 6 + () + )] + ) + [(Pass)] + [(Pass)] + ) + (While + (Compare + (Name + i + Load + ) + Lt + [(ConstantInt + 3 + () + )] + ) + [(Pass)] + [] + ) + (While + (Compare + (Name + i + Load + ) + Lt + [(ConstantInt + 6 + () + )] + ) + [(Pass)] + [(Pass)] + )] + [] +) diff --git a/tests/reference/ast_new-with1-6c88c0f.json b/tests/reference/ast_new-with1-6c88c0f.json new file mode 100644 index 0000000000..379e083532 --- /dev/null +++ b/tests/reference/ast_new-with1-6c88c0f.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-with1-6c88c0f", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/with1.py", + "infile_hash": "76c56f94e39ec49c634bd827a4b1e6c14e8da599466c733c44d55b1e", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-with1-6c88c0f.stdout", + "stdout_hash": "da9e18ca666189ea27993cfac36f5193654225e29453bd37b5df0a17", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-with1-6c88c0f.stdout b/tests/reference/ast_new-with1-6c88c0f.stdout new file mode 100644 index 0000000000..d1cef145af --- /dev/null +++ b/tests/reference/ast_new-with1-6c88c0f.stdout @@ -0,0 +1,331 @@ +(Module + [(With + [((Call + (Name + A + Load + ) + [] + [] + ) + (Name + a + Store + )) + ((Call + (Name + B + Load + ) + [] + [] + ) + (Name + b + Store + ))] + [(Expr + (Call + (Name + f + Load + ) + [(Name + a + Load + ) + (Name + b + Load + )] + [] + ) + )] + () + ) + (With + [((Call + (Name + A + Load + ) + [] + [] + ) + (Name + a + Store + )) + ((Call + (Name + B + Load + ) + [(Name + a + Load + )] + [] + ) + (Name + b + Store + )) + ((Call + (Name + C + Load + ) + [(Name + a + Load + ) + (Name + b + Load + )] + [] + ) + (Name + c + Store + ))] + [(Expr + (Call + (Name + f + Load + ) + [(Name + a + Load + ) + (Name + c + Load + )] + [] + ) + )] + () + ) + (With + [((Call + (Name + open + Load + ) + [(ConstantStr + "examples/expr2.py" + () + ) + (ConstantStr + "r" + () + )] + [] + ) + (Name + file + Store + ))] + [(Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + file + Load + ) + read + Load + ) + [] + [] + ) + () + )] + () + ) + (With + [((Call + (Name + open + Load + ) + [(ConstantEllipsis + () + )] + [] + ) + (Name + f + Store + ))] + [(Expr + (ConstantEllipsis + () + ) + )] + () + ) + (With + [((Call + (Name + open + Load + ) + [(ConstantStr + "examples/expr2.py" + () + ) + (ConstantStr + "r" + () + )] + [] + ) + (Name + file + Store + ))] + [(Assign + [(Name + x + Store + )] + (Call + (Attribute + (Name + file + Load + ) + read + Load + ) + [] + [] + ) + () + )] + () + ) + (With + [((Name + a + Load + ) + ()) + ((Name + b + Load + ) + ()) + ((Name + c + Load + ) + (Name + y + Store + )) + ((Name + z + Load + ) + ())] + [(Pass)] + () + ) + (With + [((Call + (Name + tag + Load + ) + [(ConstantStr + "x" + () + )] + [] + ) + ())] + [(Pass)] + () + ) + (With + [((Name + t + Load + ) + (Name + x + Store + )) + ((Call + (Name + y + Load + ) + [] + [] + ) + ())] + [(Expr + (ConstantEllipsis + () + ) + )] + () + ) + (With + [((Name + a + Load + ) + (Name + b + Store + )) + ((Call + (Name + c + Load + ) + [] + [] + ) + ()) + ((Call + (Name + d + Load + ) + [] + [] + ) + ()) + ((Name + e + Load + ) + (Name + f + Store + )) + ((Name + g + Load + ) + (Name + x + Store + ))] + [(Pass)] + () + )] + [] +) diff --git a/tests/reference/ast_new-yield-4c41668.json b/tests/reference/ast_new-yield-4c41668.json new file mode 100644 index 0000000000..84c7e07ded --- /dev/null +++ b/tests/reference/ast_new-yield-4c41668.json @@ -0,0 +1,13 @@ +{ + "basename": "ast_new-yield-4c41668", + "cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}", + "infile": "tests/parser/yield.py", + "infile_hash": "8be8f045d190dbc958c308128da40d7e8b590f0320166d10b545722b", + "outfile": null, + "outfile_hash": null, + "stdout": "ast_new-yield-4c41668.stdout", + "stdout_hash": "86dec82fdfba5c8c8fe63c0a67dac680041e208fb7f372bf1744ce7d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast_new-yield-4c41668.stdout b/tests/reference/ast_new-yield-4c41668.stdout new file mode 100644 index 0000000000..f6007b5793 --- /dev/null +++ b/tests/reference/ast_new-yield-4c41668.stdout @@ -0,0 +1,346 @@ +(Module + [(FunctionDef + func + ([] + [] + [] + [] + [] + [] + []) + [(AnnAssign + (Name + x + Store + ) + (Subscript + (Name + list + Load + ) + (Name + i32 + Load + ) + Load + ) + () + 1 + ) + (Assign + [(Name + x + Store + )] + (List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + ) + () + ) + (AnnAssign + (Name + i + Store + ) + (Name + i32 + Load + ) + () + 1 + ) + (For + (Name + i + Store + ) + (Name + x + Load + ) + [(Expr + (Yield + (Name + i + Load + ) + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Name + x + Load + ) + [(Expr + (Yield + (Name + i + Load + ) + ) + )] + [] + () + ) + (For + (Name + i + Store + ) + (Name + x + Load + ) + [(Expr + (Yield + (Tuple + [] + Load + ) + ) + )] + [] + () + ) + (For + (Name + _ + Store + ) + (Name + x + Load + ) + [(Expr + (Yield + () + ) + )] + [] + () + ) + (Expr + (Yield + (Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + ) + ) + ) + (Expr + (Yield + (Tuple + [(Name + x + Load + ) + (Name + y + Load + )] + Load + ) + ) + )] + [] + () + () + ) + (FunctionDef + iterable1 + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (Yield + (ConstantInt + 1 + () + ) + ) + ) + (Expr + (Yield + (ConstantInt + 2 + () + ) + ) + )] + [] + () + () + ) + (FunctionDef + iterable2 + ([] + [] + [] + [] + [] + [] + []) + [(Expr + (YieldFrom + (Call + (Name + iterable1 + Load + ) + [] + [] + ) + ) + ) + (Expr + (Yield + (ConstantInt + 3 + () + ) + ) + )] + [] + () + () + ) + (Assert + (Compare + (Call + (Name + list + Load + ) + [(Call + (Name + iterable2 + Load + ) + [] + [] + )] + [] + ) + Eq + [(List + [(ConstantInt + 1 + () + ) + (ConstantInt + 2 + () + ) + (ConstantInt + 3 + () + )] + Load + )] + ) + () + ) + (FunctionDef + test_02 + ([] + [] + [] + [] + [] + [] + []) + [(Assign + [(Name + x + Store + )] + (Yield + (ConstantInt + 123 + () + ) + ) + () + ) + (Assign + [(Name + generator + Store + )] + (Call + (Name + type + Load + ) + [(Call + (Lambda + ([] + [] + [] + [] + [] + [] + []) + (Yield + () + ) + ) + [] + [] + )] + [] + ) + () + ) + (Return + (YieldFrom + (Call + (Attribute + (Name + awaitable + Load + ) + __await__ + Load + ) + [] + [] + ) + ) + )] + [] + () + () + )] + [] +) diff --git a/tests/reference/c-c_interop1-e215531.json b/tests/reference/c-c_interop1-e215531.json new file mode 100644 index 0000000000..9cd8533dac --- /dev/null +++ b/tests/reference/c-c_interop1-e215531.json @@ -0,0 +1,13 @@ +{ + "basename": "c-c_interop1-e215531", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/c_interop1.py", + "infile_hash": "aeb797508318740ae58a14cf663910a8fa077c574eaf79b9f54656ef", + "outfile": null, + "outfile_hash": null, + "stdout": "c-c_interop1-e215531.stdout", + "stdout_hash": "9d9dd1715b625024203f8b4de330a936a806c5e8031ae7b643c23e71", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-c_interop1-e215531.stdout b/tests/reference/c-c_interop1-e215531.stdout new file mode 100644 index 0000000000..60c6da2270 --- /dev/null +++ b/tests/reference/c-c_interop1-e215531.stdout @@ -0,0 +1,33 @@ +#include + +#include +#include +#include +#include +#include + + + + +// 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.00000000000000000e+00; + return _lpython_return_variable; +} + +void l(double a, float b, int64_t c, int32_t d) +{ + printf("%s\n", "OK"); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + return 0; +} diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json new file mode 100644 index 0000000000..c0fcdfcb2c --- /dev/null +++ b/tests/reference/c-expr7-bb2692a.json @@ -0,0 +1,13 @@ +{ + "basename": "c-expr7-bb2692a", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/expr7.py", + "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "c-expr7-bb2692a.stderr", + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/c-expr7-bb2692a.stderr b/tests/reference/c-expr7-bb2692a.stderr new file mode 100644 index 0000000000..d1b84ec030 --- /dev/null +++ b/tests/reference/c-expr7-bb2692a.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr7.py:4:13 + | +4 | a = i32(pow(2, 2)) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/c-expr_01-28f449f.json b/tests/reference/c-expr_01-28f449f.json new file mode 100644 index 0000000000..e26f28894a --- /dev/null +++ b/tests/reference/c-expr_01-28f449f.json @@ -0,0 +1,13 @@ +{ + "basename": "c-expr_01-28f449f", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/expr_01.py", + "infile_hash": "230a65e2cddb76f58d56747325caf24b8a1f6277810186581948c514", + "outfile": null, + "outfile_hash": null, + "stdout": "c-expr_01-28f449f.stdout", + "stdout_hash": "182f1a13f6ba0679a3107a8a9cc181130651a9f5d2f2acf7c382e431", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-expr_01-28f449f.stdout b/tests/reference/c-expr_01-28f449f.stdout new file mode 100644 index 0000000000..817a7c4225 --- /dev/null +++ b/tests/reference/c-expr_01-28f449f.stdout @@ -0,0 +1,54 @@ +#include + +#include +#include +#include +#include +#include + +inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y); +inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y); +void main0(); +void __main__global_stmts(); + + + +// Implementations +inline __attribute__((always_inline)) int32_t add(int32_t x, int32_t y) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = x + y; + return _lpython_return_variable; +} + +inline __attribute__((always_inline)) int32_t and_op(int32_t x, int32_t y) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = x&y; + return _lpython_return_variable; +} + +void main0() +{ + int32_t x; + int32_t y; + int32_t z; + x = (2 + 3)*5; + y = add(x, 2)*2; + ASSERT(x == 25); + ASSERT(y == 54); + z = and_op(x, y); + ASSERT(z == 16); +} + +void __main__global_stmts() +{ + main0(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-expr_11-c452314.json b/tests/reference/c-expr_11-c452314.json new file mode 100644 index 0000000000..b6c5580a8a --- /dev/null +++ b/tests/reference/c-expr_11-c452314.json @@ -0,0 +1,13 @@ +{ + "basename": "c-expr_11-c452314", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/expr_11.py", + "infile_hash": "d5027dd0f515c653c66202e02cc961bfbe09e628e069ce57b5f5ffe2", + "outfile": null, + "outfile_hash": null, + "stdout": "c-expr_11-c452314.stdout", + "stdout_hash": "2d6fe10d9189c578a5a20e042153115de54220d02a56baedc15efc31", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-expr_11-c452314.stdout b/tests/reference/c-expr_11-c452314.stdout new file mode 100644 index 0000000000..9edc21adfe --- /dev/null +++ b/tests/reference/c-expr_11-c452314.stdout @@ -0,0 +1,35 @@ +#include + +#include +#include +#include +#include +#include + +void f(); +void __main__global_stmts(); + + + +// Implementations +void f() +{ + bool b; + int32_t i; + i = 3; + b = (bool)(i); + ASSERT(b); + printf("%d\n", b); +} + +void __main__global_stmts() +{ + f(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-expr_12-93c7780.json b/tests/reference/c-expr_12-93c7780.json new file mode 100644 index 0000000000..58f7ee190c --- /dev/null +++ b/tests/reference/c-expr_12-93c7780.json @@ -0,0 +1,13 @@ +{ + "basename": "c-expr_12-93c7780", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/expr_12.py", + "infile_hash": "00534ea8d2143408735ea96d7a26888e53563758c1b14569daf0f962", + "outfile": null, + "outfile_hash": null, + "stdout": "c-expr_12-93c7780.stdout", + "stdout_hash": "4cbfe2f301edb2e5df13058ec0ff1415277851ee8ffcdda264b2f239", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-expr_12-93c7780.stdout b/tests/reference/c-expr_12-93c7780.stdout new file mode 100644 index 0000000000..b8a29576cb --- /dev/null +++ b/tests/reference/c-expr_12-93c7780.stdout @@ -0,0 +1,70 @@ +#include + +#include +#include +#include +#include +#include + + +struct dimension_descriptor +{ + int32_t lower_bound, length; +}; + +struct i16 +{ + int16_t *data; + struct dimension_descriptor dims[32]; + int32_t n_dims; + bool is_allocated; +}; + +void g(struct i16* *x, struct i16* y); +void check(struct i16* *ptr); +void f(); +void __main__global_stmts(); + + + +// Implementations +void g(struct i16* *x, struct i16* y) +{ + y->data[(0 - y->dims[0].lower_bound)] = 1; + y->data[(1 - y->dims[0].lower_bound)] = 2; + (*x) = y; + printf("%d%s%d\n", (*x)->data[(0 - (*x)->dims[0].lower_bound)], " ", (*x)->data[(1 - (*x)->dims[0].lower_bound)]); +} + +void check(struct i16* *ptr) +{ + ASSERT((*ptr)->data[(0 - (*ptr)->dims[0].lower_bound)] == 1); + ASSERT((*ptr)->data[(1 - (*ptr)->dims[0].lower_bound)] == 2); +} + +void f() +{ + struct i16 y_value; + struct i16* y = &y_value; + int16_t y_data[2]; + y->data = y_data; + y->n_dims = 1; + y->dims[0].lower_bound = 0; + y->dims[0].length = 2; + struct i16 yptr1_value; + struct i16* yptr1 = &yptr1_value; + g(&yptr1, y); + check(&yptr1); +} + +void __main__global_stmts() +{ + f(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-func_static_01-fc146ec.json b/tests/reference/c-func_static_01-fc146ec.json new file mode 100644 index 0000000000..237ebd35cc --- /dev/null +++ b/tests/reference/c-func_static_01-fc146ec.json @@ -0,0 +1,13 @@ +{ + "basename": "c-func_static_01-fc146ec", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/func_static_01.py", + "infile_hash": "073b018c3b06cdbf34c603363c53e12bf471a80c457aecc676316c29", + "outfile": null, + "outfile_hash": null, + "stdout": "c-func_static_01-fc146ec.stdout", + "stdout_hash": "ba4195c88f493b5e4d007ced548cd22bb7b12a7ba6a21df7526018bb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-func_static_01-fc146ec.stdout b/tests/reference/c-func_static_01-fc146ec.stdout new file mode 100644 index 0000000000..38379130dc --- /dev/null +++ b/tests/reference/c-func_static_01-fc146ec.stdout @@ -0,0 +1,46 @@ +#include + +#include +#include +#include +#include +#include + +static int64_t fib(int64_t n); +void main0(); +void __main__global_stmts(); + + + +// Implementations +static int64_t fib(int64_t n) +{ + int64_t _lpython_return_variable; + if (n < 2) { + _lpython_return_variable = n; + return _lpython_return_variable; + } + _lpython_return_variable = fib(n - 1) + fib(n - 2); + return _lpython_return_variable; +} + +void main0() +{ + int64_t ans; + int64_t x; + x = 5; + ans = fib(x); + ASSERT(ans == 5); +} + +void __main__global_stmts() +{ + main0(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-import_order_01-3ebf3c3.json b/tests/reference/c-import_order_01-3ebf3c3.json new file mode 100644 index 0000000000..8a602aa1fc --- /dev/null +++ b/tests/reference/c-import_order_01-3ebf3c3.json @@ -0,0 +1,13 @@ +{ + "basename": "c-import_order_01-3ebf3c3", + "cmd": "lpython --no-color --disable-main --show-c {infile}", + "infile": "tests/../integration_tests/import_order_01.py", + "infile_hash": "b6f67090973a5fce0778dbdd86fdb12272a8da5bbae2f50051df34e5", + "outfile": null, + "outfile_hash": null, + "stdout": "c-import_order_01-3ebf3c3.stdout", + "stdout_hash": "f3e4798c2ffb4df885977927d38d89b0354c812264ae40b4e7103ced", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-import_order_01-3ebf3c3.stdout b/tests/reference/c-import_order_01-3ebf3c3.stdout new file mode 100644 index 0000000000..3a50069788 --- /dev/null +++ b/tests/reference/c-import_order_01-3ebf3c3.stdout @@ -0,0 +1,27 @@ +#include + +#include +#include +#include +#include +#include + +int32_t f(); + + + +// Implementations +int32_t f() +{ + int32_t _lpython_return_variable; + _lpython_return_variable = 42; + return _lpython_return_variable; +} + +void main1() +{ + int32_t a; + a = f(); + printf("%d\n", a); +} + diff --git a/tests/reference/c-loop1-3e341c7.json b/tests/reference/c-loop1-3e341c7.json new file mode 100644 index 0000000000..35b5b1707a --- /dev/null +++ b/tests/reference/c-loop1-3e341c7.json @@ -0,0 +1,13 @@ +{ + "basename": "c-loop1-3e341c7", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/loop1.py", + "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", + "outfile": null, + "outfile_hash": null, + "stdout": "c-loop1-3e341c7.stdout", + "stdout_hash": "c83616df972c7b3f966dab1ae3c339147a426324bd33890a9d13144e", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-loop1-3e341c7.stdout b/tests/reference/c-loop1-3e341c7.stdout new file mode 100644 index 0000000000..e1cd5ce5d1 --- /dev/null +++ b/tests/reference/c-loop1-3e341c7.stdout @@ -0,0 +1,85 @@ +#include + +#include +#include +#include +#include +#include + +int32_t test_factorial_1(int32_t x); +int32_t test_factorial_2(int32_t x); +int64_t test_factorial_3(int32_t x); +void main0(); +void __main__global_stmts(); + + + +// Implementations +int32_t test_factorial_1(int32_t x) +{ + int32_t _lpython_return_variable; + int32_t result; + if (x < 0) { + _lpython_return_variable = 0; + return _lpython_return_variable; + } + result = 1; + while (x > 0) { + result = result*x; + x = x - 1; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +int32_t test_factorial_2(int32_t x) +{ + int32_t _lpython_return_variable; + int32_t i; + int32_t result; + result = 1; + for (i=1; i<=x + 1 - 1; i++) { + result = result*i; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +int64_t test_factorial_3(int32_t x) +{ + int64_t _lpython_return_variable; + int64_t result; + result = 0; + if (x < 0) { + _lpython_return_variable = result; + return _lpython_return_variable; + } + result = 1; + while (x > 0) { + result = result*x; + x = x - 1; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +void main0() +{ + int32_t i; + int64_t j; + i = test_factorial_1(4); + i = test_factorial_2(4); + j = test_factorial_3(5); +} + +void __main__global_stmts() +{ + main0(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-loop4-eec10d3.json b/tests/reference/c-loop4-eec10d3.json new file mode 100644 index 0000000000..3ee5448d4f --- /dev/null +++ b/tests/reference/c-loop4-eec10d3.json @@ -0,0 +1,13 @@ +{ + "basename": "c-loop4-eec10d3", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/loop4.py", + "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", + "outfile": null, + "outfile_hash": null, + "stdout": "c-loop4-eec10d3.stdout", + "stdout_hash": "8eea5321c1fd80c9bce62d443a5bc4709a5a9cfcb95fc38c8f369ce4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-loop4-eec10d3.stdout b/tests/reference/c-loop4-eec10d3.stdout new file mode 100644 index 0000000000..d273d2a9c5 --- /dev/null +++ b/tests/reference/c-loop4-eec10d3.stdout @@ -0,0 +1,41 @@ +#include + +#include +#include +#include +#include +#include + +void test_for(); +void __main__global_stmts(); + + + +// Implementations +void test_for() +{ + int32_t i; + for (i=0; i<=10 - 1; i++) { + if (i == 0) { + continue; + } + if (i > 5) { + break; + } + if (i == 3) { + exit(0); + } + } +} + +void __main__global_stmts() +{ + test_for(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-print_01-4d44628.json b/tests/reference/c-print_01-4d44628.json new file mode 100644 index 0000000000..c19acd876f --- /dev/null +++ b/tests/reference/c-print_01-4d44628.json @@ -0,0 +1,13 @@ +{ + "basename": "c-print_01-4d44628", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/print_01.py", + "infile_hash": "4755131262f8eb382c206da769880635ad00787824c37f788d1c3d44", + "outfile": null, + "outfile_hash": null, + "stdout": "c-print_01-4d44628.stdout", + "stdout_hash": "618b140a8c12a6798b60e01373d930af2a8d6df85b5aed54227b3462", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-print_01-4d44628.stdout b/tests/reference/c-print_01-4d44628.stdout new file mode 100644 index 0000000000..63b74c8211 --- /dev/null +++ b/tests/reference/c-print_01-4d44628.stdout @@ -0,0 +1,40 @@ + +#include +#include +#include +#include +#include + +void f(); +void __main__global_stmts(); + + + +// Implementations +void f() +{ + char * x = NULL; + char * y = NULL; + printf("%s\n", "Hello World!"); + _lfortran_strcpy(&x, ",", 1); + _lfortran_strcpy(&y, "!!", 1); + printf("%s%s%s\n", "a", x, "b"); + _lfortran_strcpy(&x, "-+-+-", 1); + printf("%s%s%s%s%s\n", "a", x, "b", x, "c"); + printf("%s%s%s%s%s%s", "d", "=", "e", "=", "f", "+\n"); + printf("%s%s%s%s%s%s", "x", "*\n", "y", "*\n", "z", y); + printf("%s%s%s\n", "1", ":", "2"); + printf("%s%s%s\n", "LCompilers", " ", "LPython"); +} + +void __main__global_stmts() +{ + f(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-test_import_02-d2c54c4.json b/tests/reference/c-test_import_02-d2c54c4.json new file mode 100644 index 0000000000..dce151ed72 --- /dev/null +++ b/tests/reference/c-test_import_02-d2c54c4.json @@ -0,0 +1,13 @@ +{ + "basename": "c-test_import_02-d2c54c4", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/test_import_02.py", + "infile_hash": "cf2059987c7470ee617df897ed0d19906a9a8a94f05a5612570fce91", + "outfile": null, + "outfile_hash": null, + "stdout": "c-test_import_02-d2c54c4.stdout", + "stdout_hash": "dc4de2618a3ad2e6c3f4eaa2b203104e51758040bb1f2ab14d85ba3a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-test_import_02-d2c54c4.stdout b/tests/reference/c-test_import_02-d2c54c4.stdout new file mode 100644 index 0000000000..0fdceff8c0 --- /dev/null +++ b/tests/reference/c-test_import_02-d2c54c4.stdout @@ -0,0 +1,53 @@ +#include + +#include +#include +#include +#include +#include + +int32_t add(int32_t x, int32_t y); +int32_t multiply(int32_t x, int32_t y); +void f(); +void __main__global_stmts(); + + + +// Implementations +const double μ = 1.45136923488338110e+00; +int32_t add(int32_t x, int32_t y) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = x + y; + return _lpython_return_variable; +} + +const double e = 2.71828182845904509e+00; +int32_t multiply(int32_t x, int32_t y) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = x*y; + return _lpython_return_variable; +} + +void f() +{ + printf("%lf\n", e); + printf("%lf\n", μ); + printf("%d\n", add(10, 20)); + printf("%d\n", multiply(10, 20)); + ASSERT(add(10, 20) == 30); + ASSERT(multiply(10, 20) == 200); +} + +void __main__global_stmts() +{ + f(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-test_issue_518-fbbd299.json b/tests/reference/c-test_issue_518-fbbd299.json new file mode 100644 index 0000000000..329271b124 --- /dev/null +++ b/tests/reference/c-test_issue_518-fbbd299.json @@ -0,0 +1,13 @@ +{ + "basename": "c-test_issue_518-fbbd299", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/test_issue_518.py", + "infile_hash": "9cf223e018e0affc76044dff23cb75157fbdca458be3ae68871da8db", + "outfile": null, + "outfile_hash": null, + "stdout": "c-test_issue_518-fbbd299.stdout", + "stdout_hash": "2140b84aa94533cf8a3cc994b6eefa42b22cb03615c99967a9e3b1e9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-test_issue_518-fbbd299.stdout b/tests/reference/c-test_issue_518-fbbd299.stdout new file mode 100644 index 0000000000..b5733123da --- /dev/null +++ b/tests/reference/c-test_issue_518-fbbd299.stdout @@ -0,0 +1,55 @@ +#include + +#include +#include +#include +#include +#include + +int64_t fib(int64_t n); +void main0(); +void _xx_lcompilers_changed_main_xx(); +void __main__global_stmts(); + + + +// Implementations +int64_t fib(int64_t n) +{ + int64_t _lpython_return_variable; + if (n < 2) { + _lpython_return_variable = n; + return _lpython_return_variable; + } else { + _lpython_return_variable = fib(n - 1) + fib(n - 2); + return _lpython_return_variable; + } + return _lpython_return_variable; +} + +void main0() +{ + int64_t ans; + ans = fib(15); + ASSERT(ans == 610); +} + +void _xx_lcompilers_changed_main_xx() +{ + int64_t ans; + ans = fib(10); + ASSERT(ans == 55); +} + +void __main__global_stmts() +{ + main0(); + _xx_lcompilers_changed_main_xx(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/c-variable_decl_03-fa1823b.json b/tests/reference/c-variable_decl_03-fa1823b.json new file mode 100644 index 0000000000..1060de968b --- /dev/null +++ b/tests/reference/c-variable_decl_03-fa1823b.json @@ -0,0 +1,13 @@ +{ + "basename": "c-variable_decl_03-fa1823b", + "cmd": "lpython --no-color --show-c {infile}", + "infile": "tests/../integration_tests/variable_decl_03.py", + "infile_hash": "1e6bd54d3ca0db90eec540b68eff063ae2186d623cf0d64335b09cfe", + "outfile": null, + "outfile_hash": null, + "stdout": "c-variable_decl_03-fa1823b.stdout", + "stdout_hash": "b8397cdd7e8998d29574393db30b5638aedd2ecd34a596b8b1c29f7f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/c-variable_decl_03-fa1823b.stdout b/tests/reference/c-variable_decl_03-fa1823b.stdout new file mode 100644 index 0000000000..7c25386e04 --- /dev/null +++ b/tests/reference/c-variable_decl_03-fa1823b.stdout @@ -0,0 +1,52 @@ + +#include +#include +#include +#include +#include + +double _lcompilers_abs_f64(double x); +double f(); +void _xx_lcompilers_changed_main_xx(); +void __main__global_stmts(); + + + +// Implementations +double _lcompilers_abs_f64(double x) +{ + double _lcompilers_abs_f64; + if (x >= 0.00000000000000000e+00) { + _lcompilers_abs_f64 = x; + } else { + _lcompilers_abs_f64 = -x; + } + return _lcompilers_abs_f64; +} + +double f() +{ + double _lpython_return_variable; + _lpython_return_variable = 5.50000000000000000e+00; + return _lpython_return_variable; +} + +void _xx_lcompilers_changed_main_xx() +{ + double t1; + t1 = f()* 1.00000000000000000e+06; + printf("%lf\n", t1); + ASSERT(_lcompilers_abs_f64(t1 - 5.50000000000000000e+00* 1.00000000000000000e+06) <= 9.99999999999999955e-07); +} + +void __main__global_stmts() +{ + _xx_lcompilers_changed_main_xx(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/cpp-assert1-ba60925.json b/tests/reference/cpp-assert1-ba60925.json new file mode 100644 index 0000000000..9e0008db37 --- /dev/null +++ b/tests/reference/cpp-assert1-ba60925.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-assert1-ba60925", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/assert1.py", + "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-assert1-ba60925.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-assert1-ba60925.stdout b/tests/reference/cpp-assert1-ba60925.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-assert1-ba60925.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.json b/tests/reference/cpp-doconcurrentloop_01-4e9f274.json new file mode 100644 index 0000000000..740a0bcf97 --- /dev/null +++ b/tests/reference/cpp-doconcurrentloop_01-4e9f274.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-doconcurrentloop_01-4e9f274", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/doconcurrentloop_01.py", + "infile_hash": "2fe3769863a595a01e46a88bf55c944e61a0d141d5c75816ffa74d96", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-doconcurrentloop_01-4e9f274.stdout", + "stdout_hash": "cef4c9a2fa79bd4f12c0842cc4cae9d0be7f1891b5c66ee6b229bb9f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout b/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout new file mode 100644 index 0000000000..ec2ad044bb --- /dev/null +++ b/tests/reference/cpp-doconcurrentloop_01-4e9f274.stdout @@ -0,0 +1,105 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + + +struct dimension_descriptor +{ + int32_t lower_bound, length; +}; + +struct f32_10000_1 +{ + Kokkos::View* data; + dimension_descriptor dims[1]; + bool is_allocated; + + f32_10000_1(Kokkos::View* data_): data{data_} {}; +}; + +// Forward declarations +void __main__global_stmts(); +void main0(); + +template +void triad(T0* a, T1* b, float scalar, T2* c); +namespace { +} + +// Implementations + +template +void triad(T0* a, T1* b, float scalar, T2* c) +{ + int32_t N; + int32_t i; + N = a->data->extent(0); + Kokkos::parallel_for(Kokkos::RangePolicy(0, N - 1+1), KOKKOS_LAMBDA(const long i) { + c->data->operator[](i - c->dims[0].lower_bound) = a->data->operator[](i - a->dims[0].lower_bound) + scalar*b->data->operator[](i - b->dims[0].lower_bound); + }); +} + +void main0() +{ + Kokkos::View a_data("a_data", 10000); + f32_10000_1 a_value(&a_data); + f32_10000_1* a = &a_value; + a->dims[0].lower_bound = 0; + a->dims[0].length = 10000; + Kokkos::View b_data("b_data", 10000); + f32_10000_1 b_value(&b_data); + f32_10000_1* b = &b_value; + b->dims[0].lower_bound = 0; + b->dims[0].length = 10000; + Kokkos::View c_data("c_data", 10000); + f32_10000_1 c_value(&c_data); + f32_10000_1* c = &c_value; + c->dims[0].lower_bound = 0; + c->dims[0].length = 10000; + int32_t i; + int32_t nsize; + float scalar; + scalar = 1.00000000000000000e+01; + nsize = a->data->extent(0); + Kokkos::parallel_for(Kokkos::RangePolicy(0, nsize - 1+1), KOKKOS_LAMBDA(const long i) { + a->data->operator[](i - a->dims[0].lower_bound) = 5.00000000000000000e+00; + b->data->operator[](i - b->dims[0].lower_bound) = 5.00000000000000000e+00; + }); + triad(a, b, scalar, c); + std::cout << "End Stream Triad" << std::endl; +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr12-fd2ea87.json b/tests/reference/cpp-expr12-fd2ea87.json new file mode 100644 index 0000000000..abfda3e82e --- /dev/null +++ b/tests/reference/cpp-expr12-fd2ea87.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr12-fd2ea87", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr12.py", + "infile_hash": "bad9ac6e0956fddb636f4e806f4a97c27396adc2416640bd291d2dc8", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr12-fd2ea87.stdout", + "stdout_hash": "3fd932aa8477bf21939c1376aa02973ffaa27249dded08685a4f8a27", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr12-fd2ea87.stdout b/tests/reference/cpp-expr12-fd2ea87.stdout new file mode 100644 index 0000000000..55b3be2423 --- /dev/null +++ b/tests/reference/cpp-expr12-fd2ea87.stdout @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +int32_t check(); +void main0(); +int32_t test(int32_t a, int32_t b); +namespace { +} + +// Implementations +int32_t test(int32_t a, int32_t b) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = std::pow(a, b); + return _lpython_return_variable; +} + +int32_t check() +{ + int32_t _lpython_return_variable; + int32_t a; + a = test(2, 2); + _lpython_return_variable = a; + return _lpython_return_variable; +} + +void main0() +{ + int32_t x; + x = check(); +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr15-1661c0d.json b/tests/reference/cpp-expr15-1661c0d.json new file mode 100644 index 0000000000..812a9c4978 --- /dev/null +++ b/tests/reference/cpp-expr15-1661c0d.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr15-1661c0d", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr15.py", + "infile_hash": "f3fa7c8efa999392edc0a94ff9c7820ed0c3f1e849c77655151b8d72", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-expr15-1661c0d.stderr", + "stderr_hash": "abb193cadddd4745a52610eabc746e5facafefb220f85ba3310a7498", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr15-1661c0d.stderr b/tests/reference/cpp-expr15-1661c0d.stderr new file mode 100644 index 0000000000..9b4deb20d2 --- /dev/null +++ b/tests/reference/cpp-expr15-1661c0d.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr15.py:11:9 + | +11 | x = complex(2, 2) + | ^^^^^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr2-09c05ad.json b/tests/reference/cpp-expr2-09c05ad.json new file mode 100644 index 0000000000..7f2a65d8fe --- /dev/null +++ b/tests/reference/cpp-expr2-09c05ad.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr2-09c05ad", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr2.py", + "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr2-09c05ad.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr2-09c05ad.stdout b/tests/reference/cpp-expr2-09c05ad.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-expr2-09c05ad.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr5-1de0e30.json b/tests/reference/cpp-expr5-1de0e30.json new file mode 100644 index 0000000000..0db3289f22 --- /dev/null +++ b/tests/reference/cpp-expr5-1de0e30.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr5-1de0e30", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr5.py", + "infile_hash": "7bbb5f9dacb13556f99de8f2969f9089235fea372fc2f43fc9c4bb18", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr5-1de0e30.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr5-1de0e30.stdout b/tests/reference/cpp-expr5-1de0e30.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-expr5-1de0e30.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr6-f337f4f.json b/tests/reference/cpp-expr6-f337f4f.json new file mode 100644 index 0000000000..8115193f00 --- /dev/null +++ b/tests/reference/cpp-expr6-f337f4f.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr6-f337f4f", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr6.py", + "infile_hash": "1f3b5a7d997851264e679d58353346835eb450c608f6da7d2f5e5cd2", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr6-f337f4f.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr6-f337f4f.stdout b/tests/reference/cpp-expr6-f337f4f.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-expr6-f337f4f.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr7-529bd53.json b/tests/reference/cpp-expr7-529bd53.json new file mode 100644 index 0000000000..be1428115b --- /dev/null +++ b/tests/reference/cpp-expr7-529bd53.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr7-529bd53", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr7.py", + "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-expr7-529bd53.stderr", + "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr7-529bd53.stderr b/tests/reference/cpp-expr7-529bd53.stderr new file mode 100644 index 0000000000..d1b84ec030 --- /dev/null +++ b/tests/reference/cpp-expr7-529bd53.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr7.py:4:13 + | +4 | a = i32(pow(2, 2)) + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr8-704cece.json b/tests/reference/cpp-expr8-704cece.json new file mode 100644 index 0000000000..5478fb2f70 --- /dev/null +++ b/tests/reference/cpp-expr8-704cece.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr8-704cece", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr8.py", + "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-expr8-704cece.stderr", + "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr8-704cece.stderr b/tests/reference/cpp-expr8-704cece.stderr new file mode 100644 index 0000000000..6e9d8d0f32 --- /dev/null +++ b/tests/reference/cpp-expr8-704cece.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/expr8.py:22:13 + | +22 | x = i32(b1//b1) + | ^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-expr9-48868e9.json b/tests/reference/cpp-expr9-48868e9.json new file mode 100644 index 0000000000..ec3d6312dc --- /dev/null +++ b/tests/reference/cpp-expr9-48868e9.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr9-48868e9", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/expr9.py", + "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr9-48868e9.stdout", + "stdout_hash": "8322420a1f1df346d89982ca461b6d08b67c2dab936e74d2a5f544f7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr9-48868e9.stdout b/tests/reference/cpp-expr9-48868e9.stdout new file mode 100644 index 0000000000..25c5d422e9 --- /dev/null +++ b/tests/reference/cpp-expr9-48868e9.stdout @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void main0(); +int32_t test_return_1(int32_t a); +std::string test_return_2(int32_t a); +int32_t test_return_3(int32_t a); +namespace { +} + +// Implementations +int32_t test_return_1(int32_t a) +{ + int32_t _lpython_return_variable; + int32_t x; + x = 5; + _lpython_return_variable = x; + return _lpython_return_variable; +} + +std::string test_return_2(int32_t a) +{ + std::string _lpython_return_variable; + std::string x; + x = "test"; + _lpython_return_variable = x; + return _lpython_return_variable; +} + +int32_t test_return_3(int32_t a) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = a; + return _lpython_return_variable; +} + +void main0() +{ + int32_t i; + std::string s; + i = test_return_1(4); + s = test_return_2(4); + i = test_return_3(4); +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr_11-422c839.json b/tests/reference/cpp-expr_11-422c839.json new file mode 100644 index 0000000000..ab8387e398 --- /dev/null +++ b/tests/reference/cpp-expr_11-422c839.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-expr_11-422c839", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/../integration_tests/expr_11.py", + "infile_hash": "d5027dd0f515c653c66202e02cc961bfbe09e628e069ce57b5f5ffe2", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-expr_11-422c839.stdout", + "stdout_hash": "c015d4446b89b36b010a37f5651e19ef8615ca00148c4ff51f8c5e3d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-expr_11-422c839.stdout b/tests/reference/cpp-expr_11-422c839.stdout new file mode 100644 index 0000000000..82be5bfb91 --- /dev/null +++ b/tests/reference/cpp-expr_11-422c839.stdout @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void f(); +namespace { +} + +// Implementations +void f() +{ + bool b; + int32_t i; + i = 3; + b = (bool)(i); + assert (b); + std::cout << b << std::endl; +} + +void __main__global_stmts() +{ + f(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-loop1-0a8cf3b.json b/tests/reference/cpp-loop1-0a8cf3b.json new file mode 100644 index 0000000000..83fab1323b --- /dev/null +++ b/tests/reference/cpp-loop1-0a8cf3b.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-loop1-0a8cf3b", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/loop1.py", + "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-loop1-0a8cf3b.stdout", + "stdout_hash": "47940a3d90ec65bad62ffb4a582149a8ed514e48071a45bb7eb3fe5b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-loop1-0a8cf3b.stdout b/tests/reference/cpp-loop1-0a8cf3b.stdout new file mode 100644 index 0000000000..1b5b8dc1ff --- /dev/null +++ b/tests/reference/cpp-loop1-0a8cf3b.stdout @@ -0,0 +1,105 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void main0(); +int32_t test_factorial_1(int32_t x); +int32_t test_factorial_2(int32_t x); +int64_t test_factorial_3(int32_t x); +namespace { +} + +// Implementations +int32_t test_factorial_1(int32_t x) +{ + int32_t _lpython_return_variable; + int32_t result; + if (x < 0) { + _lpython_return_variable = 0; + return _lpython_return_variable; + } + result = 1; + while (x > 0) { + result = result*x; + x = x - 1; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +int32_t test_factorial_2(int32_t x) +{ + int32_t _lpython_return_variable; + int32_t i; + int32_t result; + result = 1; + for (i=1; i<=x + 1 - 1; i++) { + result = result*i; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +int64_t test_factorial_3(int32_t x) +{ + int64_t _lpython_return_variable; + int64_t result; + result = 0; + if (x < 0) { + _lpython_return_variable = result; + return _lpython_return_variable; + } + result = 1; + while (x > 0) { + result = result*x; + x = x - 1; + } + _lpython_return_variable = result; + return _lpython_return_variable; +} + +void main0() +{ + int32_t i; + int64_t j; + i = test_factorial_1(4); + i = test_factorial_2(4); + j = test_factorial_3(5); +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-loop3-6020091.json b/tests/reference/cpp-loop3-6020091.json new file mode 100644 index 0000000000..8705b64cc5 --- /dev/null +++ b/tests/reference/cpp-loop3-6020091.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-loop3-6020091", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/loop3.py", + "infile_hash": "498c7c40ca352ed21dde33c128aff4d59d3c329e770e3a2ff3eb3fad", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-loop3-6020091.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-loop3-6020091.stdout b/tests/reference/cpp-loop3-6020091.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-loop3-6020091.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-loop4-cdb2174.json b/tests/reference/cpp-loop4-cdb2174.json new file mode 100644 index 0000000000..d5637d4b89 --- /dev/null +++ b/tests/reference/cpp-loop4-cdb2174.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-loop4-cdb2174", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/loop4.py", + "infile_hash": "660eb1a895c81609d791240171fc34b6f0fea02c43de8f86420b06b7", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-loop4-cdb2174.stdout", + "stdout_hash": "a7a82cd77e9ab3cc7ed092234263ce57db724e0352d8bad31d090fcb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-loop4-cdb2174.stdout b/tests/reference/cpp-loop4-cdb2174.stdout new file mode 100644 index 0000000000..60b9ac1969 --- /dev/null +++ b/tests/reference/cpp-loop4-cdb2174.stdout @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void test_for(); +namespace { +} + +// Implementations +void test_for() +{ + int32_t i; + for (i=0; i<=10 - 1; i++) { + if (i == 0) { + continue; + } + if (i > 5) { + break; + } + if (i == 3) { + exit(0); + } + } +} + +void __main__global_stmts() +{ + test_for(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-print_01-026ef17.json b/tests/reference/cpp-print_01-026ef17.json new file mode 100644 index 0000000000..c254ecab8d --- /dev/null +++ b/tests/reference/cpp-print_01-026ef17.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-print_01-026ef17", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/../integration_tests/print_01.py", + "infile_hash": "4755131262f8eb382c206da769880635ad00787824c37f788d1c3d44", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-print_01-026ef17.stdout", + "stdout_hash": "27da0159fcbc074b4527f6dc2ad9fbde547b888311fc5b92083eb0b9", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-print_01-026ef17.stdout b/tests/reference/cpp-print_01-026ef17.stdout new file mode 100644 index 0000000000..e8b8a9aba5 --- /dev/null +++ b/tests/reference/cpp-print_01-026ef17.stdout @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void f(); +namespace { +} + +// Implementations +void f() +{ + std::string x; + std::string y; + std::cout << "Hello World!" << std::endl; + x = ","; + y = "!!"; + std::cout << "a" << x << "b" << std::endl; + x = "-+-+-"; + std::cout << "a" << x << "b" << x << "c" << std::endl; + std::cout << "d" << "=" << "e" << "=" << "f" << "+\n"; + std::cout << "x" << "*\n" << "y" << "*\n" << "z" << y; + std::cout << "1" << ":" << "2" << std::endl; + std::cout << "LCompilers" << " " << "LPython" << std::endl; +} + +void __main__global_stmts() +{ + f(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json new file mode 100644 index 0000000000..346ddf6b70 --- /dev/null +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-test_builtin_pow-56b3f92", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/../integration_tests/test_builtin_pow.py", + "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "cpp-test_builtin_pow-56b3f92.stderr", + "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr new file mode 100644 index 0000000000..e2d434b6f1 --- /dev/null +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr @@ -0,0 +1,11 @@ +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> tests/../integration_tests/test_builtin_pow.py:11:16 + | +11 | assert i32(pow(a, b)) == 32 + | ^^^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/cpp-test_list_repeat2-698d7f4.json b/tests/reference/cpp-test_list_repeat2-698d7f4.json new file mode 100644 index 0000000000..dda23b2b21 --- /dev/null +++ b/tests/reference/cpp-test_list_repeat2-698d7f4.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-test_list_repeat2-698d7f4", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/../integration_tests/test_list_repeat2.py", + "infile_hash": "3f1fa9fd655b76efa451a83734ddc61af0a917090588ef53afe30b04", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-test_list_repeat2-698d7f4.stdout", + "stdout_hash": "b3979f6c5ea575cbbb0ae75fe566f811f6bb92aca2e698e6d0564326", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-test_list_repeat2-698d7f4.stdout b/tests/reference/cpp-test_list_repeat2-698d7f4.stdout new file mode 100644 index 0000000000..ec53d18482 --- /dev/null +++ b/tests/reference/cpp-test_list_repeat2-698d7f4.stdout @@ -0,0 +1,256 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + + +struct dimension_descriptor +{ + int32_t lower_bound, length; +}; + +struct list_r32 { + int32_t capacity; + int32_t current_end_point; + float* data; +}; + +inline bool compare_list_r32_(struct list_r32 a, struct list_r32 b); +inline bool compare_r32(float a, float b); +inline void print_list_r32_(struct list_r32 a); +inline void print_r32(float a); +inline void list_init_r32(struct list_r32* x, int32_t capacity); +inline void list_deepcopy_r32(struct list_r32* src, struct list_r32* dest); +inline void resize_if_needed_r32(struct list_r32* x); +inline void list_append_r32(struct list_r32* x, float element); +inline void list_insert_r32(struct list_r32* x, int pos, float element); +inline int list_find_item_r32(struct list_r32* x, float element); +inline void list_remove_r32(struct list_r32* x, float element); +inline void list_clear_r32(struct list_r32* x); +inline struct list_r32* list_concat_r32(struct list_r32* left, struct list_r32* right); +inline struct list_r32* list_repeat_r32(struct list_r32* x, int32_t freq); +inline struct list_r32* list_section_r32(struct list_r32* x, int32_t idx1, int32_t idx2, int32_t step, bool i1_present, bool i2_present); + +// Forward declarations +void __main__global_stmts(); +float add_list(struct list_r32 x); +struct list_r32 create_list(int32_t n); +void main0(); +namespace { +} + +// Implementations +struct list_r32 create_list(int32_t n) +{ + struct list_r32 _lpython_return_variable; + int32_t i; + struct list_r32 x; + struct list_r32 constname0; + list_init_r32(&constname0, 1); + constname0.data[0] = 0.00000000000000000e+00; + constname0.current_end_point = 1; + list_deepcopy_r32(&(*list_repeat_r32(&constname0, n)), &x); + + for (i=0; i<=n - 1; i++) { + x.data[i] = (float)(i); + } + list_deepcopy_r32(&x, &_lpython_return_variable); + + return _lpython_return_variable; +} + +float add_list(struct list_r32 x) +{ + float _lpython_return_variable; + int32_t i; + float sum; + sum = 0.00000000000000000e+00; + for (i=0; i<=x.current_end_point - 1; i++) { + sum = sum + x.data[i]; + } + _lpython_return_variable = sum; + return _lpython_return_variable; +} + +void main0() +{ + struct list_r32 x; + struct list_r32 constname01 = create_list(10); + list_deepcopy_r32(&constname01, &x); + + std::cout << add_list(x) << std::endl; +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} + +bool compare_r32(float a, float b) { + return a == b; +} + +bool compare_list_r32_(struct list_r32 a, struct list_r32 b) { + if (a.current_end_point != b.current_end_point) + return false; + for (int i=0; icapacity = capacity; + x->current_end_point = 0; + x->data = (float*) malloc(capacity * sizeof(float)); +} + +void list_deepcopy_r32(struct list_r32* src, struct list_r32* dest) { + dest->capacity = src->capacity; + dest->current_end_point = src->current_end_point; + dest->data = (float*) malloc(src->capacity * sizeof(float)); + memcpy(dest->data, src->data, src->capacity * sizeof(float)); +} + +void resize_if_needed_r32(struct list_r32* x) { + if (x->capacity == x->current_end_point) { + x->capacity = 2 * x->capacity + 1; + x->data = (float*) realloc(x->data, x->capacity * sizeof(float)); + } +} + +void list_append_r32(struct list_r32* x, float element) { + resize_if_needed_r32(x); + x->data[x->current_end_point] = element; + x->current_end_point += 1; +} + +void list_insert_r32(struct list_r32* x, int pos, float element) { + resize_if_needed_r32(x); + int pos_ptr = pos; + float tmp_ptr = x->data[pos]; + float tmp; + while (x->current_end_point > pos_ptr) { + tmp = x->data[pos_ptr + 1]; + x->data[pos_ptr + 1] = tmp_ptr; + tmp_ptr = tmp; + pos_ptr++; + } + + x->data[pos] = element; + x->current_end_point += 1; +} + +int list_find_item_r32(struct list_r32* x, float element) { + int el_pos = 0; + while (x->current_end_point > el_pos) { + if (compare_r32(x->data[el_pos], element)) return el_pos; + el_pos++; + } + return -1; +} + +void list_remove_r32(struct list_r32* x, float element) { + int el_pos = list_find_item_r32(x, element); + while (x->current_end_point > el_pos) { + int tmp = el_pos + 1; + x->data[el_pos] = x->data[tmp]; + el_pos = tmp; + } + x->current_end_point -= 1; +} + +void list_clear_r32(struct list_r32* x) { + free(x->data); + x->capacity = 4; + x->current_end_point = 0; + x->data = (float*) malloc(x->capacity * sizeof(float)); +} + +struct list_r32* list_concat_r32(struct list_r32* left, struct list_r32* right) { + struct list_r32 *result = (struct list_r32*)malloc(sizeof(struct list_r32)); + list_init_r32(result, left->current_end_point + right->current_end_point); + memcpy(result->data, left->data, left->current_end_point * sizeof(float)); + memcpy(result->data + left->current_end_point, right->data, right->current_end_point * sizeof(float)); + result->current_end_point = left->current_end_point + right->current_end_point; + return result; +} + +struct list_r32* list_repeat_r32(struct list_r32* x, int32_t freq) { + struct list_r32 *result = (struct list_r32*)malloc(sizeof(struct list_r32)); + list_init_r32(result, x->current_end_point * freq); + for (int i=0; idata[i*x->current_end_point], x->data, x->current_end_point * sizeof(float)); + } + result->current_end_point = x->current_end_point * freq; + return result; +} + +struct list_r32* list_section_r32(struct list_r32* x, int32_t idx1, int32_t idx2, int32_t step, bool i1_present, bool i2_present) { + int s_len = x->current_end_point; + if (step == 0) { + printf("slice step cannot be zero"); + exit(1); + } + idx1 = idx1 < 0 ? idx1 + s_len : idx1; + idx2 = idx2 < 0 ? idx2 + s_len : idx2; + idx1 = i1_present ? idx1 : (step > 0 ? 0 : s_len-1); + idx2 = i2_present ? idx2 : (step > 0 ? s_len : -1); + idx2 = step > 0 ? (idx2 > s_len ? s_len : idx2) : idx2; + idx1 = step < 0 ? (idx1 >= s_len ? s_len-1 : idx1) : idx1; + struct list_r32 *__tmp = (struct list_r32*) malloc(sizeof(struct list_r32)); + list_init_r32(__tmp, 4); + int s_i = idx1; + while((step > 0 && s_i >= idx1 && s_i < idx2) || + (step < 0 && s_i <= idx1 && s_i > idx2)) { + list_append_r32(__tmp, x->data[s_i]); + s_i+=step; + } + return __tmp; +} + + diff --git a/tests/reference/cpp-test_unary_op_03-fd9669a.json b/tests/reference/cpp-test_unary_op_03-fd9669a.json new file mode 100644 index 0000000000..b09b2a94a3 --- /dev/null +++ b/tests/reference/cpp-test_unary_op_03-fd9669a.json @@ -0,0 +1,13 @@ +{ + "basename": "cpp-test_unary_op_03-fd9669a", + "cmd": "lpython --no-color --show-cpp {infile}", + "infile": "tests/../integration_tests/test_unary_op_03.py", + "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", + "outfile": null, + "outfile_hash": null, + "stdout": "cpp-test_unary_op_03-fd9669a.stdout", + "stdout_hash": "50205765dbafb525c90c7551a7217ca5b5c197047dfe471ffd2f4dec", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/cpp-test_unary_op_03-fd9669a.stdout b/tests/reference/cpp-test_unary_op_03-fd9669a.stdout new file mode 100644 index 0000000000..1f8faa116b --- /dev/null +++ b/tests/reference/cpp-test_unary_op_03-fd9669a.stdout @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void f(); +namespace { +} + +// Implementations +void f() +{ + int32_t i; + int32_t res; + i = 5; + res = ~i; + assert (res == -6); + i = -235346; + assert (~i == 235345); +} + +void __main__global_stmts() +{ + f(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/llvm-assert1-8df4f31.json b/tests/reference/llvm-assert1-8df4f31.json new file mode 100644 index 0000000000..f7af1f27c3 --- /dev/null +++ b/tests/reference/llvm-assert1-8df4f31.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-assert1-8df4f31", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/assert1.py", + "infile_hash": "0ff84ea5ccd3d0815cbb66e1c3d3acd61dee7257c98aa1a27ceeef3b", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-assert1-8df4f31.stdout", + "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-assert1-8df4f31.stdout b/tests/reference/llvm-assert1-8df4f31.stdout new file mode 100644 index 0000000000..084a225695 --- /dev/null +++ b/tests/reference/llvm-assert1-8df4f31.stdout @@ -0,0 +1,10 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-bindc_01-c984f09.json b/tests/reference/llvm-bindc_01-c984f09.json new file mode 100644 index 0000000000..b8bf60feb9 --- /dev/null +++ b/tests/reference/llvm-bindc_01-c984f09.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-bindc_01-c984f09", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/../integration_tests/bindc_01.py", + "infile_hash": "3cfb601d3294c470842a85777832f5582ab52cb5bd64c0e02d40deb6", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-bindc_01-c984f09.stdout", + "stdout_hash": "36302aceabcf2682f3e954ab4bc56dd960fe532dc7799cb58baa19a3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-bindc_01-c984f09.stdout b/tests/reference/llvm-bindc_01-c984f09.stdout new file mode 100644 index 0000000000..16f056eec7 --- /dev/null +++ b/tests/reference/llvm-bindc_01-c984f09.stdout @@ -0,0 +1,81 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@queries = global void* null +@x = global i16* null +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [13 x i8] c"%lld%s%lld%s\00", align 1 +@3 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 +@4 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + %0 = load void*, void** @queries, align 8 + %1 = bitcast void* %0 to i16* + store i16* %1, i16** @x, align 8 + %2 = load void*, void** @queries, align 8 + %3 = ptrtoint void* %2 to i64 + %4 = load i16*, i16** @x, align 8 + %5 = ptrtoint i16* %4 to i64 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @2, i32 0, i32 0), i64 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + call void @__module___main___test_issue_1781() + br label %return + +return: ; preds = %.entry + ret void +} + +define void @__module___main___test_issue_1781() { +.entry: + %p = alloca void*, align 8 + store void* null, void** %p, align 8 + %0 = load void*, void** %p, align 8 + %1 = ptrtoint void* %0 to i64 + %2 = icmp eq i64 %1, 0 + br i1 %2, label %then, label %else + +then: ; preds = %.entry + br label %ifcont + +else: ; preds = %.entry + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @3, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +ifcont: ; preds = %else, %then + %3 = load void*, void** %p, align 8 + %4 = ptrtoint void* %3 to i64 + %5 = icmp ne i64 %4, 0 + %6 = xor i1 %5, true + br i1 %6, label %then1, label %else2 + +then1: ; preds = %ifcont + br label %ifcont3 + +else2: ; preds = %ifcont + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @4, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont3 + +ifcont3: ; preds = %else2, %then1 + br label %return + +return: ; preds = %ifcont3 + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +declare void @_lcompilers_print_error(i8*, ...) + +declare void @exit(i32) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-bool1-af4376b.json b/tests/reference/llvm-bool1-af4376b.json new file mode 100644 index 0000000000..8a924e4972 --- /dev/null +++ b/tests/reference/llvm-bool1-af4376b.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-bool1-af4376b", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/bool1.py", + "infile_hash": "f61ed4d1f164753f9f78f63957d4faf040bcd6099e18dbf3e32cf7d5", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-bool1-af4376b.stdout", + "stdout_hash": "cb60cdc2beb220bbe693b54079b5ebc7efcdc2cdc830c3cc0e213c39", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-bool1-af4376b.stdout b/tests/reference/llvm-bool1-af4376b.stdout new file mode 100644 index 0000000000..67423eab3e --- /dev/null +++ b/tests/reference/llvm-bool1-af4376b.stdout @@ -0,0 +1,64 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [6 x i8] c"False\00", align 1 +@3 = private unnamed_addr constant [5 x i8] c"True\00", align 1 +@4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 +@5 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@7 = private unnamed_addr constant [6 x i8] c"False\00", align 1 +@8 = private unnamed_addr constant [5 x i8] c"True\00", align 1 +@9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 +@10 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@11 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@12 = private unnamed_addr constant [6 x i8] c"False\00", align 1 +@13 = private unnamed_addr constant [5 x i8] c"True\00", align 1 +@14 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 +@15 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@17 = private unnamed_addr constant [6 x i8] c"False\00", align 1 +@18 = private unnamed_addr constant [5 x i8] c"True\00", align 1 +@19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + call void @__module___main___test_bool() + br label %return + +return: ; preds = %.entry + ret void +} + +define void @__module___main___test_bool() { +.entry: + %b = alloca i1, align 1 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0)) + store i1 true, i1* %b, align 1 + %0 = load i1, i1* %b, align 1 + %1 = icmp eq i1 %0, false + %2 = select i1 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0) + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @14, i32 0, i32 0), i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @11, i32 0, i32 0)) + store i1 false, i1* %b, align 1 + %3 = load i1, i1* %b, align 1 + %4 = icmp eq i1 %3, false + %5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0) + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0)) + br label %return + +return: ; preds = %.entry + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-expr14-b96b5b1.json b/tests/reference/llvm-expr14-b96b5b1.json new file mode 100644 index 0000000000..a3c6d2f1be --- /dev/null +++ b/tests/reference/llvm-expr14-b96b5b1.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-expr14-b96b5b1", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/expr14.py", + "infile_hash": "d18abc152939c944f6a1e493754cea8b72f0d03d360ab4c9e75ad697", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-expr14-b96b5b1.stdout", + "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-expr14-b96b5b1.stdout b/tests/reference/llvm-expr14-b96b5b1.stdout new file mode 100644 index 0000000000..084a225695 --- /dev/null +++ b/tests/reference/llvm-expr14-b96b5b1.stdout @@ -0,0 +1,10 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-expr_01-54467c1.json b/tests/reference/llvm-expr_01-54467c1.json new file mode 100644 index 0000000000..f3c32d129d --- /dev/null +++ b/tests/reference/llvm-expr_01-54467c1.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-expr_01-54467c1", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/expr_01.py", + "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-expr_01-54467c1.stdout", + "stdout_hash": "8018bddb16bb05f28f77e84b0c4bb63a5515c75d5fee087543a243b5", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-expr_01-54467c1.stdout b/tests/reference/llvm-expr_01-54467c1.stdout new file mode 100644 index 0000000000..1eb63578bf --- /dev/null +++ b/tests/reference/llvm-expr_01-54467c1.stdout @@ -0,0 +1,41 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + call void @__module___main___main0() + br label %return + +return: ; preds = %.entry + ret void +} + +define void @__module___main___main0() { +.entry: + %x = alloca i32, align 4 + %x2 = alloca i64, align 8 + %y = alloca float, align 4 + %y2 = alloca double, align 8 + store i32 25, i32* %x, align 4 + %0 = load i32, i32* %x, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + br label %return + +return: ; preds = %.entry + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-func_inline_01-2d4583a.json b/tests/reference/llvm-func_inline_01-2d4583a.json new file mode 100644 index 0000000000..075a1dfc5f --- /dev/null +++ b/tests/reference/llvm-func_inline_01-2d4583a.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-func_inline_01-2d4583a", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/../integration_tests/func_inline_01.py", + "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-func_inline_01-2d4583a.stdout", + "stdout_hash": "a91f2155136dbc019a41e5b1006d9b4a9e1f7def08086e307aafd15c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-func_inline_01-2d4583a.stdout b/tests/reference/llvm-func_inline_01-2d4583a.stdout new file mode 100644 index 0000000000..ec43646d47 --- /dev/null +++ b/tests/reference/llvm-func_inline_01-2d4583a.stdout @@ -0,0 +1,100 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [7 x i8] c"%lld%s\00", align 1 +@3 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + call void @__module___main____xx_lcompilers_changed_main_xx() + br label %return + +return: ; preds = %.entry + ret void +} + +define i64 @__module___main___fib(i64* %n) { +.entry: + %call_arg_value1 = alloca i64, align 8 + %call_arg_value = alloca i64, align 8 + %_lpython_return_variable = alloca i64, align 8 + %0 = load i64, i64* %n, align 4 + %1 = icmp slt i64 %0, 2 + br i1 %1, label %then, label %else + +then: ; preds = %.entry + %2 = load i64, i64* %n, align 4 + store i64 %2, i64* %_lpython_return_variable, align 4 + br label %return + +unreachable_after_return: ; No predecessors! + br label %ifcont + +else: ; preds = %.entry + br label %ifcont + +ifcont: ; preds = %else, %unreachable_after_return + %3 = load i64, i64* %n, align 4 + %4 = sub i64 %3, 1 + store i64 %4, i64* %call_arg_value, align 4 + %5 = call i64 @__module___main___fib(i64* %call_arg_value) + %6 = load i64, i64* %n, align 4 + %7 = sub i64 %6, 2 + store i64 %7, i64* %call_arg_value1, align 4 + %8 = call i64 @__module___main___fib(i64* %call_arg_value1) + %9 = add i64 %5, %8 + store i64 %9, i64* %_lpython_return_variable, align 4 + br label %return + +unreachable_after_return2: ; No predecessors! + br label %return + +return: ; preds = %unreachable_after_return2, %ifcont, %then + %10 = load i64, i64* %_lpython_return_variable, align 4 + ret i64 %10 +} + +define void @__module___main____xx_lcompilers_changed_main_xx() { +.entry: + %ans = alloca i64, align 8 + %x = alloca i64, align 8 + store i64 40, i64* %x, align 4 + %0 = call i64 @__module___main___fib(i64* %x) + store i64 %0, i64* %ans, align 4 + %1 = load i64, i64* %ans, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i32 0, i32 0), i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + %2 = load i64, i64* %ans, align 4 + %3 = icmp eq i64 %2, 102334155 + br i1 %3, label %then, label %else + +then: ; preds = %.entry + br label %ifcont + +else: ; preds = %.entry + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @3, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +ifcont: ; preds = %else, %then + br label %return + +return: ; preds = %ifcont + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +declare void @_lcompilers_print_error(i8*, ...) + +declare void @exit(i32) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-lpython1-23c5987.json b/tests/reference/llvm-lpython1-23c5987.json new file mode 100644 index 0000000000..326c58af5a --- /dev/null +++ b/tests/reference/llvm-lpython1-23c5987.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-lpython1-23c5987", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/lpython1.py", + "infile_hash": "195a467b66705e0f2638aee8c8a6e9145112b2964e05896c328e0d86", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-lpython1-23c5987.stdout", + "stdout_hash": "15764832892f7e0cd2a438b247a148564f5f83b3a00ca929bd9cc625", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-lpython1-23c5987.stdout b/tests/reference/llvm-lpython1-23c5987.stdout new file mode 100644 index 0000000000..084a225695 --- /dev/null +++ b/tests/reference/llvm-lpython1-23c5987.stdout @@ -0,0 +1,10 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-print_04-443a8d8.json b/tests/reference/llvm-print_04-443a8d8.json new file mode 100644 index 0000000000..6edad74b2a --- /dev/null +++ b/tests/reference/llvm-print_04-443a8d8.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-print_04-443a8d8", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/../integration_tests/print_04.py", + "infile_hash": "88affcdc1013b979debbf8b47a481909670b62c91fc5963af42c2495", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-print_04-443a8d8.stdout", + "stdout_hash": "5fd7d7df606b54cd4d8304825a94448d366762055fdc5de73c61738c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-print_04-443a8d8.stdout b/tests/reference/llvm-print_04-443a8d8.stdout new file mode 100644 index 0000000000..520f8a3d65 --- /dev/null +++ b/tests/reference/llvm-print_04-443a8d8.stdout @@ -0,0 +1,46 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@u = global i64 -922337203685477580 +@x = global i32 -2147483648 +@y = global i16 -32768 +@z = global i8 -128 +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [7 x i8] c"%lld%s\00", align 1 +@3 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@5 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 +@6 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@7 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@8 = private unnamed_addr constant [6 x i8] c"%hi%s\00", align 1 +@9 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@11 = private unnamed_addr constant [7 x i8] c"%hhi%s\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + %0 = load i64, i64* @u, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @2, i32 0, i32 0), i64 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + %1 = load i32, i32* @x, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) + %2 = load i16, i16* @y, align 2 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @8, i32 0, i32 0), i16 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @7, i32 0, i32 0)) + %3 = load i8, i8* @z, align 1 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @11, i32 0, i32 0), i8 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) + br label %return + +return: ; preds = %.entry + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-structs_11-09fea6a.json b/tests/reference/llvm-structs_11-09fea6a.json new file mode 100644 index 0000000000..861941353b --- /dev/null +++ b/tests/reference/llvm-structs_11-09fea6a.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-structs_11-09fea6a", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/structs_11.py", + "infile_hash": "9cb6c80ad837ba66472a91b22e9068ec439b6a2a179a452d90d84c78", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-structs_11-09fea6a.stdout", + "stdout_hash": "c6cdeacf6cdb7b9a5e68d2263a28585e68ec51e11f544fd366eac428", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-structs_11-09fea6a.stdout b/tests/reference/llvm-structs_11-09fea6a.stdout new file mode 100644 index 0000000000..c72ba9709d --- /dev/null +++ b/tests/reference/llvm-structs_11-09fea6a.stdout @@ -0,0 +1,45 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +%Bar = type { %Foo } +%Foo = type { i32 } + +@bar = global %Bar zeroinitializer +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 +@3 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@5 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 + +define void @__module___main_____main__global_init() { +.entry: + br label %return + +return: ; preds = %.entry + ret void +} + +define void @__module___main_____main__global_stmts() { +.entry: + %0 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) + %1 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) + br label %return + +return: ; preds = %.entry + ret void +} + +declare void @_lfortran_printf(i8*, ...) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_init() + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-test_issue_518-cdb641a.json b/tests/reference/llvm-test_issue_518-cdb641a.json new file mode 100644 index 0000000000..e11cc83f6d --- /dev/null +++ b/tests/reference/llvm-test_issue_518-cdb641a.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-test_issue_518-cdb641a", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_issue_518.py", + "infile_hash": "9cf223e018e0affc76044dff23cb75157fbdca458be3ae68871da8db", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-test_issue_518-cdb641a.stdout", + "stdout_hash": "61bea2762ce630ed6295649a1653e608a77cc1165f7575d28fdfefd1", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-test_issue_518-cdb641a.stdout b/tests/reference/llvm-test_issue_518-cdb641a.stdout new file mode 100644 index 0000000000..00236ee26f --- /dev/null +++ b/tests/reference/llvm-test_issue_518-cdb641a.stdout @@ -0,0 +1,121 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 +@1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + call void @__module___main___main0() + call void @__module___main____xx_lcompilers_changed_main_xx() + br label %return + +return: ; preds = %.entry + ret void +} + +define i64 @__module___main___fib(i64* %n) { +.entry: + %call_arg_value1 = alloca i64, align 8 + %call_arg_value = alloca i64, align 8 + %_lpython_return_variable = alloca i64, align 8 + %0 = load i64, i64* %n, align 4 + %1 = icmp slt i64 %0, 2 + br i1 %1, label %then, label %else + +then: ; preds = %.entry + %2 = load i64, i64* %n, align 4 + store i64 %2, i64* %_lpython_return_variable, align 4 + br label %return + +unreachable_after_return: ; No predecessors! + br label %ifcont + +else: ; preds = %.entry + %3 = load i64, i64* %n, align 4 + %4 = sub i64 %3, 1 + store i64 %4, i64* %call_arg_value, align 4 + %5 = call i64 @__module___main___fib(i64* %call_arg_value) + %6 = load i64, i64* %n, align 4 + %7 = sub i64 %6, 2 + store i64 %7, i64* %call_arg_value1, align 4 + %8 = call i64 @__module___main___fib(i64* %call_arg_value1) + %9 = add i64 %5, %8 + store i64 %9, i64* %_lpython_return_variable, align 4 + br label %return + +unreachable_after_return2: ; No predecessors! + br label %ifcont + +ifcont: ; preds = %unreachable_after_return2, %unreachable_after_return + br label %return + +return: ; preds = %ifcont, %else, %then + %10 = load i64, i64* %_lpython_return_variable, align 4 + ret i64 %10 +} + +define void @__module___main____xx_lcompilers_changed_main_xx() { +.entry: + %call_arg_value = alloca i64, align 8 + %ans = alloca i64, align 8 + store i64 10, i64* %call_arg_value, align 4 + %0 = call i64 @__module___main___fib(i64* %call_arg_value) + store i64 %0, i64* %ans, align 4 + %1 = load i64, i64* %ans, align 4 + %2 = icmp eq i64 %1, 55 + br i1 %2, label %then, label %else + +then: ; preds = %.entry + br label %ifcont + +else: ; preds = %.entry + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @0, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +ifcont: ; preds = %else, %then + br label %return + +return: ; preds = %ifcont + ret void +} + +define void @__module___main___main0() { +.entry: + %call_arg_value = alloca i64, align 8 + %ans = alloca i64, align 8 + store i64 15, i64* %call_arg_value, align 4 + %0 = call i64 @__module___main___fib(i64* %call_arg_value) + store i64 %0, i64* %ans, align 4 + %1 = load i64, i64* %ans, align 4 + %2 = icmp eq i64 %1, 610 + br i1 %2, label %then, label %else + +then: ; preds = %.entry + br label %ifcont + +else: ; preds = %.entry + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +ifcont: ; preds = %else, %then + br label %return + +return: ; preds = %ifcont + ret void +} + +declare void @_lcompilers_print_error(i8*, ...) + +declare void @exit(i32) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm-test_unary_op_03-046fb86.json b/tests/reference/llvm-test_unary_op_03-046fb86.json new file mode 100644 index 0000000000..d6390dde20 --- /dev/null +++ b/tests/reference/llvm-test_unary_op_03-046fb86.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm-test_unary_op_03-046fb86", + "cmd": "lpython --no-color --show-llvm {infile} -o {outfile}", + "infile": "tests/../integration_tests/test_unary_op_03.py", + "infile_hash": "ce63509c56eb6c68ca6d64cc2a195644f3d2fc285f3ec8865551eff5", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm-test_unary_op_03-046fb86.stdout", + "stdout_hash": "1e9e596b5383d76430007e2e89893f64e5b07c21d46edeea5bd5acba", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm-test_unary_op_03-046fb86.stdout b/tests/reference/llvm-test_unary_op_03-046fb86.stdout new file mode 100644 index 0000000000..f460174a28 --- /dev/null +++ b/tests/reference/llvm-test_unary_op_03-046fb86.stdout @@ -0,0 +1,69 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 +@1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 + +define void @__module___main_____main__global_stmts() { +.entry: + call void @__module___main___f() + br label %return + +return: ; preds = %.entry + ret void +} + +define void @__module___main___f() { +.entry: + %i = alloca i32, align 4 + %res = alloca i32, align 4 + store i32 5, i32* %i, align 4 + %0 = load i32, i32* %i, align 4 + %1 = xor i32 %0, -1 + store i32 %1, i32* %res, align 4 + %2 = load i32, i32* %res, align 4 + %3 = icmp eq i32 %2, -6 + br i1 %3, label %then, label %else + +then: ; preds = %.entry + br label %ifcont + +else: ; preds = %.entry + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @0, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +ifcont: ; preds = %else, %then + store i32 -235346, i32* %i, align 4 + %4 = load i32, i32* %i, align 4 + %5 = xor i32 %4, -1 + %6 = icmp eq i32 %5, 235345 + br i1 %6, label %then1, label %else2 + +then1: ; preds = %ifcont + br label %ifcont3 + +else2: ; preds = %ifcont + call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont3 + +ifcont3: ; preds = %else2, %then1 + br label %return + +return: ; preds = %ifcont3 + ret void +} + +declare void @_lcompilers_print_error(i8*, ...) + +declare void @exit(i32) + +define i32 @main(i32 %0, i8** %1) { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1) + call void @__module___main_____main__global_stmts() + ret i32 0 +} + +declare void @_lpython_set_argv(i32, i8**) diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.json b/tests/reference/llvm_dbg-expr_01-9fc5f30.json new file mode 100644 index 0000000000..c139101c1d --- /dev/null +++ b/tests/reference/llvm_dbg-expr_01-9fc5f30.json @@ -0,0 +1,13 @@ +{ + "basename": "llvm_dbg-expr_01-9fc5f30", + "cmd": "lpython --no-color --show-llvm -g --debug-with-line-column {infile} -o {outfile}", + "infile": "tests/expr_01.py", + "infile_hash": "4284fe3a1b4dd3e5d1de1357a79e9a25b426ca245b4cc91cf99e8547", + "outfile": null, + "outfile_hash": null, + "stdout": "llvm_dbg-expr_01-9fc5f30.stdout", + "stdout_hash": "f5424d14e2553fd4ea59a66c0d1560e435f0871cdfc5250f6a5df57d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout b/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout new file mode 100644 index 0000000000..c942af4f3a --- /dev/null +++ b/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout @@ -0,0 +1,79 @@ +; ModuleID = 'LFortran' +source_filename = "LFortran" + +@0 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1 + +define void @__module___main_____main__global_stmts() !dbg !3 { +.entry: + call void @__module___main___main0(), !dbg !6 + br label %return, !dbg !6 + +return: ; preds = %.entry + ret void, !dbg !6 +} + +define void @__module___main___main0() !dbg !7 { +.entry: + %x = alloca i32, align 4, !dbg !8 + call void @llvm.dbg.declare(metadata i32* %x, metadata !9, metadata !DIExpression()), !dbg !11 + %x2 = alloca i64, align 8 + call void @llvm.dbg.declare(metadata i64* %x2, metadata !12, metadata !DIExpression()), !dbg !14 + %y = alloca float, align 4 + call void @llvm.dbg.declare(metadata float* %y, metadata !15, metadata !DIExpression()), !dbg !17 + %y2 = alloca double, align 8 + call void @llvm.dbg.declare(metadata double* %y2, metadata !18, metadata !DIExpression()), !dbg !20 + store i32 25, i32* %x, align 4, !dbg !21 + %0 = load i32, i32* %x, align 4, !dbg !21 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)), !dbg !21 + br label %return, !dbg !21 + +return: ; preds = %.entry + ret void, !dbg !21 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 + +declare void @_lfortran_printf(i8*, ...) + +define i32 @main(i32 %0, i8** %1) !dbg !22 { +.entry: + call void @_lpython_set_argv(i32 %0, i8** %1), !dbg !25 + call void @__module___main_____main__global_stmts(), !dbg !25 + ret i32 0, !dbg !25 +} + +declare void @_lpython_set_argv(i32, i8**) + +attributes #0 = { nounwind readnone speculatable willreturn } + +!llvm.dbg.cu = !{!0} + +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "LPython Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "tests/expr_01.py", directory: ".") +!2 = !{} +!3 = distinct !DISubprogram(name: "__main__global_stmts", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) +!4 = !DISubroutineType(types: !5) +!5 = !{null} +!6 = !DILocation(line: 9, column: 1, scope: !3) +!7 = distinct !DISubprogram(name: "main0", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) +!8 = !DILocation(line: 1, column: 1, scope: !7) +!9 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 2, type: !10) +!10 = !DIBasicType(name: "integer", size: 32, encoding: DW_ATE_signed) +!11 = !DILocation(line: 2, scope: !7) +!12 = !DILocalVariable(name: "x2", arg: 2, scope: !7, file: !1, line: 3, type: !13) +!13 = !DIBasicType(name: "integer", size: 64, encoding: DW_ATE_signed) +!14 = !DILocation(line: 3, scope: !7) +!15 = !DILocalVariable(name: "y", arg: 3, scope: !7, file: !1, line: 4, type: !16) +!16 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) +!17 = !DILocation(line: 4, scope: !7) +!18 = !DILocalVariable(name: "y2", arg: 4, scope: !7, file: !1, line: 5, type: !19) +!19 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +!20 = !DILocation(line: 5, scope: !7) +!21 = !DILocation(line: 6, column: 5, scope: !7) +!22 = distinct !DISubprogram(name: "main_program", scope: !1, file: !1, line: 1, type: !23, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) +!23 = !DISubroutineType(types: !24) +!24 = !{!10} +!25 = !DILocation(line: 1, column: 1, scope: !22) diff --git a/tests/reference/pass_class_constructor-structs_16-5e3508f.json b/tests/reference/pass_class_constructor-structs_16-5e3508f.json new file mode 100644 index 0000000000..62901bd56c --- /dev/null +++ b/tests/reference/pass_class_constructor-structs_16-5e3508f.json @@ -0,0 +1,13 @@ +{ + "basename": "pass_class_constructor-structs_16-5e3508f", + "cmd": "lpython --cumulative --pass=class_constructor --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/structs_16.py", + "infile_hash": "e87ea0ba10cb7fcd6ce2eb6d2e953a26dcd6a843f6cf4e891287dcb1", + "outfile": null, + "outfile_hash": null, + "stdout": "pass_class_constructor-structs_16-5e3508f.stdout", + "stdout_hash": "74b7cad17c2d6f7774e930e8a24b9bf35ca37425c7a3fa6f4851ef84", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout b/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout new file mode 100644 index 0000000000..a3b30d3762 --- /dev/null +++ b/tests/reference/pass_class_constructor-structs_16-5e3508f.stdout @@ -0,0 +1,356 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 3 + { + B: + (UnionType + (SymbolTable + 4 + { + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + B + [] + [x + y] + Source + Public + [(()) + (())] + () + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Union + 3 B + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + A + [] + [b + c] + Source + Public + .false. + .false. + [(()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_ordering] + [] + [(SubroutineCall + 2 test_ordering + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_ordering: + (Function + (SymbolTable + 5 + { + 1_A_b: + (ExternalSymbol + 5 + 1_A_b + 3 b + A + [] + b + Public + ), + 1_A_c: + (ExternalSymbol + 5 + 1_A_c + 3 c + A + [] + c + Public + ), + A_B: + (ExternalSymbol + 5 + A_B + 3 B + A + [] + B + Public + ), + ad: + (Variable + 5 + ad + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + bd: + (Variable + 5 + bd + [] + Local + () + () + Default + (Union + 5 A_B + ) + () + Source + Public + Required + .false. + ) + }) + test_ordering + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 bd) + (UnionTypeConstructor + 5 A_B + [] + (Union + 5 A_B + ) + () + ) + () + ) + (= + (UnionInstanceMember + (Var 5 bd) + 4 x + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (StructInstanceMember + (Var 5 ad) + 5 1_A_b + (Union + 3 B + ) + () + ) + (Var 5 bd) + () + ) + (= + (StructInstanceMember + (Var 5 ad) + 5 1_A_c + (Integer 4) + () + ) + (IntegerConstant 2 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (UnionInstanceMember + (StructInstanceMember + (Var 5 ad) + 3 b + (Union + 3 B + ) + () + ) + 4 x + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 5 ad) + 3 c + (Integer 4) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json new file mode 100644 index 0000000000..b388bc658f --- /dev/null +++ b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.json @@ -0,0 +1,13 @@ +{ + "basename": "pass_inline_function_calls-func_inline_01-8b6a5da", + "cmd": "lpython --pass=inline_function_calls --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/func_inline_01.py", + "infile_hash": "65a2e9a9bc7ad68a5e104549eed00cafd02b643a1d91ab2e175b2198", + "outfile": null, + "outfile_hash": null, + "stdout": "pass_inline_function_calls-func_inline_01-8b6a5da.stdout", + "stdout_hash": "7663857180d522294ed1b3012593172c8ffde3c3fa016f8c0f8185aa", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout new file mode 100644 index 0000000000..8bb565e306 --- /dev/null +++ b/tests/reference/pass_inline_function_calls-func_inline_01-8b6a5da.stdout @@ -0,0 +1,432 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 5 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main] + [] + [(SubroutineCall + 2 main + () + [] + () + )] + () + Public + .false. + .false. + () + ), + fib: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + n: + (Variable + 3 + n + [] + In + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + fib + (FunctionType + [(Integer 8)] + (Integer 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [fib] + [(Var 3 n)] + [(If + (IntegerCompare + (Var 3 n) + Lt + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Logical 4) + () + ) + [(= + (Var 3 _lpython_return_variable) + (Var 3 n) + () + ) + (Return)] + [] + ) + (= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 3 n) + Sub + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + Add + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 3 n) + Sub + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + (Integer 8) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ), + main: + (Function + (SymbolTable + 4 + { + _lpython_return_variable_fib: + (Variable + 4 + _lpython_return_variable_fib + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + ans: + (Variable + 4 + ans + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + n_fib: + (Variable + 4 + n_fib + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + ~empty_block: + (Block + (SymbolTable + 7 + { + + }) + ~empty_block + [] + ) + }) + main + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [fib] + [] + [(= + (Var 4 x) + (Cast + (IntegerConstant 40 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 40 (Integer 8)) + ) + () + ) + (= + (Var 4 n_fib) + (Var 4 x) + () + ) + (If + (IntegerCompare + (Var 4 n_fib) + Lt + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Logical 4) + () + ) + [(= + (Var 4 _lpython_return_variable_fib) + (Var 4 n_fib) + () + ) + (GoTo + 1 + __1 + )] + [] + ) + (= + (Var 4 _lpython_return_variable_fib) + (IntegerBinOp + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 4 n_fib) + Sub + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + Add + (FunctionCall + 2 fib + () + [((IntegerBinOp + (Var 4 n_fib) + Sub + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Integer 8) + () + ))] + (Integer 8) + () + () + ) + (Integer 8) + () + ) + () + ) + (GoTo + 1 + __1 + ) + (BlockCall + 1 + 4 ~empty_block + ) + (= + (Var 4 ans) + (Var 4 _lpython_return_variable_fib) + () + ) + (Print + () + [(Var 4 ans)] + () + () + ) + (Assert + (IntegerCompare + (Var 4 ans) + Eq + (Cast + (IntegerConstant 102334155 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 102334155 (Integer 8)) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 6 + { + __main__global_stmts: + (ExternalSymbol + 6 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 6 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json new file mode 100644 index 0000000000..e023d7e0eb --- /dev/null +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json @@ -0,0 +1,13 @@ +{ + "basename": "pass_loop_vectorise-vec_01-be9985e", + "cmd": "lpython --pass=loop_vectorise --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/vec_01.py", + "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "pass_loop_vectorise-vec_01-be9985e.stderr", + "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr new file mode 100644 index 0000000000..0371022cc6 --- /dev/null +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr @@ -0,0 +1,17 @@ +warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded + --> tests/../integration_tests/vec_01.py:2:1 + | +2 | from numpy import empty, float64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here + +warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded + --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 + | +364 | return x1 % x2 + | ^^^^^^^ imported here + +semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' + --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 + | +209 | if (n_ - (n_ // 2)*2) == 0: + | ^^^^^^^ diff --git a/tests/reference/pass_print_list_tuple-print_02-09600eb.json b/tests/reference/pass_print_list_tuple-print_02-09600eb.json new file mode 100644 index 0000000000..ef9da7864b --- /dev/null +++ b/tests/reference/pass_print_list_tuple-print_02-09600eb.json @@ -0,0 +1,13 @@ +{ + "basename": "pass_print_list_tuple-print_02-09600eb", + "cmd": "lpython --pass=print_list_tuple --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/print_02.py", + "infile_hash": "c4513f1b2ab1a2f33a0784fe80b4d32b506c05799b0c920c4f5b0411", + "outfile": null, + "outfile_hash": null, + "stdout": "pass_print_list_tuple-print_02-09600eb.stdout", + "stdout_hash": "92cf61833ce7c5944c99f073590128d6199de5ae303f96c4a384ee19", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout b/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout new file mode 100644 index 0000000000..98d84e254e --- /dev/null +++ b/tests/reference/pass_print_list_tuple-print_02-09600eb.stdout @@ -0,0 +1,8761 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 8 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 7 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f + test_nested_lists + test_nested_lists2 + test_print_list_tuple] + [] + [(SubroutineCall + 2 f + () + [] + () + ) + (SubroutineCall + 2 test_nested_lists + () + [] + () + ) + (SubroutineCall + 2 test_nested_lists2 + () + [] + () + ) + (SubroutineCall + 2 test_print_list_tuple + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + __list_iterator: + (Variable + 3 + __list_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator1: + (Variable + 3 + __list_iterator1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator10: + (Variable + 3 + __list_iterator10 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator11: + (Variable + 3 + __list_iterator11 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator12: + (Variable + 3 + __list_iterator12 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator13: + (Variable + 3 + __list_iterator13 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator14: + (Variable + 3 + __list_iterator14 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator15: + (Variable + 3 + __list_iterator15 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator16: + (Variable + 3 + __list_iterator16 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator17: + (Variable + 3 + __list_iterator17 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator18: + (Variable + 3 + __list_iterator18 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator2: + (Variable + 3 + __list_iterator2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator3: + (Variable + 3 + __list_iterator3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator4: + (Variable + 3 + __list_iterator4 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator5: + (Variable + 3 + __list_iterator5 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator6: + (Variable + 3 + __list_iterator6 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator7: + (Variable + 3 + __list_iterator7 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator8: + (Variable + 3 + __list_iterator8 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator9: + (Variable + 3 + __list_iterator9 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 3 + a + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (List + (Real 8) + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 3 + d + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 a) + (ListConstant + [(StringConstant + "ab" + (Character 1 2 ()) + ) + (StringConstant + "abc" + (Character 1 3 ()) + ) + (StringConstant + "abcd" + (Character 1 4 ()) + )] + (List + (Character 1 2 ()) + ) + ) + () + ) + (= + (Var 3 b) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 3 c) + (ListConstant + [(RealConstant + 1.230000 + (Real 8) + ) + (RealConstant + 324.300000 + (Real 8) + ) + (RealConstant + 56.431000 + (Real 8) + ) + (RealConstant + 90.500000 + (Real 8) + ) + (RealConstant + 34.100000 + (Real 8) + )] + (List + (Real 8) + ) + ) + () + ) + (= + (Var 3 d) + (ListConstant + [] + (List + (Integer 4) + ) + ) + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator1) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 b) + (Var 3 __list_iterator1) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator1) + Lt + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator2) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 c) + (Var 3 __list_iterator2) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator2) + Lt + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator3) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 d) + (Var 3 __list_iterator3) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator3) + Lt + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator4) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator4) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator4) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator5) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator5) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator5) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator6) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 b) + (Var 3 __list_iterator6) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator6) + Lt + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator7) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 c) + (Var 3 __list_iterator7) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator7) + Lt + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator8) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 d) + (Var 3 __list_iterator8) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator8) + Lt + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator9) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator9) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator9) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator10) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator10) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator10) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(IntegerConstant 1 (Integer 4))] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator11) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 b) + (Var 3 __list_iterator11) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator11) + Lt + (IntegerBinOp + (ListLen + (Var 3 b) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator12) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 c) + (Var 3 __list_iterator12) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator12) + Lt + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(RealConstant + 1.100000 + (Real 8) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator13) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 d) + (Var 3 __list_iterator13) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator13) + Lt + (IntegerBinOp + (ListLen + (Var 3 d) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator14) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 0 (Integer 4))] + (List + (Integer 4) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 0 (Integer 4))] + (List + (Integer 4) + ) + ) + (Var 3 __list_iterator14) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator14) + Lt + (IntegerBinOp + (ListLen + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 0 (Integer 4))] + (List + (Integer 4) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator15) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "d" + (Character 1 1 ()) + ) + (StringConstant + "e" + (Character 1 1 ()) + ) + (StringConstant + "f" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "d" + (Character 1 1 ()) + ) + (StringConstant + "e" + (Character 1 1 ()) + ) + (StringConstant + "f" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (Var 3 __list_iterator15) + (Character 1 1 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator15) + Lt + (IntegerBinOp + (ListLen + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "d" + (Character 1 1 ()) + ) + (StringConstant + "e" + (Character 1 1 ()) + ) + (StringConstant + "f" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator16) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + (Var 3 __list_iterator16) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator16) + Lt + (IntegerBinOp + (ListLen + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator17) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 3 a) + (Var 3 __list_iterator17) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator17) + Lt + (IntegerBinOp + (ListLen + (Var 3 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator18) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 3 c) + (Var 3 __list_iterator18) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator18) + Lt + (IntegerBinOp + (ListLen + (Var 3 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + test_nested_lists: + (Function + (SymbolTable + 4 + { + __list_iterator: + (Variable + 4 + __list_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator1: + (Variable + 4 + __list_iterator1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator10: + (Variable + 4 + __list_iterator10 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator11: + (Variable + 4 + __list_iterator11 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator2: + (Variable + 4 + __list_iterator2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator3: + (Variable + 4 + __list_iterator3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator4: + (Variable + 4 + __list_iterator4 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator5: + (Variable + 4 + __list_iterator5 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator6: + (Variable + 4 + __list_iterator6 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator7: + (Variable + 4 + __list_iterator7 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator8: + (Variable + 4 + __list_iterator8 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator9: + (Variable + 4 + __list_iterator9 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + w: + (Variable + 4 + w + [] + Local + () + () + Default + (List + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (List + (List + (List + (Integer 4) + ) + ) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (List + (List + (Real 8) + ) + ) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + Local + () + () + Default + (List + (List + (Character 1 -2 ()) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_nested_lists + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 w) + (ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 2.130000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 98.170000 + (Real 8) + ) + (Real 8) + (RealConstant + -98.170000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 1.110000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + )] + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + )] + (List + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + ) + () + ) + (= + (Var 4 x) + (ListConstant + [(ListConstant + [(ListConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + )] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (IntegerConstant 5 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 5 (Integer 4))] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + ) + (ListConstant + [(ListConstant + [(IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 2 (Integer 4)) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + )] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + )] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + )] + (List + (List + (List + (Integer 4) + ) + ) + ) + ) + () + ) + (= + (Var 4 y) + (ListConstant + [(ListConstant + [(RealConstant + 3.140000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 1.001200 + (Real 8) + ) + (Real 8) + (RealConstant + -1.001200 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 2.380000 + (Real 8) + ) + (Real 8) + (RealConstant + -2.380000 + (Real 8) + ) + ) + (RealConstant + 5.510000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + () + ) + (= + (Var 4 z) + (ListConstant + [(ListConstant + [(StringConstant + "bat" + (Character 1 3 ()) + ) + (StringConstant + "ball" + (Character 1 4 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "cat" + (Character 1 3 ()) + ) + (StringConstant + "dog" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "c++" + (Character 1 3 ()) + ) + (StringConstant + "java" + (Character 1 4 ()) + ) + (StringConstant + "python" + (Character 1 6 ()) + )] + (List + (Character 1 1 ()) + ) + )] + (List + (List + (Character 1 3 ()) + ) + ) + ) + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 4 w) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator1) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator2) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator3) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 4 __list_iterator2) + (List + (List + (Real 8) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator4) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 4 __list_iterator2) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 4 __list_iterator3) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListItem + (ListItem + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 4 __list_iterator2) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 4 __list_iterator3) + (List + (Real 8) + ) + () + ) + (Var 4 __list_iterator4) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator4) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 4 __list_iterator2) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 4 __list_iterator3) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator3) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 4 __list_iterator2) + (List + (List + (Real 8) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator2) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Var 4 __list_iterator1) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator1) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 4 w) + (Var 4 __list_iterator) + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator) + Lt + (IntegerBinOp + (ListLen + (Var 4 w) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator5) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 4 x) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator6) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 4 x) + (Var 4 __list_iterator5) + (List + (List + (Integer 4) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator7) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 4 x) + (Var 4 __list_iterator5) + (List + (List + (Integer 4) + ) + ) + () + ) + (Var 4 __list_iterator6) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListItem + (ListItem + (Var 4 x) + (Var 4 __list_iterator5) + (List + (List + (Integer 4) + ) + ) + () + ) + (Var 4 __list_iterator6) + (List + (Integer 4) + ) + () + ) + (Var 4 __list_iterator7) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator7) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 4 x) + (Var 4 __list_iterator5) + (List + (List + (Integer 4) + ) + ) + () + ) + (Var 4 __list_iterator6) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator6) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 4 x) + (Var 4 __list_iterator5) + (List + (List + (Integer 4) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator5) + Lt + (IntegerBinOp + (ListLen + (Var 4 x) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator8) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 4 y) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator9) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 4 y) + (Var 4 __list_iterator8) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListItem + (Var 4 y) + (Var 4 __list_iterator8) + (List + (Real 8) + ) + () + ) + (Var 4 __list_iterator9) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator9) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 4 y) + (Var 4 __list_iterator8) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator8) + Lt + (IntegerBinOp + (ListLen + (Var 4 y) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator10) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 4 z) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 4 __list_iterator11) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 4 z) + (Var 4 __list_iterator10) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (ListItem + (Var 4 z) + (Var 4 __list_iterator10) + (List + (Character 1 -2 ()) + ) + () + ) + (Var 4 __list_iterator11) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator11) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 4 z) + (Var 4 __list_iterator10) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 4 __list_iterator10) + Lt + (IntegerBinOp + (ListLen + (Var 4 z) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + test_nested_lists2: + (Function + (SymbolTable + 6 + { + __list_iterator: + (Variable + 6 + __list_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator1: + (Variable + 6 + __list_iterator1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator2: + (Variable + 6 + __list_iterator2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator3: + (Variable + 6 + __list_iterator3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator4: + (Variable + 6 + __list_iterator4 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator5: + (Variable + 6 + __list_iterator5 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator6: + (Variable + 6 + __list_iterator6 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator7: + (Variable + 6 + __list_iterator7 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator8: + (Variable + 6 + __list_iterator8 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + p: + (Variable + 6 + p + [] + Local + () + () + Default + (List + (List + (Integer 4) + ) + ) + () + Source + Public + Required + .false. + ), + q: + (Variable + 6 + q + [] + Local + () + () + Default + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + () + Source + Public + Required + .false. + ), + r: + (Variable + 6 + r + [] + Local + () + () + Default + (List + (List + (List + (Character 1 -2 ()) + ) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_nested_lists2 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 p) + (ListConstant + [(ListConstant + [(IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4)) + (IntegerConstant 5 (Integer 4)) + (IntegerConstant 6 (Integer 4)) + (IntegerConstant 7 (Integer 4)) + (IntegerConstant 8 (Integer 4)) + (IntegerConstant 9 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 10 (Integer 4)) + (IntegerConstant 11 (Integer 4)) + (IntegerConstant 12 (Integer 4)) + (IntegerConstant 13 (Integer 4)) + (IntegerConstant 14 (Integer 4)) + (IntegerConstant 15 (Integer 4)) + (IntegerConstant 16 (Integer 4)) + (IntegerConstant 17 (Integer 4)) + (IntegerConstant 18 (Integer 4)) + (IntegerConstant 19 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 20 (Integer 4)) + (IntegerConstant 21 (Integer 4)) + (IntegerConstant 22 (Integer 4)) + (IntegerConstant 23 (Integer 4)) + (IntegerConstant 24 (Integer 4)) + (IntegerConstant 25 (Integer 4)) + (IntegerConstant 26 (Integer 4)) + (IntegerConstant 27 (Integer 4)) + (IntegerConstant 28 (Integer 4)) + (IntegerConstant 29 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 30 (Integer 4)) + (IntegerConstant 31 (Integer 4)) + (IntegerConstant 32 (Integer 4)) + (IntegerConstant 33 (Integer 4)) + (IntegerConstant 34 (Integer 4)) + (IntegerConstant 35 (Integer 4)) + (IntegerConstant 36 (Integer 4)) + (IntegerConstant 37 (Integer 4)) + (IntegerConstant 38 (Integer 4)) + (IntegerConstant 39 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 40 (Integer 4)) + (IntegerConstant 41 (Integer 4)) + (IntegerConstant 42 (Integer 4)) + (IntegerConstant 43 (Integer 4)) + (IntegerConstant 44 (Integer 4)) + (IntegerConstant 45 (Integer 4)) + (IntegerConstant 46 (Integer 4)) + (IntegerConstant 47 (Integer 4)) + (IntegerConstant 48 (Integer 4)) + (IntegerConstant 49 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 50 (Integer 4)) + (IntegerConstant 51 (Integer 4)) + (IntegerConstant 52 (Integer 4)) + (IntegerConstant 53 (Integer 4)) + (IntegerConstant 54 (Integer 4)) + (IntegerConstant 55 (Integer 4)) + (IntegerConstant 56 (Integer 4)) + (IntegerConstant 57 (Integer 4)) + (IntegerConstant 58 (Integer 4)) + (IntegerConstant 59 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 60 (Integer 4)) + (IntegerConstant 61 (Integer 4)) + (IntegerConstant 62 (Integer 4)) + (IntegerConstant 63 (Integer 4)) + (IntegerConstant 64 (Integer 4)) + (IntegerConstant 65 (Integer 4)) + (IntegerConstant 66 (Integer 4)) + (IntegerConstant 67 (Integer 4)) + (IntegerConstant 68 (Integer 4)) + (IntegerConstant 69 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 70 (Integer 4)) + (IntegerConstant 71 (Integer 4)) + (IntegerConstant 72 (Integer 4)) + (IntegerConstant 73 (Integer 4)) + (IntegerConstant 74 (Integer 4)) + (IntegerConstant 75 (Integer 4)) + (IntegerConstant 76 (Integer 4)) + (IntegerConstant 77 (Integer 4)) + (IntegerConstant 78 (Integer 4)) + (IntegerConstant 79 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 80 (Integer 4)) + (IntegerConstant 81 (Integer 4)) + (IntegerConstant 82 (Integer 4)) + (IntegerConstant 83 (Integer 4)) + (IntegerConstant 84 (Integer 4)) + (IntegerConstant 85 (Integer 4)) + (IntegerConstant 86 (Integer 4)) + (IntegerConstant 87 (Integer 4)) + (IntegerConstant 88 (Integer 4)) + (IntegerConstant 89 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 90 (Integer 4)) + (IntegerConstant 91 (Integer 4)) + (IntegerConstant 92 (Integer 4)) + (IntegerConstant 93 (Integer 4)) + (IntegerConstant 94 (Integer 4)) + (IntegerConstant 95 (Integer 4)) + (IntegerConstant 96 (Integer 4)) + (IntegerConstant 97 (Integer 4)) + (IntegerConstant 98 (Integer 4)) + (IntegerConstant 99 (Integer 4))] + (List + (Integer 4) + ) + )] + (List + (List + (Integer 4) + ) + ) + ) + () + ) + (= + (Var 6 q) + (ListConstant + [(ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 74.550000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 77.640000 + (Real 8) + ) + (Real 8) + (RealConstant + -77.640000 + (Real 8) + ) + ) + (RealConstant + 52.350000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 78.250000 + (Real 8) + ) + (Real 8) + (RealConstant + -78.250000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 19.240000 + (Real 8) + ) + (Real 8) + (RealConstant + -19.240000 + (Real 8) + ) + ) + (RealConstant + 81.380000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 7.860000 + (Real 8) + ) + (RealConstant + 12.110000 + (Real 8) + ) + (RealConstant + 27.500000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 98.930000 + (Real 8) + ) + (Real 8) + (RealConstant + -98.930000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 79.620000 + (Real 8) + ) + (Real 8) + (RealConstant + -79.620000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 73.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -73.760000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 42.050000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 90.290000 + (Real 8) + ) + (Real 8) + (RealConstant + -90.290000 + (Real 8) + ) + ) + (RealConstant + 69.950000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 59.320000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 70.780000 + (Real 8) + ) + (Real 8) + (RealConstant + -70.780000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 53.220000 + (Real 8) + ) + (Real 8) + (RealConstant + -53.220000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 53.520000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 93.880000 + (Real 8) + ) + (Real 8) + (RealConstant + -93.880000 + (Real 8) + ) + ) + (RealConstant + 49.650000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 2.180000 + (Real 8) + ) + (RealConstant + 19.910000 + (Real 8) + ) + (RealConstant + 69.240000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 78.510000 + (Real 8) + ) + (RealConstant + 89.690000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 86.680000 + (Real 8) + ) + (Real 8) + (RealConstant + -86.680000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 92.480000 + (Real 8) + ) + (Real 8) + (RealConstant + -92.480000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 80.750000 + (Real 8) + ) + (Real 8) + (RealConstant + -80.750000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 27.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -27.760000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 13.350000 + (Real 8) + ) + (Real 8) + (RealConstant + -13.350000 + (Real 8) + ) + ) + (RealConstant + 12.280000 + (Real 8) + ) + (RealConstant + 79.610000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 48.480000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 10.490000 + (Real 8) + ) + (Real 8) + (RealConstant + -10.490000 + (Real 8) + ) + ) + (RealConstant + 41.100000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 20.330000 + (Real 8) + ) + (RealConstant + 14.520000 + (Real 8) + ) + (RealConstant + 82.560000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 57.760000 + (Real 8) + ) + (Real 8) + (RealConstant + -57.760000 + (Real 8) + ) + ) + (RealConstant + 76.030000 + (Real 8) + ) + (RealConstant + 67.330000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 21.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -21.500000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 11.920000 + (Real 8) + ) + (Real 8) + (RealConstant + -11.920000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 31.840000 + (Real 8) + ) + (Real 8) + (RealConstant + -31.840000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealConstant + 9.650000 + (Real 8) + ) + (RealConstant + 11.150000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 36.580000 + (Real 8) + ) + (Real 8) + (RealConstant + -36.580000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 56.550000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 70.850000 + (Real 8) + ) + (Real 8) + (RealConstant + -70.850000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 50.670000 + (Real 8) + ) + (Real 8) + (RealConstant + -50.670000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 94.630000 + (Real 8) + ) + (RealConstant + 25.680000 + (Real 8) + ) + (RealConstant + 89.300000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + ) + (ListConstant + [(ListConstant + [(ListConstant + [(RealConstant + 28.530000 + (Real 8) + ) + (RealConstant + 71.220000 + (Real 8) + ) + (RealConstant + 71.870000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 58.390000 + (Real 8) + ) + (Real 8) + (RealConstant + -58.390000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 6.960000 + (Real 8) + ) + (Real 8) + (RealConstant + -6.960000 + (Real 8) + ) + ) + (RealConstant + 42.980000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 8.950000 + (Real 8) + ) + (Real 8) + (RealConstant + -8.950000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 75.090000 + (Real 8) + ) + (Real 8) + (RealConstant + -75.090000 + (Real 8) + ) + ) + (RealConstant + 37.960000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 31.750000 + (Real 8) + ) + (Real 8) + (RealConstant + -31.750000 + (Real 8) + ) + ) + (RealConstant + 67.330000 + (Real 8) + ) + (RealConstant + 58.170000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 64.010000 + (Real 8) + ) + (Real 8) + (RealConstant + -64.010000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 9.220000 + (Real 8) + ) + (Real 8) + (RealConstant + -9.220000 + (Real 8) + ) + ) + (RealConstant + 9.590000 + (Real 8) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 15.710000 + (Real 8) + ) + (RealConstant + 82.360000 + (Real 8) + ) + (RealConstant + 51.180000 + (Real 8) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + ) + (ListConstant + [(ListConstant + [(RealUnaryMinus + (RealConstant + 100.290000 + (Real 8) + ) + (Real 8) + (RealConstant + -100.290000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 32.720000 + (Real 8) + ) + (Real 8) + (RealConstant + -32.720000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 54.940000 + (Real 8) + ) + (Real 8) + (RealConstant + -54.940000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealUnaryMinus + (RealConstant + 0.320000 + (Real 8) + ) + (Real 8) + (RealConstant + -0.320000 + (Real 8) + ) + ) + (RealConstant + 68.810000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 55.090000 + (Real 8) + ) + (Real 8) + (RealConstant + -55.090000 + (Real 8) + ) + )] + (List + (Real 8) + ) + ) + (ListConstant + [(RealConstant + 97.280000 + (Real 8) + ) + (RealUnaryMinus + (RealConstant + 28.200000 + (Real 8) + ) + (Real 8) + (RealConstant + -28.200000 + (Real 8) + ) + ) + (RealUnaryMinus + (RealConstant + 62.610000 + (Real 8) + ) + (Real 8) + (RealConstant + -62.610000 + (Real 8) + ) + )] + (List + (Real 8) + ) + )] + (List + (List + (Real 8) + ) + ) + )] + (List + (List + (List + (Real 8) + ) + ) + ) + )] + (List + (List + (List + (List + (Real 8) + ) + ) + ) + ) + ) + () + ) + (= + (Var 6 r) + (ListConstant + [(ListConstant + [(ListConstant + [(StringConstant + "Io" + (Character 1 2 ()) + ) + (StringConstant + "tl" + (Character 1 2 ()) + ) + (StringConstant + "bLvjV" + (Character 1 5 ()) + ) + (StringConstant + "wjFKQ" + (Character 1 5 ()) + ) + (StringConstant + "lY2" + (Character 1 3 ()) + )] + (List + (Character 1 2 ()) + ) + ) + (ListConstant + [(StringConstant + "Be2l6bqE" + (Character 1 8 ()) + ) + (StringConstant + "pQER3utIXA" + (Character 1 10 ()) + ) + (StringConstant + "llZBJj5Cdu" + (Character 1 10 ()) + ) + (StringConstant + "C8" + (Character 1 2 ()) + ) + (StringConstant + "gwTr77PdYR" + (Character 1 10 ()) + )] + (List + (Character 1 8 ()) + ) + ) + (ListConstant + [(StringConstant + "4M6L" + (Character 1 4 ()) + ) + (StringConstant + "ktPdowqERy" + (Character 1 10 ()) + ) + (StringConstant + "KSifqTkR" + (Character 1 8 ()) + ) + (StringConstant + "ZE2p1N78f1" + (Character 1 10 ()) + ) + (StringConstant + "Mi5e87Xw" + (Character 1 8 ()) + )] + (List + (Character 1 4 ()) + ) + ) + (ListConstant + [(StringConstant + "uwfzqDq9g" + (Character 1 9 ()) + ) + (StringConstant + "QaM1s" + (Character 1 5 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "LB" + (Character 1 2 ()) + )] + (List + (Character 1 9 ()) + ) + ) + (ListConstant + [(StringConstant + "OJFRY6k" + (Character 1 7 ()) + ) + (StringConstant + "iz7Oie" + (Character 1 6 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "LUYLF" + (Character 1 5 ()) + ) + (StringConstant + "JBND5FuV7l" + (Character 1 10 ()) + )] + (List + (Character 1 7 ()) + ) + )] + (List + (List + (Character 1 2 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "m" + (Character 1 1 ()) + ) + (StringConstant + "WIQBQfV" + (Character 1 7 ()) + ) + (StringConstant + "jxjDrqxu" + (Character 1 8 ()) + ) + (StringConstant + "kea" + (Character 1 3 ()) + ) + (StringConstant + "mu" + (Character 1 2 ()) + )] + (List + (Character 1 1 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "GI8aOwLMe" + (Character 1 9 ()) + ) + (StringConstant + "Y5m8" + (Character 1 4 ()) + ) + (StringConstant + "a02Rz" + (Character 1 5 ()) + ) + (StringConstant + "xNKCJ" + (Character 1 5 ()) + )] + (List + (Character 1 0 ()) + ) + ) + (ListConstant + [(StringConstant + "LzkhyiJQHP" + (Character 1 10 ()) + ) + (StringConstant + "uzc3xyoXL" + (Character 1 9 ()) + ) + (StringConstant + "sKGnYfpRy" + (Character 1 9 ()) + ) + (StringConstant + "7x" + (Character 1 2 ()) + ) + (StringConstant + "WTVKrnPO" + (Character 1 8 ()) + )] + (List + (Character 1 10 ()) + ) + ) + (ListConstant + [(StringConstant + "TZa6" + (Character 1 4 ()) + ) + (StringConstant + "GXRuyRX" + (Character 1 7 ()) + ) + (StringConstant + "R" + (Character 1 1 ()) + ) + (StringConstant + "JQxS" + (Character 1 4 ()) + ) + (StringConstant + "OH" + (Character 1 2 ()) + )] + (List + (Character 1 4 ()) + ) + ) + (ListConstant + [(StringConstant + "bSVJZ1OQ" + (Character 1 8 ()) + ) + (StringConstant + "M" + (Character 1 1 ()) + ) + (StringConstant + "I9omlF" + (Character 1 6 ()) + ) + (StringConstant + "x7FR" + (Character 1 4 ()) + ) + (StringConstant + "XtpL" + (Character 1 4 ()) + )] + (List + (Character 1 8 ()) + ) + )] + (List + (List + (Character 1 1 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "DKOpK" + (Character 1 5 ()) + ) + (StringConstant + "eg8Nz" + (Character 1 5 ()) + ) + (StringConstant + "ru" + (Character 1 2 ()) + ) + (StringConstant + "Sj" + (Character 1 2 ()) + ) + (StringConstant + "YUDxyI" + (Character 1 6 ()) + )] + (List + (Character 1 5 ()) + ) + ) + (ListConstant + [(StringConstant + "Q5uyhvp" + (Character 1 7 ()) + ) + (StringConstant + "Ydx" + (Character 1 3 ()) + ) + (StringConstant + "p" + (Character 1 1 ()) + ) + (StringConstant + "DLM5RX" + (Character 1 6 ()) + ) + (StringConstant + "pwOujxCO" + (Character 1 8 ()) + )] + (List + (Character 1 7 ()) + ) + ) + (ListConstant + [(StringConstant + "s5GOWnNJV" + (Character 1 9 ()) + ) + (StringConstant + "af" + (Character 1 2 ()) + ) + (StringConstant + "KAkD" + (Character 1 4 ()) + ) + (StringConstant + "4IIZK" + (Character 1 5 ()) + ) + (StringConstant + "JQK040x" + (Character 1 7 ()) + )] + (List + (Character 1 9 ()) + ) + ) + (ListConstant + [(StringConstant + "9vF" + (Character 1 3 ()) + ) + (StringConstant + "9pc7R8v" + (Character 1 7 ()) + ) + (StringConstant + "nDReIU7" + (Character 1 7 ()) + ) + (StringConstant + "K" + (Character 1 1 ()) + ) + (StringConstant + "btn" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "wVeivkdi" + (Character 1 8 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "C" + (Character 1 1 ()) + )] + (List + (Character 1 0 ()) + ) + )] + (List + (List + (Character 1 5 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "vNTtcRXD" + (Character 1 8 ()) + ) + (StringConstant + "rsi" + (Character 1 3 ()) + ) + (StringConstant + "YsoF7mZD" + (Character 1 8 ()) + ) + (StringConstant + "VrPXU50rgA" + (Character 1 10 ()) + ) + (StringConstant + "mG7zqN0G" + (Character 1 8 ()) + )] + (List + (Character 1 8 ()) + ) + ) + (ListConstant + [(StringConstant + "la7cJ" + (Character 1 5 ()) + ) + (StringConstant + "M5rLJ8Go" + (Character 1 8 ()) + ) + (StringConstant + "gb" + (Character 1 2 ()) + ) + (StringConstant + "FjKwYZ7E" + (Character 1 8 ()) + ) + (StringConstant + "uSPD" + (Character 1 4 ()) + )] + (List + (Character 1 5 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "oOa79jWcMx" + (Character 1 10 ()) + ) + (StringConstant + "yyAYZZ" + (Character 1 6 ()) + ) + (StringConstant + "wbvggXm" + (Character 1 7 ()) + ) + (StringConstant + "aE3BkCL4" + (Character 1 8 ()) + )] + (List + (Character 1 0 ()) + ) + ) + (ListConstant + [(StringConstant + "RdP" + (Character 1 3 ()) + ) + (StringConstant + "Hwc0x9RZ" + (Character 1 8 ()) + ) + (StringConstant + "sy" + (Character 1 2 ()) + ) + (StringConstant + "9" + (Character 1 1 ()) + ) + (StringConstant + "W1d9xA2BXe" + (Character 1 10 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "A" + (Character 1 1 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "QnK" + (Character 1 3 ()) + ) + (StringConstant + "N5tzN" + (Character 1 5 ()) + ) + (StringConstant + "ou7Lp" + (Character 1 5 ()) + )] + (List + (Character 1 1 ()) + ) + )] + (List + (List + (Character 1 8 ()) + ) + ) + ) + (ListConstant + [(ListConstant + [(StringConstant + "DL68rDF" + (Character 1 7 ()) + ) + (StringConstant + "v" + (Character 1 1 ()) + ) + (StringConstant + "kQ3Mxm" + (Character 1 6 ()) + ) + (StringConstant + "g" + (Character 1 1 ()) + ) + (StringConstant + "6KTeF4Eo" + (Character 1 8 ()) + )] + (List + (Character 1 7 ()) + ) + ) + (ListConstant + [(StringConstant + "Hx9" + (Character 1 3 ()) + ) + (StringConstant + "Y1IzQm85Z4" + (Character 1 10 ()) + ) + (StringConstant + "3D8" + (Character 1 3 ()) + ) + (StringConstant + "ZLZ5" + (Character 1 4 ()) + ) + (StringConstant + "rWn" + (Character 1 3 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "LtT" + (Character 1 3 ()) + ) + (StringConstant + "Dh5B" + (Character 1 4 ()) + ) + (StringConstant + "M" + (Character 1 1 ()) + ) + (StringConstant + "F" + (Character 1 1 ()) + ) + (StringConstant + "QTARbY" + (Character 1 6 ()) + )] + (List + (Character 1 3 ()) + ) + ) + (ListConstant + [(StringConstant + "Sh" + (Character 1 2 ()) + ) + (StringConstant + "WL" + (Character 1 2 ()) + ) + (StringConstant + "yvAfWvZSx1" + (Character 1 10 ()) + ) + (StringConstant + "90yx" + (Character 1 4 ()) + ) + (StringConstant + "v" + (Character 1 1 ()) + )] + (List + (Character 1 2 ()) + ) + ) + (ListConstant + [(StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "7IBW" + (Character 1 4 ()) + ) + (StringConstant + "nI" + (Character 1 2 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "6Cbp5c8RT" + (Character 1 9 ()) + )] + (List + (Character 1 0 ()) + ) + )] + (List + (List + (Character 1 7 ()) + ) + ) + )] + (List + (List + (List + (Character 1 2 ()) + ) + ) + ) + ) + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 6 p) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator1) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 6 p) + (Var 6 __list_iterator) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListItem + (Var 6 p) + (Var 6 __list_iterator) + (List + (Integer 4) + ) + () + ) + (Var 6 __list_iterator1) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator1) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 6 p) + (Var 6 __list_iterator) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator) + Lt + (IntegerBinOp + (ListLen + (Var 6 p) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator2) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 6 q) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator3) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator4) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 6 __list_iterator3) + (List + (List + (Real 8) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator5) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 6 __list_iterator3) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 6 __list_iterator4) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (ListItem + (ListItem + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 6 __list_iterator3) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 6 __list_iterator4) + (List + (Real 8) + ) + () + ) + (Var 6 __list_iterator5) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator5) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 6 __list_iterator3) + (List + (List + (Real 8) + ) + ) + () + ) + (Var 6 __list_iterator4) + (List + (Real 8) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator4) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Var 6 __list_iterator3) + (List + (List + (Real 8) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator3) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 6 q) + (Var 6 __list_iterator2) + (List + (List + (List + (Real 8) + ) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator2) + Lt + (IntegerBinOp + (ListLen + (Var 6 q) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator6) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 6 r) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator7) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 6 r) + (Var 6 __list_iterator6) + (List + (List + (Character 1 -2 ()) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 6 __list_iterator8) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 6 r) + (Var 6 __list_iterator6) + (List + (List + (Character 1 -2 ()) + ) + ) + () + ) + (Var 6 __list_iterator7) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (ListItem + (ListItem + (Var 6 r) + (Var 6 __list_iterator6) + (List + (List + (Character 1 -2 ()) + ) + ) + () + ) + (Var 6 __list_iterator7) + (List + (Character 1 -2 ()) + ) + () + ) + (Var 6 __list_iterator8) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator8) + Lt + (IntegerBinOp + (ListLen + (ListItem + (ListItem + (Var 6 r) + (Var 6 __list_iterator6) + (List + (List + (Character 1 -2 ()) + ) + ) + () + ) + (Var 6 __list_iterator7) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator7) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 6 r) + (Var 6 __list_iterator6) + (List + (List + (Character 1 -2 ()) + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 6 __list_iterator6) + Lt + (IntegerBinOp + (ListLen + (Var 6 r) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ), + test_print_list_tuple: + (Function + (SymbolTable + 5 + { + __list_iterator: + (Variable + 5 + __list_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator1: + (Variable + 5 + __list_iterator1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator2: + (Variable + 5 + __list_iterator2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator3: + (Variable + 5 + __list_iterator3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator4: + (Variable + 5 + __list_iterator4 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator5: + (Variable + 5 + __list_iterator5 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + __list_iterator6: + (Variable + 5 + __list_iterator6 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 5 + a + [] + Local + () + () + Default + (List + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Tuple + [(List + (Character 1 -2 ()) + ) + (List + (Integer 4) + ) + (Real 8)] + ) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 5 + b1 + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 5 + b2 + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (List + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + ) + () + Source + Public + Required + .false. + ) + }) + test_print_list_tuple + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 a) + (ListConstant + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 5 (Integer 4)) + (IntegerConstant 6 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + )] + (List + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + ) + () + ) + (= + (Var 5 c) + (ListConstant + [(ListConstant + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (StringConstant + "a" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + (TupleConstant + [(IntegerConstant 2 (Integer 4)) + (StringConstant + "b" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + )] + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + ) + (ListConstant + [(TupleConstant + [(IntegerConstant 3 (Integer 4)) + (StringConstant + "c" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + (TupleConstant + [(IntegerConstant 4 (Integer 4)) + (StringConstant + "d" + (Character 1 1 ()) + )] + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + )] + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + )] + (List + (List + (Tuple + [(Integer 4) + (Character 1 1 ())] + ) + ) + ) + ) + () + ) + (= + (Var 5 b1) + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "bb" + (Character 1 2 ()) + ) + (StringConstant + "ccc" + (Character 1 3 ()) + ) + (StringConstant + "dddd" + (Character 1 4 ()) + ) + (StringConstant + "eeeee" + (Character 1 5 ()) + )] + (List + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 5 b2) + (ListConstant + [(IntegerConstant 10 (Integer 4)) + (IntegerConstant 20 (Integer 4)) + (IntegerConstant 30 (Integer 4)) + (IntegerConstant 40 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 5 b) + (TupleConstant + [(Var 5 b1) + (Var 5 b2) + (RealConstant + 6.030500 + (Real 8) + )] + (Tuple + [(List + (Character 1 -2 ()) + ) + (List + (Integer 4) + ) + (Real 8)] + ) + ) + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 5 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "(" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (ListItem + (Var 5 a) + (Var 5 __list_iterator) + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (ListItem + (Var 5 a) + (Var 5 __list_iterator) + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ")" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator) + Lt + (IntegerBinOp + (ListLen + (Var 5 a) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "(" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator1) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (TupleItem + (Var 5 b) + (IntegerConstant 0 (Integer 4)) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (TupleItem + (Var 5 b) + (IntegerConstant 0 (Integer 4)) + (List + (Character 1 -2 ()) + ) + () + ) + (Var 5 __list_iterator1) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator1) + Lt + (IntegerBinOp + (ListLen + (TupleItem + (Var 5 b) + (IntegerConstant 0 (Integer 4)) + (List + (Character 1 -2 ()) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator2) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (TupleItem + (Var 5 b) + (IntegerConstant 1 (Integer 4)) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (TupleItem + (Var 5 b) + (IntegerConstant 1 (Integer 4)) + (List + (Integer 4) + ) + () + ) + (Var 5 __list_iterator2) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator2) + Lt + (IntegerBinOp + (ListLen + (TupleItem + (Var 5 b) + (IntegerConstant 1 (Integer 4)) + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (Var 5 b) + (IntegerConstant 2 (Integer 4)) + (Real 8) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ")" + (Character 1 1 ()) + )] + () + () + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator3) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 5 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator4) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (ListItem + (Var 5 c) + (Var 5 __list_iterator3) + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "(" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (ListItem + (ListItem + (Var 5 c) + (Var 5 __list_iterator3) + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + () + ) + (Var 5 __list_iterator4) + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + () + ) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (TupleItem + (ListItem + (ListItem + (Var 5 c) + (Var 5 __list_iterator3) + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + () + ) + (Var 5 __list_iterator4) + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + () + ) + (IntegerConstant 1 (Integer 4)) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ")" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator4) + Lt + (IntegerBinOp + (ListLen + (ListItem + (Var 5 c) + (Var 5 __list_iterator3) + (List + (Tuple + [(Integer 4) + (Character 1 -2 ())] + ) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator3) + Lt + (IntegerBinOp + (ListLen + (Var 5 c) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator5) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 5 b1) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(StringConstant + "'" + (Character 1 1 ()) + ) + (ListItem + (Var 5 b1) + (Var 5 __list_iterator5) + (Character 1 -2 ()) + () + ) + (StringConstant + "'" + (Character 1 1 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator5) + Lt + (IntegerBinOp + (ListLen + (Var 5 b1) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 5 __list_iterator6) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (Var 5 b2) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (Var 5 b2) + (Var 5 __list_iterator6) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 5 __list_iterator6) + Lt + (IntegerBinOp + (ListLen + (Var 5 b2) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(RealConstant + 3.420000 + (Real 8) + ) + (StringConstant + "okay" + (Character 1 4 ()) + ) + (LogicalConstant + .true. + (Logical 4) + ) + (IntegerConstant 14483 (Integer 4))] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 9 + { + __main__global_stmts: + (ExternalSymbol + 9 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 9 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json new file mode 100644 index 0000000000..7eb0803aaf --- /dev/null +++ b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.json @@ -0,0 +1,13 @@ +{ + "basename": "pass_print_list_tuple-print_list_tuple_03-195fa9c", + "cmd": "lpython --pass=print_list_tuple --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/../integration_tests/print_list_tuple_03.py", + "infile_hash": "5131d7b6049e22c278ad41494969ff1f70c1dc811313032a9fcf58f3", + "outfile": null, + "outfile_hash": null, + "stdout": "pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout", + "stdout_hash": "2dbf3429f4e3c9e37321ed5251aebc13df479e2001fb95f16f37ed2f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout new file mode 100644 index 0000000000..42cfebc908 --- /dev/null +++ b/tests/reference/pass_print_list_tuple-print_list_tuple_03-195fa9c.stdout @@ -0,0 +1,522 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + __list_iterator: + (Variable + 3 + __list_iterator + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Dict + (Integer 4) + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Dict + (Integer 4) + (List + (Integer 4) + ) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (DictConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + [(TupleConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + (TupleConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (Tuple + [(Integer 4) + (Integer 4)] + ) + )] + (Dict + (Integer 4) + (Tuple + [(Integer 4) + (Integer 4)] + ) + ) + ) + () + ) + (= + (Var 3 y) + (DictConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + [(ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4))] + (List + (Integer 4) + ) + ) + (ListConstant + [(IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + )] + (Dict + (Integer 4) + (List + (Integer 4) + ) + ) + ) + () + ) + (Print + () + [(StringConstant + "(" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (DictItem + (Var 3 x) + (IntegerConstant 1 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (DictItem + (Var 3 x) + (IntegerConstant 1 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ")" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "(" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (DictItem + (Var 3 x) + (IntegerConstant 2 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 0 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(TupleItem + (DictItem + (Var 3 x) + (IntegerConstant 2 (Integer 4)) + () + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + ) + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (Print + () + [(StringConstant + ")" + (Character 1 1 ()) + )] + () + (StringConstant + " " + (Character 1 1 ()) + ) + ) + (Print + () + [(StringConstant + "[" + (Character 1 1 ()) + )] + () + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (DoLoop + () + ((Var 3 __list_iterator) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (ListLen + (DictItem + (Var 3 y) + (IntegerConstant 1 (Integer 4)) + () + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Print + () + [(ListItem + (DictItem + (Var 3 y) + (IntegerConstant 1 (Integer 4)) + () + (List + (Integer 4) + ) + () + ) + (Var 3 __list_iterator) + (Integer 4) + () + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + ) + (If + (IntegerCompare + (Var 3 __list_iterator) + Lt + (IntegerBinOp + (ListLen + (DictItem + (Var 3 y) + (IntegerConstant 1 (Integer 4)) + () + (List + (Integer 4) + ) + () + ) + (Integer 4) + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (Logical 4) + () + ) + [(Print + () + [(StringConstant + ", " + (Character 1 2 ()) + )] + (StringConstant + "" + (Character 1 0 ()) + ) + (StringConstant + "" + (Character 1 0 ()) + ) + )] + [] + )] + ) + (Print + () + [(StringConstant + "]" + (Character 1 1 ()) + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/run_dbg-test_assert_01-2f34744.json b/tests/reference/run_dbg-test_assert_01-2f34744.json new file mode 100644 index 0000000000..f8ac5ccbe9 --- /dev/null +++ b/tests/reference/run_dbg-test_assert_01-2f34744.json @@ -0,0 +1,13 @@ +{ + "basename": "run_dbg-test_assert_01-2f34744", + "cmd": "lpython {infile} -g --debug-with-line-column --no-color", + "infile": "tests/runtime_errors/test_assert_01.py", + "infile_hash": "7a380295a35651b1a5120e1e64a44cae95d2c14c89cf5a4b6ea3dd1a", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "run_dbg-test_assert_01-2f34744.stderr", + "stderr_hash": "4811af471c73572b285e9ea01c8689abdd3cb32c717b3cd4876d2669", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_01-2f34744.stderr b/tests/reference/run_dbg-test_assert_01-2f34744.stderr new file mode 100644 index 0000000000..a7dc14d623 --- /dev/null +++ b/tests/reference/run_dbg-test_assert_01-2f34744.stderr @@ -0,0 +1,7 @@ + File "tests/runtime_errors/test_assert_01.py", line 1 + def test(): + File "tests/runtime_errors/test_assert_01.py", line 4 + test() + File "tests/runtime_errors/test_assert_01.py", line 2 + assert False +AssertionError diff --git a/tests/reference/run_dbg-test_assert_02-c6de25a.json b/tests/reference/run_dbg-test_assert_02-c6de25a.json new file mode 100644 index 0000000000..19b16179f5 --- /dev/null +++ b/tests/reference/run_dbg-test_assert_02-c6de25a.json @@ -0,0 +1,13 @@ +{ + "basename": "run_dbg-test_assert_02-c6de25a", + "cmd": "lpython {infile} -g --debug-with-line-column --no-color", + "infile": "tests/runtime_errors/test_assert_02.py", + "infile_hash": "85f0e908c3e5d21da83216f95221f59ebd69b477f42718842c1d6c8c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "run_dbg-test_assert_02-c6de25a.stderr", + "stderr_hash": "d5bfce55992e8d0630849442ee1f9b32864c64c328917c29fafc9424", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_02-c6de25a.stderr b/tests/reference/run_dbg-test_assert_02-c6de25a.stderr new file mode 100644 index 0000000000..0b837dc18e --- /dev/null +++ b/tests/reference/run_dbg-test_assert_02-c6de25a.stderr @@ -0,0 +1,7 @@ + File "tests/runtime_errors/test_assert_02.py", line 1 + def test(): + File "tests/runtime_errors/test_assert_02.py", line 4 + test() + File "tests/runtime_errors/test_assert_02.py", line 2 + assert 1 != 1, "One is equal to one." +AssertionError: One is equal to one. diff --git a/tests/reference/run_dbg-test_assert_03-bd7b7dd.json b/tests/reference/run_dbg-test_assert_03-bd7b7dd.json new file mode 100644 index 0000000000..f771107475 --- /dev/null +++ b/tests/reference/run_dbg-test_assert_03-bd7b7dd.json @@ -0,0 +1,13 @@ +{ + "basename": "run_dbg-test_assert_03-bd7b7dd", + "cmd": "lpython {infile} -g --debug-with-line-column --no-color", + "infile": "tests/runtime_errors/test_assert_03.py", + "infile_hash": "8d04aa5eb18e1faa6b0f923f5585bfd8211391b1e423b159d5da4764", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "run_dbg-test_assert_03-bd7b7dd.stderr", + "stderr_hash": "cae7dd955478787917e9dbb0bc1f63631317b13da1d892c3ebab9097", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr b/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr new file mode 100644 index 0000000000..65f2444ba9 --- /dev/null +++ b/tests/reference/run_dbg-test_assert_03-bd7b7dd.stderr @@ -0,0 +1,11 @@ + File "tests/runtime_errors/test_assert_03.py", line 1 + def f(): + File "tests/runtime_errors/test_assert_03.py", line 10 + main() + File "tests/runtime_errors/test_assert_03.py", line 8 + f() + File "tests/runtime_errors/test_assert_03.py", line 2 + g() + File "tests/runtime_errors/test_assert_03.py", line 5 + assert False +AssertionError diff --git a/tests/reference/run_dbg-test_quit_01-30889cc.json b/tests/reference/run_dbg-test_quit_01-30889cc.json new file mode 100644 index 0000000000..d46739a952 --- /dev/null +++ b/tests/reference/run_dbg-test_quit_01-30889cc.json @@ -0,0 +1,13 @@ +{ + "basename": "run_dbg-test_quit_01-30889cc", + "cmd": "lpython {infile} -g --debug-with-line-column --no-color", + "infile": "tests/runtime_errors/test_quit_01.py", + "infile_hash": "d2c544c21b4973dde53993e0a26bae6fac9581e7d5c87dd2cfc93f07", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "run_dbg-test_quit_01-30889cc.stderr", + "stderr_hash": "b3dac87462f9f0650e5a6af68791137ca9d29f9a64139ba7718a9f96", + "returncode": 10 +} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_quit_01-30889cc.stderr b/tests/reference/run_dbg-test_quit_01-30889cc.stderr new file mode 100644 index 0000000000..c1c7a54e60 --- /dev/null +++ b/tests/reference/run_dbg-test_quit_01-30889cc.stderr @@ -0,0 +1,7 @@ + File "tests/runtime_errors/test_quit_01.py", line 1 + def test(): + File "tests/runtime_errors/test_quit_01.py", line 4 + test() + File "tests/runtime_errors/test_quit_01.py", line 2 + quit(10) +STOP diff --git a/tests/reference/run_dbg-test_raise_01-dfd86ca.json b/tests/reference/run_dbg-test_raise_01-dfd86ca.json new file mode 100644 index 0000000000..2dbe004c7e --- /dev/null +++ b/tests/reference/run_dbg-test_raise_01-dfd86ca.json @@ -0,0 +1,13 @@ +{ + "basename": "run_dbg-test_raise_01-dfd86ca", + "cmd": "lpython {infile} -g --debug-with-line-column --no-color", + "infile": "tests/runtime_errors/test_raise_01.py", + "infile_hash": "359f595e813294fccdacb372c25a2aa6d3827066af7d91db62e32d83", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "run_dbg-test_raise_01-dfd86ca.stderr", + "stderr_hash": "76085f527077a81ba6457af8f982a497038168f555ab4027d0d6340e", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr b/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr new file mode 100644 index 0000000000..42bc707825 --- /dev/null +++ b/tests/reference/run_dbg-test_raise_01-dfd86ca.stderr @@ -0,0 +1,7 @@ + File "tests/runtime_errors/test_raise_01.py", line 1 + def test(): + File "tests/runtime_errors/test_raise_01.py", line 4 + test() + File "tests/runtime_errors/test_raise_01.py", line 2 + raise +ERROR STOP diff --git a/tests/reference/runtime-test_dict14-421fe53.json b/tests/reference/runtime-test_dict14-421fe53.json new file mode 100644 index 0000000000..ae6a837f77 --- /dev/null +++ b/tests/reference/runtime-test_dict14-421fe53.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_dict14-421fe53", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_dict14.py", + "infile_hash": "c81e4a1e050c87d04f537b49fcfb0b479a5ce3ed7735f90d2c347dba", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_dict14-421fe53.stderr", + "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict14-421fe53.stderr b/tests/reference/runtime-test_dict14-421fe53.stderr new file mode 100644 index 0000000000..e8c90e4e1d --- /dev/null +++ b/tests/reference/runtime-test_dict14-421fe53.stderr @@ -0,0 +1 @@ +KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_dict15-6f3af0d.json b/tests/reference/runtime-test_dict15-6f3af0d.json new file mode 100644 index 0000000000..5bf5c80a4b --- /dev/null +++ b/tests/reference/runtime-test_dict15-6f3af0d.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_dict15-6f3af0d", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_dict15.py", + "infile_hash": "6a0e507b9a9cf659cb433abbdc3435b4c63a6079eadcd7d2c765def1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_dict15-6f3af0d.stderr", + "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict15-6f3af0d.stderr b/tests/reference/runtime-test_dict15-6f3af0d.stderr new file mode 100644 index 0000000000..e8c90e4e1d --- /dev/null +++ b/tests/reference/runtime-test_dict15-6f3af0d.stderr @@ -0,0 +1 @@ +KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_dict16-c5a958d.json b/tests/reference/runtime-test_dict16-c5a958d.json new file mode 100644 index 0000000000..471c82d252 --- /dev/null +++ b/tests/reference/runtime-test_dict16-c5a958d.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_dict16-c5a958d", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_dict16.py", + "infile_hash": "7b00cfd7f6eac8338897bd99e5d953605f16927ee0f27683146b0182", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_dict16-c5a958d.stderr", + "stderr_hash": "cb46ef04db0862506d688ebe8830a50afaaead9b0d29b0c007dd149a", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_dict16-c5a958d.stderr b/tests/reference/runtime-test_dict16-c5a958d.stderr new file mode 100644 index 0000000000..e8c90e4e1d --- /dev/null +++ b/tests/reference/runtime-test_dict16-c5a958d.stderr @@ -0,0 +1 @@ +KeyError: The dict does not contain the specified key diff --git a/tests/reference/runtime-test_list_01-3ee9b3e.json b/tests/reference/runtime-test_list_01-3ee9b3e.json new file mode 100644 index 0000000000..0c845eb4e6 --- /dev/null +++ b/tests/reference/runtime-test_list_01-3ee9b3e.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_01-3ee9b3e", + "cmd": "lpython {infile}", + "infile": "tests/runtime_errors/test_list_01.py", + "infile_hash": "a982aac98be709cc9304e20c7d79f4141f41fdfb0eba261d00beff2c", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_01-3ee9b3e.stderr", + "stderr_hash": "c9cbdc4df1e7fbe0a6e73db7ac7809f71102fb524c8aa86139271006", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_01-3ee9b3e.stderr b/tests/reference/runtime-test_list_01-3ee9b3e.stderr new file mode 100644 index 0000000000..86d697f5c2 --- /dev/null +++ b/tests/reference/runtime-test_list_01-3ee9b3e.stderr @@ -0,0 +1 @@ +ValueError: The list does not contain the element: 4 diff --git a/tests/reference/runtime-test_list_02-5f7db5f.json b/tests/reference/runtime-test_list_02-5f7db5f.json new file mode 100644 index 0000000000..c4afb880c4 --- /dev/null +++ b/tests/reference/runtime-test_list_02-5f7db5f.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_02-5f7db5f", + "cmd": "lpython {infile}", + "infile": "tests/runtime_errors/test_list_02.py", + "infile_hash": "004ac679732e715b87556ac0d6f0ea649612981999a20dad4e25acd0", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_02-5f7db5f.stderr", + "stderr_hash": "f45ba86e610eeb2cc11fc176120e56d153a896f486e9b04d94fa3de1", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_02-5f7db5f.stderr b/tests/reference/runtime-test_list_02-5f7db5f.stderr new file mode 100644 index 0000000000..4f2d5a50c5 --- /dev/null +++ b/tests/reference/runtime-test_list_02-5f7db5f.stderr @@ -0,0 +1 @@ +IndexError: List index is out of range. Index range is (0, 2), but the given index is 3 diff --git a/tests/reference/runtime-test_list_index-0483808.json b/tests/reference/runtime-test_list_index-0483808.json new file mode 100644 index 0000000000..36ec2cbe9d --- /dev/null +++ b/tests/reference/runtime-test_list_index-0483808.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_index-0483808", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_list_index.py", + "infile_hash": "cded5d4f016ab4642b0ad1e30239da53272d823fe7d01c999c2811a1", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_index-0483808.stderr", + "stderr_hash": "dd3d49b5f2f97ed8f1d27cd73ebca7a8740483660dd4ae702e2048b2", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index-0483808.stderr b/tests/reference/runtime-test_list_index-0483808.stderr new file mode 100644 index 0000000000..93fd195103 --- /dev/null +++ b/tests/reference/runtime-test_list_index-0483808.stderr @@ -0,0 +1 @@ +ValueError: The list does not contain the element: 0 diff --git a/tests/reference/runtime-test_list_index2-1249233.json b/tests/reference/runtime-test_list_index2-1249233.json new file mode 100644 index 0000000000..f1e4344ce2 --- /dev/null +++ b/tests/reference/runtime-test_list_index2-1249233.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_index2-1249233", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_list_index2.py", + "infile_hash": "f7f556f1c048a88ee6eb9eae3ce3a337da17b3705b602085ff62ac4f", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_index2-1249233.stderr", + "stderr_hash": "fc647b30c89710c23d7efec0fe4390894c725680b5d8c4b4c939a5bf", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index2-1249233.stderr b/tests/reference/runtime-test_list_index2-1249233.stderr new file mode 100644 index 0000000000..68bd909af9 --- /dev/null +++ b/tests/reference/runtime-test_list_index2-1249233.stderr @@ -0,0 +1 @@ +ValueError: The list does not contain the element: 1 diff --git a/tests/reference/runtime-test_list_index3-647a94a.json b/tests/reference/runtime-test_list_index3-647a94a.json new file mode 100644 index 0000000000..6a0d2c606b --- /dev/null +++ b/tests/reference/runtime-test_list_index3-647a94a.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_index3-647a94a", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_list_index3.py", + "infile_hash": "2e560614ee9a755d3a001cee48f968f2ff90bea9f00ab22b441667b2", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_index3-647a94a.stderr", + "stderr_hash": "fc647b30c89710c23d7efec0fe4390894c725680b5d8c4b4c939a5bf", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index3-647a94a.stderr b/tests/reference/runtime-test_list_index3-647a94a.stderr new file mode 100644 index 0000000000..68bd909af9 --- /dev/null +++ b/tests/reference/runtime-test_list_index3-647a94a.stderr @@ -0,0 +1 @@ +ValueError: The list does not contain the element: 1 diff --git a/tests/reference/runtime-test_list_index4-c31dfdb.json b/tests/reference/runtime-test_list_index4-c31dfdb.json new file mode 100644 index 0000000000..237d1a5f2e --- /dev/null +++ b/tests/reference/runtime-test_list_index4-c31dfdb.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_list_index4-c31dfdb", + "cmd": "lpython {infile}", + "infile": "tests/errors/test_list_index4.py", + "infile_hash": "4513031129335b8c83686936c12f6b24516c14a79ad5c3b9a9d98113", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "runtime-test_list_index4-c31dfdb.stderr", + "stderr_hash": "3e3eee1ba7f96c1edaeed1c7b93f54b397dbe3b08d20c9b720c291a5", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_list_index4-c31dfdb.stderr b/tests/reference/runtime-test_list_index4-c31dfdb.stderr new file mode 100644 index 0000000000..6adc6bd250 --- /dev/null +++ b/tests/reference/runtime-test_list_index4-c31dfdb.stderr @@ -0,0 +1 @@ +ValueError: The list does not contain the element: 2 diff --git a/tests/reference/runtime-test_str_01-50bdf2f.json b/tests/reference/runtime-test_str_01-50bdf2f.json new file mode 100644 index 0000000000..d28f645eca --- /dev/null +++ b/tests/reference/runtime-test_str_01-50bdf2f.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_str_01-50bdf2f", + "cmd": "lpython {infile}", + "infile": "tests/runtime_errors/test_str_01.py", + "infile_hash": "7fb9748271af03bfa35e190a4514480662f42263ebfa0a6b2e082868", + "outfile": null, + "outfile_hash": null, + "stdout": "runtime-test_str_01-50bdf2f.stdout", + "stdout_hash": "ae5584858d62f3df08abdd365ea09fed0a7aa75f0f10698a7f7c2508", + "stderr": null, + "stderr_hash": null, + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_str_01-50bdf2f.stdout b/tests/reference/runtime-test_str_01-50bdf2f.stdout new file mode 100644 index 0000000000..8a34c88ede --- /dev/null +++ b/tests/reference/runtime-test_str_01-50bdf2f.stdout @@ -0,0 +1 @@ +String index: -4 is out of Bounds diff --git a/tests/reference/runtime-test_str_02-c38ba27.json b/tests/reference/runtime-test_str_02-c38ba27.json new file mode 100644 index 0000000000..18d74d95fd --- /dev/null +++ b/tests/reference/runtime-test_str_02-c38ba27.json @@ -0,0 +1,13 @@ +{ + "basename": "runtime-test_str_02-c38ba27", + "cmd": "lpython {infile}", + "infile": "tests/runtime_errors/test_str_02.py", + "infile_hash": "63853d644565a26ea82a41221d8fe11d9fc20d9132a36a76e6aba5e6", + "outfile": null, + "outfile_hash": null, + "stdout": "runtime-test_str_02-c38ba27.stdout", + "stdout_hash": "59f7b180db70f25c853c552c014ae09c1ee0671dfa0cbe205815c6b9", + "stderr": null, + "stderr_hash": null, + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/runtime-test_str_02-c38ba27.stdout b/tests/reference/runtime-test_str_02-c38ba27.stdout new file mode 100644 index 0000000000..2d17446782 --- /dev/null +++ b/tests/reference/runtime-test_str_02-c38ba27.stdout @@ -0,0 +1 @@ +String index: -8 is out of Bounds diff --git a/tests/reference/tokens-comment1-2f8ab90.json b/tests/reference/tokens-comment1-2f8ab90.json new file mode 100644 index 0000000000..cea27f0740 --- /dev/null +++ b/tests/reference/tokens-comment1-2f8ab90.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-comment1-2f8ab90", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/comment1.py", + "infile_hash": "27258459bf39e8c5bcaa41e7fef8a593775a915273787edc46c73b4d", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-comment1-2f8ab90.stdout", + "stdout_hash": "9e9a900b941381aadb0d8f29662fa337e918a769daba0c019d7ccdee", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-comment1-2f8ab90.stdout b/tests/reference/tokens-comment1-2f8ab90.stdout new file mode 100644 index 0000000000..778edf2ad2 --- /dev/null +++ b/tests/reference/tokens-comment1-2f8ab90.stdout @@ -0,0 +1,34 @@ +(TOKEN "comment") 0:9 +(NEWLINE) 10:10 +(KEYWORD "def") 11:13 +(TOKEN "identifier" test) 15:18 +(TOKEN "(") 19:19 +(TOKEN ")") 20:20 +(TOKEN ":") 21:21 +(TOKEN "eolcomment") 23:33 +(NEWLINE) 34:34 +(TOKEN "comment") 39:49 +(NEWLINE) 50:50 +(TOKEN "indent") 51:54 +(TOKEN "identifier" print) 55:59 +(TOKEN "(") 60:60 +(TOKEN ")") 61:61 +(NEWLINE) 62:62 +(TOKEN "comment") 63:73 +(NEWLINE) 74:74 +(TOKEN "dedent") 74:74 +(TOKEN "identifier" test) 75:78 +(TOKEN "(") 79:79 +(TOKEN ")") 80:80 +(TOKEN "eolcomment") 82:92 +(NEWLINE) 93:93 +(TOKEN "comment") 94:104 +(NEWLINE) 105:105 +(NEWLINE) 106:106 +(TOKEN "comment") 107:109 +(NEWLINE) 110:110 +(TOKEN "comment") 111:122 +(NEWLINE) 123:123 +(TOKEN "comment") 124:133 +(NEWLINE) 134:134 +(EOF) 135:135 diff --git a/tests/reference/tokens-comment2-b289dad.json b/tests/reference/tokens-comment2-b289dad.json new file mode 100644 index 0000000000..8bdb10892b --- /dev/null +++ b/tests/reference/tokens-comment2-b289dad.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-comment2-b289dad", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/comment2.py", + "infile_hash": "b62404a5d774f0b18fcad6fb1dac8733334ce3593a77d34bcbb05019", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-comment2-b289dad.stdout", + "stdout_hash": "40e09fec45afa4b961404b5b0e5d4b1ff68828891bbf3c2cd373a910", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-comment2-b289dad.stdout b/tests/reference/tokens-comment2-b289dad.stdout new file mode 100644 index 0000000000..3013ac4416 --- /dev/null +++ b/tests/reference/tokens-comment2-b289dad.stdout @@ -0,0 +1,133 @@ +(KEYWORD "def") 0:2 +(TOKEN "identifier" main) 4:7 +(TOKEN "(") 8:8 +(TOKEN ")") 9:9 +(TOKEN ":") 10:10 +(NEWLINE) 11:11 +(TOKEN "comment") 12:14 +(NEWLINE) 15:15 +(TOKEN "comment") 20:22 +(NEWLINE) 23:23 +(TOKEN "indent") 24:27 +(KEYWORD "if") 28:29 +(TOKEN "identifier" foo) 31:33 +(TOKEN ":") 34:34 +(TOKEN "eolcomment") 36:38 +(NEWLINE) 39:39 +(TOKEN "comment") 48:50 +(NEWLINE) 51:51 +(TOKEN "comment") 56:58 +(NEWLINE) 59:59 +(TOKEN "comment") 60:61 +(NEWLINE) 62:62 +(TOKEN "indent") 63:70 +(KEYWORD "if") 71:72 +(TOKEN "identifier" bar) 74:76 +(TOKEN ":") 77:77 +(TOKEN "eolcomment") 79:81 +(NEWLINE) 82:82 +(TOKEN "indent") 83:94 +(KEYWORD "pass") 95:98 +(NEWLINE) 99:99 +(TOKEN "dedent") 100:103 +(TOKEN "dedent") 103:103 +(KEYWORD "else") 104:107 +(TOKEN ":") 108:108 +(NEWLINE) 109:109 +(TOKEN "indent") 110:117 +(KEYWORD "pass") 118:121 +(NEWLINE) 122:122 +(TOKEN "dedent") 123:126 +(KEYWORD "return") 127:132 +(NEWLINE) 133:133 +(NEWLINE) 134:134 +(TOKEN "dedent") 134:134 +(KEYWORD "def") 135:137 +(TOKEN "identifier" test) 139:142 +(TOKEN "(") 143:143 +(TOKEN ")") 144:144 +(TOKEN ":") 145:145 +(NEWLINE) 146:146 +(TOKEN "indent") 147:150 +(TOKEN "identifier" print) 151:155 +(TOKEN "(") 156:156 +(TOKEN ")") 157:157 +(NEWLINE) 158:158 +(NEWLINE) 159:159 +(TOKEN "comment") 160:168 +(NEWLINE) 169:169 +(NEWLINE) 170:170 +(TOKEN "dedent") 170:170 +(KEYWORD "def") 171:173 +(TOKEN "identifier" main) 175:178 +(TOKEN "(") 179:179 +(TOKEN ")") 180:180 +(TOKEN ":") 181:181 +(NEWLINE) 182:182 +(TOKEN "indent") 183:186 +(TOKEN "identifier" print) 187:191 +(TOKEN "(") 192:192 +(TOKEN ")") 193:193 +(NEWLINE) 194:194 +(TOKEN "comment") 199:207 +(NEWLINE) 208:208 +(NEWLINE) 209:209 +(TOKEN "dedent") 209:209 +(KEYWORD "def") 210:212 +(TOKEN "identifier" main) 214:217 +(TOKEN "(") 218:218 +(TOKEN ")") 219:219 +(TOKEN ":") 220:220 +(NEWLINE) 221:221 +(TOKEN "indent") 222:225 +(TOKEN "identifier" print) 226:230 +(TOKEN "(") 231:231 +(TOKEN ")") 232:232 +(NEWLINE) 233:233 +(TOKEN "comment") 234:242 +(NEWLINE) 243:243 +(KEYWORD "pass") 248:251 +(NEWLINE) 252:252 +(NEWLINE) 253:253 +(TOKEN "dedent") 253:253 +(KEYWORD "def") 254:256 +(TOKEN "identifier" main) 258:261 +(TOKEN "(") 262:262 +(TOKEN ")") 263:263 +(TOKEN ":") 264:264 +(NEWLINE) 265:265 +(TOKEN "indent") 266:269 +(KEYWORD "if") 270:271 +(TOKEN "identifier" foo) 273:275 +(TOKEN ":") 276:276 +(NEWLINE) 277:277 +(TOKEN "indent") 278:285 +(KEYWORD "pass") 286:289 +(NEWLINE) 290:290 +(TOKEN "comment") 291:299 +(NEWLINE) 300:300 +(KEYWORD "pass") 309:312 +(NEWLINE) 313:313 +(KEYWORD "if") 322:323 +(TOKEN "identifier" bar) 325:327 +(TOKEN ":") 328:328 +(NEWLINE) 329:329 +(TOKEN "indent") 330:341 +(KEYWORD "pass") 342:345 +(NEWLINE) 346:346 +(TOKEN "dedent") 347:354 +(KEYWORD "pass") 355:358 +(NEWLINE) 359:359 +(TOKEN "dedent") 360:363 +(KEYWORD "pass") 364:367 +(NEWLINE) 368:368 +(NEWLINE) 369:369 +(TOKEN "dedent") 369:369 +(TOKEN "identifier" x) 370:370 +(TOKEN "=") 372:372 +(TOKEN "[") 374:374 +(TOKEN "identifier" a) 390:390 +(TOKEN ",") 391:391 +(TOKEN "]") 393:393 +(NEWLINE) 394:394 +(EOF) 395:395 diff --git a/tests/reference/tokens-docstring1-1355fbb.json b/tests/reference/tokens-docstring1-1355fbb.json new file mode 100644 index 0000000000..ee767caca7 --- /dev/null +++ b/tests/reference/tokens-docstring1-1355fbb.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-docstring1-1355fbb", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/docstring1.py", + "infile_hash": "76a733fb41e5cfebb1d9bd74a719fa2644e746ce06a64fbbf91358a8", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-docstring1-1355fbb.stdout", + "stdout_hash": "9afa056946f77dcfa0a5aa89b3ff738274836892169e03c14ee14a8f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-docstring1-1355fbb.stdout b/tests/reference/tokens-docstring1-1355fbb.stdout new file mode 100644 index 0000000000..fe9060da80 --- /dev/null +++ b/tests/reference/tokens-docstring1-1355fbb.stdout @@ -0,0 +1,36 @@ +(KEYWORD "def") 0:2 +(TOKEN "identifier" test1) 4:8 +(TOKEN "(") 9:9 +(TOKEN ")") 10:10 +(TOKEN ":") 11:11 +(NEWLINE) 12:12 +(TOKEN "indent") 13:16 +(TOKEN "string" "A multi-line\n docstring.\n ") 17:54 +(NEWLINE) 55:55 +(NEWLINE) 56:56 +(TOKEN "dedent") 56:56 +(KEYWORD "def") 57:59 +(TOKEN "identifier" test2) 61:65 +(TOKEN "(") 66:66 +(TOKEN ")") 67:67 +(TOKEN ":") 68:68 +(NEWLINE) 69:69 +(TOKEN "indent") 70:73 +(TOKEN "string" "\n A multi-line\n docstring.\n ") 74:116 +(NEWLINE) 117:117 +(NEWLINE) 118:118 +(TOKEN "dedent") 118:118 +(KEYWORD "def") 119:121 +(TOKEN "identifier" test2) 123:127 +(TOKEN "(") 128:128 +(TOKEN ")") 129:129 +(TOKEN ":") 130:130 +(NEWLINE) 131:131 +(TOKEN "indent") 132:135 +(TOKEN "string" " A single-line docstring.") 136:166 +(NEWLINE) 167:167 +(NEWLINE) 168:168 +(TOKEN "dedent") 168:168 +(TOKEN "string" "\nA multi-line\ndocstring.\n") 169:199 +(NEWLINE) 200:200 +(EOF) 201:201 diff --git a/tests/reference/tokens-indent1-0b243c5.json b/tests/reference/tokens-indent1-0b243c5.json new file mode 100644 index 0000000000..8f6a69248b --- /dev/null +++ b/tests/reference/tokens-indent1-0b243c5.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-indent1-0b243c5", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/indent1.py", + "infile_hash": "e4b85b69276c943f42a1779fce9d11e4afdcf5a037890a3222afa21d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-indent1-0b243c5.stderr", + "stderr_hash": "d642cbfab3b7f5cdc1d373d420877c776d64b9eb6dcdd2491f7970f7", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-indent1-0b243c5.stderr b/tests/reference/tokens-indent1-0b243c5.stderr new file mode 100644 index 0000000000..ce7ce194d9 --- /dev/null +++ b/tests/reference/tokens-indent1-0b243c5.stderr @@ -0,0 +1,5 @@ +tokenizer error: Indentation should be of the same type (either tabs or spaces) + --> tests/tokens/errors/indent1.py:3:1 + | +3 | pass + | ^^ diff --git a/tests/reference/tokens-indent1-290e858.json b/tests/reference/tokens-indent1-290e858.json new file mode 100644 index 0000000000..7374507118 --- /dev/null +++ b/tests/reference/tokens-indent1-290e858.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-indent1-290e858", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/indent1.py", + "infile_hash": "e8d2e3a0872f5aea8db4b6631f2fcb0e562dda5b3f59ff247cb9aaa9", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-indent1-290e858.stdout", + "stdout_hash": "9b71c23ca510cf5a4529540766fb16fc3c5b59bc7225efcfe25b3f0b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-indent1-290e858.stdout b/tests/reference/tokens-indent1-290e858.stdout new file mode 100644 index 0000000000..98197c5ed5 --- /dev/null +++ b/tests/reference/tokens-indent1-290e858.stdout @@ -0,0 +1,73 @@ +(KEYWORD "from") 0:3 +(TOKEN "identifier" lpython) 5:11 +(KEYWORD "import") 13:18 +(TOKEN "identifier" i32) 26:28 +(NEWLINE) 29:29 +(NEWLINE) 30:30 +(KEYWORD "def") 31:33 +(TOKEN "identifier" test) 35:38 +(TOKEN "(") 39:39 +(TOKEN ")") 40:40 +(TOKEN ":") 41:41 +(NEWLINE) 42:42 +(TOKEN "indent") 43:46 +(TOKEN "identifier" print) 47:51 +(TOKEN "(") 52:52 +(TOKEN ")") 53:53 +(NEWLINE) 54:54 +(KEYWORD "if") 59:60 +(TOKEN "integer" 1) 62:62 +(TOKEN ">") 64:64 +(TOKEN "integer" 0) 66:66 +(TOKEN ":") 67:67 +(NEWLINE) 68:68 +(TOKEN "indent") 69:76 +(TOKEN "identifier" print) 77:81 +(TOKEN "(") 82:82 +(TOKEN ")") 83:83 +(NEWLINE) 84:84 +(KEYWORD "if") 93:94 +(TOKEN "integer" 2) 96:96 +(TOKEN ">") 98:98 +(TOKEN "integer" 0) 100:100 +(TOKEN ":") 101:101 +(NEWLINE) 102:102 +(TOKEN "indent") 103:114 +(TOKEN "identifier" print) 115:119 +(TOKEN "(") 120:120 +(TOKEN ")") 121:121 +(NEWLINE) 122:122 +(TOKEN "dedent") 123:126 +(TOKEN "dedent") 126:126 +(KEYWORD "if") 127:128 +(TOKEN "integer" 3) 130:130 +(TOKEN ">") 132:132 +(TOKEN "integer" 0) 134:134 +(TOKEN ":") 135:135 +(NEWLINE) 136:136 +(TOKEN "indent") 137:144 +(TOKEN "identifier" print) 145:149 +(TOKEN "(") 150:150 +(TOKEN ")") 151:151 +(NEWLINE) 152:152 +(NEWLINE) 153:153 +(KEYWORD "if") 162:163 +(TOKEN "integer" 4) 165:165 +(TOKEN ">") 167:167 +(TOKEN "integer" 0) 169:169 +(TOKEN ":") 170:170 +(NEWLINE) 171:171 +(TOKEN "indent") 172:183 +(TOKEN "identifier" print) 184:188 +(TOKEN "(") 189:189 +(TOKEN ")") 190:190 +(NEWLINE) 191:191 +(NEWLINE) 192:192 +(TOKEN "dedent") 192:192 +(TOKEN "dedent") 192:192 +(TOKEN "dedent") 192:192 +(TOKEN "identifier" test) 193:196 +(TOKEN "(") 197:197 +(TOKEN ")") 198:198 +(NEWLINE) 199:199 +(EOF) 200:200 diff --git a/tests/reference/tokens-indent2-a8438a0.json b/tests/reference/tokens-indent2-a8438a0.json new file mode 100644 index 0000000000..6842962c04 --- /dev/null +++ b/tests/reference/tokens-indent2-a8438a0.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-indent2-a8438a0", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/indent2.py", + "infile_hash": "19c2d8095cd65d521be708e23a2e29ab3cb672b888bc5fa8fbf745b3", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-indent2-a8438a0.stderr", + "stderr_hash": "ab862ff68983c5975d21f13c5b159de2a2888cae1d38a38a24700a88", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-indent2-a8438a0.stderr b/tests/reference/tokens-indent2-a8438a0.stderr new file mode 100644 index 0000000000..75f882f0a8 --- /dev/null +++ b/tests/reference/tokens-indent2-a8438a0.stderr @@ -0,0 +1,5 @@ +tokenizer error: Indentation should be of the same type (either tabs or spaces) + --> tests/tokens/errors/indent2.py:4:1 + | +4 | else: + | ^ diff --git a/tests/reference/tokens-indent2-e702789.json b/tests/reference/tokens-indent2-e702789.json new file mode 100644 index 0000000000..a30e0d0e55 --- /dev/null +++ b/tests/reference/tokens-indent2-e702789.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-indent2-e702789", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/indent2.py", + "infile_hash": "6ee8bbeb2e48631f07b13012f569904545ce5c14e714003d030fc385", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-indent2-e702789.stdout", + "stdout_hash": "e259b5fcc4c1d83a04924c51a6a6f6d9be631970d3663e5be065ed7d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-indent2-e702789.stdout b/tests/reference/tokens-indent2-e702789.stdout new file mode 100644 index 0000000000..46aca1243c --- /dev/null +++ b/tests/reference/tokens-indent2-e702789.stdout @@ -0,0 +1,88 @@ +(KEYWORD "class") 0:4 +(TOKEN "identifier" Test) 6:9 +(TOKEN ":") 10:10 +(NEWLINE) 11:11 +(TOKEN "indent") 12:15 +(KEYWORD "def") 16:18 +(TOKEN "identifier" foo) 20:22 +(TOKEN "(") 23:23 +(TOKEN "identifier" a) 24:24 +(TOKEN ")") 25:25 +(TOKEN ":") 26:26 +(NEWLINE) 27:27 +(TOKEN "indent") 28:35 +(KEYWORD "if") 36:37 +(TOKEN "identifier" a) 39:39 +(TOKEN "==") 41:42 +(TOKEN "string" "foo") 44:48 +(TOKEN ":") 49:49 +(NEWLINE) 50:50 +(TOKEN "indent") 51:62 +(KEYWORD "return") 63:68 +(TOKEN "string" "foo") 70:74 +(NEWLINE) 75:75 +(TOKEN "dedent") 76:83 +(KEYWORD "return") 84:89 +(TOKEN "string" "bar") 91:95 +(NEWLINE) 96:96 +(NEWLINE) 97:97 +(TOKEN "dedent") 97:97 +(TOKEN "dedent") 97:97 +(KEYWORD "def") 98:100 +(TOKEN "identifier" test) 102:105 +(TOKEN "(") 106:106 +(TOKEN ")") 107:107 +(TOKEN ":") 108:108 +(NEWLINE) 109:109 +(TOKEN "indent") 110:110 +(KEYWORD "if") 111:112 +(TOKEN "True") 114:117 +(TOKEN ":") 118:118 +(NEWLINE) 119:119 +(TOKEN "indent") 120:121 +(KEYWORD "pass") 122:125 +(NEWLINE) 126:126 +(TOKEN "dedent") 127:127 +(KEYWORD "else") 128:131 +(TOKEN ":") 132:132 +(NEWLINE) 133:133 +(TOKEN "indent") 134:135 +(KEYWORD "pass") 136:139 +(NEWLINE) 140:140 +(NEWLINE) 141:141 +(TOKEN "dedent") 141:141 +(TOKEN "dedent") 141:141 +(KEYWORD "def") 142:144 +(TOKEN "identifier" test) 146:149 +(TOKEN "(") 150:150 +(TOKEN "identifier" x) 151:151 +(TOKEN ":") 152:152 +(TOKEN "identifier" i32) 154:156 +(TOKEN ")") 157:157 +(TOKEN ":") 158:158 +(NEWLINE) 159:159 +(TOKEN "indent") 160:160 +(KEYWORD "if") 161:162 +(TOKEN "identifier" x) 164:164 +(TOKEN "<") 166:166 +(TOKEN "integer" 0) 168:168 +(TOKEN ":") 169:169 +(NEWLINE) 170:170 +(TOKEN "indent") 171:172 +(KEYWORD "pass") 173:176 +(NEWLINE) 177:177 +(TOKEN "dedent") 178:178 +(KEYWORD "else") 179:182 +(TOKEN ":") 183:183 +(NEWLINE) 184:184 +(TOKEN "indent") 185:186 +(TOKEN "identifier" Test) 187:190 +(TOKEN ".") 191:191 +(TOKEN "identifier" foo) 192:194 +(TOKEN "(") 195:195 +(TOKEN "identifier" x) 196:196 +(TOKEN ")") 197:197 +(NEWLINE) 198:198 +(TOKEN "dedent") 198:198 +(TOKEN "dedent") 198:198 +(EOF) 199:199 diff --git a/tests/reference/tokens-indent3-0eaf3e6.json b/tests/reference/tokens-indent3-0eaf3e6.json new file mode 100644 index 0000000000..e1ee281ca3 --- /dev/null +++ b/tests/reference/tokens-indent3-0eaf3e6.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-indent3-0eaf3e6", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/indent3.py", + "infile_hash": "cd9102f8d110fa0d6b12c07025d6646de807b60ee17b4604d9df08dc", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-indent3-0eaf3e6.stderr", + "stderr_hash": "1eddb6f37641a3eee16900c7025e6420f21cd97d3f877720bc90401b", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-indent3-0eaf3e6.stderr b/tests/reference/tokens-indent3-0eaf3e6.stderr new file mode 100644 index 0000000000..d6f7eb6224 --- /dev/null +++ b/tests/reference/tokens-indent3-0eaf3e6.stderr @@ -0,0 +1,5 @@ +tokenizer error: Expected an indented block. + --> tests/tokens/errors/indent3.py:5:1 + | +5 | pass + | ^^^^ diff --git a/tests/reference/tokens-numbers1-589063f.json b/tests/reference/tokens-numbers1-589063f.json new file mode 100644 index 0000000000..6b70fe6d2a --- /dev/null +++ b/tests/reference/tokens-numbers1-589063f.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-numbers1-589063f", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/numbers1.py", + "infile_hash": "8905fda648bd8c1b0dde75bdbd1eeb72232d459d634f324a676a70aa", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-numbers1-589063f.stdout", + "stdout_hash": "10d82b7f649d7cded64379a82a40123a29115546eb66bf54389958cf", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-numbers1-589063f.stdout b/tests/reference/tokens-numbers1-589063f.stdout new file mode 100644 index 0000000000..b887a5a96d --- /dev/null +++ b/tests/reference/tokens-numbers1-589063f.stdout @@ -0,0 +1,242 @@ +(TOKEN "identifier" i) 0:0 +(TOKEN "=") 2:2 +(TOKEN "integer" 123) 4:6 +(NEWLINE) 7:7 +(TOKEN "identifier" i) 8:8 +(TOKEN "=") 10:10 +(TOKEN "-") 12:12 +(TOKEN "integer" 123) 13:15 +(NEWLINE) 16:16 +(TOKEN "identifier" i) 17:17 +(TOKEN "=") 19:19 +(TOKEN "-") 21:21 +(TOKEN "integer" 291) 22:26 +(NEWLINE) 27:27 +(TOKEN "identifier" i) 28:28 +(TOKEN "=") 30:30 +(TOKEN "integer" 6844) 32:37 +(NEWLINE) 38:38 +(TOKEN "identifier" i) 39:39 +(TOKEN "=") 41:41 +(TOKEN "integer" 6844) 43:48 +(NEWLINE) 49:49 +(TOKEN "identifier" i) 50:50 +(TOKEN "=") 52:52 +(TOKEN "-") 54:54 +(TOKEN "integer" 83) 55:59 +(NEWLINE) 60:60 +(TOKEN "identifier" i) 61:61 +(TOKEN "=") 63:63 +(TOKEN "integer" 87) 65:70 +(NEWLINE) 71:71 +(TOKEN "identifier" i) 72:72 +(TOKEN "=") 74:74 +(TOKEN "-") 76:76 +(TOKEN "integer" 13) 77:82 +(NEWLINE) 83:83 +(TOKEN "identifier" i) 84:84 +(TOKEN "=") 86:86 +(TOKEN "integer" 13) 88:93 +(NEWLINE) 94:94 +(TOKEN "identifier" i) 95:95 +(TOKEN "=") 97:97 +(TOKEN "real" 123.000000) 99:102 +(NEWLINE) 103:103 +(TOKEN "identifier" i) 104:104 +(TOKEN "=") 106:106 +(TOKEN "real" 0.123000) 108:111 +(NEWLINE) 112:112 +(TOKEN "identifier" i) 113:113 +(TOKEN "=") 115:115 +(TOKEN "real" 123.450000) 117:122 +(NEWLINE) 123:123 +(TOKEN "identifier" i) 124:124 +(TOKEN "=") 126:126 +(TOKEN "real" 0.123000) 128:132 +(NEWLINE) 133:133 +(TOKEN "identifier" i) 134:134 +(TOKEN "=") 136:136 +(TOKEN "real" 120000000000.000000) 138:144 +(NEWLINE) 145:145 +(TOKEN "identifier" i) 146:146 +(TOKEN "=") 148:148 +(TOKEN "real" 123400000000.000000) 150:158 +(NEWLINE) 159:159 +(TOKEN "identifier" i) 160:160 +(TOKEN "=") 162:162 +(TOKEN "real" 0.000000) 164:170 +(NEWLINE) 171:171 +(TOKEN "identifier" i) 172:172 +(TOKEN "=") 174:174 +(TOKEN "real" 0.000000) 176:183 +(NEWLINE) 184:184 +(TOKEN "identifier" i) 185:185 +(TOKEN "=") 187:187 +(TOKEN "real" 123400000000.000000) 189:196 +(NEWLINE) 197:197 +(TOKEN "identifier" i) 198:198 +(TOKEN "=") 200:200 +(TOKEN "integer" 12) 202:203 +(TOKEN "+") 204:204 +(TOKEN "imag number" 3.000000j) 205:206 +(NEWLINE) 207:207 +(TOKEN "identifier" i) 208:208 +(TOKEN "=") 210:210 +(TOKEN "integer" 12) 212:213 +(TOKEN "+") 214:214 +(TOKEN "imag number" 3.000000j) 215:216 +(NEWLINE) 217:217 +(TOKEN "identifier" i) 218:218 +(TOKEN "=") 220:220 +(TOKEN "integer" 12) 222:223 +(TOKEN "+") 224:224 +(TOKEN "imag number" 0.000000j) 225:233 +(NEWLINE) 234:234 +(TOKEN "identifier" i) 235:235 +(TOKEN "=") 237:237 +(TOKEN "real" 0.120000) 239:241 +(TOKEN "+") 242:242 +(TOKEN "imag number" 0.001000j) 243:247 +(NEWLINE) 248:248 +(NEWLINE) 249:249 +(TOKEN "identifier" i) 250:250 +(TOKEN "=") 252:252 +(TOKEN "integer" 1234) 254:258 +(NEWLINE) 259:259 +(TOKEN "identifier" i) 260:260 +(TOKEN "=") 262:262 +(TOKEN "-") 264:264 +(TOKEN "integer" 1234) 265:269 +(NEWLINE) 270:270 +(TOKEN "identifier" i) 271:271 +(TOKEN "=") 273:273 +(TOKEN "-") 275:275 +(TOKEN "integer" 291) 276:281 +(NEWLINE) 282:282 +(TOKEN "identifier" i) 283:283 +(TOKEN "=") 285:285 +(TOKEN "integer" 6844) 287:293 +(NEWLINE) 294:294 +(TOKEN "identifier" i) 295:295 +(TOKEN "=") 297:297 +(TOKEN "integer" 4796) 299:305 +(NEWLINE) 306:306 +(TOKEN "identifier" i) 307:307 +(TOKEN "=") 309:309 +(TOKEN "-") 311:311 +(TOKEN "integer" 83) 312:317 +(NEWLINE) 318:318 +(TOKEN "identifier" i) 319:319 +(TOKEN "=") 321:321 +(TOKEN "integer" 87) 323:329 +(NEWLINE) 330:330 +(TOKEN "identifier" i) 331:331 +(TOKEN "=") 333:333 +(TOKEN "-") 335:335 +(TOKEN "integer" 43) 336:345 +(NEWLINE) 346:346 +(TOKEN "identifier" i) 347:347 +(TOKEN "=") 349:349 +(TOKEN "integer" 13) 351:358 +(NEWLINE) 359:359 +(TOKEN "identifier" i) 360:360 +(TOKEN "=") 362:362 +(TOKEN "real" 1123.000000) 364:369 +(NEWLINE) 370:370 +(TOKEN "identifier" i) 371:371 +(TOKEN "=") 373:373 +(TOKEN "real" 0.123000) 375:380 +(NEWLINE) 381:381 +(TOKEN "identifier" i) 382:382 +(TOKEN "=") 384:384 +(TOKEN "real" 0.123000) 386:392 +(NEWLINE) 393:393 +(TOKEN "identifier" i) 394:394 +(TOKEN "=") 396:396 +(TOKEN "real" 120000000000.000000) 398:406 +(NEWLINE) 407:407 +(TOKEN "identifier" i) 408:408 +(TOKEN "=") 410:410 +(TOKEN "real" 0.000001) 412:428 +(NEWLINE) 429:429 +(TOKEN "identifier" i) 430:430 +(TOKEN "=") 432:432 +(TOKEN "integer" 1234) 434:438 +(TOKEN "+") 439:439 +(TOKEN "imag number" 3456.000000j) 440:445 +(NEWLINE) 446:446 +(TOKEN "identifier" i) 447:447 +(TOKEN "=") 449:449 +(TOKEN "integer" 12) 451:452 +(TOKEN "+") 453:453 +(TOKEN "imag number" 0.000000j) 454:465 +(NEWLINE) 466:466 +(TOKEN "identifier" i) 467:467 +(TOKEN "=") 469:469 +(TOKEN "real" 1000.120000) 471:478 +(TOKEN "+") 479:479 +(TOKEN "imag number" 0.000100j) 480:486 +(NEWLINE) 487:487 +(NEWLINE) 488:488 +(TOKEN "identifier" float) 489:493 +(TOKEN "(") 494:494 +(TOKEN "real" inf) 495:499 +(TOKEN ")") 500:500 +(NEWLINE) 501:501 +(TOKEN "identifier" x) 502:502 +(TOKEN "=") 504:504 +(TOKEN "real" inf) 506:510 +(NEWLINE) 511:511 +(TOKEN "identifier" complex) 512:518 +(TOKEN "(") 519:519 +(TOKEN "real" 140000000000000005528749527191103381749434659621913717006437476935335702571970573026452444307820696028601680522881043700541120085625386611604505789664591785922123926873769078699987831481595335695749181141356976015104370165785971235340948584343131219149608095136586496161650337802003105866881830462290332221440.000000) 520:526 +(TOKEN ",") 527:527 +(TOKEN "real" 140000000000000005528749527191103381749434659621913717006437476935335702571970573026452444307820696028601680522881043700541120085625386611604505789664591785922123926873769078699987831481595335695749181141356976015104370165785971235340948584343131219149608095136586496161650337802003105866881830462290332221440.000000) 529:535 +(TOKEN ")") 536:536 +(NEWLINE) 537:537 +(TOKEN "identifier" abs_err) 538:544 +(TOKEN "=") 546:546 +(TOKEN "real" 0.000000) 548:553 +(NEWLINE) 554:554 +(TOKEN "identifier" tiny) 555:558 +(TOKEN "=") 560:560 +(TOKEN "real" 0.000000) 562:567 +(NEWLINE) 568:568 +(TOKEN "-") 569:569 +(TOKEN "real" 1.000000) 570:571 +(TOKEN "+") 572:572 +(TOKEN "imag number" 0.000000j) 573:579 +(NEWLINE) 580:580 +(TOKEN "identifier" vals) 581:584 +(TOKEN "=") 586:586 +(TOKEN "[") 588:588 +(TOKEN "real" 0.000000) 589:594 +(TOKEN ",") 595:595 +(TOKEN "real" 0.000000) 597:602 +(TOKEN ",") 603:603 +(TOKEN "real" 0.000000) 605:610 +(TOKEN "]") 611:611 +(NEWLINE) 612:612 +(TOKEN "identifier" z2) 613:614 +(TOKEN "=") 616:616 +(TOKEN "-") 618:618 +(TOKEN "imag number" infj) 619:625 +(NEWLINE) 626:626 +(TOKEN "identifier" repr) 627:630 +(TOKEN "(") 631:631 +(TOKEN "real" 1000000000000000052504760255204420248704468581108159154915854115511802457988908195786371375080447864043704443832883878176942523235360430575644792184786706982848387200926575803737830233794788090059368953234970799945081119038967640880074652742780142494579258788820056842838115669472196386865459400540160.000000) 632:636 +(TOKEN "*") 638:638 +(TOKEN "real" 1000000000000000052504760255204420248704468581108159154915854115511802457988908195786371375080447864043704443832883878176942523235360430575644792184786706982848387200926575803737830233794788090059368953234970799945081119038967640880074652742780142494579258788820056842838115669472196386865459400540160.000000) 640:644 +(TOKEN "*") 646:646 +(TOKEN "integer" 0) 648:648 +(TOKEN ")") 649:649 +(NEWLINE) 650:650 +(TOKEN "identifier" weights) 651:657 +(TOKEN "=") 658:658 +(TOKEN "[") 659:659 +(TOKEN "real" 0.000000) 660:665 +(TOKEN ",") 666:666 +(TOKEN "real" 0.000000) 668:673 +(TOKEN "]") 674:674 +(NEWLINE) 675:675 +(EOF) 676:676 diff --git a/tests/reference/tokens-paren1-94fa736.json b/tests/reference/tokens-paren1-94fa736.json new file mode 100644 index 0000000000..b939a408f3 --- /dev/null +++ b/tests/reference/tokens-paren1-94fa736.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-paren1-94fa736", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/paren1.py", + "infile_hash": "2daad629476f5c2f192512f8759c633b7d52da75889d137d32a2d562", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-paren1-94fa736.stderr", + "stderr_hash": "d0af4503aa7935c5215252efbb68900d95a6b897f6ad195850573db0", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-paren1-94fa736.stderr b/tests/reference/tokens-paren1-94fa736.stderr new file mode 100644 index 0000000000..9d1d1aee5a --- /dev/null +++ b/tests/reference/tokens-paren1-94fa736.stderr @@ -0,0 +1,5 @@ +tokenizer error: Too many nested parentheses + --> tests/tokens/errors/paren1.py:1:202 + | +1 | -(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + | ^ diff --git a/tests/reference/tokens-paren2-0eef339.json b/tests/reference/tokens-paren2-0eef339.json new file mode 100644 index 0000000000..8d1ac74d27 --- /dev/null +++ b/tests/reference/tokens-paren2-0eef339.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-paren2-0eef339", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/paren2.py", + "infile_hash": "64ddb2cf28db48e5c99c9ff58a848b654a8eaf8e4d133c6772034522", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-paren2-0eef339.stderr", + "stderr_hash": "60430252b0f0f0ab667252a10da601d08dcc962d240fbc7c3fe3fd6c", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-paren2-0eef339.stderr b/tests/reference/tokens-paren2-0eef339.stderr new file mode 100644 index 0000000000..e1fa73a259 --- /dev/null +++ b/tests/reference/tokens-paren2-0eef339.stderr @@ -0,0 +1,5 @@ +tokenizer error: Parentheses does not match + --> tests/tokens/errors/paren2.py:6:3 + | +6 | [{]} + | ^ diff --git a/tests/reference/tokens-paren3-0d47100.json b/tests/reference/tokens-paren3-0d47100.json new file mode 100644 index 0000000000..a0fc7a5fe8 --- /dev/null +++ b/tests/reference/tokens-paren3-0d47100.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-paren3-0d47100", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/paren3.py", + "infile_hash": "57c6a1bdbc4971271437ae51ef8eef6a26f1061ff38d6be8a281560b", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-paren3-0d47100.stderr", + "stderr_hash": "5dfebef8a231835dd95c490a961ef3981b73e717a91351ad9d327676", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-paren3-0d47100.stderr b/tests/reference/tokens-paren3-0d47100.stderr new file mode 100644 index 0000000000..fd5422d82b --- /dev/null +++ b/tests/reference/tokens-paren3-0d47100.stderr @@ -0,0 +1,5 @@ +tokenizer error: Parenthesis unexpected + --> tests/tokens/errors/paren3.py:2:1 + | +2 | ] {}} + | ^ diff --git a/tests/reference/tokens-paren4-5c2fc32.json b/tests/reference/tokens-paren4-5c2fc32.json new file mode 100644 index 0000000000..184481775c --- /dev/null +++ b/tests/reference/tokens-paren4-5c2fc32.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-paren4-5c2fc32", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/errors/paren4.py", + "infile_hash": "10d0c8281aba40d1910e24ea824a43117ba9e95d518053323278284d", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "tokens-paren4-5c2fc32.stderr", + "stderr_hash": "4ee038fab6af5c6ed6e0bfc147b98031946c9aa227364e263aaa4913", + "returncode": 1 +} \ No newline at end of file diff --git a/tests/reference/tokens-paren4-5c2fc32.stderr b/tests/reference/tokens-paren4-5c2fc32.stderr new file mode 100644 index 0000000000..28331acf02 --- /dev/null +++ b/tests/reference/tokens-paren4-5c2fc32.stderr @@ -0,0 +1,5 @@ +tokenizer error: Parentheses was never closed + --> tests/tokens/errors/paren4.py:6:1 + | +6 | + | ^ diff --git a/tests/reference/tokens-symbols1-658c990.json b/tests/reference/tokens-symbols1-658c990.json new file mode 100644 index 0000000000..58240ae0fe --- /dev/null +++ b/tests/reference/tokens-symbols1-658c990.json @@ -0,0 +1,13 @@ +{ + "basename": "tokens-symbols1-658c990", + "cmd": "lpython --no-color --show-tokens {infile} -o {outfile}", + "infile": "tests/tokens/symbols1.py", + "infile_hash": "3f7910682e26267a50d48952da7dfcd8414cebb79ce55acc3b7ccc3f", + "outfile": null, + "outfile_hash": null, + "stdout": "tokens-symbols1-658c990.stdout", + "stdout_hash": "19dac50b2ce24d3a3d807a0d471b725063dd652bb785b46ffe05c81f", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/tokens-symbols1-658c990.stdout b/tests/reference/tokens-symbols1-658c990.stdout new file mode 100644 index 0000000000..0987cc79f9 --- /dev/null +++ b/tests/reference/tokens-symbols1-658c990.stdout @@ -0,0 +1,340 @@ +(KEYWORD "from") 0:3 +(TOKEN "identifier" typing) 5:10 +(KEYWORD "import") 12:17 +(TOKEN "identifier" overload) 19:26 +(NEWLINE) 27:27 +(NEWLINE) 28:28 +(TOKEN "identifier" i) 29:29 +(TOKEN "=") 31:31 +(TOKEN "{") 33:33 +(TOKEN "integer" 1) 34:34 +(TOKEN ":") 35:35 +(TOKEN "[") 37:37 +(TOKEN "(") 38:38 +(TOKEN "integer" 1) 39:39 +(TOKEN ",") 40:40 +(TOKEN "integer" 2) 42:42 +(TOKEN ")") 43:43 +(TOKEN ",") 44:44 +(TOKEN "(") 46:46 +(TOKEN "integer" 3) 47:47 +(TOKEN ",") 48:48 +(TOKEN "integer" 4) 50:50 +(TOKEN ")") 51:51 +(TOKEN "]") 52:52 +(TOKEN "}") 53:53 +(NEWLINE) 54:54 +(NEWLINE) 55:55 +(TOKEN "identifier" i) 56:56 +(KEYWORD "is") 58:59 +(TOKEN "identifier" i) 61:61 +(NEWLINE) 62:62 +(TOKEN "identifier" j) 63:63 +(TOKEN "=") 65:65 +(TOKEN "integer" 1) 67:67 +(NEWLINE) 68:68 +(TOKEN "identifier" j) 69:69 +(KEYWORD "in") 71:72 +(TOKEN "identifier" i) 74:74 +(NEWLINE) 75:75 +(NEWLINE) 76:76 +(KEYWORD "def") 77:79 +(TOKEN "identifier" test) 81:84 +(TOKEN "(") 85:85 +(TOKEN ")") 86:86 +(TOKEN ":") 87:87 +(NEWLINE) 88:88 +(TOKEN "indent") 89:92 +(TOKEN "identifier" print) 93:97 +(TOKEN "(") 98:98 +(TOKEN "string" ":") 99:101 +(TOKEN ")") 102:102 +(TOKEN ";") 103:103 +(TOKEN "identifier" print) 105:109 +(TOKEN "(") 110:110 +(TOKEN "string" ";") 111:113 +(TOKEN ")") 114:114 +(NEWLINE) 115:115 +(NEWLINE) 116:116 +(TOKEN "dedent") 116:116 +(TOKEN "identifier" i) 117:117 +(TOKEN "=") 119:119 +(TOKEN "integer" 1) 121:121 +(TOKEN "+") 123:123 +(TOKEN "integer" 2) 125:125 +(TOKEN "-") 127:127 +(TOKEN "integer" 3) 129:129 +(TOKEN "*") 131:131 +(TOKEN "integer" 4) 133:133 +(TOKEN "/") 135:135 +(TOKEN "integer" 5) 137:137 +(TOKEN "%") 139:139 +(TOKEN "integer" 6) 141:141 +(NEWLINE) 142:142 +(NEWLINE) 143:143 +(TOKEN "identifier" i) 144:144 +(TOKEN "=") 146:146 +(TOKEN "True") 148:151 +(TOKEN "<") 153:153 +(TOKEN "(") 155:155 +(TOKEN "False") 156:160 +(TOKEN ">") 162:162 +(TOKEN "True") 164:167 +(TOKEN ")") 168:168 +(NEWLINE) 169:169 +(NEWLINE) 170:170 +(TOKEN "identifier" i) 171:171 +(TOKEN "=") 173:173 +(TOKEN "not") 175:177 +(TOKEN "(") 178:178 +(TOKEN "False") 179:183 +(TOKEN "==") 185:186 +(TOKEN "False") 188:192 +(TOKEN ")") 193:193 +(TOKEN "!=") 195:196 +(TOKEN "True") 198:201 +(NEWLINE) 202:202 +(TOKEN "identifier" i) 203:203 +(TOKEN "=") 205:205 +(TOKEN "integer" 3) 207:207 +(TOKEN "<=") 209:210 +(TOKEN "integer" 4) 212:212 +(TOKEN "and") 214:216 +(TOKEN "integer" 4) 218:218 +(TOKEN ">=") 220:221 +(TOKEN "integer" 3) 223:223 +(NEWLINE) 224:224 +(TOKEN "identifier" i) 225:225 +(TOKEN "=") 227:227 +(TOKEN "integer" 3) 229:229 +(TOKEN "<=") 231:232 +(TOKEN "integer" 4) 234:234 +(TOKEN "or") 236:237 +(TOKEN "integer" 4) 239:239 +(TOKEN ">=") 241:242 +(TOKEN "integer" 3) 244:244 +(NEWLINE) 245:245 +(NEWLINE) 246:246 +(TOKEN "identifier" i) 247:247 +(TOKEN "=") 249:249 +(TOKEN "~") 251:251 +(TOKEN "identifier" i) 252:252 +(NEWLINE) 253:253 +(TOKEN "identifier" i) 254:254 +(TOKEN "=") 256:256 +(TOKEN "integer" 1) 258:258 +(TOKEN "^") 260:260 +(TOKEN "integer" 2) 262:262 +(NEWLINE) 263:263 +(TOKEN "identifier" i) 264:264 +(TOKEN "=") 266:266 +(TOKEN "integer" 2) 268:268 +(TOKEN "<<") 270:271 +(TOKEN "integer" 3) 273:273 +(NEWLINE) 274:274 +(TOKEN "identifier" i) 275:275 +(TOKEN "=") 277:277 +(TOKEN "integer" 3) 279:279 +(TOKEN ">>") 281:282 +(TOKEN "integer" 4) 284:284 +(NEWLINE) 285:285 +(TOKEN "identifier" i) 286:286 +(TOKEN "=") 288:288 +(TOKEN "integer" 4) 290:290 +(TOKEN "**") 292:293 +(TOKEN "integer" 5) 295:295 +(NEWLINE) 296:296 +(TOKEN "identifier" i) 297:297 +(TOKEN "=") 299:299 +(TOKEN "integer" 5) 301:301 +(TOKEN "//") 303:304 +(TOKEN "integer" 6) 306:306 +(NEWLINE) 307:307 +(TOKEN "identifier" i) 308:308 +(TOKEN "=") 310:310 +(TOKEN "integer" 6) 312:312 +(TOKEN "|") 314:314 +(TOKEN "integer" 7) 316:316 +(NEWLINE) 317:317 +(TOKEN "identifier" i) 318:318 +(TOKEN "=") 320:320 +(TOKEN "integer" 7) 322:322 +(TOKEN "&") 324:324 +(TOKEN "integer" 8) 326:326 +(NEWLINE) 327:327 +(NEWLINE) 328:328 +(TOKEN "identifier" i) 329:329 +(TOKEN "|=") 331:332 +(TOKEN "integer" 1) 334:334 +(NEWLINE) 335:335 +(TOKEN "identifier" i) 336:336 +(TOKEN "&=") 338:339 +(TOKEN "integer" 2) 341:341 +(NEWLINE) 342:342 +(TOKEN "identifier" i) 343:343 +(TOKEN "^=") 345:346 +(TOKEN "integer" 3) 348:348 +(NEWLINE) 349:349 +(TOKEN "identifier" i) 350:350 +(TOKEN "//=") 352:354 +(TOKEN "integer" 4) 356:356 +(NEWLINE) 357:357 +(TOKEN "identifier" i) 358:358 +(TOKEN "**=") 360:362 +(TOKEN "integer" 5) 364:364 +(NEWLINE) 365:365 +(TOKEN "identifier" i) 366:366 +(TOKEN "<<=") 368:370 +(TOKEN "integer" 6) 372:372 +(NEWLINE) 373:373 +(TOKEN "identifier" i) 374:374 +(TOKEN ">>=") 376:378 +(TOKEN "integer" 7) 380:380 +(NEWLINE) 381:381 +(TOKEN "identifier" i) 382:382 +(TOKEN "+=") 384:385 +(TOKEN "integer" 8) 387:387 +(NEWLINE) 388:388 +(TOKEN "identifier" i) 389:389 +(TOKEN "-=") 391:392 +(TOKEN "integer" 9) 394:394 +(NEWLINE) 395:395 +(TOKEN "identifier" i) 396:396 +(TOKEN "*=") 398:399 +(TOKEN "integer" 10) 401:402 +(NEWLINE) 403:403 +(TOKEN "identifier" i) 404:404 +(TOKEN "/=") 406:407 +(TOKEN "integer" 11) 409:410 +(NEWLINE) 411:411 +(TOKEN "identifier" i) 412:412 +(TOKEN "%=") 414:415 +(TOKEN "integer" 12) 417:418 +(NEWLINE) 419:419 +(NEWLINE) 420:420 +(TOKEN "@") 421:421 +(TOKEN "identifier" overload) 422:429 +(NEWLINE) 430:430 +(KEYWORD "def") 431:433 +(TOKEN "identifier" test) 435:438 +(TOKEN "(") 439:439 +(TOKEN "identifier" x) 440:440 +(TOKEN ")") 441:441 +(TOKEN ":") 442:442 +(NEWLINE) 443:443 +(TOKEN "indent") 444:447 +(TOKEN "identifier" print) 448:452 +(TOKEN "(") 453:453 +(TOKEN "string" "Decorators") 454:465 +(TOKEN ")") 466:466 +(NEWLINE) 467:467 +(NEWLINE) 468:468 +(TOKEN "dedent") 468:468 +(KEYWORD "class") 469:473 +(TOKEN "identifier" t) 475:475 +(TOKEN ":") 476:476 +(NEWLINE) 477:477 +(TOKEN "indent") 478:481 +(KEYWORD "def") 482:484 +(TOKEN "identifier" __init__) 486:493 +(TOKEN "(") 494:494 +(TOKEN "identifier" self) 495:498 +(TOKEN ",") 499:499 +(TOKEN "identifier" x) 501:501 +(TOKEN ")") 502:502 +(TOKEN ":") 503:503 +(NEWLINE) 504:504 +(TOKEN "indent") 505:512 +(TOKEN "identifier" self) 513:516 +(TOKEN ".") 517:517 +(TOKEN "identifier" x) 518:518 +(TOKEN "=") 520:520 +(TOKEN "identifier" x) 522:522 +(NEWLINE) 523:523 +(NEWLINE) 524:524 +(TOKEN "dedent") 524:524 +(TOKEN "dedent") 524:524 +(KEYWORD "if") 525:526 +(TOKEN "identifier" i) 528:528 +(TOKEN ">=") 530:531 +(TOKEN "integer" 1) 533:533 +(TOKEN "or") 535:536 +(TOKEN "identifier" j) 548:548 +(TOKEN "<=") 550:551 +(TOKEN "integer" 10) 553:554 +(TOKEN ":") 555:555 +(NEWLINE) 556:556 +(TOKEN "indent") 557:560 +(TOKEN "identifier" print) 561:565 +(TOKEN "(") 566:566 +(TOKEN "string" "Backlash") 567:576 +(TOKEN ")") 577:577 +(NEWLINE) 578:578 +(NEWLINE) 579:579 +(TOKEN "dedent") 579:579 +(KEYWORD "assert") 580:585 +(TOKEN "identifier" self) 587:590 +(TOKEN ".") 591:591 +(TOKEN "identifier" conv) 592:595 +(TOKEN "(") 596:596 +(TOKEN "identifier" np) 597:598 +(TOKEN ".") 599:599 +(TOKEN "identifier" RAISE) 600:604 +(TOKEN ")") 605:605 +(TOKEN "==") 607:608 +(TOKEN "string" "NPY_RAISE") 610:620 +(NEWLINE) 621:621 +(TOKEN "identifier" args) 622:625 +(TOKEN "+=") 627:628 +(TOKEN "identifier" k) 630:630 +(TOKEN "+") 632:632 +(TOKEN "string" "=") 634:636 +(TOKEN "+") 638:638 +(TOKEN "identifier" v) 640:640 +(TOKEN ".") 641:641 +(TOKEN "identifier" tostring) 642:649 +(TOKEN "(") 650:650 +(TOKEN "identifier" Precedence) 651:660 +(TOKEN ".") 661:661 +(TOKEN "identifier" NONE) 662:665 +(TOKEN ")") 666:666 +(NEWLINE) 667:667 +(NEWLINE) 668:668 +(TOKEN "identifier" x) 669:669 +(TOKEN "=") 671:671 +(TOKEN "identifier" none) 673:676 +(NEWLINE) 677:677 +(TOKEN "identifier" x) 678:678 +(TOKEN "=") 680:680 +(KEYWORD "none") 682:685 +(NEWLINE) 686:686 +(NEWLINE) 687:687 +(KEYWORD "if") 688:689 +(TOKEN "not") 691:693 +(TOKEN "identifier" info) 695:698 +(TOKEN "or") 700:701 +(TOKEN "identifier" name) 703:706 +(KEYWORD "in") 708:709 +(TOKEN "identifier" info) 711:714 +(TOKEN "[") 715:715 +(TOKEN "-") 716:716 +(TOKEN "integer" 1) 717:717 +(TOKEN "]") 718:718 +(TOKEN ":") 719:719 +(TOKEN "eolcomment") 721:736 +(NEWLINE) 737:737 +(TOKEN "indent") 738:741 +(KEYWORD "pass") 742:745 +(NEWLINE) 746:746 +(NEWLINE) 747:747 +(TOKEN "dedent") 747:747 +(TOKEN "identifier" assert_) 748:754 +(TOKEN "(") 755:755 +(TOKEN "not") 756:758 +(TOKEN "identifier" internal_overlap) 760:775 +(TOKEN "(") 776:776 +(TOKEN "identifier" a) 777:777 +(TOKEN ")") 778:778 +(TOKEN ")") 779:779 +(NEWLINE) 780:780 +(EOF) 781:781 diff --git a/tests/reference/wat-bool1-234bcd1.json b/tests/reference/wat-bool1-234bcd1.json new file mode 100644 index 0000000000..4be1a3e7c1 --- /dev/null +++ b/tests/reference/wat-bool1-234bcd1.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-bool1-234bcd1", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/bool1.py", + "infile_hash": "f61ed4d1f164753f9f78f63957d4faf040bcd6099e18dbf3e32cf7d5", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-bool1-234bcd1.stdout", + "stdout_hash": "1ac138f5c0fd3b21a75e6bf4e0024d5f0df2f0a6b195defd472677c2", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-bool1-234bcd1.stdout b/tests/reference/wat-bool1-234bcd1.stdout new file mode 100644 index 0000000000..b50b0ccd6a --- /dev/null +++ b/tests/reference/wat-bool1-234bcd1.stdout @@ -0,0 +1,218 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (type (;3;) (func (param) (result))) + (type (;4;) (func (param) (result))) + (type (;5;) (func (param i64) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + call 3 + return + ) + (func $3 (type 3) (param) (result) + (local i32) + i32.const 1 + i64.extend_i32_s + call 5 + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 0 + i64.extend_i32_s + call 5 + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + local.set 0 + local.get 0 + i64.extend_i32_s + call 5 + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 0 + local.set 0 + local.get 0 + i64.extend_i32_s + call 5 + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + return + ) + (func $4 (type 4) (param) (result) + (local) + call 2 + i32.const 0 + call 0 + return + ) + (func $5 (type 5) (param i64) (result) + (local i64 i64 i64 i64) + local.get 0 + i64.const 0 + i64.eq + if + i32.const 1 + i32.const 88 + i32.const 1 + i32.const 0 + call 1 + drop + return + else + end + local.get 0 + i64.const 0 + i64.lt_s + if + i32.const 1 + i32.const 28 + i32.const 1 + i32.const 0 + call 1 + drop + local.get 0 + i64.const -1 + i64.mul + local.set 0 + else + end + local.get 0 + local.set 4 + i64.const 0 + local.set 1 + loop + local.get 0 + i64.const 0 + i64.gt_s + if + local.get 1 + i64.const 1 + i64.add + local.set 1 + local.get 0 + i64.const 10 + i64.div_s + local.set 0 + br 1 + else + end + end + loop + local.get 1 + i64.const 0 + i64.gt_s + if + local.get 1 + i64.const 1 + i64.sub + local.set 1 + i64.const 1 + local.set 2 + i64.const 0 + local.set 3 + loop + local.get 3 + local.get 1 + i64.lt_s + if + local.get 3 + i64.const 1 + i64.add + local.set 3 + local.get 2 + i64.const 10 + i64.mul + local.set 2 + br 1 + else + end + end + local.get 4 + local.get 2 + i64.div_s + i64.const 10 + i64.rem_s + i64.const 12 + i64.mul + i64.const 88 + i64.add + local.set 0 + i32.const 1 + local.get 0 + i32.wrap_i64 + i32.const 1 + i32.const 0 + call 1 + drop + br 1 + else + end + end + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "__main__global_stmts" (func 2)) + (export "test_bool" (func 3)) + (export "_start" (func 4)) + (export "print_i64" (func 5)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") +) diff --git a/tests/reference/wat-expr14-5e0cb96.json b/tests/reference/wat-expr14-5e0cb96.json new file mode 100644 index 0000000000..09741a198d --- /dev/null +++ b/tests/reference/wat-expr14-5e0cb96.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-expr14-5e0cb96", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/expr14.py", + "infile_hash": "d18abc152939c944f6a1e493754cea8b72f0d03d360ab4c9e75ad697", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-expr14-5e0cb96.stdout", + "stdout_hash": "f8ff7eb9eb4bc533fc4d36c58a0378df6dfbf135313962dbf379d69a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-expr14-5e0cb96.stdout b/tests/reference/wat-expr14-5e0cb96.stdout new file mode 100644 index 0000000000..60c9b0a760 --- /dev/null +++ b/tests/reference/wat-expr14-5e0cb96.stdout @@ -0,0 +1,57 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + i32.const 0 + call 0 + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "_start" (func 2)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") +) diff --git a/tests/reference/wat-expr2-8b17723.json b/tests/reference/wat-expr2-8b17723.json new file mode 100644 index 0000000000..ad73a311e7 --- /dev/null +++ b/tests/reference/wat-expr2-8b17723.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-expr2-8b17723", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/expr2.py", + "infile_hash": "52d7d4d33553138f2cf55b9900047e5310c54d62e54b3ca1fa394024", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-expr2-8b17723.stdout", + "stdout_hash": "f8ff7eb9eb4bc533fc4d36c58a0378df6dfbf135313962dbf379d69a", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-expr2-8b17723.stdout b/tests/reference/wat-expr2-8b17723.stdout new file mode 100644 index 0000000000..60c9b0a760 --- /dev/null +++ b/tests/reference/wat-expr2-8b17723.stdout @@ -0,0 +1,57 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + i32.const 0 + call 0 + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "_start" (func 2)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") +) diff --git a/tests/reference/wat-expr9-f73afd1.json b/tests/reference/wat-expr9-f73afd1.json new file mode 100644 index 0000000000..a5aa2534df --- /dev/null +++ b/tests/reference/wat-expr9-f73afd1.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-expr9-f73afd1", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/expr9.py", + "infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-expr9-f73afd1.stdout", + "stdout_hash": "169634bcbf991ebd3a4315e3824320762aea19971ac0a85026095e6c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-expr9-f73afd1.stdout b/tests/reference/wat-expr9-f73afd1.stdout new file mode 100644 index 0000000000..d02d5684b0 --- /dev/null +++ b/tests/reference/wat-expr9-f73afd1.stdout @@ -0,0 +1,113 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (type (;3;) (func (param) (result))) + (type (;4;) (func (param i32) (result i32))) + (type (;5;) (func (param i32) (result i32))) + (type (;6;) (func (param i32) (result i32))) + (type (;7;) (func (param) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + call 3 + return + ) + (func $3 (type 3) (param) (result) + (local i32 i32) + i32.const 4 + call 4 + local.set 0 + i32.const 4 + call 5 + local.set 1 + i32.const 4 + call 6 + local.set 0 + return + ) + (func $4 (type 4) (param i32) (result i32) + (local i32 i32) + i32.const 5 + local.set 2 + local.get 2 + local.set 1 + local.get 1 + return + ) + (func $5 (type 5) (param i32) (result i32) + (local i32 i32) + i32.const 208 + local.set 2 + local.get 2 + local.set 1 + local.get 1 + return + ) + (func $6 (type 6) (param i32) (result i32) + (local i32) + local.get 0 + local.set 1 + local.get 1 + return + ) + (func $7 (type 7) (param) (result) + (local) + call 2 + i32.const 0 + call 0 + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "__main__global_stmts" (func 2)) + (export "main0" (func 3)) + (export "test_return_1" (func 4)) + (export "test_return_2" (func 5)) + (export "test_return_3" (func 6)) + (export "_start" (func 7)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") + (data (;34;) (i32.const 208) "\d8\00\00\00\04\00\00\00") + (data (;35;) (i32.const 216) "test") +) diff --git a/tests/reference/wat-loop1-e0046d4.json b/tests/reference/wat-loop1-e0046d4.json new file mode 100644 index 0000000000..05dedbeef8 --- /dev/null +++ b/tests/reference/wat-loop1-e0046d4.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-loop1-e0046d4", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/loop1.py", + "infile_hash": "324b018f29f7dffbd326e77b7ff9b6a9286837d573ed28f9d86e0311", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-loop1-e0046d4.stdout", + "stdout_hash": "186355413b04732159a4ea9cf108245721b5a41d5a6630a4f8cc7785", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-loop1-e0046d4.stdout b/tests/reference/wat-loop1-e0046d4.stdout new file mode 100644 index 0000000000..2683a49e6c --- /dev/null +++ b/tests/reference/wat-loop1-e0046d4.stdout @@ -0,0 +1,197 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (type (;3;) (func (param) (result))) + (type (;4;) (func (param i32) (result i32))) + (type (;5;) (func (param i32) (result i32))) + (type (;6;) (func (param i32) (result i64))) + (type (;7;) (func (param) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + call 3 + return + ) + (func $3 (type 3) (param) (result) + (local i32 i64) + i32.const 4 + call 4 + local.set 0 + i32.const 4 + call 5 + local.set 0 + i32.const 5 + call 6 + local.set 1 + return + ) + (func $4 (type 4) (param i32) (result i32) + (local i32 i32) + local.get 0 + i32.const 0 + i32.lt_s + if + i32.const 0 + local.set 1 + local.get 1 + return + else + end + i32.const 1 + local.set 2 + loop + local.get 0 + i32.const 0 + i32.gt_s + if + local.get 2 + local.get 0 + i32.mul + local.set 2 + local.get 0 + i32.const 1 + i32.sub + local.set 0 + br 1 + else + end + end + local.get 2 + local.set 1 + local.get 1 + return + ) + (func $5 (type 5) (param i32) (result i32) + (local i32 i32 i32) + i32.const 1 + local.set 3 + i32.const 1 + i32.const 1 + i32.sub + local.set 2 + loop + local.get 2 + i32.const 1 + i32.add + local.get 0 + i32.const 1 + i32.add + i32.const 1 + i32.sub + i32.le_s + if + local.get 2 + i32.const 1 + i32.add + local.set 2 + local.get 3 + local.get 2 + i32.mul + local.set 3 + br 1 + else + end + end + local.get 3 + local.set 1 + local.get 1 + return + ) + (func $6 (type 6) (param i32) (result i64) + (local i64 i64) + i64.const 0 + local.set 2 + local.get 0 + i32.const 0 + i32.lt_s + if + local.get 2 + local.set 1 + local.get 1 + return + else + end + i64.const 1 + local.set 2 + loop + local.get 0 + i32.const 0 + i32.gt_s + if + local.get 2 + local.get 0 + i64.extend_i32_s + i64.mul + local.set 2 + local.get 0 + i32.const 1 + i32.sub + local.set 0 + br 1 + else + end + end + local.get 2 + local.set 1 + local.get 1 + return + ) + (func $7 (type 7) (param) (result) + (local) + call 2 + i32.const 0 + call 0 + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "__main__global_stmts" (func 2)) + (export "main0" (func 3)) + (export "test_factorial_1" (func 4)) + (export "test_factorial_2" (func 5)) + (export "test_factorial_3" (func 6)) + (export "_start" (func 7)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") +) diff --git a/tests/reference/wat-print_str-385e953.json b/tests/reference/wat-print_str-385e953.json new file mode 100644 index 0000000000..de1714455f --- /dev/null +++ b/tests/reference/wat-print_str-385e953.json @@ -0,0 +1,13 @@ +{ + "basename": "wat-print_str-385e953", + "cmd": "lpython --no-color --show-wat {infile}", + "infile": "tests/print_str.py", + "infile_hash": "56d2a86f8e1cca05ff1749d1c4cdaa79f99b6f92d3ce60870ee900d7", + "outfile": null, + "outfile_hash": null, + "stdout": "wat-print_str-385e953.stdout", + "stdout_hash": "8e9a0f7a017cdd451f10e9b8686d3a9ba00c1c4088fbd01cfa2df1cc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/wat-print_str-385e953.stdout b/tests/reference/wat-print_str-385e953.stdout new file mode 100644 index 0000000000..9db655a5ed --- /dev/null +++ b/tests/reference/wat-print_str-385e953.stdout @@ -0,0 +1,162 @@ +(module + (type (;0;) (func (param i32) (result))) + (type (;1;) (func (param i32 i32 i32 i32) (result i32))) + (type (;2;) (func (param) (result))) + (type (;3;) (func (param) (result))) + (type (;4;) (func (param) (result))) + (type (;5;) (func (param) (result))) + (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0))) + (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1))) + (global $0 (mut i32) (i32.const 0)) + (global $1 (mut i32) (i32.const 0)) + (global $2 (mut i64) (i64.const 0)) + (global $3 (mut f32) (f32.const 0.000000)) + (global $4 (mut f32) (f32.const 0.000000)) + (global $5 (mut f64) (f64.const 0.000000)) + (global $6 (mut f64) (f64.const 0.000000)) + (func $2 (type 2) (param) (result) + (local) + call 3 + return + ) + (func $3 (type 3) (param) (result) + (local) + call 4 + return + ) + (func $4 (type 4) (param) (result) + (local) + i32.const 1 + i32.const 208 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 224 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 240 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 256 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 272 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 288 + i32.const 1 + i32.const 0 + call 1 + drop + i32.const 1 + i32.const 16 + i32.const 1 + i32.const 0 + call 1 + drop + return + ) + (func $5 (type 5) (param) (result) + (local) + call 2 + i32.const 0 + call 0 + return + ) + (memory (;0;) 1000 1000) + (export "memory" (memory 0)) + (export "__main__global_stmts" (func 2)) + (export "main0" (func 3)) + (export "printCompOperations" (func 4)) + (export "_start" (func 5)) + (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00") + (data (;1;) (i32.const 12) " ") + (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00") + (data (;3;) (i32.const 24) "\n ") + (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00") + (data (;5;) (i32.const 36) "- ") + (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00") + (data (;7;) (i32.const 48) ". ") + (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00") + (data (;9;) (i32.const 60) "( ") + (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00") + (data (;11;) (i32.const 72) ") ") + (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00") + (data (;13;) (i32.const 84) ", ") + (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00") + (data (;15;) (i32.const 96) "0 ") + (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00") + (data (;17;) (i32.const 108) "1 ") + (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00") + (data (;19;) (i32.const 120) "2 ") + (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00") + (data (;21;) (i32.const 132) "3 ") + (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00") + (data (;23;) (i32.const 144) "4 ") + (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00") + (data (;25;) (i32.const 156) "5 ") + (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00") + (data (;27;) (i32.const 168) "6 ") + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") + (data (;29;) (i32.const 180) "7 ") + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") + (data (;31;) (i32.const 192) "8 ") + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") + (data (;33;) (i32.const 204) "9 ") + (data (;34;) (i32.const 208) "\d8\00\00\00\05\00\00\00") + (data (;35;) (i32.const 216) "x < y ") + (data (;36;) (i32.const 224) "\e8\00\00\00\06\00\00\00") + (data (;37;) (i32.const 232) "x !< y ") + (data (;38;) (i32.const 240) "\f8\00\00\00\05\00\00\00") + (data (;39;) (i32.const 248) "x > y ") + (data (;40;) (i32.const 256) "\08\01\00\00\06\00\00\00") + (data (;41;) (i32.const 264) "x !> y ") + (data (;42;) (i32.const 272) "\18\01\00\00\06\00\00\00") + (data (;43;) (i32.const 280) "x == y ") + (data (;44;) (i32.const 288) "\28\01\00\00\06\00\00\00") + (data (;45;) (i32.const 296) "x != y ") +) From dad38f94fd9b525b03346b0961af7cdc5287eb2b Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 12:55:12 +0530 Subject: [PATCH 06/18] Clean test references --- .../reference/asr-array_01_decl-39cf894.json | 10 +- .../asr-array_01_decl-39cf894.stdout | 1043 +++++ .../reference/asr-array_02_decl-e8f6874.json | 10 +- .../asr-array_02_decl-e8f6874.stdout | 833 ++++ tests/reference/asr-arrays_01-a617b64.json | 2 +- tests/reference/asr-arrays_01-a617b64.stderr | 25 +- tests/reference/asr-arrays_02-da94458.json | 2 +- tests/reference/asr-arrays_02-da94458.stderr | 22 +- tests/reference/asr-arrays_03-de2e952.json | 2 +- tests/reference/asr-arrays_03-de2e952.stderr | 20 +- tests/reference/asr-arrays_04-880407c.json | 2 +- tests/reference/asr-arrays_04-880407c.stderr | 20 +- tests/reference/asr-arrays_05-ec8fbd5.json | 2 +- tests/reference/asr-arrays_05-ec8fbd5.stderr | 20 +- tests/reference/asr-arrays_06-fbb09a3.json | 2 +- tests/reference/asr-arrays_06-fbb09a3.stderr | 20 +- tests/reference/asr-arrays_07-de430fd.json | 2 +- tests/reference/asr-arrays_07-de430fd.stderr | 20 +- tests/reference/asr-arrays_08-ba317a3.json | 2 +- tests/reference/asr-arrays_08-ba317a3.stderr | 20 +- tests/reference/asr-arrays_09-50ee586.json | 2 +- tests/reference/asr-arrays_09-50ee586.stderr | 20 +- tests/reference/asr-arrays_10-bc82d75.json | 2 +- tests/reference/asr-arrays_10-bc82d75.stderr | 20 +- tests/reference/asr-arrays_11-fc505b4.json | 2 +- tests/reference/asr-arrays_11-fc505b4.stderr | 20 +- tests/reference/asr-arrays_12-63d6f25.json | 2 +- tests/reference/asr-arrays_12-63d6f25.stderr | 20 +- tests/reference/asr-arrays_13-b5fcc7e.json | 2 +- tests/reference/asr-arrays_13-b5fcc7e.stderr | 20 +- tests/reference/asr-arrays_14-78be00e.json | 2 +- tests/reference/asr-arrays_14-78be00e.stderr | 20 +- tests/reference/asr-bindc_02-bc1a7ea.json | 10 +- tests/reference/asr-bindc_02-bc1a7ea.stdout | 437 ++ tests/reference/asr-bindc_03-95dbba7.json | 2 +- tests/reference/asr-bindc_03-95dbba7.stderr | 20 +- tests/reference/asr-bindc_04-06bd800.json | 2 +- tests/reference/asr-bindc_04-06bd800.stderr | 22 +- tests/reference/asr-cast-435c233.json | 10 +- tests/reference/asr-cast-435c233.stdout | 312 ++ tests/reference/asr-complex1-f26c460.json | 10 +- tests/reference/asr-complex1-f26c460.stdout | 794 ++++ tests/reference/asr-constants1-5828e8a.json | 10 +- tests/reference/asr-constants1-5828e8a.stdout | 1793 ++++++++ tests/reference/asr-elemental_01-b58df26.json | 10 +- .../reference/asr-elemental_01-b58df26.stdout | 3649 +++++++++++++++++ tests/reference/asr-expr10-efcbb1b.json | 10 +- tests/reference/asr-expr10-efcbb1b.stdout | 453 ++ tests/reference/asr-expr13-81bdb5a.json | 10 +- tests/reference/asr-expr13-81bdb5a.stdout | 473 +++ tests/reference/asr-expr7-480ba2f.json | 8 +- tests/reference/asr-expr7-480ba2f.stderr | 14 +- tests/reference/asr-expr7-480ba2f.stdout | 371 ++ tests/reference/asr-expr8-6beda60.json | 10 +- tests/reference/asr-expr8-6beda60.stdout | 430 ++ tests/reference/asr-expr_05-3a37324.json | 10 +- tests/reference/asr-expr_05-3a37324.stdout | 1642 ++++++++ .../asr-generics_array_01-682b1b2.json | 10 +- .../asr-generics_array_01-682b1b2.stdout | 459 +++ .../asr-generics_array_02-22c8dc1.json | 10 +- .../asr-generics_array_02-22c8dc1.stdout | 1391 +++++++ .../asr-generics_array_03-fb3706c.json | 10 +- .../asr-generics_array_03-fb3706c.stdout | 1880 +++++++++ .../asr-kwargs_02_error-7c91f8f.json | 2 +- .../asr-kwargs_02_error-7c91f8f.stderr | 16 +- tests/reference/asr-string_02-499c9ff.json | 2 +- tests/reference/asr-string_02-499c9ff.stderr | 10 +- tests/reference/asr-structs_05-fa98307.json | 10 +- tests/reference/asr-structs_05-fa98307.stdout | 1476 +++++++ tests/reference/asr-test_assign8-4b26e63.json | 2 +- .../reference/asr-test_assign8-4b26e63.stderr | 14 +- tests/reference/asr-test_binop3-a67201d.json | 2 +- .../reference/asr-test_binop3-a67201d.stderr | 10 +- .../asr-test_bool_binop-f856ef0.json | 10 +- .../asr-test_bool_binop-f856ef0.stdout | 442 ++ .../asr-test_builtin_bin-52ba9fa.json | 10 +- .../asr-test_builtin_bin-52ba9fa.stdout | 271 ++ .../asr-test_builtin_bool-330223a.json | 10 +- .../asr-test_builtin_bool-330223a.stdout | 896 ++++ .../asr-test_builtin_hex-64bd268.json | 10 +- .../asr-test_builtin_hex-64bd268.stdout | 246 ++ .../asr-test_builtin_oct-20b9066.json | 10 +- .../asr-test_builtin_oct-20b9066.stdout | 246 ++ .../asr-test_builtin_pow-f02fcda.json | 8 +- .../asr-test_builtin_pow-f02fcda.stderr | 10 +- .../asr-test_builtin_pow-f02fcda.stdout | 1919 +++++++++ .../asr-test_builtin_round-7417a21.json | 10 +- .../asr-test_builtin_round-7417a21.stdout | 919 +++++ .../asr-test_complex_01-a6def58.json | 10 +- .../asr-test_complex_01-a6def58.stdout | 2013 +++++++++ .../asr-test_complex_02-782ba2d.json | 10 +- .../asr-test_complex_02-782ba2d.stdout | 718 ++++ tests/reference/asr-test_dict13-683b290.json | 2 +- .../reference/asr-test_dict13-683b290.stderr | 12 +- tests/reference/asr-test_max_min-3c2fc51.json | 10 +- .../reference/asr-test_max_min-3c2fc51.stdout | 814 ++++ .../reference/asr-test_numpy_03-e600a49.json | 10 +- .../asr-test_numpy_03-e600a49.stdout | 1938 +++++++++ .../reference/asr-test_numpy_04-ecbb614.json | 10 +- .../asr-test_numpy_04-ecbb614.stdout | 519 +++ tests/reference/asr-test_pow-3f5d550.json | 8 +- tests/reference/asr-test_pow-3f5d550.stderr | 10 +- tests/reference/asr-test_pow-3f5d550.stdout | 159 + tests/reference/asr-test_pow1-581ef42.json | 2 +- tests/reference/asr-test_pow1-581ef42.stderr | 14 +- tests/reference/asr-test_pow2-0dcbd7d.json | 2 +- tests/reference/asr-test_pow2-0dcbd7d.stderr | 14 +- tests/reference/asr-test_pow3-79749ed.json | 2 +- tests/reference/asr-test_pow3-79749ed.stderr | 14 +- tests/reference/asr-test_pow4-ef60978.json | 2 +- tests/reference/asr-test_pow4-ef60978.stderr | 14 +- .../asr-test_zero_division-3dd84e8.json | 2 +- .../asr-test_zero_division-3dd84e8.stderr | 4 +- .../asr-test_zero_division2-d84989f.json | 2 +- .../asr-test_zero_division2-d84989f.stderr | 4 +- tests/reference/asr-vec_01-66ac423.json | 10 +- tests/reference/asr-vec_01-66ac423.stdout | 295 ++ tests/reference/c-expr7-bb2692a.json | 8 +- tests/reference/c-expr7-bb2692a.stderr | 14 +- tests/reference/c-expr7-bb2692a.stdout | 362 ++ tests/reference/cpp-expr15-1661c0d.json | 10 +- tests/reference/cpp-expr15-1661c0d.stdout | 92 + tests/reference/cpp-expr7-529bd53.json | 8 +- tests/reference/cpp-expr7-529bd53.stderr | 14 +- tests/reference/cpp-expr7-529bd53.stdout | 83 + tests/reference/cpp-expr8-704cece.json | 10 +- tests/reference/cpp-expr8-704cece.stdout | 37 + .../cpp-test_builtin_pow-56b3f92.json | 8 +- .../cpp-test_builtin_pow-56b3f92.stderr | 10 +- .../cpp-test_builtin_pow-56b3f92.stdout | 269 ++ .../pass_loop_vectorise-vec_01-be9985e.json | 10 +- .../pass_loop_vectorise-vec_01-be9985e.stdout | 527 +++ 132 files changed, 30547 insertions(+), 583 deletions(-) create mode 100644 tests/reference/asr-array_01_decl-39cf894.stdout create mode 100644 tests/reference/asr-array_02_decl-e8f6874.stdout create mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stdout create mode 100644 tests/reference/asr-cast-435c233.stdout create mode 100644 tests/reference/asr-complex1-f26c460.stdout create mode 100644 tests/reference/asr-constants1-5828e8a.stdout create mode 100644 tests/reference/asr-elemental_01-b58df26.stdout create mode 100644 tests/reference/asr-expr10-efcbb1b.stdout create mode 100644 tests/reference/asr-expr13-81bdb5a.stdout create mode 100644 tests/reference/asr-expr7-480ba2f.stdout create mode 100644 tests/reference/asr-expr8-6beda60.stdout create mode 100644 tests/reference/asr-expr_05-3a37324.stdout create mode 100644 tests/reference/asr-generics_array_01-682b1b2.stdout create mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stdout create mode 100644 tests/reference/asr-generics_array_03-fb3706c.stdout create mode 100644 tests/reference/asr-structs_05-fa98307.stdout create mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stdout create mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stdout create mode 100644 tests/reference/asr-test_builtin_bool-330223a.stdout create mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stdout create mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stdout create mode 100644 tests/reference/asr-test_builtin_pow-f02fcda.stdout create mode 100644 tests/reference/asr-test_builtin_round-7417a21.stdout create mode 100644 tests/reference/asr-test_complex_01-a6def58.stdout create mode 100644 tests/reference/asr-test_complex_02-782ba2d.stdout create mode 100644 tests/reference/asr-test_max_min-3c2fc51.stdout create mode 100644 tests/reference/asr-test_numpy_03-e600a49.stdout create mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stdout create mode 100644 tests/reference/asr-test_pow-3f5d550.stdout create mode 100644 tests/reference/asr-vec_01-66ac423.stdout create mode 100644 tests/reference/c-expr7-bb2692a.stdout create mode 100644 tests/reference/cpp-expr15-1661c0d.stdout create mode 100644 tests/reference/cpp-expr7-529bd53.stdout create mode 100644 tests/reference/cpp-expr8-704cece.stdout create mode 100644 tests/reference/cpp-test_builtin_pow-56b3f92.stdout create mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout diff --git a/tests/reference/asr-array_01_decl-39cf894.json b/tests/reference/asr-array_01_decl-39cf894.json index b23bdaa272..6ad942e950 100644 --- a/tests/reference/asr-array_01_decl-39cf894.json +++ b/tests/reference/asr-array_01_decl-39cf894.json @@ -5,9 +5,9 @@ "infile_hash": "3dff59bab7475d254ce0470065c11e797e52a5b2a3d7546acc0e6705", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-array_01_decl-39cf894.stderr", - "stderr_hash": "5155e10cd4958bdda66178e2ed1b6faed6f415ff1cf3ff78e45f9cbb", - "returncode": 2 + "stdout": "asr-array_01_decl-39cf894.stdout", + "stdout_hash": "337d67c221f17230293b36428d0f59e687b3a1d577e9b361298e1257", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-array_01_decl-39cf894.stdout b/tests/reference/asr-array_01_decl-39cf894.stdout new file mode 100644 index 0000000000..94b5539996 --- /dev/null +++ b/tests/reference/asr-array_01_decl-39cf894.stdout @@ -0,0 +1,1043 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + ArraySizes: + (EnumType + (SymbolTable + 203 + { + SIZE_10: + (Variable + 203 + SIZE_10 + [] + Local + (IntegerConstant 10 (Integer 4)) + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + SIZE_3: + (Variable + 203 + SIZE_3 + [] + Local + (IntegerConstant 3 (Integer 4)) + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + ArraySizes + [] + [SIZE_3 + SIZE_10] + Source + Public + IntegerUnique + (Integer 4) + () + ), + __main__global_stmts: + (Function + (SymbolTable + 210 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [declare_arrays] + [] + [(SubroutineCall + 2 declare_arrays + () + [] + () + )] + () + Public + .false. + .false. + () + ), + accept_f32_array: + (Function + (SymbolTable + 207 + { + _lpython_return_variable: + (Variable + 207 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + xf32: + (Variable + 207 + xf32 + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_f32_array + (FunctionType + [(Array + (Real 4) + [(() + ())] + DescriptorArray + )] + (Real 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 207 xf32)] + [(= + (ArrayItem + (Var 207 xf32) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (RealConstant + 32.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 32.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 207 _lpython_return_variable) + (ArrayItem + (Var 207 xf32) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + () + ) + (Return)] + (Var 207 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_f64_array: + (Function + (SymbolTable + 208 + { + _lpython_return_variable: + (Variable + 208 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + xf64: + (Variable + 208 + xf64 + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_f64_array + (FunctionType + [(Array + (Real 8) + [(() + ())] + DescriptorArray + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 208 xf64)] + [(= + (ArrayItem + (Var 208 xf64) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + (RealConstant + 64.000000 + (Real 8) + ) + () + ) + (= + (Var 208 _lpython_return_variable) + (ArrayItem + (Var 208 xf64) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + () + ) + (Return)] + (Var 208 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_i16_array: + (Function + (SymbolTable + 204 + { + _lpython_return_variable: + (Variable + 204 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 2) + () + Source + Public + Required + .false. + ), + xi16: + (Variable + 204 + xi16 + [] + InOut + () + () + Default + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_i16_array + (FunctionType + [(Array + (Integer 2) + [(() + ())] + DescriptorArray + )] + (Integer 2) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 xi16)] + [(= + (ArrayItem + (Var 204 xi16) + [(() + (IntegerConstant 2 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (Cast + (IntegerConstant 32 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 32 (Integer 2)) + ) + () + ) + (= + (Var 204 _lpython_return_variable) + (ArrayItem + (Var 204 xi16) + [(() + (IntegerConstant 2 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + () + ) + (Return)] + (Var 204 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_i32_array: + (Function + (SymbolTable + 205 + { + _lpython_return_variable: + (Variable + 205 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + xi32: + (Variable + 205 + xi32 + [] + InOut + () + () + Default + (Array + (Integer 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_i32_array + (FunctionType + [(Array + (Integer 4) + [(() + ())] + DescriptorArray + )] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 xi32)] + [(= + (ArrayItem + (Var 205 xi32) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 32 (Integer 4)) + () + ) + (= + (Var 205 _lpython_return_variable) + (ArrayItem + (Var 205 xi32) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + () + ) + (Return)] + (Var 205 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_i64_array: + (Function + (SymbolTable + 206 + { + _lpython_return_variable: + (Variable + 206 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + xi64: + (Variable + 206 + xi64 + [] + InOut + () + () + Default + (Array + (Integer 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_i64_array + (FunctionType + [(Array + (Integer 8) + [(() + ())] + DescriptorArray + )] + (Integer 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 206 xi64)] + [(= + (ArrayItem + (Var 206 xi64) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 8) + RowMajor + () + ) + (Cast + (IntegerConstant 64 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 64 (Integer 8)) + ) + () + ) + (= + (Var 206 _lpython_return_variable) + (ArrayItem + (Var 206 xi64) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 8) + RowMajor + () + ) + () + ) + (Return)] + (Var 206 _lpython_return_variable) + Public + .false. + .false. + () + ), + declare_arrays: + (Function + (SymbolTable + 209 + { + ac32: + (Variable + 209 + ac32 + [] + Local + () + () + Default + (Array + (Complex 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ac64: + (Variable + 209 + ac64 + [] + Local + () + () + Default + (Array + (Complex 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + af32: + (Variable + 209 + af32 + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + af64: + (Variable + 209 + af64 + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ai16: + (Variable + 209 + ai16 + [] + Local + () + () + Default + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ai32: + (Variable + 209 + ai32 + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ai64: + (Variable + 209 + ai64 + [] + Local + () + () + Default + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + declare_arrays + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [accept_i16_array + accept_i32_array + accept_i64_array + accept_f32_array + accept_f64_array] + [] + [(= + (Var 209 ai16) + (ArrayConstant + [] + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 ai32) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 ai64) + (ArrayConstant + [] + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 af32) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 af64) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 ac32) + (ArrayConstant + [] + (Array + (Complex 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 ac64) + (ArrayConstant + [] + (Array + (Complex 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (Print + () + [(FunctionCall + 2 accept_i16_array + () + [((ArrayPhysicalCast + (Var 209 ai16) + FixedSizeArray + DescriptorArray + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Integer 2) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_i32_array + () + [((ArrayPhysicalCast + (Var 209 ai32) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Integer 4) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_i64_array + () + [((ArrayPhysicalCast + (Var 209 ai64) + FixedSizeArray + DescriptorArray + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Integer 8) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_f32_array + () + [((ArrayPhysicalCast + (Var 209 af32) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Real 4) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_f64_array + () + [((ArrayPhysicalCast + (Var 209 af64) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Real 8) + () + () + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 211 + { + __main__global_stmts: + (ExternalSymbol + 211 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 211 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-array_02_decl-e8f6874.json b/tests/reference/asr-array_02_decl-e8f6874.json index f59af233fa..fc84f3cbee 100644 --- a/tests/reference/asr-array_02_decl-e8f6874.json +++ b/tests/reference/asr-array_02_decl-e8f6874.json @@ -5,9 +5,9 @@ "infile_hash": "9a398864499c7a3b4e2a480faf3a5dccaa65f9771a8de27f55f11ca4", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-array_02_decl-e8f6874.stderr", - "stderr_hash": "b9fd331511456947bef74d5df2f292244e7fa1861ab43918a6e02acd", - "returncode": 2 + "stdout": "asr-array_02_decl-e8f6874.stdout", + "stdout_hash": "dba6ce6693793b0b40b3c7d2687ab8fed7eeca07ef25c8d7698470b8", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-array_02_decl-e8f6874.stdout b/tests/reference/asr-array_02_decl-e8f6874.stdout new file mode 100644 index 0000000000..12139962ed --- /dev/null +++ b/tests/reference/asr-array_02_decl-e8f6874.stdout @@ -0,0 +1,833 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 208 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [declare_arrays] + [] + [(SubroutineCall + 2 declare_arrays + () + [] + () + )] + () + Public + .false. + .false. + () + ), + accept_multidim_f32_array: + (Function + (SymbolTable + 205 + { + _lpython_return_variable: + (Variable + 205 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + xf32: + (Variable + 205 + xf32 + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_multidim_f32_array + (FunctionType + [(Array + (Real 4) + [(() + ())] + DescriptorArray + )] + (Real 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 xf32)] + [(= + (Var 205 _lpython_return_variable) + (ArrayItem + (Var 205 xf32) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + () + ) + (Return)] + (Var 205 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_multidim_f64_array: + (Function + (SymbolTable + 206 + { + _lpython_return_variable: + (Variable + 206 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + xf64: + (Variable + 206 + xf64 + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_multidim_f64_array + (FunctionType + [(Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + )] + (Real 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 206 xf64)] + [(= + (Var 206 _lpython_return_variable) + (ArrayItem + (Var 206 xf64) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 1 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + () + ) + (Return)] + (Var 206 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_multidim_i32_array: + (Function + (SymbolTable + 203 + { + _lpython_return_variable: + (Variable + 203 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + xi32: + (Variable + 203 + xi32 + [] + InOut + () + () + Default + (Array + (Integer 4) + [(() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_multidim_i32_array + (FunctionType + [(Array + (Integer 4) + [(() + ()) + (() + ())] + DescriptorArray + )] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 203 xi32)] + [(= + (Var 203 _lpython_return_variable) + (ArrayItem + (Var 203 xi32) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + () + ) + (Return)] + (Var 203 _lpython_return_variable) + Public + .false. + .false. + () + ), + accept_multidim_i64_array: + (Function + (SymbolTable + 204 + { + _lpython_return_variable: + (Variable + 204 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + xi64: + (Variable + 204 + xi64 + [] + InOut + () + () + Default + (Array + (Integer 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + accept_multidim_i64_array + (FunctionType + [(Array + (Integer 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + )] + (Integer 8) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 xi64)] + [(= + (Var 204 _lpython_return_variable) + (ArrayItem + (Var 204 xi64) + [(() + (IntegerConstant 9 (Integer 4)) + ()) + (() + (IntegerConstant 9 (Integer 4)) + ()) + (() + (IntegerConstant 9 (Integer 4)) + ())] + (Integer 8) + RowMajor + () + ) + () + ) + (Return)] + (Var 204 _lpython_return_variable) + Public + .false. + .false. + () + ), + declare_arrays: + (Function + (SymbolTable + 207 + { + ac32: + (Variable + 207 + ac32 + [] + Local + () + () + Default + (Array + (Complex 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 99 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ac64: + (Variable + 207 + ac64 + [] + Local + () + () + Default + (Array + (Complex 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 13 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 11 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + af32: + (Variable + 207 + af32 + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + af64: + (Variable + 207 + af64 + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ai32: + (Variable + 207 + ai32 + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + ai64: + (Variable + 207 + ai64 + [] + Local + () + () + Default + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + declare_arrays + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [accept_multidim_i32_array + accept_multidim_i64_array + accept_multidim_f32_array + accept_multidim_f64_array] + [] + [(= + (Var 207 ai32) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 207 ai64) + (ArrayConstant + [] + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 207 af32) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 207 af64) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 207 ac32) + (ArrayConstant + [] + (Array + (Complex 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 5 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 99 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 207 ac64) + (ArrayConstant + [] + (Array + (Complex 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 13 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 11 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (Print + () + [(FunctionCall + 2 accept_multidim_i32_array + () + [((ArrayPhysicalCast + (Var 207 ai32) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Integer 4) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_multidim_i64_array + () + [((ArrayPhysicalCast + (Var 207 ai64) + FixedSizeArray + DescriptorArray + (Array + (Integer 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Integer 8) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_multidim_f32_array + () + [((ArrayPhysicalCast + (Var 207 af32) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Real 4) + () + () + )] + () + () + ) + (Print + () + [(FunctionCall + 2 accept_multidim_f64_array + () + [((ArrayPhysicalCast + (Var 207 af64) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 10 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + DescriptorArray + ) + () + ))] + (Real 8) + () + () + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 209 + { + __main__global_stmts: + (ExternalSymbol + 209 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 209 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-arrays_01-a617b64.json b/tests/reference/asr-arrays_01-a617b64.json index ca8f874250..45a1b7310d 100644 --- a/tests/reference/asr-arrays_01-a617b64.json +++ b/tests/reference/asr-arrays_01-a617b64.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_01-a617b64.stderr", - "stderr_hash": "ddb2640e06012a8ab9efe1bc1dbe130321fb96721ce3fd749813c988", + "stderr_hash": "b8317c7306f747ceefa8557c06f2a0b4a8a4bd7ae805bb494fca6ef2", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_01-a617b64.stderr b/tests/reference/asr-arrays_01-a617b64.stderr index e712ee9cf1..4fa39a8c3c 100644 --- a/tests/reference/asr-arrays_01-a617b64.stderr +++ b/tests/reference/asr-arrays_01-a617b64.stderr @@ -1,17 +1,8 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_01.py:2:1 - | -2 | from numpy import empty, int8 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Type mismatch in procedure call; the types must be compatible + --> tests/errors/arrays_01.py:15:9 + | +15 | [i8(214), i8(157), i8(3), i8(146)]) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch (passed argument type is list[i8] but required type is i8[4]) + | + 9 | a : i8[4] = empty(4, dtype=int8) + | ^^^^^ type mismatch (passed argument type is list[i8] but required type is i8[4]) diff --git a/tests/reference/asr-arrays_02-da94458.json b/tests/reference/asr-arrays_02-da94458.json index 2dfc6c7f7c..37de52ba40 100644 --- a/tests/reference/asr-arrays_02-da94458.json +++ b/tests/reference/asr-arrays_02-da94458.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_02-da94458.stderr", - "stderr_hash": "b7b907310495016dfb487fccb13739865174dda44541ade08931bae9", + "stderr_hash": "dc0e5be7cd6de7395421aedf1ce11977206f3e35bb7cba271aed8992", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_02-da94458.stderr b/tests/reference/asr-arrays_02-da94458.stderr index 5229403208..295e0c9b28 100644 --- a/tests/reference/asr-arrays_02-da94458.stderr +++ b/tests/reference/asr-arrays_02-da94458.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_02.py:2:1 - | -2 | from numpy import (empty, int8) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() + --> tests/errors/arrays_02.py:28:8 + | +28 | assert r1.a == t1.a + | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-arrays_03-de2e952.json b/tests/reference/asr-arrays_03-de2e952.json index 77b002c31e..1583b11b63 100644 --- a/tests/reference/asr-arrays_03-de2e952.json +++ b/tests/reference/asr-arrays_03-de2e952.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_03-de2e952.stderr", - "stderr_hash": "ddfa8ceea3cb39c9b59069d2a67d13c8752ec2511fc62c162e77b206", + "stderr_hash": "4c932f31bbb10c9ba8d8d75be226ba9c33553be3bcb367c8112e31af", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_03-de2e952.stderr b/tests/reference/asr-arrays_03-de2e952.stderr index 00df208054..1fb5635502 100644 --- a/tests/reference/asr-arrays_03-de2e952.stderr +++ b/tests/reference/asr-arrays_03-de2e952.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_03.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_03.py:6:5 | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | x: i16[4] = empty([5], dtype=int16) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') diff --git a/tests/reference/asr-arrays_04-880407c.json b/tests/reference/asr-arrays_04-880407c.json index 69bda74cc5..1c5077a22c 100644 --- a/tests/reference/asr-arrays_04-880407c.json +++ b/tests/reference/asr-arrays_04-880407c.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_04-880407c.stderr", - "stderr_hash": "ee2a3d13e91567e2924e0154d6c09db79923debe4c2733b246964808", + "stderr_hash": "10ef155b0236096d5de8157e38b3989d99343b016a8153b68a36aa54", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_04-880407c.stderr b/tests/reference/asr-arrays_04-880407c.stderr index 692cb026bf..5cb27a1cb7 100644 --- a/tests/reference/asr-arrays_04-880407c.stderr +++ b/tests/reference/asr-arrays_04-880407c.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_04.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_04.py:6:5 | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | x: i16[5] = empty([5], dtype=int32) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5]' and 'i32[5]') diff --git a/tests/reference/asr-arrays_05-ec8fbd5.json b/tests/reference/asr-arrays_05-ec8fbd5.json index 8ff8c5a20d..a4302b38e0 100644 --- a/tests/reference/asr-arrays_05-ec8fbd5.json +++ b/tests/reference/asr-arrays_05-ec8fbd5.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_05-ec8fbd5.stderr", - "stderr_hash": "066b86f582348bb519b6a39a7e7421ac5a666b29d9ef96d753be0207", + "stderr_hash": "4e5d42a186b8d82b484ec66ccc5a3b90da7e4be8a32bac26ea906198", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_05-ec8fbd5.stderr b/tests/reference/asr-arrays_05-ec8fbd5.stderr index ee5cc62302..165aee29a8 100644 --- a/tests/reference/asr-arrays_05-ec8fbd5.stderr +++ b/tests/reference/asr-arrays_05-ec8fbd5.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_05.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_05.py:6:5 | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | x: i16[5, 4] = empty([5, 3], dtype=int16) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5,4]' and 'i16[5,3]') diff --git a/tests/reference/asr-arrays_06-fbb09a3.json b/tests/reference/asr-arrays_06-fbb09a3.json index 8c473166fc..863eeebf1e 100644 --- a/tests/reference/asr-arrays_06-fbb09a3.json +++ b/tests/reference/asr-arrays_06-fbb09a3.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_06-fbb09a3.stderr", - "stderr_hash": "529c8dc2333a83b0b67feb5db104ea294258fdcac341dad9e314cfee", + "stderr_hash": "1fa3f5061a72f03c0678806c0460b9ec5caf01cbbd2f07a606f1057e", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_06-fbb09a3.stderr b/tests/reference/asr-arrays_06-fbb09a3.stderr index 8d8b27a690..9bbcde8ee8 100644 --- a/tests/reference/asr-arrays_06-fbb09a3.stderr +++ b/tests/reference/asr-arrays_06-fbb09a3.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_06.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_06.py:6:5 | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | x: i16[5, 4] = empty([5, 4], dtype=int32) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5,4]' and 'i32[5,4]') diff --git a/tests/reference/asr-arrays_07-de430fd.json b/tests/reference/asr-arrays_07-de430fd.json index a3c5bfc680..19a44750cc 100644 --- a/tests/reference/asr-arrays_07-de430fd.json +++ b/tests/reference/asr-arrays_07-de430fd.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_07-de430fd.stderr", - "stderr_hash": "78a96ca7fbcae19b8cdaa9f9a2d18de003d7569070edb855bd07bff6", + "stderr_hash": "7fadea44b4ad8f383e0cadbd27a53eb3ab75f0edef98d27639527723", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_07-de430fd.stderr b/tests/reference/asr-arrays_07-de430fd.stderr index f5f3ff9143..7624d1fe92 100644 --- a/tests/reference/asr-arrays_07-de430fd.stderr +++ b/tests/reference/asr-arrays_07-de430fd.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_07.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_07.py:6:5 | -2 | from numpy import empty, complex64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | x: f32[5, 4] = empty([5, 4], dtype=complex64) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('f32[5,4]' and 'c32[5,4]') diff --git a/tests/reference/asr-arrays_08-ba317a3.json b/tests/reference/asr-arrays_08-ba317a3.json index 068d21e7d1..56982fe195 100644 --- a/tests/reference/asr-arrays_08-ba317a3.json +++ b/tests/reference/asr-arrays_08-ba317a3.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_08-ba317a3.stderr", - "stderr_hash": "2c0dffd29d0f996f1403e49241e6fe1cfbf7df0ce479e4434c3a7c6a", + "stderr_hash": "bedb87b219b7c49a18cced170e4ffcac780d242f70c3ae8bbfb27a26", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_08-ba317a3.stderr b/tests/reference/asr-arrays_08-ba317a3.stderr index d5aad26c5b..e8f8eb441e 100644 --- a/tests/reference/asr-arrays_08-ba317a3.stderr +++ b/tests/reference/asr-arrays_08-ba317a3.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_08.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_08.py:9:5 | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i64[100,120,200]' and 'i64[120,100,200]') diff --git a/tests/reference/asr-arrays_09-50ee586.json b/tests/reference/asr-arrays_09-50ee586.json index 1180b9b694..fa9b9de0df 100644 --- a/tests/reference/asr-arrays_09-50ee586.json +++ b/tests/reference/asr-arrays_09-50ee586.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_09-50ee586.stderr", - "stderr_hash": "31ae490ebcebebc570a4846a32f1723dd3e9861f47c6805e9cc5e9b4", + "stderr_hash": "30bfc87e70c4b4688cf7162eec34dce8e52c959539d20ad8b79cf845", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_09-50ee586.stderr b/tests/reference/asr-arrays_09-50ee586.stderr index efb877322b..58147a840d 100644 --- a/tests/reference/asr-arrays_09-50ee586.stderr +++ b/tests/reference/asr-arrays_09-50ee586.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_09.py:2:1 +semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. + --> tests/errors/arrays_09.py:9:12 | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +9 | x: i64[p, q, r] = empty([q, p, r], dtype=int64) + | ^ diff --git a/tests/reference/asr-arrays_10-bc82d75.json b/tests/reference/asr-arrays_10-bc82d75.json index 8125d1c0f8..4599fd95cf 100644 --- a/tests/reference/asr-arrays_10-bc82d75.json +++ b/tests/reference/asr-arrays_10-bc82d75.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_10-bc82d75.stderr", - "stderr_hash": "12434839db5b4ef953cdf8002472348be5b31f95ed106f68c6646523", + "stderr_hash": "59e8cc91d7dae61bf60ec4d9cd23d62cdcb162e553bd64a3995fad19", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_10-bc82d75.stderr b/tests/reference/asr-arrays_10-bc82d75.stderr index af28c4fcb3..7935120aa7 100644 --- a/tests/reference/asr-arrays_10-bc82d75.stderr +++ b/tests/reference/asr-arrays_10-bc82d75.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_10.py:2:1 +semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. + --> tests/errors/arrays_10.py:9:36 | -2 | from numpy import empty, int64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +9 | x: i64[100, 120, 200] = empty([q, p, r], dtype=int64) + | ^ diff --git a/tests/reference/asr-arrays_11-fc505b4.json b/tests/reference/asr-arrays_11-fc505b4.json index 31cf31d842..22700cace0 100644 --- a/tests/reference/asr-arrays_11-fc505b4.json +++ b/tests/reference/asr-arrays_11-fc505b4.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_11-fc505b4.stderr", - "stderr_hash": "f5a3fde8bbd2fd083b1f1d2148c92c3ae71ef4aaaed74e725061cb94", + "stderr_hash": "ef5e89392b20ad345ba9bcf862ab71b19e56c85d9838db742be117a1", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_11-fc505b4.stderr b/tests/reference/asr-arrays_11-fc505b4.stderr index 1fd700c7b4..09cb02b625 100644 --- a/tests/reference/asr-arrays_11-fc505b4.stderr +++ b/tests/reference/asr-arrays_11-fc505b4.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_11.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_11.py:5:1 | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +5 | x: i16[4] = empty([5], dtype=int16) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') diff --git a/tests/reference/asr-arrays_12-63d6f25.json b/tests/reference/asr-arrays_12-63d6f25.json index 4f456715f5..a032a5fad1 100644 --- a/tests/reference/asr-arrays_12-63d6f25.json +++ b/tests/reference/asr-arrays_12-63d6f25.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_12-63d6f25.stderr", - "stderr_hash": "28d115256d1f8e36fdce5f2192e17e06c4b6daaa2166ece7bed3947c", + "stderr_hash": "b6fa626301868bd5cbbef6d914f5b4f38b1d896b951753122969e74a", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_12-63d6f25.stderr b/tests/reference/asr-arrays_12-63d6f25.stderr index 4dc8ec210c..8000ae521d 100644 --- a/tests/reference/asr-arrays_12-63d6f25.stderr +++ b/tests/reference/asr-arrays_12-63d6f25.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_12.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_12.py:5:1 | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +5 | x: i16[5] = empty([5], dtype=int32) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[5]' and 'i32[5]') diff --git a/tests/reference/asr-arrays_13-b5fcc7e.json b/tests/reference/asr-arrays_13-b5fcc7e.json index d2c834ff6a..3a17697702 100644 --- a/tests/reference/asr-arrays_13-b5fcc7e.json +++ b/tests/reference/asr-arrays_13-b5fcc7e.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_13-b5fcc7e.stderr", - "stderr_hash": "684ced8828de6debbd6d46dd706f9bbb993e8c85b22b656583c3a077", + "stderr_hash": "6bde2f7fc14d5a461a58d694e44e19dd79ef5bee47c88b4022daf5d6", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_13-b5fcc7e.stderr b/tests/reference/asr-arrays_13-b5fcc7e.stderr index 1533a34f7a..14f0dbe414 100644 --- a/tests/reference/asr-arrays_13-b5fcc7e.stderr +++ b/tests/reference/asr-arrays_13-b5fcc7e.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_13.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_13.py:7:5 | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +7 | x: i16[4] = empty(5, dtype=int16) + | ^ ^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') diff --git a/tests/reference/asr-arrays_14-78be00e.json b/tests/reference/asr-arrays_14-78be00e.json index 9a235f1984..b41704e4d0 100644 --- a/tests/reference/asr-arrays_14-78be00e.json +++ b/tests/reference/asr-arrays_14-78be00e.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-arrays_14-78be00e.stderr", - "stderr_hash": "3539282cce2d83675ca57e47d093800765d28c5b74a04eb46457f715", + "stderr_hash": "267aea8e48708230a9b2bc61c37c849a0b75cb45294ca25ee11fe632", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-arrays_14-78be00e.stderr b/tests/reference/asr-arrays_14-78be00e.stderr index 14bdfe6421..ed7f661811 100644 --- a/tests/reference/asr-arrays_14-78be00e.stderr +++ b/tests/reference/asr-arrays_14-78be00e.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/arrays_14.py:2:1 +semantic error: Type mismatch in annotation-assignment, the types must be compatible + --> tests/errors/arrays_14.py:7:5 | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +7 | x: i16[4] = empty((5), dtype=int16) + | ^ ^^^^^^^^^^^^^^^^^^^^^^^ type mismatch ('i16[4]' and 'i16[5]') diff --git a/tests/reference/asr-bindc_02-bc1a7ea.json b/tests/reference/asr-bindc_02-bc1a7ea.json index b8abd26275..3dd0941a7d 100644 --- a/tests/reference/asr-bindc_02-bc1a7ea.json +++ b/tests/reference/asr-bindc_02-bc1a7ea.json @@ -5,9 +5,9 @@ "infile_hash": "a29f0f269c494419077ca8725e7c2d2dc7a5b4964d5c909347f1caa4", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-bindc_02-bc1a7ea.stderr", - "stderr_hash": "f35a1e2233396c7620436bb77c9e617e33e60fb9c92da2552280ed2c", - "returncode": 2 + "stdout": "asr-bindc_02-bc1a7ea.stdout", + "stdout_hash": "cbf9ef32b1f268bbf7b766822c2b8f7efe9053d8d72525035a5079d5", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stdout b/tests/reference/asr-bindc_02-bc1a7ea.stdout new file mode 100644 index 0000000000..a3df6dd08a --- /dev/null +++ b/tests/reference/asr-bindc_02-bc1a7ea.stdout @@ -0,0 +1,437 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 204 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(CPtrToPointer + (Var 2 queries) + (Var 2 x) + (ArrayConstant + [(IntegerConstant 1 (Integer 4))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + (ArrayConstant + [(IntegerConstant 0 (Integer 4))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + ) + (Print + () + [(Var 2 queries) + (Var 2 x)] + () + () + ) + (SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 203 + { + y: + (Variable + 203 + y + [] + Local + () + () + Default + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + yptr1: + (Variable + 203 + yptr1 + [] + Local + () + () + Default + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + Source + Public + Required + .false. + ), + yq: + (Variable + 203 + yq + [] + Local + () + () + Default + (CPtr) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 203 yq) + (PointerNullConstant + (CPtr) + ) + () + ) + (= + (Var 203 y) + (ArrayConstant + [] + (Array + (Integer 2) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 203 y) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + ) + () + ) + (= + (ArrayItem + (Var 203 y) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + ) + () + ) + (= + (Var 203 yptr1) + (GetPointer + (Var 203 y) + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + ) + () + ) + (Print + () + [(GetPointer + (Var 203 y) + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + ) + (Var 203 yptr1)] + () + () + ) + (Print + () + [(ArrayItem + (Var 203 yptr1) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + (ArrayItem + (Var 203 yptr1) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + )] + () + () + ) + (Assert + (IntegerCompare + (ArrayItem + (Var 203 yptr1) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + Eq + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (ArrayItem + (Var 203 yptr1) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 2) + RowMajor + () + ) + Eq + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + ) + (Logical 4) + () + ) + () + ) + (CPtrToPointer + (Var 203 yq) + (Var 203 yptr1) + (ArrayConstant + [(IntegerConstant 2 (Integer 4))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + (ArrayConstant + [(IntegerConstant 0 (Integer 4))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + ) + (Print + () + [(Var 203 yq) + (Var 203 yptr1)] + () + () + )] + () + Public + .false. + .false. + () + ), + queries: + (Variable + 2 + queries + [] + Local + (PointerNullConstant + (CPtr) + ) + (PointerNullConstant + (CPtr) + ) + Default + (CPtr) + () + Source + Public + Required + .false. + ), + x: + (Variable + 2 + x + [] + Local + () + () + Default + (Pointer + (Array + (Integer 2) + [(() + ())] + DescriptorArray + ) + ) + () + Source + Public + Required + .false. + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 205 + { + __main__global_stmts: + (ExternalSymbol + 205 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 205 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-bindc_03-95dbba7.json b/tests/reference/asr-bindc_03-95dbba7.json index fa55114a3e..7ea004cc34 100644 --- a/tests/reference/asr-bindc_03-95dbba7.json +++ b/tests/reference/asr-bindc_03-95dbba7.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-bindc_03-95dbba7.stderr", - "stderr_hash": "9225af71c044978cc3832abb4a60a5d13f6d143a8c4dc219e930eab9", + "stderr_hash": "371c3fc384c0e72448648d5a3734a373fe96ba258b261f0695ccb518", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_03-95dbba7.stderr b/tests/reference/asr-bindc_03-95dbba7.stderr index 98e9a26f07..ae2b810b6c 100644 --- a/tests/reference/asr-bindc_03-95dbba7.stderr +++ b/tests/reference/asr-bindc_03-95dbba7.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/bindc_03.py:3:1 +semantic error: Target type specified in c_p_pointer must have deferred shape. + --> tests/errors/bindc_03.py:6:26 | -3 | from numpy import array - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | A: Pointer[i16[:]] = c_p_pointer(b, i16[n * k], array([k * n])) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-bindc_04-06bd800.json b/tests/reference/asr-bindc_04-06bd800.json index a19d71962d..4772e98aa9 100644 --- a/tests/reference/asr-bindc_04-06bd800.json +++ b/tests/reference/asr-bindc_04-06bd800.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-bindc_04-06bd800.stderr", - "stderr_hash": "6aa8aa05ae2628d04b771044165e1c9078ba3c5ae211906def3ff0be", + "stderr_hash": "20c105d0189cd06a197a6b1dda073a58f5c8ee0104230cf187960c46", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-bindc_04-06bd800.stderr b/tests/reference/asr-bindc_04-06bd800.stderr index 704b35ab47..1a05ab5e55 100644 --- a/tests/reference/asr-bindc_04-06bd800.stderr +++ b/tests/reference/asr-bindc_04-06bd800.stderr @@ -1,17 +1,5 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/errors/bindc_04.py:2:1 - | -2 | from numpy import empty, int16 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Only those local variables which can be reduced to compile time constant should be used in dimensions of an array. + --> tests/errors/bindc_04.py:20:12 + | +20 | C: i16[nk] = empty(nk, dtype=int16) + | ^^ diff --git a/tests/reference/asr-cast-435c233.json b/tests/reference/asr-cast-435c233.json index 8614194075..60ceb3c6dd 100644 --- a/tests/reference/asr-cast-435c233.json +++ b/tests/reference/asr-cast-435c233.json @@ -5,9 +5,9 @@ "infile_hash": "6e4219b25f4aa2035b57c9658dbb133f2dff55db0d9c128b19214f62", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-cast-435c233.stderr", - "stderr_hash": "94b3ddb64aab37aa358cd260252df21698826606401d00e07c873603", - "returncode": 2 + "stdout": "asr-cast-435c233.stdout", + "stdout_hash": "58fc6550fcc3f8ac88859c3ad8f16640ddbd112d9a9b46a3faa379dd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-cast-435c233.stdout b/tests/reference/asr-cast-435c233.stdout new file mode 100644 index 0000000000..9b07bd686a --- /dev/null +++ b/tests/reference/asr-cast-435c233.stdout @@ -0,0 +1,312 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + list: + (ExternalSymbol + 3 + list + 4 list + lpython_builtin + [] + list + Private + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (List + (Character 1 -2 ()) + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [list] + [] + [(= + (Var 3 s) + (StringConstant + "lpython" + (Character 1 7 ()) + ) + () + ) + (= + (Var 3 x) + (FunctionCall + 3 list + () + [((Var 3 s))] + (List + (Character 1 -2 ()) + ) + () + () + ) + () + ) + (= + (Var 3 y) + (ListConstant + [(StringConstant + "a" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (StringConstant + "c" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 3 x) + (FunctionCall + 3 list + () + [((Var 3 y))] + (List + (Character 1 -2 ()) + ) + () + () + ) + () + ) + (= + (Var 3 x) + (ListConstant + [] + (List + (Character 1 -2 ()) + ) + ) + () + ) + (= + (Var 3 x) + (FunctionCall + 3 list + () + [((ListConstant + [] + (List + (Character 1 -2 ()) + ) + ))] + (List + (Character 1 -2 ()) + ) + (ListConstant + [] + (List + (Character 1 -2 ()) + ) + ) + () + ) + () + ) + (= + (Var 3 x) + (FunctionCall + 3 list + () + [((StringConstant + "lpython" + (Character 1 7 ()) + ))] + (List + (Character 1 -2 ()) + ) + (ListConstant + [(StringConstant + "l" + (Character 1 1 ()) + ) + (StringConstant + "p" + (Character 1 1 ()) + ) + (StringConstant + "y" + (Character 1 1 ()) + ) + (StringConstant + "t" + (Character 1 1 ()) + ) + (StringConstant + "h" + (Character 1 1 ()) + ) + (StringConstant + "o" + (Character 1 1 ()) + ) + (StringConstant + "n" + (Character 1 1 ()) + )] + (List + (Character 1 1 ()) + ) + ) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-complex1-f26c460.json b/tests/reference/asr-complex1-f26c460.json index 2eb40d0cd8..dd3e51b43f 100644 --- a/tests/reference/asr-complex1-f26c460.json +++ b/tests/reference/asr-complex1-f26c460.json @@ -5,9 +5,9 @@ "infile_hash": "60b45de7b88ec768d70a3122b36545e9604a86504ed6e5d9d813c719", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-complex1-f26c460.stderr", - "stderr_hash": "850f4cbe87b0a7ae8138fbfb71f94b82843abf09e50752159f900292", - "returncode": 2 + "stdout": "asr-complex1-f26c460.stdout", + "stdout_hash": "d2492faf2c4817c79e63e63c41265783d5cc209b149ea27019480440", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-complex1-f26c460.stdout b/tests/reference/asr-complex1-f26c460.stdout new file mode 100644 index 0000000000..cd78fe3416 --- /dev/null +++ b/tests/reference/asr-complex1-f26c460.stdout @@ -0,0 +1,794 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test: + (Function + (SymbolTable + 4 + { + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ) + }) + test + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 x) + (ComplexBinOp + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 2.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 3.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 4 y) + (ComplexBinOp + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 5.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 5.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 5.000000 + 5.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 4 z) + (Cast + (ComplexBinOp + (Var 4 x) + Add + (Var 4 y) + (Complex 8) + () + ) + ComplexToComplex + (Complex 4) + () + ) + () + ) + (= + (Var 4 z) + (Cast + (ComplexBinOp + (Var 4 x) + Sub + (Var 4 y) + (Complex 8) + () + ) + ComplexToComplex + (Complex 4) + () + ) + () + ) + (= + (Var 4 z) + (Cast + (ComplexBinOp + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 2.000000 + 0.000000 + (Complex 8) + ) + ) + Mul + (Var 4 x) + (Complex 8) + () + ) + ComplexToComplex + (Complex 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_complex: + (Function + (SymbolTable + 3 + { + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c1: + (Variable + 3 + c1 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c2: + (Variable + 3 + c2 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c3: + (Variable + 3 + c3 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 3 + complex + 5 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_0__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_0__complex + 5 __lpython_overloaded_0__complex + lpython_builtin + [] + __lpython_overloaded_0__complex + Public + ), + complex@__lpython_overloaded_13__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_13__complex + 5 __lpython_overloaded_13__complex + lpython_builtin + [] + __lpython_overloaded_13__complex + Public + ), + complex@__lpython_overloaded_1__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_1__complex + 5 __lpython_overloaded_1__complex + lpython_builtin + [] + __lpython_overloaded_1__complex + Public + ), + complex@__lpython_overloaded_2__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_2__complex + 5 __lpython_overloaded_2__complex + lpython_builtin + [] + __lpython_overloaded_2__complex + Public + ), + complex@__lpython_overloaded_5__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_5__complex + 5 __lpython_overloaded_5__complex + lpython_builtin + [] + __lpython_overloaded_5__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 5 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ) + }) + test_complex + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_0__complex + complex@__lpython_overloaded_1__complex + complex@__lpython_overloaded_5__complex + complex@__lpython_overloaded_2__complex + complex@__lpython_overloaded_9__complex + complex@__lpython_overloaded_13__complex] + [] + [(= + (Var 3 c) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_0__complex + 3 complex + [] + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_1__complex + 3 complex + [((RealConstant + 3.400000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.400000 + 0.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 3.400000 + 0.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_5__complex + 3 complex + [((RealConstant + 5.000000 + (Real 8) + )) + ((RealConstant + 4.300000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 5.000000 + 4.300000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 5.000000 + 4.300000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c) + (FunctionCall + 3 complex@__lpython_overloaded_2__complex + 3 complex + [((IntegerConstant 1 (Integer 4)))] + (Complex 4) + (ComplexConstant + 1.000000 + 0.000000 + (Complex 8) + ) + () + ) + () + ) + (= + (Var 3 c1) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c2) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_13__complex + 3 complex + [((IntegerConstant 2 (Integer 4))) + ((RealConstant + 4.500000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 2.000000 + 4.500000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 2.000000 + 4.500000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c3) + (FunctionCall + 3 complex@__lpython_overloaded_5__complex + 3 complex + [((RealConstant + 3.000000 + (Real 8) + )) + ((RealConstant + 4.000000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + () + ) + (= + (Var 3 b) + (ComplexCompare + (Var 3 c1) + NotEq + (Var 3 c2) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (ComplexCompare + (Cast + (Var 3 c1) + ComplexToComplex + (Complex 8) + () + ) + Eq + (Var 3 c3) + (Logical 4) + () + ) + () + ) + (= + (Var 3 c) + (ComplexBinOp + (Var 3 c1) + Add + (Var 3 c2) + (Complex 4) + () + ) + () + ) + (= + (Var 3 c) + (ComplexBinOp + (Var 3 c2) + Sub + (Var 3 c1) + (Complex 4) + () + ) + () + ) + (= + (Var 3 c) + (ComplexBinOp + (Var 3 c1) + Mul + (Var 3 c2) + (Complex 4) + () + ) + () + ) + (= + (Var 3 c) + (Cast + (ComplexBinOp + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Complex 8) + (ComplexConstant + 1.000000 + 2.000000 + (Complex 8) + ) + () + ) + Pow + (FunctionCall + 3 complex@__lpython_overloaded_5__complex + 3 complex + [((RealConstant + 3.345340 + (Real 8) + )) + ((RealConstant + 4.867868 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.345340 + 4.867868 + (Complex 8) + ) + () + ) + (Complex 8) + (ComplexConstant + 0.015553 + 0.065561 + (Complex 8) + ) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.015553 + 0.065561 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c) + (Cast + (ComplexBinOp + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Complex 8) + (ComplexConstant + 1.000000 + 2.000000 + (Complex 8) + ) + () + ) + Mul + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + (Complex 8) + (ComplexConstant + -5.000000 + 10.000000 + (Complex 8) + ) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + -5.000000 + 10.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c) + (Cast + (ComplexBinOp + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 4 (Integer 4))) + ((IntegerConstant 5 (Integer 4)))] + (Complex 8) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 8) + ) + () + ) + Sub + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + (Complex 8) + (ComplexConstant + 1.000000 + 1.000000 + (Complex 8) + ) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 1.000000 + 1.000000 + (Complex 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-constants1-5828e8a.json b/tests/reference/asr-constants1-5828e8a.json index 5abb75edfe..dfe88ebc86 100644 --- a/tests/reference/asr-constants1-5828e8a.json +++ b/tests/reference/asr-constants1-5828e8a.json @@ -5,9 +5,9 @@ "infile_hash": "5dca391c30a1477fb903e17c1d47dad3b9b816088384ba61ff372db1", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-constants1-5828e8a.stderr", - "stderr_hash": "ebf1574a4c5a5194ffa967d7e3a768aad6fe823a3eae7b48b0ea46f2", - "returncode": 2 + "stdout": "asr-constants1-5828e8a.stdout", + "stdout_hash": "427b04cc81be4dc077b8804718659bbe1c1d1fd74b493e5a2ae78c48", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-constants1-5828e8a.stdout b/tests/reference/asr-constants1-5828e8a.stdout new file mode 100644 index 0000000000..086a712f13 --- /dev/null +++ b/tests/reference/asr-constants1-5828e8a.stdout @@ -0,0 +1,1793 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_abs: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 5 + complex + 13 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_5__complex: + (ExternalSymbol + 5 + complex@__lpython_overloaded_5__complex + 13 __lpython_overloaded_5__complex + lpython_builtin + [] + __lpython_overloaded_5__complex + Public + ) + }) + test_abs + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_5__complex] + [] + [(= + (Var 5 a) + (IntrinsicScalarFunction + Abs + [(IntegerConstant 5 (Integer 4))] + 0 + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + () + ) + (= + (Var 5 a) + (IntrinsicScalarFunction + Abs + [(IntegerUnaryMinus + (IntegerConstant 500 (Integer 4)) + (Integer 4) + (IntegerConstant -500 (Integer 4)) + )] + 0 + (Integer 4) + (IntegerConstant 500 (Integer 4)) + ) + () + ) + (= + (Var 5 a) + (IntrinsicScalarFunction + Abs + [(Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 5 a) + (IntrinsicScalarFunction + Abs + [(Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 5 b) + (Cast + (IntrinsicScalarFunction + Abs + [(RealConstant + 3.450000 + (Real 8) + )] + 0 + (Real 8) + (RealConstant + 3.450000 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 3.450000 + (Real 4) + ) + ) + () + ) + (= + (Var 5 b) + (Cast + (IntrinsicScalarFunction + Abs + [(RealUnaryMinus + (RealConstant + 5346.340000 + (Real 8) + ) + (Real 8) + (RealConstant + -5346.340000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 5346.340000 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 5346.340000 + (Real 4) + ) + ) + () + ) + (= + (Var 5 b) + (Cast + (IntrinsicScalarFunction + Abs + [(FunctionCall + 5 complex@__lpython_overloaded_5__complex + 5 complex + [((RealConstant + 3.450000 + (Real 8) + )) + ((RealConstant + 5.600000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.450000 + 5.600000 + (Complex 8) + ) + () + )] + 0 + (Real 8) + (RealConstant + 6.577424 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 6.577424 + (Real 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ), + test_bool: + (Function + (SymbolTable + 7 + { + a: + (Variable + 7 + a + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 7 + complex + 13 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 7 + complex@__lpython_overloaded_9__complex + 13 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ) + }) + test_bool + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_9__complex] + [] + [(= + (Var 7 a) + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 7 a) + (Cast + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + IntegerToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 7 a) + (Cast + (StringConstant + "" + (Character 1 0 ()) + ) + CharacterToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 7 a) + (Cast + (FunctionCall + 7 complex@__lpython_overloaded_9__complex + 7 complex + [((IntegerConstant 0 (Integer 4))) + ((IntegerConstant 0 (Integer 4)))] + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + () + ) + ComplexToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (Assert + (LogicalCompare + (Var 7 a) + Eq + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 7 a) + (Cast + (StringConstant + "t" + (Character 1 1 ()) + ) + CharacterToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 7 a) + (Cast + (RealConstant + 2.300000 + (Real 8) + ) + RealToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (LogicalCompare + (Var 7 a) + Eq + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_boz: + (Function + (SymbolTable + 3 + { + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ), + bin: + (ExternalSymbol + 3 + bin + 13 bin + lpython_builtin + [] + bin + Private + ), + hex: + (ExternalSymbol + 3 + hex + 13 hex + lpython_builtin + [] + hex + Private + ), + oct: + (ExternalSymbol + 3 + oct + 13 oct + lpython_builtin + [] + oct + Private + ) + }) + test_boz + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [bin + oct + hex] + [] + [(= + (Var 3 b) + (FunctionCall + 3 bin + () + [((IntegerConstant 5 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0b101" + (Character 1 5 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 bin + () + [((IntegerConstant 64 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0b1000000" + (Character 1 9 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 bin + () + [((IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0b1000010110" + (Character 1 13 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 oct + () + [((IntegerConstant 8 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0o10" + (Character 1 4 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 oct + () + [((IntegerConstant 56 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0o70" + (Character 1 4 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 oct + () + [((IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0o1026" + (Character 1 7 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 hex + () + [((IntegerConstant 42 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0x2a" + (Character 1 4 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 hex + () + [((IntegerConstant 12648430 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0xc0ffee" + (Character 1 8 ()) + ) + () + ) + () + ) + (= + (Var 3 b) + (FunctionCall + 3 hex + () + [((IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0x216" + (Character 1 6 ()) + ) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_callable: + (Function + (SymbolTable + 9 + { + a: + (Variable + 9 + a + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 9 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_callable + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 9 b) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 9 a) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (LogicalCompare + (Var 9 a) + Eq + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 9 a) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (LogicalCompare + (Var 9 a) + Eq + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 9 a) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (LogicalCompare + (Var 9 a) + Eq + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_divmod: + (Function + (SymbolTable + 12 + { + a: + (Variable + 12 + a + [] + Local + () + () + Default + (Tuple + [(Integer 4) + (Integer 4)] + ) + () + Source + Public + Required + .false. + ), + divmod: + (ExternalSymbol + 12 + divmod + 13 divmod + lpython_builtin + [] + divmod + Private + ) + }) + test_divmod + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [divmod] + [] + [(= + (Var 12 a) + (FunctionCall + 12 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 12 a) + (FunctionCall + 12 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 12 a) + (FunctionCall + 12 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 12 a) + (FunctionCall + 12 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 12 a) + (FunctionCall + 12 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)] + ) + ) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_float: + (Function + (SymbolTable + 11 + { + a: + (Variable + 11 + a + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + test_float + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 11 a) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 11 a) + (RealConstant + 4.560000 + (Real 8) + ) + () + ) + (= + (Var 11 a) + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 5.000000 + (Real 8) + ) + ) + () + ) + (= + (Var 11 a) + (Cast + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + IntegerToReal + (Real 8) + (RealConstant + -1.000000 + (Real 8) + ) + ) + () + ) + (= + (Var 11 a) + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToReal + (Real 8) + (RealConstant + 1.000000 + (Real 8) + ) + ) + () + ) + (= + (Var 11 a) + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToReal + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + () + )] + () + Public + .false. + .false. + () + ), + test_int: + (Function + (SymbolTable + 10 + { + a: + (Variable + 10 + a + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + test_int + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 10 a) + (IntegerConstant 0 (Integer 8)) + () + ) + (= + (Var 10 a) + (Cast + (RealConstant + 4.560000 + (Real 8) + ) + RealToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ) + () + ) + (= + (Var 10 a) + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + () + ) + (= + (Var 10 a) + (Cast + (RealUnaryMinus + (RealConstant + 5.000010 + (Real 8) + ) + (Real 8) + (RealConstant + -5.000010 + (Real 8) + ) + ) + RealToInteger + (Integer 8) + (IntegerConstant -5 (Integer 8)) + ) + () + ) + (= + (Var 10 a) + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + () + ) + (= + (Var 10 a) + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + () + ) + (= + (Var 10 a) + (IntegerConstant 5346 (Integer 8)) + () + )] + () + Public + .false. + .false. + () + ), + test_len: + (Function + (SymbolTable + 6 + { + a: + (Variable + 6 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 6 + l + [] + Local + () + () + Default + (List + (Integer 4) + ) + () + Source + Public + Required + .false. + ) + }) + test_len + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 a) + (StringLen + (StringConstant + "" + (Character 1 0 ()) + ) + (Integer 4) + (IntegerConstant 0 (Integer 4)) + ) + () + ) + (= + (Var 6 a) + (StringLen + (StringConstant + "test" + (Character 1 4 ()) + ) + (Integer 4) + (IntegerConstant 4 (Integer 4)) + ) + () + ) + (= + (Var 6 a) + (StringLen + (StringConstant + "this is a test" + (Character 1 14 ()) + ) + (Integer 4) + (IntegerConstant 14 (Integer 4)) + ) + () + ) + (= + (Var 6 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 6 a) + (TupleLen + (TupleConstant + [(TupleConstant + [(StringConstant + "c" + (Character 1 1 ()) + ) + (StringConstant + "b" + (Character 1 1 ()) + ) + (RealConstant + 3.400000 + (Real 8) + )] + (Tuple + [(Character 1 1 ()) + (Character 1 1 ()) + (Real 8)] + ) + ) + (TupleConstant + [(StringConstant + "c" + (Character 1 1 ()) + ) + (IntegerConstant 3 (Integer 4)) + (RealConstant + 5.600000 + (Real 8) + )] + (Tuple + [(Character 1 1 ()) + (Integer 4) + (Real 8)] + ) + )] + (Tuple + [(Tuple + [(Character 1 1 ()) + (Character 1 1 ()) + (Real 8)] + ) + (Tuple + [(Character 1 1 ()) + (Integer 4) + (Real 8)] + )] + ) + ) + (Integer 4) + (IntegerConstant 2 (Integer 4)) + ) + () + ) + (= + (Var 6 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 6 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 6 a) + (SetLen + (SetConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (Set + (Integer 4) + ) + ) + (Integer 4) + () + ) + () + ) + (= + (Var 6 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) + () + ) + () + ) + (= + (Var 6 l) + (ListConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4)) + (IntegerConstant 4 (Integer 4))] + (List + (Integer 4) + ) + ) + () + ) + (= + (Var 6 a) + (ListLen + (Var 6 l) + (Integer 4) + () + ) + () + ) + (ListAppend + (Var 6 l) + (IntegerConstant 5 (Integer 4)) + ) + (= + (Var 6 a) + (ListLen + (Var 6 l) + (Integer 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_ord_chr: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 4 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_ord_chr + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 a) + (StringOrd + (StringConstant + "5" + (Character 1 1 ()) + ) + (Integer 4) + (IntegerConstant 53 (Integer 4)) + ) + () + ) + (= + (Var 4 s) + (StringChr + (IntegerConstant 43 (Integer 4)) + (Character 1 1 ()) + (StringConstant + "+" + (Character 1 1 ()) + ) + ) + () + )] + () + Public + .false. + .false. + () + ), + test_str: + (Function + (SymbolTable + 8 + { + s: + (Variable + 8 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_str + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 8 s) + (StringConstant + "" + (Character 1 0 ()) + ) + () + ) + (= + (Var 8 s) + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "5" + (Character 1 1 ()) + ) + ) + () + ) + (= + (Var 8 s) + (Cast + (IntegerUnaryMinus + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant -4 (Integer 4)) + ) + IntegerToCharacter + (Character 1 -2 ()) + (StringConstant + "-4" + (Character 1 2 ()) + ) + ) + () + ) + (= + (Var 8 s) + (Cast + (RealConstant + 5.600000 + (Real 8) + ) + RealToCharacter + (Character 1 -2 ()) + (StringConstant + "5.6" + (Character 1 3 ()) + ) + ) + () + ) + (= + (Var 8 s) + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "True" + (Character 1 4 ()) + ) + ) + () + ) + (= + (Var 8 s) + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToCharacter + (Character 1 -2 ()) + (StringConstant + "False" + (Character 1 5 ()) + ) + ) + () + ) + (= + (Var 8 s) + (StringConstant + "5346" + (Character 1 4 ()) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 130 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-elemental_01-b58df26.json b/tests/reference/asr-elemental_01-b58df26.json index 91ad0f8c5d..d953b2745f 100644 --- a/tests/reference/asr-elemental_01-b58df26.json +++ b/tests/reference/asr-elemental_01-b58df26.json @@ -5,9 +5,9 @@ "infile_hash": "1d1eb8ce26df5817c1e474e4f69b0b96e53df362a31f1b722efaadf0", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-elemental_01-b58df26.stderr", - "stderr_hash": "cd10f41e485a55b944782ec55b168ba07907570bc9c92869d02f705e", - "returncode": 2 + "stdout": "asr-elemental_01-b58df26.stdout", + "stdout_hash": "28d02afc6512eee1834c7812fa9bf1674ea63364aba882cb533cf9da", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-elemental_01-b58df26.stdout b/tests/reference/asr-elemental_01-b58df26.stdout new file mode 100644 index 0000000000..92f7fa55b7 --- /dev/null +++ b/tests/reference/asr-elemental_01-b58df26.stdout @@ -0,0 +1,3649 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 236 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [elemental_sin + elemental_cos + elemental_trig_identity + elemental_sum + elemental_mul] + [] + [(SubroutineCall + 2 elemental_sin + () + [] + () + ) + (SubroutineCall + 2 elemental_cos + () + [] + () + ) + (SubroutineCall + 2 elemental_trig_identity + () + [] + () + ) + (SubroutineCall + 2 elemental_sum + () + [] + () + ) + (SubroutineCall + 2 elemental_mul + () + [] + () + )] + () + Public + .false. + .false. + () + ), + cos: + (ExternalSymbol + 2 + cos + 3 cos + numpy + [] + cos + Public + ), + elemental_cos: + (Function + (SymbolTable + 211 + { + array2d: + (Variable + 211 + array2d + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + cos2d: + (Variable + 211 + cos2d + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + cos@__lpython_overloaded_0__cos: + (ExternalSymbol + 211 + cos@__lpython_overloaded_0__cos + 3 __lpython_overloaded_0__cos + numpy + [] + __lpython_overloaded_0__cos + Public + ), + i: + (Variable + 211 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 211 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + elemental_cos + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [cos@__lpython_overloaded_0__cos + verify2d] + [] + [(= + (Var 211 array2d) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 211 cos2d) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 211 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 256 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 255 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 211 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 64 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 63 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 211 array2d) + [(() + (Var 211 i) + ()) + (() + (Var 211 j) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (IntegerBinOp + (Var 211 i) + Add + (Var 211 j) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + () + )] + )] + ) + (= + (Var 211 cos2d) + (RealBinOp + (FunctionCall + 211 cos@__lpython_overloaded_0__cos + 2 cos + [((Var 211 array2d))] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (SubroutineCall + 2 verify2d + () + [((ArrayPhysicalCast + (Var 211 array2d) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 211 cos2d) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 256 (Integer 4))) + ((IntegerConstant 64 (Integer 4)))] + () + )] + () + Public + .false. + .false. + () + ), + elemental_mul: + (Function + (SymbolTable + 209 + { + array_a: + (Variable + 209 + array_a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + array_b: + (Variable + 209 + array_b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + array_c: + (Variable + 209 + array_c + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 209 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 209 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 209 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + elemental_mul + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [verify1d_mul] + [] + [(= + (Var 209 array_a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 array_b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 209 array_c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 209 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 100 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 99 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 209 array_a) + [(() + (Var 209 i) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (Var 209 i) + IntegerToReal + (Real 8) + () + ) + () + )] + ) + (DoLoop + () + ((Var 209 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 100 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 99 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 209 array_b) + [(() + (Var 209 j) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (IntegerBinOp + (Var 209 j) + Add + (IntegerConstant 5 (Integer 4)) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + () + )] + ) + (= + (Var 209 array_c) + (RealBinOp + (RealBinOp + (RealBinOp + (Var 209 array_a) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + Mul + (RealConstant + 5.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + Mul + (RealBinOp + (Var 209 array_b) + Pow + (RealConstant + 3.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (SubroutineCall + 2 verify1d_mul + () + [((ArrayPhysicalCast + (Var 209 array_a) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 209 array_b) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 209 array_c) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 100 (Integer 4)))] + () + )] + () + Public + .false. + .false. + () + ), + elemental_sin: + (Function + (SymbolTable + 210 + { + array1d: + (Variable + 210 + array1d + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + arraynd: + (Variable + 210 + arraynd + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 210 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 210 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 210 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + sin1d: + (Variable + 210 + sin1d + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + sin@__lpython_overloaded_0__sin: + (ExternalSymbol + 210 + sin@__lpython_overloaded_0__sin + 3 __lpython_overloaded_0__sin + numpy + [] + __lpython_overloaded_0__sin + Public + ), + sin@__lpython_overloaded_1__sin: + (ExternalSymbol + 210 + sin@__lpython_overloaded_1__sin + 3 __lpython_overloaded_1__sin + numpy + [] + __lpython_overloaded_1__sin + Public + ), + sinnd: + (Variable + 210 + sinnd + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + elemental_sin + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [sin@__lpython_overloaded_1__sin + verify1d + sin@__lpython_overloaded_0__sin + verifynd] + [] + [(= + (Var 210 array1d) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 210 sin1d) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 210 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 256 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 255 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 210 array1d) + [(() + (Var 210 i) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (Var 210 i) + IntegerToReal + (Real 4) + () + ) + () + )] + ) + (= + (Var 210 sin1d) + (FunctionCall + 210 sin@__lpython_overloaded_1__sin + 2 sin + [((FunctionCall + 210 sin@__lpython_overloaded_1__sin + 2 sin + [((Var 210 array1d))] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + () + ))] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + () + ) + (SubroutineCall + 2 verify1d + () + [((ArrayPhysicalCast + (Var 210 array1d) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 210 sin1d) + FixedSizeArray + DescriptorArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 256 (Integer 4)))] + () + ) + (= + (Var 210 arraynd) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 210 sinnd) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 210 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 256 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 255 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 210 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 64 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 63 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 210 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 210 arraynd) + [(() + (Var 210 i) + ()) + (() + (Var 210 j) + ()) + (() + (Var 210 k) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (IntegerBinOp + (IntegerBinOp + (Var 210 i) + Add + (Var 210 j) + (Integer 4) + () + ) + Add + (Var 210 k) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + () + )] + )] + )] + ) + (= + (Var 210 sinnd) + (RealBinOp + (FunctionCall + 210 sin@__lpython_overloaded_0__sin + 2 sin + [((Var 210 arraynd))] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (SubroutineCall + 2 verifynd + () + [((ArrayPhysicalCast + (Var 210 arraynd) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 210 sinnd) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 256 (Integer 4))) + ((IntegerConstant 64 (Integer 4))) + ((IntegerConstant 16 (Integer 4)))] + () + )] + () + Public + .false. + .false. + () + ), + elemental_sum: + (Function + (SymbolTable + 208 + { + array_a: + (Variable + 208 + array_a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + array_b: + (Variable + 208 + array_b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + array_c: + (Variable + 208 + array_c + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 208 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 208 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 208 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + elemental_sum + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [verify1d_sum] + [] + [(= + (Var 208 array_a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 208 array_b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 208 array_c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 208 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 100 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 99 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 208 array_a) + [(() + (Var 208 i) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (Var 208 i) + IntegerToReal + (Real 8) + () + ) + () + )] + ) + (DoLoop + () + ((Var 208 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 100 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 99 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 208 array_b) + [(() + (Var 208 j) + ())] + (Real 8) + RowMajor + () + ) + (Cast + (IntegerBinOp + (Var 208 j) + Add + (IntegerConstant 5 (Integer 4)) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + () + )] + ) + (= + (Var 208 array_c) + (RealBinOp + (RealBinOp + (Var 208 array_a) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + Add + (RealBinOp + (RealConstant + 5.000000 + (Real 8) + ) + Mul + (RealBinOp + (Var 208 array_b) + Pow + (RealConstant + 3.000000 + (Real 8) + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (SubroutineCall + 2 verify1d_sum + () + [((ArrayPhysicalCast + (Var 208 array_a) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 208 array_b) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((ArrayPhysicalCast + (Var 208 array_c) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 100 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 100 (Integer 4)))] + () + )] + () + Public + .false. + .false. + () + ), + elemental_trig_identity: + (Function + (SymbolTable + 212 + { + arraynd: + (Variable + 212 + arraynd + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + cos@__lpython_overloaded_1__cos: + (ExternalSymbol + 212 + cos@__lpython_overloaded_1__cos + 3 __lpython_overloaded_1__cos + numpy + [] + __lpython_overloaded_1__cos + Public + ), + eps: + (Variable + 212 + eps + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 212 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 212 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 212 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 212 + l + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + newshape: + (Variable + 212 + newshape + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + observed: + (Variable + 212 + observed + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + observed1d: + (Variable + 212 + observed1d + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 65536 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + sin@__lpython_overloaded_1__sin: + (ExternalSymbol + 212 + sin@__lpython_overloaded_1__sin + 3 __lpython_overloaded_1__sin + numpy + [] + __lpython_overloaded_1__sin + Public + ) + }) + elemental_trig_identity + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [sin@__lpython_overloaded_1__sin + cos@__lpython_overloaded_1__cos] + [] + [(= + (Var 212 eps) + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + () + ) + (= + (Var 212 arraynd) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 212 observed) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 212 observed1d) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 65536 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 212 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 64 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 63 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 212 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 32 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 31 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 212 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 8 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 7 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 212 l) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 4 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 3 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 212 arraynd) + [(() + (Var 212 i) + ()) + (() + (Var 212 j) + ()) + (() + (Var 212 k) + ()) + (() + (Var 212 l) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (IntegerBinOp + (IntegerBinOp + (IntegerBinOp + (Var 212 i) + Add + (Var 212 j) + (Integer 4) + () + ) + Add + (Var 212 k) + (Integer 4) + () + ) + Add + (Var 212 l) + (Integer 4) + () + ) + IntegerToReal + (Real 4) + () + ) + () + )] + )] + )] + )] + ) + (= + (Var 212 observed) + (RealBinOp + (RealBinOp + (FunctionCall + 212 sin@__lpython_overloaded_1__sin + 2 sin + [((Var 212 arraynd))] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + Pow + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToReal + (Real 4) + (RealConstant + 2.000000 + (Real 4) + ) + ) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + ) + Add + (RealBinOp + (FunctionCall + 212 cos@__lpython_overloaded_1__cos + 2 cos + [((Var 212 arraynd))] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + Pow + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToReal + (Real 4) + (RealConstant + 2.000000 + (Real 4) + ) + ) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + ) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 64 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 32 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 8 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4 (Integer 4)))] + FixedSizeArray + ) + () + ) + () + ) + (= + (Var 212 newshape) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 212 newshape) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 65536 (Integer 4)) + () + ) + (= + (Var 212 observed1d) + (ArrayReshape + (Var 212 observed) + (ArrayPhysicalCast + (Var 212 newshape) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + DescriptorArray + ) + () + ) + (Array + (Real 4) + [(() + ())] + FixedSizeArray + ) + () + ) + () + ) + (DoLoop + () + ((Var 212 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 65536 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 65535 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ArrayItem + (Var 212 observed1d) + [(() + (Var 212 i) + ())] + (Real 4) + RowMajor + () + ) + Sub + (Cast + (RealConstant + 1.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.000000 + (Real 4) + ) + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + LtE + (Var 212 eps) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ), + sin: + (ExternalSymbol + 2 + sin + 3 sin + numpy + [] + sin + Public + ), + verify1d: + (Function + (SymbolTable + 203 + { + array: + (Variable + 203 + array + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + block: + (Block + (SymbolTable + 213 + { + sin@__lpython_overloaded_1__sin: + (ExternalSymbol + 213 + sin@__lpython_overloaded_1__sin + 3 __lpython_overloaded_1__sin + numpy + [] + __lpython_overloaded_1__sin + Public + ) + }) + block + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 213 sin@__lpython_overloaded_1__sin + 2 sin + [((FunctionCall + 213 sin@__lpython_overloaded_1__sin + 2 sin + [((ArrayItem + (Var 203 array) + [(() + (Var 203 i) + ())] + (Real 4) + RowMajor + () + ))] + (Real 4) + () + () + ))] + (Real 4) + () + () + ) + Sub + (ArrayItem + (Var 203 result) + [(() + (Var 203 i) + ())] + (Real 4) + RowMajor + () + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + LtE + (Var 203 eps) + (Logical 4) + () + ) + () + )] + ), + eps: + (Variable + 203 + eps + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 203 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 203 + result + [] + InOut + () + () + Default + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + size: + (Variable + 203 + size + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + verify1d + (FunctionType + [(Array + (Real 4) + [(() + ())] + DescriptorArray + ) + (Array + (Real 4) + [(() + ())] + DescriptorArray + ) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [sin@__lpython_overloaded_1__sin] + [(Var 203 array) + (Var 203 result) + (Var 203 size)] + [(= + (Var 203 eps) + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + () + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 203 size) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 203 block + )] + )] + () + Public + .false. + .false. + () + ), + verify1d_mul: + (Function + (SymbolTable + 207 + { + array_a: + (Variable + 207 + array_a + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + array_b: + (Variable + 207 + array_b + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 207 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 207 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 207 + result + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + size: + (Variable + 207 + size + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + verify1d_mul + (FunctionType + [(Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 207 array_a) + (Var 207 array_b) + (Var 207 result) + (Var 207 size)] + [(= + (Var 207 eps) + (RealConstant + 0.000010 + (Real 8) + ) + () + ) + (DoLoop + () + ((Var 207 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 207 size) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (RealBinOp + (RealBinOp + (ArrayItem + (Var 207 array_a) + [(() + (Var 207 i) + ())] + (Real 8) + RowMajor + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Mul + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + () + ) + Mul + (RealBinOp + (ArrayItem + (Var 207 array_b) + [(() + (Var 207 i) + ())] + (Real 8) + RowMajor + () + ) + Pow + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (ArrayItem + (Var 207 result) + [(() + (Var 207 i) + ())] + (Real 8) + RowMajor + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 207 eps) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ), + verify1d_sum: + (Function + (SymbolTable + 206 + { + array_a: + (Variable + 206 + array_a + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + array_b: + (Variable + 206 + array_b + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 206 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 206 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 206 + result + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + size: + (Variable + 206 + size + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + verify1d_sum + (FunctionType + [(Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 206 array_a) + (Var 206 array_b) + (Var 206 result) + (Var 206 size)] + [(= + (Var 206 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (DoLoop + () + ((Var 206 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 206 size) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (RealBinOp + (ArrayItem + (Var 206 array_a) + [(() + (Var 206 i) + ())] + (Real 8) + RowMajor + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Add + (RealBinOp + (RealConstant + 5.000000 + (Real 8) + ) + Mul + (RealBinOp + (ArrayItem + (Var 206 array_b) + [(() + (Var 206 i) + ())] + (Real 8) + RowMajor + () + ) + Pow + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + () + ) + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (ArrayItem + (Var 206 result) + [(() + (Var 206 i) + ())] + (Real 8) + RowMajor + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 206 eps) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ), + verify2d: + (Function + (SymbolTable + 205 + { + array: + (Variable + 205 + array + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + block: + (Block + (SymbolTable + 217 + { + block: + (Block + (SymbolTable + 218 + { + cos@__lpython_overloaded_0__cos: + (ExternalSymbol + 218 + cos@__lpython_overloaded_0__cos + 3 __lpython_overloaded_0__cos + numpy + [] + __lpython_overloaded_0__cos + Public + ) + }) + block + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (FunctionCall + 218 cos@__lpython_overloaded_0__cos + 2 cos + [((ArrayItem + (Var 205 array) + [(() + (Var 205 i) + ()) + (() + (Var 205 j) + ())] + (Real 8) + RowMajor + () + ))] + (Real 8) + () + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Sub + (ArrayItem + (Var 205 result) + [(() + (Var 205 i) + ()) + (() + (Var 205 j) + ())] + (Real 8) + RowMajor + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 205 eps) + (Logical 4) + () + ) + () + )] + ) + }) + block + [(DoLoop + () + ((Var 205 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 205 size2) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 217 block + )] + )] + ), + eps: + (Variable + 205 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 205 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 205 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 205 + result + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + size1: + (Variable + 205 + size1 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + size2: + (Variable + 205 + size2 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + verify2d + (FunctionType + [(Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + (Integer 4) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [cos@__lpython_overloaded_0__cos] + [(Var 205 array) + (Var 205 result) + (Var 205 size1) + (Var 205 size2)] + [(= + (Var 205 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (DoLoop + () + ((Var 205 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 205 size1) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 205 block + )] + )] + () + Public + .false. + .false. + () + ), + verifynd: + (Function + (SymbolTable + 204 + { + array: + (Variable + 204 + array + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + block: + (Block + (SymbolTable + 214 + { + block: + (Block + (SymbolTable + 215 + { + block: + (Block + (SymbolTable + 216 + { + sin@__lpython_overloaded_0__sin: + (ExternalSymbol + 216 + sin@__lpython_overloaded_0__sin + 3 __lpython_overloaded_0__sin + numpy + [] + __lpython_overloaded_0__sin + Public + ) + }) + block + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (FunctionCall + 216 sin@__lpython_overloaded_0__sin + 2 sin + [((ArrayItem + (Var 204 array) + [(() + (Var 204 i) + ()) + (() + (Var 204 j) + ()) + (() + (Var 204 k) + ())] + (Real 8) + RowMajor + () + ))] + (Real 8) + () + () + ) + Pow + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + ) + Sub + (ArrayItem + (Var 204 result) + [(() + (Var 204 i) + ()) + (() + (Var 204 j) + ()) + (() + (Var 204 k) + ())] + (Real 8) + RowMajor + () + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 204 eps) + (Logical 4) + () + ) + () + )] + ) + }) + block + [(DoLoop + () + ((Var 204 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 204 size3) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 215 block + )] + )] + ) + }) + block + [(DoLoop + () + ((Var 204 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 204 size2) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 214 block + )] + )] + ), + eps: + (Variable + 204 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 204 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 204 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 204 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + result: + (Variable + 204 + result + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + size1: + (Variable + 204 + size1 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + size2: + (Variable + 204 + size2 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + size3: + (Variable + 204 + size3 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + verifynd + (FunctionType + [(Array + (Real 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + ) + (Array + (Real 8) + [(() + ()) + (() + ()) + (() + ())] + DescriptorArray + ) + (Integer 4) + (Integer 4) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [sin@__lpython_overloaded_0__sin] + [(Var 204 array) + (Var 204 result) + (Var 204 size1) + (Var 204 size2) + (Var 204 size3)] + [(= + (Var 204 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (DoLoop + () + ((Var 204 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 204 size1) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(BlockCall + -1 + 204 block + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 237 + { + __main__global_stmts: + (ExternalSymbol + 237 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 237 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-expr10-efcbb1b.json b/tests/reference/asr-expr10-efcbb1b.json index 62a4828972..b363b881c5 100644 --- a/tests/reference/asr-expr10-efcbb1b.json +++ b/tests/reference/asr-expr10-efcbb1b.json @@ -5,9 +5,9 @@ "infile_hash": "7eb1dd6ad27fcc091e18c4447fb7a56c659565bbdb57f567b68f4a58", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr10-efcbb1b.stderr", - "stderr_hash": "32b0a64a7d73278b8d793b2991e8550827128c4df7fd48bc82d20311", - "returncode": 2 + "stdout": "asr-expr10-efcbb1b.stdout", + "stdout_hash": "c907314770f92fd70fe89854dc8249f7650db8bc23725cffb6ca12e0", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-expr10-efcbb1b.stdout b/tests/reference/asr-expr10-efcbb1b.stdout new file mode 100644 index 0000000000..17a7ec647b --- /dev/null +++ b/tests/reference/asr-expr10-efcbb1b.stdout @@ -0,0 +1,453 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_UnaryOp: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 3 + b2 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b3: + (Variable + 3 + b3 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 3 + complex + 4 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_13__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_13__complex + 4 __lpython_overloaded_13__complex + lpython_builtin + [] + __lpython_overloaded_13__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 4 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ), + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + test_UnaryOp + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_13__complex] + [] + [(= + (Var 3 a) + (IntegerConstant 4 (Integer 4)) + () + ) + (= + (Var 3 a) + (IntegerUnaryMinus + (IntegerConstant 500 (Integer 4)) + (Integer 4) + (IntegerConstant -500 (Integer 4)) + ) + () + ) + (= + (Var 3 a) + (IntegerBitNot + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -6 (Integer 4)) + ) + () + ) + (= + (Var 3 b) + (LogicalNot + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 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 3 b) + (LogicalNot + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 f) + (RealConstant + 1.000000 + (Real 4) + ) + () + ) + (= + (Var 3 f) + (RealUnaryMinus + (Cast + (RealConstant + 183745.534000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 183745.534000 + (Real 4) + ) + ) + (Real 4) + (RealConstant + -183745.534000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 b1) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 b2) + (LogicalNot + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 b3) + (LogicalNot + (Var 3 b2) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 3 a) + (IntegerUnaryMinus + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + (IntegerConstant 0 (Integer 4)) + ) + (Integer 4) + (IntegerConstant 0 (Integer 4)) + ) + () + ) + (= + (Var 3 a) + (IntegerBitNot + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + () + ) + (= + (Var 3 c) + (ComplexConstant + 1.000000 + 2.000000 + (Complex 4) + ) + () + ) + (= + (Var 3 c) + (ComplexUnaryMinus + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_13__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((RealConstant + 65.000000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.000000 + 65.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 3.000000 + 65.000000 + (Complex 4) + ) + ) + (Complex 4) + (ComplexConstant + -3.000000 + -65.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 b1) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (= + (Var 3 b2) + (LogicalConstant + .true. + (Logical 4) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 121 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr13-81bdb5a.json b/tests/reference/asr-expr13-81bdb5a.json index 739e799cd5..89ab7884d3 100644 --- a/tests/reference/asr-expr13-81bdb5a.json +++ b/tests/reference/asr-expr13-81bdb5a.json @@ -5,9 +5,9 @@ "infile_hash": "fae72924c71183c45d328b379dfa81aa4971b5e1a9ea668db546078f", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr13-81bdb5a.stderr", - "stderr_hash": "0699d234dbdd85c470cbdb001dd7447b9419e96ce3aafa7642a9edc3", - "returncode": 2 + "stdout": "asr-expr13-81bdb5a.stdout", + "stdout_hash": "a5b91838d5aa7df662a429cf27d1b582c411ed5ef7e88a31e78a78b2", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-expr13-81bdb5a.stdout b/tests/reference/asr-expr13-81bdb5a.stdout new file mode 100644 index 0000000000..933967121e --- /dev/null +++ b/tests/reference/asr-expr13-81bdb5a.stdout @@ -0,0 +1,473 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_Compare: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 3 + complex + 4 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_5__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_5__complex + 4 __lpython_overloaded_5__complex + lpython_builtin + [] + __lpython_overloaded_5__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 4 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ) + }) + test_Compare + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_9__complex + complex@__lpython_overloaded_5__complex] + [] + [(= + (Var 3 a) + (IntegerCompare + (IntegerConstant 5 (Integer 4)) + Gt + (IntegerConstant 4 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (IntegerCompare + (IntegerConstant 5 (Integer 4)) + LtE + (IntegerConstant 4 (Integer 4)) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (IntegerCompare + (IntegerConstant 5 (Integer 4)) + Lt + (IntegerConstant 4 (Integer 4)) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (RealCompare + (RealConstant + 5.600000 + (Real 8) + ) + GtE + (RealConstant + 5.599990 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (RealCompare + (RealConstant + 3.300000 + (Real 8) + ) + Eq + (RealConstant + 3.300000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (RealCompare + (RealConstant + 3.300000 + (Real 8) + ) + NotEq + (RealConstant + 3.400000 + (Real 8) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (ComplexCompare + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + Eq + (FunctionCall + 3 complex@__lpython_overloaded_5__complex + 3 complex + [((RealConstant + 3.000000 + (Real 8) + )) + ((RealConstant + 4.000000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "abc" + (Character 1 3 ()) + ) + Gt + (StringConstant + "abd" + (Character 1 3 ()) + ) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "" + (Character 1 0 ()) + ) + Lt + (StringConstant + "s" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "-abs" + (Character 1 4 ()) + ) + GtE + (StringConstant + "abs" + (Character 1 3 ()) + ) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "abcd" + (Character 1 4 ()) + ) + LtE + (StringConstant + "abcde" + (Character 1 5 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "abc" + (Character 1 3 ()) + ) + Eq + (StringConstant + "abc" + (Character 1 3 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "abc" + (Character 1 3 ()) + ) + NotEq + (StringConstant + "abd" + (Character 1 3 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (StringCompare + (StringConstant + "" + (Character 1 0 ()) + ) + Eq + (StringConstant + "+" + (Character 1 1 ()) + ) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (LogicalCompare + (LogicalConstant + .true. + (Logical 4) + ) + Gt + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (LogicalCompare + (LogicalConstant + .true. + (Logical 4) + ) + Eq + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (LogicalCompare + (LogicalConstant + .false. + (Logical 4) + ) + NotEq + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a) + (LogicalCompare + (LogicalConstant + .false. + (Logical 4) + ) + GtE + (LogicalConstant + .true. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 121 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr7-480ba2f.json b/tests/reference/asr-expr7-480ba2f.json index 7d13377709..0e7077348d 100644 --- a/tests/reference/asr-expr7-480ba2f.json +++ b/tests/reference/asr-expr7-480ba2f.json @@ -5,9 +5,9 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "asr-expr7-480ba2f.stdout", + "stdout_hash": "02945c0fc319637bb38da3114e65beccc06c8779df275d49812cb423", "stderr": "asr-expr7-480ba2f.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 + "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-expr7-480ba2f.stderr b/tests/reference/asr-expr7-480ba2f.stderr index d1b84ec030..a4fad29beb 100644 --- a/tests/reference/asr-expr7-480ba2f.stderr +++ b/tests/reference/asr-expr7-480ba2f.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here + | ^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +style suggestion: Could have used '**' instead of 'pow' + --> tests/expr7.py:8:15 + | +8 | res = i32(pow(a, b)) + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/asr-expr7-480ba2f.stdout b/tests/reference/asr-expr7-480ba2f.stdout new file mode 100644 index 0000000000..cf5897cf91 --- /dev/null +++ b/tests/reference/asr-expr7-480ba2f.stdout @@ -0,0 +1,371 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 123 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 5 + { + c: + (Variable + 5 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_pow + test_pow_1] + [] + [(SubroutineCall + 2 test_pow + () + [] + () + ) + (= + (Var 5 c) + (FunctionCall + 2 test_pow_1 + () + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Integer 4) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_pow: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + pow: + (ExternalSymbol + 3 + pow + 6 pow + lpython_builtin + [] + pow + Private + ), + pow@__lpython_overloaded_0__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_0__pow + 6 __lpython_overloaded_0__pow + lpython_builtin + [] + __lpython_overloaded_0__pow + Public + ) + }) + test_pow + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [pow@__lpython_overloaded_0__pow] + [] + [(= + (Var 3 a) + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((IntegerConstant 2 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Real 8) + (RealConstant + 4.000000 + (Real 8) + ) + () + ) + RealToInteger + (Integer 4) + (IntegerConstant 4 (Integer 4)) + ) + () + )] + () + Public + .false. + .false. + () + ), + test_pow_1: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 4 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + pow: + (ExternalSymbol + 4 + pow + 6 pow + lpython_builtin + [] + pow + Private + ), + pow@__lpython_overloaded_0__pow: + (ExternalSymbol + 4 + pow@__lpython_overloaded_0__pow + 6 __lpython_overloaded_0__pow + lpython_builtin + [] + __lpython_overloaded_0__pow + Public + ), + res: + (Variable + 4 + res + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_pow_1 + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [pow@__lpython_overloaded_0__pow] + [(Var 4 a) + (Var 4 b)] + [(= + (Var 4 res) + (Cast + (FunctionCall + 4 pow@__lpython_overloaded_0__pow + 4 pow + [((Var 4 a)) + ((Var 4 b))] + (Real 8) + () + () + ) + RealToInteger + (Integer 4) + () + ) + () + ) + (= + (Var 4 _lpython_return_variable) + (Var 4 res) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 124 + { + __main__global_stmts: + (ExternalSymbol + 124 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 124 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-expr8-6beda60.json b/tests/reference/asr-expr8-6beda60.json index 7801dbd06d..9fb8c510ab 100644 --- a/tests/reference/asr-expr8-6beda60.json +++ b/tests/reference/asr-expr8-6beda60.json @@ -5,9 +5,9 @@ "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr8-6beda60.stderr", - "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", - "returncode": 2 + "stdout": "asr-expr8-6beda60.stdout", + "stdout_hash": "b79ac7dd790182c720f71316cdcedbd0a6b3b1bd56ef5cb800fab8dd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-expr8-6beda60.stdout b/tests/reference/asr-expr8-6beda60.stdout new file mode 100644 index 0000000000..cda03a79a5 --- /dev/null +++ b/tests/reference/asr-expr8-6beda60.stdout @@ -0,0 +1,430 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + test_binop: + (Function + (SymbolTable + 3 + { + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 3 + b2 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x2: + (Variable + 3 + x2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + test_binop + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Pow + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant 8 (Integer 4)) + ) + () + ) + (= + (Var 3 x2) + (Cast + (RealBinOp + (RealConstant + 2.000000 + (Real 8) + ) + Pow + (RealConstant + 3.500000 + (Real 8) + ) + (Real 8) + (RealConstant + 11.313708 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 11.313708 + (Real 4) + ) + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (IntegerConstant 54 (Integer 4)) + Sub + (IntegerConstant 100 (Integer 4)) + (Integer 4) + (IntegerConstant -46 (Integer 4)) + ) + () + ) + (= + (Var 3 x2) + (Cast + (RealBinOp + (RealBinOp + (RealConstant + 3.454000 + (Real 8) + ) + Sub + (RealConstant + 765.430000 + (Real 8) + ) + (Real 8) + (RealConstant + -761.976000 + (Real 8) + ) + ) + Add + (RealConstant + 534.600000 + (Real 8) + ) + (Real 8) + (RealConstant + -227.376000 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + -227.376000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 x2) + (Cast + (RealBinOp + (RealConstant + 5346.565000 + (Real 8) + ) + Mul + (RealConstant + 3.450000 + (Real 8) + ) + (Real 8) + (RealConstant + 18445.649250 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 18445.649250 + (Real 4) + ) + ) + () + ) + (= + (Var 3 x2) + (Cast + (RealBinOp + (RealConstant + 5346.565000 + (Real 8) + ) + Pow + (RealConstant + 3.450000 + (Real 8) + ) + (Real 8) + (RealConstant + 7275422789925.217773 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 7275422789925.217773 + (Real 4) + ) + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Mul + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Pow + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (Var 3 b1) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 b2) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (= + (Var 3 x) + (Cast + (IntrinsicScalarFunction + FloorDiv + [(Var 3 b1) + (Var 3 b1)] + 0 + (Logical 4) + () + ) + LogicalToInteger + (Integer 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerBinOp + (Cast + (Var 3 b1) + LogicalToInteger + (Integer 4) + () + ) + Pow + (Cast + (Var 3 b2) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 4 + { + + }) + main_program + [] + [] + ) + }) + [] +) diff --git a/tests/reference/asr-expr_05-3a37324.json b/tests/reference/asr-expr_05-3a37324.json index e366badac0..8c90040f3a 100644 --- a/tests/reference/asr-expr_05-3a37324.json +++ b/tests/reference/asr-expr_05-3a37324.json @@ -5,9 +5,9 @@ "infile_hash": "cc922bec30fac0a8eb10efd99f72234aa5638b3c9cd92c68044c69ea", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-expr_05-3a37324.stderr", - "stderr_hash": "ec167ccde0bcc3539244c081abc86809b00655e649722a96f082d86b", - "returncode": 2 + "stdout": "asr-expr_05-3a37324.stdout", + "stdout_hash": "8daf39a772d99f4ae814c124aef4cd567c420d9ed98849fcaee10b87", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-expr_05-3a37324.stdout b/tests/reference/asr-expr_05-3a37324.stdout new file mode 100644 index 0000000000..c48787899e --- /dev/null +++ b/tests/reference/asr-expr_05-3a37324.stdout @@ -0,0 +1,1642 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 123 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main0] + [] + [(SubroutineCall + 2 main0 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main0: + (Function + (SymbolTable + 5 + { + _mod: + (ExternalSymbol + 5 + _mod + 6 _mod + lpython_builtin + [] + _mod + Private + ), + _mod@__lpython_overloaded_2___mod: + (ExternalSymbol + 5 + _mod@__lpython_overloaded_2___mod + 6 __lpython_overloaded_2___mod + lpython_builtin + [] + __lpython_overloaded_2___mod + Public + ), + _mod@__lpython_overloaded_4___mod: + (ExternalSymbol + 5 + _mod@__lpython_overloaded_4___mod + 6 __lpython_overloaded_4___mod + lpython_builtin + [] + __lpython_overloaded_4___mod + Public + ), + _mod@__lpython_overloaded_9___mod: + (ExternalSymbol + 5 + _mod@__lpython_overloaded_9___mod + 6 __lpython_overloaded_9___mod + lpython_builtin + [] + __lpython_overloaded_9___mod + Public + ), + a: + (Variable + 5 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a1: + (Variable + 5 + a1 + [] + Local + () + () + Default + (UnsignedInteger + 2 + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 5 + b1 + [] + Local + () + () + Default + (UnsignedInteger + 2 + ) + () + Source + Public + Required + .false. + ), + c1: + (Variable + 5 + c1 + [] + Local + () + () + Default + (UnsignedInteger + 2 + ) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 5 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 5 + i + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + i1: + (Variable + 5 + i1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 5 + i2 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i3: + (Variable + 5 + i3 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i4: + (Variable + 5 + i4 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + main0 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_multiply + test_mod + _mod@__lpython_overloaded_2___mod + _mod@__lpython_overloaded_9___mod + _mod@__lpython_overloaded_4___mod] + [] + [(= + (Var 5 a) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 5 b) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + () + ) + (= + (Var 5 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 test_multiply + () + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 50 (Integer 4)) + (Integer 4) + (IntegerConstant -50 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 i) + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + () + ) + (= + (Var 5 i) + (IntegerBinOp + (Var 5 i) + Add + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Integer 8) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 i) + Eq + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 5 b) + (IntegerConstant 5 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 test_mod + () + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 test_mod + () + [((IntegerConstant 23 (Integer 4))) + ((IntegerConstant 3 (Integer 4)))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerConstant 123282374 (Integer 4)) + () + ) + (= + (Var 5 b) + (IntegerConstant 32771 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 test_mod + () + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 30643 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerUnaryMinus + (IntegerConstant 5345 (Integer 4)) + (Integer 4) + (IntegerConstant -5345 (Integer 4)) + ) + () + ) + (= + (Var 5 b) + (IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 5 _mod@__lpython_overloaded_2___mod + 5 _mod + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerUnaryMinus + (IntegerConstant 123282374 (Integer 4)) + (Integer 4) + (IntegerConstant -123282374 (Integer 4)) + ) + () + ) + (= + (Var 5 b) + (IntegerConstant 32771 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 2 test_mod + () + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 2128 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + BitOr + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant 14 (Integer 4)) + ) + Eq + (IntegerConstant 14 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (IntegerConstant 105346 (Integer 4)) + (Integer 4) + (IntegerConstant -105346 (Integer 4)) + ) + BitOr + (IntegerUnaryMinus + (IntegerConstant 32771 (Integer 4)) + (Integer 4) + (IntegerConstant -32771 (Integer 4)) + ) + (Integer 4) + (IntegerConstant -32769 (Integer 4)) + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 32769 (Integer 4)) + (Integer 4) + (IntegerConstant -32769 (Integer 4)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + BitAnd + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant 0 (Integer 4)) + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (IntegerConstant 105346 (Integer 4)) + (Integer 4) + (IntegerConstant -105346 (Integer 4)) + ) + BitAnd + (IntegerUnaryMinus + (IntegerConstant 32771 (Integer 4)) + (Integer 4) + (IntegerConstant -32771 (Integer 4)) + ) + (Integer 4) + (IntegerConstant -105348 (Integer 4)) + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 105348 (Integer 4)) + (Integer 4) + (IntegerConstant -105348 (Integer 4)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + BitXor + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant 14 (Integer 4)) + ) + Eq + (IntegerConstant 14 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (IntegerConstant 105346 (Integer 4)) + (Integer 4) + (IntegerConstant -105346 (Integer 4)) + ) + BitXor + (IntegerUnaryMinus + (IntegerConstant 32771 (Integer 4)) + (Integer 4) + (IntegerConstant -32771 (Integer 4)) + ) + (Integer 4) + (IntegerConstant 72579 (Integer 4)) + ) + Eq + (IntegerConstant 72579 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerConstant 10 (Integer 4)) + BitRShift + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 5 (Integer 4)) + ) + Eq + (IntegerConstant 5 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerConstant 5 (Integer 4)) + BitLShift + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 10 (Integer 4)) + ) + Eq + (IntegerConstant 10 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 5 i1) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 5 i2) + (IntegerConstant 4 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i1) + BitLShift + (Var 5 i2) + (Integer 4) + () + ) + Eq + (IntegerConstant 160 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i1) + BitRShift + (Var 5 i2) + (Integer 4) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i1) + BitAnd + (Var 5 i2) + (Integer 4) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i1) + BitOr + (Var 5 i2) + (Integer 4) + () + ) + Eq + (IntegerConstant 14 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i1) + BitXor + (Var 5 i2) + (Integer 4) + () + ) + Eq + (IntegerConstant 14 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (Var 5 i1) + (Integer 4) + () + ) + BitXor + (IntegerUnaryMinus + (Var 5 i2) + (Integer 4) + () + ) + (Integer 4) + () + ) + Eq + (IntegerConstant 10 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 i3) + (IntegerConstant 432534534 (Integer 4)) + () + ) + (= + (Var 5 i4) + (IntegerUnaryMinus + (IntegerConstant 4325 (Integer 4)) + (Integer 4) + (IntegerConstant -4325 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i3) + BitOr + (Var 5 i4) + (Integer 4) + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 225 (Integer 4)) + (Integer 4) + (IntegerConstant -225 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (Var 5 i4) + BitRShift + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 541 (Integer 4)) + (Integer 4) + (IntegerConstant -541 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (Var 5 i3) + (Integer 4) + () + ) + BitAnd + (Var 5 i4) + (Integer 4) + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 432534758 (Integer 4)) + (Integer 4) + (IntegerConstant -432534758 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntegerBinOp + (IntegerUnaryMinus + (Var 5 i3) + (Integer 4) + () + ) + BitXor + (Var 5 i4) + (Integer 4) + () + ) + Eq + (IntegerConstant 432530657 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 5 a) + (IntegerBinOp + (Var 5 a) + BitOr + (IntegerConstant 4 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 14 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerBinOp + (Var 5 a) + BitXor + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 13 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 b) + (IntegerConstant 10 (Integer 4)) + () + ) + (= + (Var 5 a) + (FunctionCall + 5 _mod@__lpython_overloaded_2___mod + 5 _mod + [((Var 5 a)) + ((Var 5 b))] + (Integer 4) + () + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 3 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 b) + (IntegerConstant 4 (Integer 4)) + () + ) + (= + (Var 5 a) + (IntegerBinOp + (Var 5 a) + BitLShift + (Var 5 b) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 48 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerBinOp + (Var 5 a) + BitRShift + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 24 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a) + (IntegerBinOp + (Var 5 a) + BitAnd + (Var 5 b) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 a) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 5 b) + (IntegerBinOp + (Var 5 b) + Pow + (IntegerConstant 4 (Integer 4)) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 5 b) + Eq + (IntegerConstant 256 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 5 _mod@__lpython_overloaded_2___mod + 5 _mod + [((IntegerUnaryMinus + (IntegerConstant 8 (Integer 4)) + (Integer 4) + (IntegerConstant -8 (Integer 4)) + )) + ((IntegerConstant 3 (Integer 4)))] + (Integer 4) + (IntegerConstant 1 (Integer 4)) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 5 _mod@__lpython_overloaded_2___mod + 5 _mod + [((IntegerConstant 8 (Integer 4))) + ((IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ))] + (Integer 4) + (IntegerConstant -1 (Integer 4)) + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 5 _mod@__lpython_overloaded_2___mod + 5 _mod + [((IntegerUnaryMinus + (IntegerConstant 8 (Integer 4)) + (Integer 4) + (IntegerConstant -8 (Integer 4)) + )) + ((IntegerUnaryMinus + (IntegerConstant 3 (Integer 4)) + (Integer 4) + (IntegerConstant -3 (Integer 4)) + ))] + (Integer 4) + (IntegerConstant -2 (Integer 4)) + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant -2 (Integer 4)) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 5 _mod@__lpython_overloaded_9___mod + 5 _mod + [((RealConstant + 11.000000 + (Real 8) + )) + ((RealUnaryMinus + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -3.000000 + (Real 8) + ) + ))] + (Real 8) + (RealConstant + -1.000000 + (Real 8) + ) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -1.000000 + (Real 8) + ) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 5 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 5 _mod@__lpython_overloaded_9___mod + 5 _mod + [((RealUnaryMinus + (RealConstant + 11.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -11.000000 + (Real 8) + ) + )) + ((RealConstant + 3.000000 + (Real 8) + ))] + (Real 8) + (RealConstant + 1.000000 + (Real 8) + ) + () + ) + Sub + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 5 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 5 a1) + (Cast + (IntegerConstant 10 (Integer 4)) + IntegerToUnsignedInteger + (UnsignedInteger + 2 + ) + (UnsignedIntegerConstant + 10 + (UnsignedInteger + 2 + ) + ) + ) + () + ) + (= + (Var 5 b1) + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToUnsignedInteger + (UnsignedInteger + 2 + ) + (UnsignedIntegerConstant + 3 + (UnsignedInteger + 2 + ) + ) + ) + () + ) + (= + (Var 5 c1) + (FunctionCall + 5 _mod@__lpython_overloaded_4___mod + 5 _mod + [((Var 5 a1)) + ((Var 5 b1))] + (UnsignedInteger + 2 + ) + () + () + ) + () + ) + (Assert + (UnsignedIntegerCompare + (Var 5 c1) + Eq + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToUnsignedInteger + (UnsignedInteger + 2 + ) + (UnsignedIntegerConstant + 1 + (UnsignedInteger + 2 + ) + ) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 c1) + (IntrinsicScalarFunction + FloorDiv + [(Var 5 a1) + (Var 5 b1)] + 0 + (UnsignedInteger + 2 + ) + () + ) + () + ) + (Assert + (UnsignedIntegerCompare + (Var 5 c1) + Eq + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToUnsignedInteger + (UnsignedInteger + 2 + ) + (UnsignedIntegerConstant + 3 + (UnsignedInteger + 2 + ) + ) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_mod: + (Function + (SymbolTable + 4 + { + _lpython_return_variable: + (Variable + 4 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + _mod: + (ExternalSymbol + 4 + _mod + 6 _mod + lpython_builtin + [] + _mod + Private + ), + _mod@__lpython_overloaded_2___mod: + (ExternalSymbol + 4 + _mod@__lpython_overloaded_2___mod + 6 __lpython_overloaded_2___mod + lpython_builtin + [] + __lpython_overloaded_2___mod + Public + ), + a: + (Variable + 4 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 4 + b + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_mod + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [_mod@__lpython_overloaded_2___mod] + [(Var 4 a) + (Var 4 b)] + [(= + (Var 4 _lpython_return_variable) + (FunctionCall + 4 _mod@__lpython_overloaded_2___mod + 4 _mod + [((Var 4 a)) + ((Var 4 b))] + (Integer 4) + () + () + ) + () + ) + (Return)] + (Var 4 _lpython_return_variable) + Public + .false. + .false. + () + ), + test_multiply: + (Function + (SymbolTable + 3 + { + _lpython_return_variable: + (Variable + 3 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a: + (Variable + 3 + a + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_multiply + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 3 a) + (Var 3 b)] + [(= + (Var 3 _lpython_return_variable) + (IntegerBinOp + (Var 3 a) + Mul + (Var 3 b) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 3 _lpython_return_variable) + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 124 + { + __main__global_stmts: + (ExternalSymbol + 124 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 124 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-generics_array_01-682b1b2.json b/tests/reference/asr-generics_array_01-682b1b2.json index 2da3a03bc0..fae1832ba1 100644 --- a/tests/reference/asr-generics_array_01-682b1b2.json +++ b/tests/reference/asr-generics_array_01-682b1b2.json @@ -5,9 +5,9 @@ "infile_hash": "6e943dd0e26ab4d1ffb6ed6909a365b4135b6f5295957b2478cfb479", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_01-682b1b2.stderr", - "stderr_hash": "07809b586ef30105878e1532461ac0ad302722003d44d2ae71b4cb7a", - "returncode": 2 + "stdout": "asr-generics_array_01-682b1b2.stdout", + "stdout_hash": "af14475be21a8b255e3482c293596282a24e86e643a0502519879a08", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_01-682b1b2.stdout b/tests/reference/asr-generics_array_01-682b1b2.stdout new file mode 100644 index 0000000000..8a408834a9 --- /dev/null +++ b/tests/reference/asr-generics_array_01-682b1b2.stdout @@ -0,0 +1,459 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_f_0: + (Function + (SymbolTable + 205 + { + _lpython_return_variable: + (Variable + 205 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 205 + i + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + lst: + (Variable + 205 + lst + [] + InOut + () + () + Default + (Array + (Integer 4) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_f_0 + (FunctionType + [(Array + (Integer 4) + [(() + ())] + DescriptorArray + ) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 lst) + (Var 205 i)] + [(= + (ArrayItem + (Var 205 lst) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (Var 205 i) + () + ) + (= + (Var 205 _lpython_return_variable) + (ArrayItem + (Var 205 lst) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + () + ) + (Return)] + (Var 205 _lpython_return_variable) + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 206 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [use_array] + [] + [(SubroutineCall + 2 use_array + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 203 + { + _lpython_return_variable: + (Variable + 203 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 203 + i + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + lst: + (Variable + 203 + lst + [] + InOut + () + () + Default + (Array + (TypeParameter + T + ) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [(Array + (TypeParameter + T + ) + [(() + ())] + DescriptorArray + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 203 lst) + (Var 203 i)] + [(= + (ArrayItem + (Var 203 lst) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (TypeParameter + T + ) + RowMajor + () + ) + (Var 203 i) + () + ) + (= + (Var 203 _lpython_return_variable) + (ArrayItem + (Var 203 lst) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (TypeParameter + T + ) + RowMajor + () + ) + () + ) + (Return)] + (Var 203 _lpython_return_variable) + Public + .false. + .false. + () + ), + use_array: + (Function + (SymbolTable + 204 + { + array: + (Variable + 204 + array + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 204 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + use_array + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_f_0] + [] + [(= + (Var 204 array) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 204 x) + (IntegerConstant 69 (Integer 4)) + () + ) + (Print + () + [(FunctionCall + 2 __asr_generic_f_0 + () + [((ArrayPhysicalCast + (Var 204 array) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + DescriptorArray + ) + () + )) + ((Var 204 x))] + (Integer 4) + () + () + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 207 + { + __main__global_stmts: + (ExternalSymbol + 207 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 207 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-generics_array_02-22c8dc1.json b/tests/reference/asr-generics_array_02-22c8dc1.json index b869c0013e..f4d661ba5e 100644 --- a/tests/reference/asr-generics_array_02-22c8dc1.json +++ b/tests/reference/asr-generics_array_02-22c8dc1.json @@ -5,9 +5,9 @@ "infile_hash": "54b5f1d4b8fc7543c292ac0d6f7a39939816a657173937fa7dc02f07", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_02-22c8dc1.stderr", - "stderr_hash": "ab2cfe57f54581e673039761ff5a42919ddb665b1083a36342cbe7e1", - "returncode": 2 + "stdout": "asr-generics_array_02-22c8dc1.stdout", + "stdout_hash": "5e5091e93e3005801410e364adb3a1ad1a821e13d054ff7120661e34", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stdout b/tests/reference/asr-generics_array_02-22c8dc1.stdout new file mode 100644 index 0000000000..1ed0cc609a --- /dev/null +++ b/tests/reference/asr-generics_array_02-22c8dc1.stdout @@ -0,0 +1,1391 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_g_0: + (Function + (SymbolTable + 209 + { + a: + (Variable + 209 + a + [n] + InOut + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 209 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 209 + b + [n] + InOut + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 209 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 209 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 209 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 209 + r + [n] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 209 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_g_0 + (FunctionType + [(Integer 4) + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_integer] + [(Var 209 n) + (Var 209 a) + (Var 209 b)] + [(= + (Var 209 r) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 209 n))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 209 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 209 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 209 r) + [(() + (Var 209 i) + ())] + (Integer 4) + RowMajor + () + ) + (FunctionCall + 2 add_integer + () + [((ArrayItem + (Var 209 a) + [(() + (Var 209 i) + ())] + (Integer 4) + RowMajor + () + )) + ((ArrayItem + (Var 209 b) + [(() + (Var 209 i) + ())] + (Integer 4) + RowMajor + () + ))] + (Integer 4) + () + () + ) + () + )] + ) + (Print + () + [(ArrayItem + (Var 209 r) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + __asr_generic_g_1: + (Function + (SymbolTable + 210 + { + a: + (Variable + 210 + a + [n] + InOut + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 210 + b + [n] + InOut + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 210 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 210 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 210 + r + [n] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_g_1 + (FunctionType + [(Integer 4) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_float] + [(Var 210 n) + (Var 210 a) + (Var 210 b)] + [(= + (Var 210 r) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 210 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 210 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 210 r) + [(() + (Var 210 i) + ())] + (Real 4) + RowMajor + () + ) + (FunctionCall + 2 add_float + () + [((ArrayItem + (Var 210 a) + [(() + (Var 210 i) + ())] + (Real 4) + RowMajor + () + )) + ((ArrayItem + (Var 210 b) + [(() + (Var 210 i) + ())] + (Real 4) + RowMajor + () + ))] + (Real 4) + () + () + ) + () + )] + ) + (Print + () + [(ArrayItem + (Var 210 r) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 211 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main] + [] + [(SubroutineCall + 2 main + () + [] + () + )] + () + Public + .false. + .false. + () + ), + add: + (Function + (SymbolTable + 203 + { + _lpython_return_variable: + (Variable + 203 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 203 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 203 + y + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + add + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 203 x) + (Var 203 y)] + [] + (Var 203 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_float: + (Function + (SymbolTable + 205 + { + _lpython_return_variable: + (Variable + 205 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 205 + x + [] + In + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 205 + y + [] + In + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + add_float + (FunctionType + [(Real 4) + (Real 4)] + (Real 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 x) + (Var 205 y)] + [(= + (Var 205 _lpython_return_variable) + (RealBinOp + (Var 205 x) + Add + (Var 205 y) + (Real 4) + () + ) + () + ) + (Return)] + (Var 205 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_integer: + (Function + (SymbolTable + 204 + { + _lpython_return_variable: + (Variable + 204 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 204 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 204 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + add_integer + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 x) + (Var 204 y)] + [(= + (Var 204 _lpython_return_variable) + (IntegerBinOp + (Var 204 x) + Add + (Var 204 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 204 _lpython_return_variable) + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 206 + { + a: + (Variable + 206 + a + [n] + InOut + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 206 + b + [n] + InOut + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 206 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 206 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 206 + r + [n] + Local + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [(Integer 4) + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + ))] + PointerToDataArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add] + [(Var 206 n) + (Var 206 a) + (Var 206 b)] + [(= + (Var 206 r) + (ArrayConstant + [] + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 206 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 206 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 206 r) + [(() + (Var 206 i) + ())] + (TypeParameter + T + ) + RowMajor + () + ) + (FunctionCall + 2 add + () + [((ArrayItem + (Var 206 a) + [(() + (Var 206 i) + ())] + (TypeParameter + T + ) + RowMajor + () + )) + ((ArrayItem + (Var 206 b) + [(() + (Var 206 i) + ())] + (TypeParameter + T + ) + RowMajor + () + ))] + (TypeParameter + T + ) + () + () + ) + () + )] + ) + (Print + () + [(ArrayItem + (Var 206 r) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (TypeParameter + T + ) + RowMajor + () + )] + () + () + )] + () + Public + .false. + .false. + () + ), + main: + (Function + (SymbolTable + 207 + { + a_float: + (Variable + 207 + a_float + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + a_int: + (Variable + 207 + a_int + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b_float: + (Variable + 207 + b_float + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b_int: + (Variable + 207 + b_int + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + main + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_g_0 + __asr_generic_g_1] + [] + [(= + (Var 207 a_int) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 a_int) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 400 (Integer 4)) + () + ) + (= + (Var 207 b_int) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 b_int) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 20 (Integer 4)) + () + ) + (SubroutineCall + 2 __asr_generic_g_0 + () + [((IntegerConstant 1 (Integer 4))) + ((ArrayPhysicalCast + (Var 207 a_int) + FixedSizeArray + PointerToDataArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + )) + ((ArrayPhysicalCast + (Var 207 b_int) + FixedSizeArray + PointerToDataArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + ))] + () + ) + (= + (Var 207 a_float) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 a_float) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (RealConstant + 400.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 400.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 207 b_float) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 b_float) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (RealConstant + 20.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 20.000000 + (Real 4) + ) + ) + () + ) + (SubroutineCall + 2 __asr_generic_g_1 + () + [((IntegerConstant 1 (Integer 4))) + ((ArrayPhysicalCast + (Var 207 a_float) + FixedSizeArray + PointerToDataArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + )) + ((ArrayPhysicalCast + (Var 207 b_float) + FixedSizeArray + PointerToDataArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + ))] + () + )] + () + Public + .false. + .false. + () + ), + n: + (Variable + 2 + n + [] + Local + () + () + Default + (TypeParameter + n + ) + () + Source + Public + Required + .false. + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 212 + { + __main__global_stmts: + (ExternalSymbol + 212 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 212 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-generics_array_03-fb3706c.json b/tests/reference/asr-generics_array_03-fb3706c.json index 128484c0ae..5eba5d5b5d 100644 --- a/tests/reference/asr-generics_array_03-fb3706c.json +++ b/tests/reference/asr-generics_array_03-fb3706c.json @@ -5,9 +5,9 @@ "infile_hash": "5b415ae64a527ce3ab3b6878141238e227258bc2b2b8c37af6d23ff5", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-generics_array_03-fb3706c.stderr", - "stderr_hash": "7d636bddcd76853697423eb36c823f5898b8274b21a62a55f764b63b", - "returncode": 2 + "stdout": "asr-generics_array_03-fb3706c.stdout", + "stdout_hash": "b815e4c783072735466386b0bc1f9d272cff4116cca14f109085c299", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-generics_array_03-fb3706c.stdout b/tests/reference/asr-generics_array_03-fb3706c.stdout new file mode 100644 index 0000000000..3048a239ed --- /dev/null +++ b/tests/reference/asr-generics_array_03-fb3706c.stdout @@ -0,0 +1,1880 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + T: + (Variable + 2 + T + [] + Local + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + __asr_generic_g_0: + (Function + (SymbolTable + 210 + { + _lpython_return_variable: + (Variable + 210 + _lpython_return_variable + [n + m] + ReturnVar + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 210 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + a: + (Variable + 210 + a + [n + m] + InOut + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 210 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 210 + b + [n + m] + InOut + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 210 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 210 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 210 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + m: + (Variable + 210 + m + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 210 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 210 + r + [n + m] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 210 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_g_0 + (FunctionType + [(Integer 4) + (Integer 4) + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + )] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_integer] + [(Var 210 n) + (Var 210 m) + (Var 210 a) + (Var 210 b)] + [(= + (Var 210 r) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (Var 210 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 210 m))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 210 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 210 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 210 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 210 m) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 210 r) + [(() + (Var 210 i) + ()) + (() + (Var 210 j) + ())] + (Integer 4) + RowMajor + () + ) + (FunctionCall + 2 add_integer + () + [((ArrayItem + (Var 210 a) + [(() + (Var 210 i) + ()) + (() + (Var 210 j) + ())] + (Integer 4) + RowMajor + () + )) + ((ArrayItem + (Var 210 b) + [(() + (Var 210 i) + ()) + (() + (Var 210 j) + ())] + (Integer 4) + RowMajor + () + ))] + (Integer 4) + () + () + ) + () + )] + )] + ) + (Print + () + [(ArrayItem + (Var 210 r) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + )] + () + () + )] + (Var 210 _lpython_return_variable) + Public + .false. + .false. + () + ), + __asr_generic_g_1: + (Function + (SymbolTable + 211 + { + _lpython_return_variable: + (Variable + 211 + _lpython_return_variable + [n + m] + ReturnVar + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 211 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 211 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + a: + (Variable + 211 + a + [n + m] + InOut + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 211 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 211 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 211 + b + [n + m] + InOut + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 211 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 211 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 211 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 211 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + m: + (Variable + 211 + m + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 211 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 211 + r + [n + m] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 211 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 211 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + __asr_generic_g_1 + (FunctionType + [(Integer 4) + (Integer 4) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + )] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add_float] + [(Var 211 n) + (Var 211 m) + (Var 211 a) + (Var 211 b)] + [(= + (Var 211 r) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (Var 211 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 211 m))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 211 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 211 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 211 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 211 m) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 211 r) + [(() + (Var 211 i) + ()) + (() + (Var 211 j) + ())] + (Real 4) + RowMajor + () + ) + (FunctionCall + 2 add_float + () + [((ArrayItem + (Var 211 a) + [(() + (Var 211 i) + ()) + (() + (Var 211 j) + ())] + (Real 4) + RowMajor + () + )) + ((ArrayItem + (Var 211 b) + [(() + (Var 211 i) + ()) + (() + (Var 211 j) + ())] + (Real 4) + RowMajor + () + ))] + (Real 4) + () + () + ) + () + )] + )] + ) + (Print + () + [(ArrayItem + (Var 211 r) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + )] + () + () + )] + (Var 211 _lpython_return_variable) + Public + .false. + .false. + () + ), + __main__global_stmts: + (Function + (SymbolTable + 212 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main] + [] + [(SubroutineCall + 2 main + () + [] + () + )] + () + Public + .false. + .false. + () + ), + add: + (Function + (SymbolTable + 203 + { + _lpython_return_variable: + (Variable + 203 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + x: + (Variable + 203 + x + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ), + y: + (Variable + 203 + y + [] + In + () + () + Default + (TypeParameter + T + ) + () + Source + Public + Required + .false. + ) + }) + add + (FunctionType + [(TypeParameter + T + ) + (TypeParameter + T + )] + (TypeParameter + T + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .true. + ) + [] + [(Var 203 x) + (Var 203 y)] + [] + (Var 203 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_float: + (Function + (SymbolTable + 205 + { + _lpython_return_variable: + (Variable + 205 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 205 + x + [] + In + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 205 + y + [] + In + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ) + }) + add_float + (FunctionType + [(Real 4) + (Real 4)] + (Real 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 x) + (Var 205 y)] + [(= + (Var 205 _lpython_return_variable) + (RealBinOp + (Var 205 x) + Add + (Var 205 y) + (Real 4) + () + ) + () + ) + (Return)] + (Var 205 _lpython_return_variable) + Public + .false. + .false. + () + ), + add_integer: + (Function + (SymbolTable + 204 + { + _lpython_return_variable: + (Variable + 204 + _lpython_return_variable + [] + ReturnVar + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 204 + x + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 204 + y + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + add_integer + (FunctionType + [(Integer 4) + (Integer 4)] + (Integer 4) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 x) + (Var 204 y)] + [(= + (Var 204 _lpython_return_variable) + (IntegerBinOp + (Var 204 x) + Add + (Var 204 y) + (Integer 4) + () + ) + () + ) + (Return)] + (Var 204 _lpython_return_variable) + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 206 + { + _lpython_return_variable: + (Variable + 206 + _lpython_return_variable + [n + m] + ReturnVar + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 206 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + a: + (Variable + 206 + a + [n + m] + InOut + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 206 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 206 + b + [n + m] + InOut + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 206 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 206 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 206 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + m: + (Variable + 206 + m + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + n: + (Variable + 206 + n + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + r: + (Variable + 206 + r + [n + m] + Local + () + () + Default + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 206 m))] + PointerToDataArray + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [(Integer 4) + (Integer 4) + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + )] + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (FunctionParam + 0 + (Integer 4) + () + )) + ((IntegerConstant 0 (Integer 4)) + (FunctionParam + 1 + (Integer 4) + () + ))] + PointerToDataArray + ) + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [2 add] + .false. + ) + [add] + [(Var 206 n) + (Var 206 m) + (Var 206 a) + (Var 206 b)] + [(= + (Var 206 r) + (ArrayConstant + [] + (Array + (TypeParameter + T + ) + [((IntegerConstant 0 (Integer 4)) + (Var 206 n)) + ((IntegerConstant 0 (Integer 4)) + (Var 206 m))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 206 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 206 n) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 206 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (Var 206 m) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 206 r) + [(() + (Var 206 i) + ()) + (() + (Var 206 j) + ())] + (TypeParameter + T + ) + RowMajor + () + ) + (FunctionCall + 2 add + () + [((ArrayItem + (Var 206 a) + [(() + (Var 206 i) + ()) + (() + (Var 206 j) + ())] + (TypeParameter + T + ) + RowMajor + () + )) + ((ArrayItem + (Var 206 b) + [(() + (Var 206 i) + ()) + (() + (Var 206 j) + ())] + (TypeParameter + T + ) + RowMajor + () + ))] + (TypeParameter + T + ) + () + () + ) + () + )] + )] + ) + (Print + () + [(ArrayItem + (Var 206 r) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (TypeParameter + T + ) + RowMajor + () + )] + () + () + )] + (Var 206 _lpython_return_variable) + Public + .false. + .false. + () + ), + m: + (Variable + 2 + m + [] + Local + () + () + Default + (TypeParameter + m + ) + () + Source + Public + Required + .false. + ), + main: + (Function + (SymbolTable + 207 + { + __lcompilers_dummy: + (Variable + 207 + __lcompilers_dummy + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + __lcompilers_dummy1: + (Variable + 207 + __lcompilers_dummy1 + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + a_float: + (Variable + 207 + a_float + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + a_int: + (Variable + 207 + a_int + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b_float: + (Variable + 207 + b_float + [] + Local + () + () + Default + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b_int: + (Variable + 207 + b_int + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + main + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [__asr_generic_g_0 + __asr_generic_g_1] + [] + [(= + (Var 207 a_int) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 a_int) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 400 (Integer 4)) + () + ) + (= + (Var 207 b_int) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 b_int) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 20 (Integer 4)) + () + ) + (= + (Var 207 __lcompilers_dummy) + (FunctionCall + 2 __asr_generic_g_0 + () + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 1 (Integer 4))) + ((ArrayPhysicalCast + (Var 207 a_int) + FixedSizeArray + PointerToDataArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + )) + ((ArrayPhysicalCast + (Var 207 b_int) + FixedSizeArray + PointerToDataArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + ))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + () + ) + (= + (Var 207 a_float) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 a_float) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (IntegerConstant 400 (Integer 4)) + IntegerToReal + (Real 4) + (RealConstant + 400.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 207 b_float) + (ArrayConstant + [] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 b_float) + [(() + (IntegerConstant 0 (Integer 4)) + ()) + (() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 4) + RowMajor + () + ) + (Cast + (IntegerConstant 20 (Integer 4)) + IntegerToReal + (Real 4) + (RealConstant + 20.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 207 __lcompilers_dummy1) + (FunctionCall + 2 __asr_generic_g_1 + () + [((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 1 (Integer 4))) + ((ArrayPhysicalCast + (Var 207 a_float) + FixedSizeArray + PointerToDataArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + )) + ((ArrayPhysicalCast + (Var 207 b_float) + FixedSizeArray + PointerToDataArray + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + PointerToDataArray + ) + () + ))] + (Array + (Real 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + n: + (Variable + 2 + n + [] + Local + () + () + Default + (TypeParameter + n + ) + () + Source + Public + Required + .false. + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 213 + { + __main__global_stmts: + (ExternalSymbol + 213 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 213 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.json b/tests/reference/asr-kwargs_02_error-7c91f8f.json index bac9cf8743..228d941171 100644 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.json +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-kwargs_02_error-7c91f8f.stderr", - "stderr_hash": "d7988f2217bab99a6e782c6cb63f3d2f505b5d59c8976e4e4fab5042", + "stderr_hash": "120e6e6838e464af15ff96aa99dcdda21923a3bb5f0c3d6d7cc8348b", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr index 738691275d..9e13b4f43d 100644 --- a/tests/reference/asr-kwargs_02_error-7c91f8f.stderr +++ b/tests/reference/asr-kwargs_02_error-7c91f8f.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/kwargs_02_error.py:4:12 - | -4 | return complex(float(a), b) + c - | ^^^^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: func02() got multiple values for argument 'b' + --> tests/errors/kwargs_02_error.py:13:5 + | +13 | func02(arg3, arg4, c=arg5, b=arg4) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-string_02-499c9ff.json b/tests/reference/asr-string_02-499c9ff.json index 4eaad46910..ac33dbbf21 100644 --- a/tests/reference/asr-string_02-499c9ff.json +++ b/tests/reference/asr-string_02-499c9ff.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-string_02-499c9ff.stderr", - "stderr_hash": "85593e60baa6c6f930b7486a92e41fac9943108966abdacb7acb39ef", + "stderr_hash": "368ba74a1e0d6609f71e6f87f95bd0b6151420c81336e48a172cb613", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-string_02-499c9ff.stderr b/tests/reference/asr-string_02-499c9ff.stderr index 7ca613cb8c..196515476b 100644 --- a/tests/reference/asr-string_02-499c9ff.stderr +++ b/tests/reference/asr-string_02-499c9ff.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +semantic error: str.join() takes type list only --> tests/errors/string_02.py:6:15 | 6 | res:str = x.join(p) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^ diff --git a/tests/reference/asr-structs_05-fa98307.json b/tests/reference/asr-structs_05-fa98307.json index e493825921..7826e07c2a 100644 --- a/tests/reference/asr-structs_05-fa98307.json +++ b/tests/reference/asr-structs_05-fa98307.json @@ -5,9 +5,9 @@ "infile_hash": "ef1037b0936a63be679efd366920a94463900e80630a070ba440aa78", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-structs_05-fa98307.stderr", - "stderr_hash": "9425960bac284eae21adb4274aa833960c505abd6bd546f896da0216", - "returncode": 2 + "stdout": "asr-structs_05-fa98307.stdout", + "stdout_hash": "64fd4586d72ce05affe152ae66a0b6ea6a9f9804d1b489381c46bcb7", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-structs_05-fa98307.stdout b/tests/reference/asr-structs_05-fa98307.stdout new file mode 100644 index 0000000000..a0960fd88a --- /dev/null +++ b/tests/reference/asr-structs_05-fa98307.stdout @@ -0,0 +1,1476 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + A: + (StructType + (SymbolTable + 203 + { + a: + (Variable + 203 + a + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 203 + b + [] + Local + () + () + Default + (Integer 2) + () + Source + Public + Required + .false. + ), + c: + (Variable + 203 + c + [] + Local + () + () + Default + (Integer 1) + () + Source + Public + Required + .false. + ), + d: + (Variable + 203 + d + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + x: + (Variable + 203 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 203 + y + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + z: + (Variable + 203 + z + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ) + }) + A + [] + [y + x + z + a + b + c + d] + Source + Public + .false. + .false. + [(()) + (()) + (()) + (()) + (()) + (()) + (())] + () + () + ), + __main__global_stmts: + (Function + (SymbolTable + 209 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [g] + [] + [(SubroutineCall + 2 g + () + [] + () + )] + () + Public + .false. + .false. + () + ), + g: + (Function + (SymbolTable + 207 + { + y: + (Variable + 207 + y + [] + Local + () + () + Default + (Array + (Struct + 2 A + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + g + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [verify + update_1 + update_2] + [] + [(= + (Var 207 y) + (ArrayConstant + [] + (Array + (Struct + 2 A + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 207 y) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + (StructTypeConstructor + 2 A + [((RealConstant + 1.100000 + (Real 8) + )) + ((IntegerConstant 1 (Integer 4))) + ((Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + )) + ((Cast + (RealConstant + 1.100000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.100000 + (Real 4) + ) + )) + ((Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + )) + ((Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 1 (Integer 1)) + )) + ((LogicalConstant + .true. + (Logical 4) + ))] + (Struct + 2 A + ) + () + ) + () + ) + (= + (ArrayItem + (Var 207 y) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + (StructTypeConstructor + 2 A + [((RealConstant + 2.200000 + (Real 8) + )) + ((IntegerConstant 2 (Integer 4))) + ((Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + )) + ((Cast + (RealConstant + 2.200000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 2.200000 + (Real 4) + ) + )) + ((Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + )) + ((Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 2 (Integer 1)) + )) + ((LogicalConstant + .true. + (Logical 4) + ))] + (Struct + 2 A + ) + () + ) + () + ) + (SubroutineCall + 2 verify + () + [((ArrayPhysicalCast + (Var 207 y) + FixedSizeArray + DescriptorArray + (Array + (Struct + 2 A + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 1 (Integer 4))) + ((RealConstant + 1.100000 + (Real 8) + )) + ((IntegerConstant 2 (Integer 4))) + ((RealConstant + 2.200000 + (Real 8) + ))] + () + ) + (SubroutineCall + 2 update_1 + () + [((ArrayItem + (Var 207 y) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ))] + () + ) + (SubroutineCall + 2 update_2 + () + [((ArrayPhysicalCast + (Var 207 y) + FixedSizeArray + DescriptorArray + (Array + (Struct + 2 A + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + DescriptorArray + ) + () + ))] + () + ) + (SubroutineCall + 2 verify + () + [((ArrayPhysicalCast + (Var 207 y) + FixedSizeArray + DescriptorArray + (Array + (Struct + 2 A + ) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + DescriptorArray + ) + () + )) + ((IntegerConstant 2 (Integer 4))) + ((RealConstant + 1.200000 + (Real 8) + )) + ((IntegerConstant 3 (Integer 4))) + ((RealConstant + 2.300000 + (Real 8) + ))] + () + )] + () + Public + .false. + .false. + () + ), + update_1: + (Function + (SymbolTable + 205 + { + s: + (Variable + 205 + s + [] + InOut + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ) + }) + update_1 + (FunctionType + [(Struct + 2 A + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 205 s)] + [(= + (StructInstanceMember + (Var 205 s) + 203 x + (Integer 4) + () + ) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (StructInstanceMember + (Var 205 s) + 203 y + (Real 8) + () + ) + (RealConstant + 1.200000 + (Real 8) + ) + () + ) + (= + (StructInstanceMember + (Var 205 s) + 203 z + (Integer 8) + () + ) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + () + ) + (= + (StructInstanceMember + (Var 205 s) + 203 a + (Real 4) + () + ) + (Cast + (RealConstant + 1.200000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 1.200000 + (Real 4) + ) + ) + () + ) + (= + (StructInstanceMember + (Var 205 s) + 203 b + (Integer 2) + () + ) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 2 (Integer 2)) + ) + () + ) + (= + (StructInstanceMember + (Var 205 s) + 203 c + (Integer 1) + () + ) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 2 (Integer 1)) + ) + () + )] + () + Public + .false. + .false. + () + ), + update_2: + (Function + (SymbolTable + 206 + { + s: + (Variable + 206 + s + [] + InOut + () + () + Default + (Array + (Struct + 2 A + ) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ) + }) + update_2 + (FunctionType + [(Array + (Struct + 2 A + ) + [(() + ())] + DescriptorArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 206 s)] + [(= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 x + (Integer 4) + () + ) + (IntegerConstant 3 (Integer 4)) + () + ) + (= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 y + (Real 8) + () + ) + (RealConstant + 2.300000 + (Real 8) + ) + () + ) + (= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 z + (Integer 8) + () + ) + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + () + ) + (= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 a + (Real 4) + () + ) + (Cast + (RealConstant + 2.300000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 2.300000 + (Real 4) + ) + ) + () + ) + (= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 b + (Integer 2) + () + ) + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 3 (Integer 2)) + ) + () + ) + (= + (StructInstanceMember + (ArrayItem + (Var 206 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + 203 c + (Integer 1) + () + ) + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 3 (Integer 1)) + ) + () + )] + () + Public + .false. + .false. + () + ), + verify: + (Function + (SymbolTable + 204 + { + eps: + (Variable + 204 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + s: + (Variable + 204 + s + [] + InOut + () + () + Default + (Array + (Struct + 2 A + ) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + s0: + (Variable + 204 + s0 + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + s1: + (Variable + 204 + s1 + [] + Local + () + () + Default + (Struct + 2 A + ) + () + Source + Public + Required + .false. + ), + x1: + (Variable + 204 + x1 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + x2: + (Variable + 204 + x2 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y1: + (Variable + 204 + y1 + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + y2: + (Variable + 204 + y2 + [] + In + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + verify + (FunctionType + [(Array + (Struct + 2 A + ) + [(() + ())] + DescriptorArray + ) + (Integer 4) + (Real 8) + (Integer 4) + (Real 8)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 s) + (Var 204 x1) + (Var 204 y1) + (Var 204 x2) + (Var 204 y2)] + [(= + (Var 204 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 204 s0) + (ArrayItem + (Var 204 s) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + () + ) + (Print + () + [(StructInstanceMember + (Var 204 s0) + 203 x + (Integer 4) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 y + (Real 8) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 z + (Integer 8) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 a + (Real 4) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 b + (Integer 2) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 c + (Integer 1) + () + ) + (StructInstanceMember + (Var 204 s0) + 203 d + (Logical 4) + () + )] + () + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s0) + 203 x + (Integer 4) + () + ) + Eq + (Var 204 x1) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (StructInstanceMember + (Var 204 s0) + 203 y + (Real 8) + () + ) + Sub + (Var 204 y1) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 204 eps) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s0) + 203 z + (Integer 8) + () + ) + Eq + (Cast + (Var 204 x1) + IntegerToInteger + (Integer 8) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (StructInstanceMember + (Var 204 s0) + 203 a + (Real 4) + () + ) + Sub + (Cast + (Var 204 y1) + RealToReal + (Real 4) + () + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + Lt + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s0) + 203 b + (Integer 2) + () + ) + Eq + (Cast + (Var 204 x1) + IntegerToInteger + (Integer 2) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s0) + 203 c + (Integer 1) + () + ) + Eq + (Cast + (Var 204 x1) + IntegerToInteger + (Integer 1) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (StructInstanceMember + (Var 204 s0) + 203 d + (Logical 4) + () + ) + () + ) + (= + (Var 204 s1) + (ArrayItem + (Var 204 s) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Struct + 2 A + ) + RowMajor + () + ) + () + ) + (Print + () + [(StructInstanceMember + (Var 204 s1) + 203 x + (Integer 4) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 y + (Real 8) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 z + (Integer 8) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 a + (Real 4) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 b + (Integer 2) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 c + (Integer 1) + () + ) + (StructInstanceMember + (Var 204 s1) + 203 d + (Logical 4) + () + )] + () + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s1) + 203 x + (Integer 4) + () + ) + Eq + (Var 204 x2) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (StructInstanceMember + (Var 204 s1) + 203 y + (Real 8) + () + ) + Sub + (Var 204 y2) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 204 eps) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s1) + 203 z + (Integer 8) + () + ) + Eq + (Cast + (Var 204 x2) + IntegerToInteger + (Integer 8) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (StructInstanceMember + (Var 204 s1) + 203 a + (Real 4) + () + ) + Sub + (Cast + (Var 204 y2) + RealToReal + (Real 4) + () + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + Lt + (Cast + (RealConstant + 0.000001 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000001 + (Real 4) + ) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s1) + 203 b + (Integer 2) + () + ) + Eq + (Cast + (Var 204 x2) + IntegerToInteger + (Integer 2) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (StructInstanceMember + (Var 204 s1) + 203 c + (Integer 1) + () + ) + Eq + (Cast + (Var 204 x2) + IntegerToInteger + (Integer 1) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (StructInstanceMember + (Var 204 s1) + 203 d + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 210 + { + __main__global_stmts: + (ExternalSymbol + 210 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 210 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-test_assign8-4b26e63.json b/tests/reference/asr-test_assign8-4b26e63.json index 3b0ecbbcd1..fb449632d9 100644 --- a/tests/reference/asr-test_assign8-4b26e63.json +++ b/tests/reference/asr-test_assign8-4b26e63.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_assign8-4b26e63.stderr", - "stderr_hash": "900fcd6359806b1e7ab41b6c5c4eb252bdbab6e96404912b710a8682", + "stderr_hash": "c8ad8a6c89a23c0e2bd0cbaf7c9568625f093e526ff8ff26ae300e07", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_assign8-4b26e63.stderr b/tests/reference/asr-test_assign8-4b26e63.stderr index e320bd3600..dcb47d9356 100644 --- a/tests/reference/asr-test_assign8-4b26e63.stderr +++ b/tests/reference/asr-test_assign8-4b26e63.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_assign8.py:5:13 +semantic error: readonly attribute + --> tests/errors/test_assign8.py:6:5 | -5 | c = c32(complex(3, 4)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +6 | c.real = 5.0 + | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_binop3-a67201d.json b/tests/reference/asr-test_binop3-a67201d.json index b93163a529..dc238a62cb 100644 --- a/tests/reference/asr-test_binop3-a67201d.json +++ b/tests/reference/asr-test_binop3-a67201d.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_binop3-a67201d.stderr", - "stderr_hash": "00ec81e32ad3b0d4145714c7224146e9af7fd913aa87aa633667f4f2", + "stderr_hash": "ff683b1bc0695903f2d2ea7bbd1963346fcb5f84bbfd10a4da0e27d7", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_binop3-a67201d.stderr b/tests/reference/asr-test_binop3-a67201d.stderr index ea6ee12b1c..84e374e2f5 100644 --- a/tests/reference/asr-test_binop3-a67201d.stderr +++ b/tests/reference/asr-test_binop3-a67201d.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +semantic error: Type mismatch in binary operator; the types must be compatible --> tests/errors/test_binop3.py:5:9 | 5 | y = complex(5)+100 - | ^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^^ ^^^ type mismatch (c32 and i32) diff --git a/tests/reference/asr-test_bool_binop-f856ef0.json b/tests/reference/asr-test_bool_binop-f856ef0.json index 358216f8de..b74825e8d7 100644 --- a/tests/reference/asr-test_bool_binop-f856ef0.json +++ b/tests/reference/asr-test_bool_binop-f856ef0.json @@ -5,9 +5,9 @@ "infile_hash": "7c44fe2915b3871b3b85edf3ab129d87a75fa4b9acbb597ae801daf9", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_bool_binop-f856ef0.stderr", - "stderr_hash": "7e1f44ed79212fae132aca28b495a511f27ee327b9bf88b797502eff", - "returncode": 2 + "stdout": "asr-test_bool_binop-f856ef0.stdout", + "stdout_hash": "b2d6b1205576cabc7c44ae611eec55ba5af026dbd918972e05e8f7da", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stdout b/tests/reference/asr-test_bool_binop-f856ef0.stdout new file mode 100644 index 0000000000..f93267c185 --- /dev/null +++ b/tests/reference/asr-test_bool_binop-f856ef0.stdout @@ -0,0 +1,442 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 4 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [f] + [] + [(SubroutineCall + 2 f + () + [] + () + )] + () + Public + .false. + .false. + () + ), + f: + (Function + (SymbolTable + 3 + { + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 3 + b2 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + f + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 i) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Add + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Sub + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerBinOp + (Cast + (LogicalConstant + .false. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Mul + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (Cast + (IntrinsicScalarFunction + FloorDiv + [(LogicalConstant + .true. + (Logical 4) + ) + (LogicalConstant + .true. + (Logical 4) + )] + 0 + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + LogicalToInteger + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (Cast + (IntrinsicScalarFunction + FloorDiv + [(LogicalConstant + .false. + (Logical 4) + ) + (LogicalConstant + .true. + (Logical 4) + )] + 0 + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + LogicalToInteger + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerBinOp + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + Pow + (Cast + (LogicalConstant + .true. + (Logical 4) + ) + LogicalToInteger + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Var 3 i) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b1) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (= + (Var 3 b2) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 f) + (RealBinOp + (Cast + (Var 3 b1) + LogicalToReal + (Real 8) + () + ) + Div + (Cast + (Var 3 b2) + LogicalToReal + (Real 8) + () + ) + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (Var 3 f) + Eq + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [] + .false. + .false. + ), + main_program: + (Program + (SymbolTable + 5 + { + __main__global_stmts: + (ExternalSymbol + 5 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 5 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.json b/tests/reference/asr-test_builtin_bin-52ba9fa.json index f617a29848..8df970ff34 100644 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.json +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.json @@ -5,9 +5,9 @@ "infile_hash": "09e09eacf697c95f358b75f6491b766781bae9a5f856c2ad5848e824", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_bin-52ba9fa.stderr", - "stderr_hash": "f96ee9f35d47046bca3a9f0e40b965bf1b0e6654a0a4da0eb7a85e30", - "returncode": 2 + "stdout": "asr-test_builtin_bin-52ba9fa.stdout", + "stdout_hash": "b24a5d440f16330d7a86bade0cac3c8ffc51adb5e0946a1b318a9b4b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stdout b/tests/reference/asr-test_builtin_bin-52ba9fa.stdout new file mode 100644 index 0000000000..fd4442df87 --- /dev/null +++ b/tests/reference/asr-test_builtin_bin-52ba9fa.stdout @@ -0,0 +1,271 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_bin] + [] + [(SubroutineCall + 2 test_bin + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_bin: + (Function + (SymbolTable + 3 + { + bin: + (ExternalSymbol + 3 + bin + 4 bin + lpython_builtin + [] + bin + Private + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_bin + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [bin] + [] + [(= + (Var 3 i) + (IntegerConstant 5 (Integer 4)) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 bin + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "0b101" + (Character 1 5 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerConstant 64 (Integer 4)) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 bin + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "0b1000000" + (Character 1 9 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 bin + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "-0b1000010110" + (Character 1 13 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 bin + () + [((IntegerConstant 64 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0b1000000" + (Character 1 9 ()) + ) + () + ) + Eq + (StringConstant + "0b1000000" + (Character 1 9 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 bin + () + [((IntegerUnaryMinus + (IntegerConstant 534 (Integer 4)) + (Integer 4) + (IntegerConstant -534 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0b1000010110" + (Character 1 13 ()) + ) + () + ) + Eq + (StringConstant + "-0b1000010110" + (Character 1 13 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_bool-330223a.json b/tests/reference/asr-test_builtin_bool-330223a.json index 91858355b1..87e15e8d5d 100644 --- a/tests/reference/asr-test_builtin_bool-330223a.json +++ b/tests/reference/asr-test_builtin_bool-330223a.json @@ -5,9 +5,9 @@ "infile_hash": "3a740faba0e36b55c179ab0fa08486dc3080332e79c8e38b8f25b4a4", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_bool-330223a.stderr", - "stderr_hash": "5cf42029c7abd7dc2dedc535fff29c622c3871ec342b595c426b27f3", - "returncode": 2 + "stdout": "asr-test_builtin_bool-330223a.stdout", + "stdout_hash": "b560f8abd927c203883fd0bb66594c4847447dd235e26527b17afe44", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_bool-330223a.stdout b/tests/reference/asr-test_builtin_bool-330223a.stdout new file mode 100644 index 0000000000..9af36dd1ef --- /dev/null +++ b/tests/reference/asr-test_builtin_bool-330223a.stdout @@ -0,0 +1,896 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_bool] + [] + [(SubroutineCall + 2 test_bool + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_bool: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 3 + a2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + a3: + (Variable + 3 + a3 + [] + Local + () + () + Default + (Integer 1) + () + Source + Public + Required + .false. + ), + a4: + (Variable + 3 + a4 + [] + Local + () + () + Default + (Integer 2) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c1: + (Variable + 3 + c1 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 3 + complex + 4 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_13__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_13__complex + 4 __lpython_overloaded_13__complex + lpython_builtin + [] + __lpython_overloaded_13__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 4 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ), + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 3 + f2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + s: + (Variable + 3 + s + [] + Local + () + () + Default + (Character 1 -2 ()) + () + Source + Public + Required + .false. + ) + }) + test_bool + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_9__complex + complex@__lpython_overloaded_13__complex] + [] + [(= + (Var 3 a) + (IntegerConstant 34 (Integer 4)) + () + ) + (Assert + (Cast + (Var 3 a) + IntegerToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 0 (Integer 4)) + () + ) + (Assert + (LogicalNot + (Cast + (Var 3 a) + IntegerToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (Cast + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + IntegerToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (LogicalNot + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 a2) + (Cast + (IntegerConstant 34 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 34 (Integer 8)) + ) + () + ) + (Assert + (Cast + (Var 3 a2) + IntegerToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 a3) + (Cast + (IntegerConstant 34 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 34 (Integer 1)) + ) + () + ) + (Assert + (Cast + (Var 3 a3) + IntegerToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 a4) + (IntegerUnaryMinus + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 2) + (IntegerConstant 1 (Integer 2)) + ) + (Integer 2) + (IntegerConstant -1 (Integer 2)) + ) + () + ) + (Assert + (Cast + (Var 3 a4) + IntegerToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (LogicalNot + (Cast + (Var 3 f) + RealToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealConstant + 1.000000 + (Real 8) + ) + () + ) + (Assert + (Cast + (Var 3 f) + RealToLogical + (Logical 4) + () + ) + () + ) + (Assert + (Cast + (RealConstant + 56.786866 + (Real 8) + ) + RealToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (LogicalNot + (Cast + (RealConstant + 0.000000 + (Real 8) + ) + RealToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 f2) + (RealUnaryMinus + (Cast + (RealConstant + 235.600000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 235.600000 + (Real 4) + ) + ) + (Real 4) + (RealConstant + -235.600000 + (Real 4) + ) + ) + () + ) + (Assert + (Cast + (Var 3 f2) + RealToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 f2) + (Cast + (RealConstant + 0.000053 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 0.000053 + (Real 4) + ) + ) + () + ) + (Assert + (Cast + (Var 3 f2) + RealToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "" + (Character 1 0 ()) + ) + () + ) + (Assert + (LogicalNot + (Cast + (Var 3 s) + CharacterToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 s) + (StringConstant + "str" + (Character 1 3 ()) + ) + () + ) + (Assert + (Cast + (Var 3 s) + CharacterToLogical + (Logical 4) + () + ) + () + ) + (Assert + (LogicalNot + (Cast + (StringConstant + "" + (Character 1 0 ()) + ) + CharacterToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (Cast + (StringConstant + "str" + (Character 1 3 ()) + ) + CharacterToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (Var 3 b) + () + ) + (= + (Var 3 b) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (LogicalNot + (Var 3 b) + (Logical 4) + () + ) + () + ) + (Assert + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (LogicalNot + (LogicalConstant + .false. + (Logical 4) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 c) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 2 (Integer 4))) + ((IntegerConstant 3 (Integer 4)))] + (Complex 8) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 4) + ) + ) + () + ) + (Assert + (Cast + (Var 3 c) + ComplexToLogical + (Logical 4) + () + ) + () + ) + (= + (Var 3 c) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 0 (Integer 4))) + ((IntegerConstant 0 (Integer 4)))] + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 4) + ) + ) + () + ) + (Assert + (LogicalNot + (Cast + (Var 3 c) + ComplexToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (LogicalNot + (Cast + (ComplexBinOp + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + ) + ComplexToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 c1) + (FunctionCall + 3 complex@__lpython_overloaded_13__complex + 3 complex + [((IntegerConstant 0 (Integer 4))) + ((RealConstant + 0.100202 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 0.000000 + 0.100202 + (Complex 8) + ) + () + ) + () + ) + (Assert + (Cast + (Var 3 c1) + ComplexToLogical + (Logical 4) + () + ) + () + ) + (Assert + (LogicalNot + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 0 (Integer 4))) + ((IntegerConstant 0 (Integer 4)))] + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + () + ) + ComplexToLogical + (Logical 4) + (LogicalConstant + .false. + (Logical 4) + ) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (Cast + (ComplexBinOp + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 3.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 5.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 3.000000 + 5.000000 + (Complex 8) + ) + ) + ComplexToLogical + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_hex-64bd268.json b/tests/reference/asr-test_builtin_hex-64bd268.json index 2779c11099..15fc72c3c7 100644 --- a/tests/reference/asr-test_builtin_hex-64bd268.json +++ b/tests/reference/asr-test_builtin_hex-64bd268.json @@ -5,9 +5,9 @@ "infile_hash": "e639f0251477f50376536d317630e3c026354859576a5f1b7b10bd7d", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_hex-64bd268.stderr", - "stderr_hash": "22b2ae7d0d34d2406125547149511ab5990a5f2163c186c48c5c4f05", - "returncode": 2 + "stdout": "asr-test_builtin_hex-64bd268.stdout", + "stdout_hash": "8551293f8c6b8fef1b16f1f47520b59f3c7cc3bec46cdfb0170deaab", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stdout b/tests/reference/asr-test_builtin_hex-64bd268.stdout new file mode 100644 index 0000000000..f9baf4f8cd --- /dev/null +++ b/tests/reference/asr-test_builtin_hex-64bd268.stdout @@ -0,0 +1,246 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_hex] + [] + [(SubroutineCall + 2 test_hex + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_hex: + (Function + (SymbolTable + 3 + { + hex: + (ExternalSymbol + 3 + hex + 4 hex + lpython_builtin + [] + hex + Private + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_hex + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [hex] + [] + [(= + (Var 3 i) + (IntegerConstant 34 (Integer 4)) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 hex + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "0x22" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 hex + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "-0x108b" + (Character 1 7 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 hex + () + [((IntegerConstant 34 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0x22" + (Character 1 4 ()) + ) + () + ) + Eq + (StringConstant + "0x22" + (Character 1 4 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 hex + () + [((IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0x108b" + (Character 1 7 ()) + ) + () + ) + Eq + (StringConstant + "-0x108b" + (Character 1 7 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_oct-20b9066.json b/tests/reference/asr-test_builtin_oct-20b9066.json index bb705fd111..cc40417da8 100644 --- a/tests/reference/asr-test_builtin_oct-20b9066.json +++ b/tests/reference/asr-test_builtin_oct-20b9066.json @@ -5,9 +5,9 @@ "infile_hash": "c20249affa4787edf4ef56c881ebbcabdced311b5b908d9da6aceaeb", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_oct-20b9066.stderr", - "stderr_hash": "986b90db11399243e0e1a9788da3876cbd8d7eecd273e46bc9437243", - "returncode": 2 + "stdout": "asr-test_builtin_oct-20b9066.stdout", + "stdout_hash": "06bfb11b70b05ca96b4c53dc59a1f55b20c6065b885706668e68c828", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stdout b/tests/reference/asr-test_builtin_oct-20b9066.stdout new file mode 100644 index 0000000000..ee0c1d8cb2 --- /dev/null +++ b/tests/reference/asr-test_builtin_oct-20b9066.stdout @@ -0,0 +1,246 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_oct] + [] + [(SubroutineCall + 2 test_oct + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_oct: + (Function + (SymbolTable + 3 + { + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + oct: + (ExternalSymbol + 3 + oct + 4 oct + lpython_builtin + [] + oct + Private + ) + }) + test_oct + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [oct] + [] + [(= + (Var 3 i) + (IntegerConstant 34 (Integer 4)) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 oct + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "0o42" + (Character 1 4 ()) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 oct + () + [((Var 3 i))] + (Character 1 -2 ()) + () + () + ) + Eq + (StringConstant + "-0o10213" + (Character 1 8 ()) + ) + (Logical 4) + () + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 oct + () + [((IntegerConstant 34 (Integer 4)))] + (Character 1 -2 ()) + (StringConstant + "0o42" + (Character 1 4 ()) + ) + () + ) + Eq + (StringConstant + "0o42" + (Character 1 4 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (StringCompare + (FunctionCall + 3 oct + () + [((IntegerUnaryMinus + (IntegerConstant 4235 (Integer 4)) + (Integer 4) + (IntegerConstant -4235 (Integer 4)) + ))] + (Character 1 -2 ()) + (StringConstant + "-0o10213" + (Character 1 8 ()) + ) + () + ) + Eq + (StringConstant + "-0o10213" + (Character 1 8 ()) + ) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.json b/tests/reference/asr-test_builtin_pow-f02fcda.json index 5bb87ef22b..558e906c74 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.json +++ b/tests/reference/asr-test_builtin_pow-f02fcda.json @@ -5,9 +5,9 @@ "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "asr-test_builtin_pow-f02fcda.stdout", + "stdout_hash": "07bfe877de2079b68a743854a66f138c21da29943575c0d18c220255", "stderr": "asr-test_builtin_pow-f02fcda.stderr", - "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", - "returncode": 2 + "stderr_hash": "859ce76c74748f2d32c7eab92cfbba789a78d4cbf5818646b99806ea", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stderr b/tests/reference/asr-test_builtin_pow-f02fcda.stderr index e2d434b6f1..5dbb75ad24 100644 --- a/tests/reference/asr-test_builtin_pow-f02fcda.stderr +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/../integration_tests/test_builtin_pow.py:11:16 | 11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/asr-test_builtin_pow-f02fcda.stdout b/tests/reference/asr-test_builtin_pow-f02fcda.stdout new file mode 100644 index 0000000000..aabef8b6f5 --- /dev/null +++ b/tests/reference/asr-test_builtin_pow-f02fcda.stdout @@ -0,0 +1,1919 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_pow] + [] + [(SubroutineCall + 2 test_pow + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_pow: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + a1: + (Variable + 3 + a1 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 3 + a2 + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b1: + (Variable + 3 + b1 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + b2: + (Variable + 3 + b2 + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + c1: + (Variable + 3 + c1 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 3 + complex + 4 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 4 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ), + eps: + (Variable + 3 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + f1: + (Variable + 3 + f1 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 3 + f2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + i1: + (Variable + 3 + i1 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 3 + i2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + j: + (Variable + 3 + j + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + k: + (Variable + 3 + k + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + p: + (Variable + 3 + p + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + pow: + (ExternalSymbol + 3 + pow + 4 pow + lpython_builtin + [] + pow + Private + ), + pow@__lpython_overloaded_0__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_0__pow + 4 __lpython_overloaded_0__pow + lpython_builtin + [] + __lpython_overloaded_0__pow + Public + ), + pow@__lpython_overloaded_10__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_10__pow + 4 __lpython_overloaded_10__pow + lpython_builtin + [] + __lpython_overloaded_10__pow + Public + ), + pow@__lpython_overloaded_11__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_11__pow + 4 __lpython_overloaded_11__pow + lpython_builtin + [] + __lpython_overloaded_11__pow + Public + ), + pow@__lpython_overloaded_1__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_1__pow + 4 __lpython_overloaded_1__pow + lpython_builtin + [] + __lpython_overloaded_1__pow + Public + ), + pow@__lpython_overloaded_2__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_2__pow + 4 __lpython_overloaded_2__pow + lpython_builtin + [] + __lpython_overloaded_2__pow + Public + ), + pow@__lpython_overloaded_3__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_3__pow + 4 __lpython_overloaded_3__pow + lpython_builtin + [] + __lpython_overloaded_3__pow + Public + ), + pow@__lpython_overloaded_4__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_4__pow + 4 __lpython_overloaded_4__pow + lpython_builtin + [] + __lpython_overloaded_4__pow + Public + ), + pow@__lpython_overloaded_5__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_5__pow + 4 __lpython_overloaded_5__pow + lpython_builtin + [] + __lpython_overloaded_5__pow + Public + ), + pow@__lpython_overloaded_6__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_6__pow + 4 __lpython_overloaded_6__pow + lpython_builtin + [] + __lpython_overloaded_6__pow + Public + ), + pow@__lpython_overloaded_7__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_7__pow + 4 __lpython_overloaded_7__pow + lpython_builtin + [] + __lpython_overloaded_7__pow + Public + ), + pow@__lpython_overloaded_8__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_8__pow + 4 __lpython_overloaded_8__pow + lpython_builtin + [] + __lpython_overloaded_8__pow + Public + ), + pow@__lpython_overloaded_9__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_9__pow + 4 __lpython_overloaded_9__pow + lpython_builtin + [] + __lpython_overloaded_9__pow + Public + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + test_pow + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [pow@__lpython_overloaded_0__pow + pow@__lpython_overloaded_1__pow + pow@__lpython_overloaded_2__pow + pow@__lpython_overloaded_4__pow + pow@__lpython_overloaded_5__pow + pow@__lpython_overloaded_8__pow + pow@__lpython_overloaded_3__pow + pow@__lpython_overloaded_6__pow + pow@__lpython_overloaded_7__pow + pow@__lpython_overloaded_11__pow + pow@__lpython_overloaded_10__pow + complex@__lpython_overloaded_9__complex + pow@__lpython_overloaded_9__pow] + [] + [(= + (Var 3 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerConstant 5 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((Var 3 a)) + ((Var 3 b))] + (Real 8) + () + () + ) + RealToInteger + (Integer 4) + () + ) + Eq + (IntegerConstant 32 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 6 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerConstant 3 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((Var 3 a)) + ((Var 3 b))] + (Real 8) + () + () + ) + RealToInteger + (Integer 4) + () + ) + Eq + (IntegerConstant 216 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerConstant 0 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((Var 3 a)) + ((Var 3 b))] + (Real 8) + () + () + ) + RealToInteger + (Integer 4) + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerUnaryMinus + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant -1 (Integer 4)) + ) + () + ) + (= + (Var 3 a) + (IntegerConstant 6 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerUnaryMinus + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant -4 (Integer 4)) + ) + () + ) + (= + (Var 3 i1) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + () + ) + (= + (Var 3 i2) + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + () + ) + (Assert + (IntegerCompare + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_1__pow + 3 pow + [((Var 3 i1)) + ((Var 3 i2))] + (Real 8) + () + () + ) + RealToInteger + (Integer 8) + () + ) + Eq + (Cast + (IntegerConstant 32 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 32 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i1) + (Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + ) + () + ) + (= + (Var 3 i2) + (IntegerUnaryMinus + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -3 (Integer 8)) + ) + () + ) + (= + (Var 3 f1) + (Cast + (RealBinOp + (Cast + (IntegerConstant 525346 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 525346.000000 + (Real 8) + ) + ) + Div + (Cast + (IntegerConstant 66456 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 66456.000000 + (Real 8) + ) + ) + (Real 8) + (RealConstant + 7.905170 + (Real 8) + ) + ) + RealToReal + (Real 4) + (RealConstant + 7.905170 + (Real 4) + ) + ) + () + ) + (= + (Var 3 f2) + (Cast + (RealConstant + 3.000000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 3.000000 + (Real 4) + ) + ) + () + ) + (= + (Var 3 p) + (FunctionCall + 3 pow@__lpython_overloaded_2__pow + 3 pow + [((Var 3 f1)) + ((Var 3 f2))] + (Real 4) + () + () + ) + () + ) + (= + (Var 3 f1) + (FunctionCall + 3 pow@__lpython_overloaded_4__pow + 3 pow + [((Var 3 a)) + ((Var 3 f2))] + (Real 4) + () + () + ) + () + ) + (= + (Var 3 f1) + (FunctionCall + 3 pow@__lpython_overloaded_5__pow + 3 pow + [((Var 3 f2)) + ((Var 3 a))] + (Real 4) + () + () + ) + () + ) + (= + (Var 3 b1) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (= + (Var 3 b2) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_8__pow + 3 pow + [((Var 3 b1)) + ((Var 3 b2))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_8__pow + 3 pow + [((Var 3 b2)) + ((Var 3 b1))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_8__pow + 3 pow + [((Var 3 b1)) + ((Var 3 b2))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_8__pow + 3 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) + ) + ) + () + ) + (= + (Var 3 a1) + (RealConstant + 4.500000 + (Real 8) + ) + () + ) + (= + (Var 3 a2) + (RealConstant + 2.300000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_3__pow + 3 pow + [((Var 3 a1)) + ((Var 3 a2))] + (Real 8) + () + () + ) + Sub + (RealConstant + 31.797193 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_3__pow + 3 pow + [((Var 3 a2)) + ((Var 3 a1))] + (Real 8) + () + () + ) + Sub + (RealConstant + 42.439989 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 3 x) + (IntegerConstant 3 (Integer 4)) + () + ) + (= + (Var 3 y) + (RealConstant + 2.300000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_6__pow + 3 pow + [((Var 3 x)) + ((Var 3 y))] + (Real 8) + () + () + ) + Sub + (RealConstant + 12.513503 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_7__pow + 3 pow + [((Var 3 y)) + ((Var 3 x))] + (Real 8) + () + () + ) + Sub + (RealConstant + 12.167000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_6__pow + 3 pow + [((Var 3 x)) + ((RealConstant + 5.500000 + (Real 8) + ))] + (Real 8) + () + () + ) + Sub + (RealConstant + 420.888346 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_1__pow + 3 pow + [((Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + )) + ((IntegerUnaryMinus + (Cast + (IntegerConstant 1 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 1 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -1 (Integer 8)) + ))] + (Real 8) + (RealConstant + 0.500000 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_1__pow + 3 pow + [((Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + )) + ((IntegerUnaryMinus + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -4 (Integer 8)) + ))] + (Real 8) + (RealConstant + 0.000772 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.000772 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_1__pow + 3 pow + [((IntegerUnaryMinus + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 3 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -3 (Integer 8)) + )) + ((IntegerUnaryMinus + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -5 (Integer 8)) + ))] + (Real 8) + (RealConstant + -0.004115 + (Real 8) + ) + () + ) + Add + (RealConstant + 0.004115 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_1__pow + 3 pow + [((Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + )) + ((IntegerUnaryMinus + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -4 (Integer 8)) + ))] + (Real 8) + (RealConstant + 0.000772 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.000772 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_3__pow + 3 pow + [((RealConstant + 4.500000 + (Real 8) + )) + ((RealConstant + 2.300000 + (Real 8) + ))] + (Real 8) + (RealConstant + 31.797193 + (Real 8) + ) + () + ) + Sub + (RealConstant + 31.797193 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_3__pow + 3 pow + [((RealConstant + 2.300000 + (Real 8) + )) + ((RealConstant + 0.000000 + (Real 8) + ))] + (Real 8) + (RealConstant + 1.000000 + (Real 8) + ) + () + ) + Sub + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_3__pow + 3 pow + [((RealConstant + 2.300000 + (Real 8) + )) + ((RealUnaryMinus + (RealConstant + 1.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -1.500000 + (Real 8) + ) + ))] + (Real 8) + (RealConstant + 0.286687 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.286687 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_6__pow + 3 pow + [((IntegerConstant 2 (Integer 4))) + ((RealConstant + 3.400000 + (Real 8) + ))] + (Real 8) + (RealConstant + 10.556063 + (Real 8) + ) + () + ) + Sub + (RealConstant + 10.556063 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_6__pow + 3 pow + [((IntegerConstant 2 (Integer 4))) + ((RealUnaryMinus + (RealConstant + 3.400000 + (Real 8) + ) + (Real 8) + (RealConstant + -3.400000 + (Real 8) + ) + ))] + (Real 8) + (RealConstant + 0.094732 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.094732 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_7__pow + 3 pow + [((RealConstant + 3.400000 + (Real 8) + )) + ((IntegerConstant 9 (Integer 4)))] + (Real 8) + (RealConstant + 60716.992766 + (Real 8) + ) + () + ) + Sub + (RealConstant + 60716.992766 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_7__pow + 3 pow + [((RealConstant + 0.000000 + (Real 8) + )) + ((IntegerConstant 53 (Integer 4)))] + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + Sub + (RealConstant + 0.000000 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (Cast + (FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((IntegerConstant 4 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Real 8) + (RealConstant + 16.000000 + (Real 8) + ) + () + ) + RealToInteger + (Integer 4) + (IntegerConstant 16 (Integer 4)) + ) + Eq + (IntegerConstant 16 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (FunctionCall + 3 pow@__lpython_overloaded_7__pow + 3 pow + [((RealUnaryMinus + (RealConstant + 4235.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4235.000000 + (Real 8) + ) + )) + ((IntegerConstant 52 (Integer 4)))] + (Real 8) + (RealConstant + 394800380598526378720936476336799774273305305904443955996320177992404102454228192853661558132283280490733920647962082901303487965679010854404517306573035287122910924343151116372519789002752.000000 + (Real 8) + ) + () + ) + Sub + (RealConstant + 394800380598526378720936476336799774273305305904443955996320177992404102454228192853661558132283280490733920647962082901303487965679010854404517306573035287122910924343151116372519789002752.000000 + (Real 8) + ) + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + )] + 0 + (Real 8) + (RealConstant + 0.000000 + (Real 8) + ) + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 7 (Integer 8)) + ) + () + ) + (= + (Var 3 j) + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 2 (Integer 8)) + ) + () + ) + (= + (Var 3 k) + (Cast + (IntegerConstant 5 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 5 (Integer 8)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_11__pow + 3 pow + [((Var 3 i)) + ((Var 3 j)) + ((Var 3 k))] + (Integer 8) + () + () + ) + Eq + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 4 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 pow@__lpython_overloaded_10__pow + 3 pow + [((IntegerConstant 102 (Integer 4))) + ((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 121 (Integer 4)))] + (Integer 4) + (RealConstant + 38.000000 + (Real 8) + ) + () + ) + Eq + (IntegerConstant 38 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 c1) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 4 (Integer 4))) + ((IntegerConstant 5 (Integer 4)))] + (Complex 8) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 c1) + (FunctionCall + 3 pow@__lpython_overloaded_9__pow + 3 pow + [((Var 3 c1)) + ((IntegerConstant 4 (Integer 4)))] + (Complex 4) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_builtin_round-7417a21.json b/tests/reference/asr-test_builtin_round-7417a21.json index efcd6cc31e..debc729721 100644 --- a/tests/reference/asr-test_builtin_round-7417a21.json +++ b/tests/reference/asr-test_builtin_round-7417a21.json @@ -5,9 +5,9 @@ "infile_hash": "a4ff4032a45ce084eb524069046afb6ec44f1b24a667c84c7605f2c7", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_builtin_round-7417a21.stderr", - "stderr_hash": "a58af3b9f4312b1036b728dc70928fe9c05f87d1b96d92b5c3da881f", - "returncode": 2 + "stdout": "asr-test_builtin_round-7417a21.stdout", + "stdout_hash": "8ec417ebc27049f4972e2c81e79c94f0983df641747977d0cfd8e5ff", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_builtin_round-7417a21.stdout b/tests/reference/asr-test_builtin_round-7417a21.stdout new file mode 100644 index 0000000000..093b8fb207 --- /dev/null +++ b/tests/reference/asr-test_builtin_round-7417a21.stdout @@ -0,0 +1,919 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_round] + [] + [(SubroutineCall + 2 test_round + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_round: + (Function + (SymbolTable + 3 + { + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + f: + (Variable + 3 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + f2: + (Variable + 3 + f2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + i: + (Variable + 3 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 3 + i2 + [] + Local + () + () + Default + (Integer 1) + () + Source + Public + Required + .false. + ), + i3: + (Variable + 3 + i3 + [] + Local + () + () + Default + (Integer 2) + () + Source + Public + Required + .false. + ), + i4: + (Variable + 3 + i4 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + round: + (ExternalSymbol + 3 + round + 4 round + lpython_builtin + [] + round + Private + ), + round@__lpython_overloaded_0__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_0__round + 4 __lpython_overloaded_0__round + lpython_builtin + [] + __lpython_overloaded_0__round + Public + ), + round@__lpython_overloaded_1__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_1__round + 4 __lpython_overloaded_1__round + lpython_builtin + [] + __lpython_overloaded_1__round + Public + ), + round@__lpython_overloaded_2__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_2__round + 4 __lpython_overloaded_2__round + lpython_builtin + [] + __lpython_overloaded_2__round + Public + ), + round@__lpython_overloaded_3__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_3__round + 4 __lpython_overloaded_3__round + lpython_builtin + [] + __lpython_overloaded_3__round + Public + ), + round@__lpython_overloaded_4__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_4__round + 4 __lpython_overloaded_4__round + lpython_builtin + [] + __lpython_overloaded_4__round + Public + ), + round@__lpython_overloaded_5__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_5__round + 4 __lpython_overloaded_5__round + lpython_builtin + [] + __lpython_overloaded_5__round + Public + ), + round@__lpython_overloaded_6__round: + (ExternalSymbol + 3 + round@__lpython_overloaded_6__round + 4 __lpython_overloaded_6__round + lpython_builtin + [] + __lpython_overloaded_6__round + Public + ) + }) + test_round + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [round@__lpython_overloaded_0__round + round@__lpython_overloaded_1__round + round@__lpython_overloaded_2__round + round@__lpython_overloaded_4__round + round@__lpython_overloaded_5__round + round@__lpython_overloaded_3__round + round@__lpython_overloaded_6__round] + [] + [(= + (Var 3 f) + (RealConstant + 5.678000 + (Real 8) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 6 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealUnaryMinus + (RealConstant + 183745.230000 + (Real 8) + ) + (Real 8) + (RealConstant + -183745.230000 + (Real 8) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 183745 (Integer 4)) + (Integer 4) + (IntegerConstant -183745 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealConstant + 44.340000 + (Real 8) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 44 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealConstant + 0.500000 + (Real 8) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealUnaryMinus + (RealConstant + 50.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -50.500000 + (Real 8) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 50 (Integer 4)) + (Integer 4) + (IntegerConstant -50 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 f) + (RealConstant + 1.500000 + (Real 8) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((Var 3 f))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealConstant + 13.001000 + (Real 8) + ))] + (Integer 4) + (IntegerConstant 13 (Integer 4)) + () + ) + Eq + (IntegerConstant 13 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealUnaryMinus + (RealConstant + 40.499990 + (Real 8) + ) + (Real 8) + (RealConstant + -40.499990 + (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 + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealConstant + 0.500000 + (Real 8) + ))] + (Integer 4) + (IntegerConstant 0 (Integer 4)) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealUnaryMinus + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -0.500000 + (Real 8) + ) + ))] + (Integer 4) + (IntegerConstant 0 (Integer 4)) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealConstant + 1.500000 + (Real 8) + ))] + (Integer 4) + (IntegerConstant 2 (Integer 4)) + () + ) + Eq + (IntegerConstant 2 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealConstant + 50.500000 + (Real 8) + ))] + (Integer 4) + (IntegerConstant 50 (Integer 4)) + () + ) + Eq + (IntegerConstant 50 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_0__round + 3 round + [((RealConstant + 56.780000 + (Real 8) + ))] + (Integer 4) + (IntegerConstant 57 (Integer 4)) + () + ) + Eq + (IntegerConstant 57 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 f2) + (Cast + (RealConstant + 5.678000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 5.678000 + (Real 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_1__round + 3 round + [((Var 3 f2))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 6 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_2__round + 3 round + [((Var 3 i))] + (Integer 4) + () + () + ) + Eq + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_2__round + 3 round + [((IntegerConstant 4 (Integer 4)))] + (Integer 4) + (IntegerConstant 4 (Integer 4)) + () + ) + Eq + (IntegerConstant 4 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (= + (Var 3 i2) + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 7 (Integer 1)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_4__round + 3 round + [((Var 3 i2))] + (Integer 1) + () + () + ) + Eq + (Cast + (IntegerConstant 7 (Integer 4)) + IntegerToInteger + (Integer 1) + (IntegerConstant 7 (Integer 1)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i3) + (Cast + (IntegerUnaryMinus + (IntegerConstant 8 (Integer 4)) + (Integer 4) + (IntegerConstant -8 (Integer 4)) + ) + IntegerToInteger + (Integer 2) + (IntegerConstant -8 (Integer 2)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_5__round + 3 round + [((Var 3 i3))] + (Integer 2) + () + () + ) + Eq + (Cast + (IntegerUnaryMinus + (IntegerConstant 8 (Integer 4)) + (Integer 4) + (IntegerConstant -8 (Integer 4)) + ) + IntegerToInteger + (Integer 2) + (IntegerConstant -8 (Integer 2)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 i4) + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_3__round + 3 round + [((Var 3 i4))] + (Integer 8) + () + () + ) + Eq + (Cast + (IntegerConstant 0 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 0 (Integer 8)) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .true. + (Logical 4) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_6__round + 3 round + [((Var 3 b))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + () + ) + () + ) + (= + (Var 3 b) + (LogicalConstant + .false. + (Logical 4) + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_6__round + 3 round + [((Var 3 b))] + (Integer 4) + () + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 round@__lpython_overloaded_6__round + 3 round + [((LogicalConstant + .false. + (Logical 4) + ))] + (Integer 4) + (IntegerConstant 0 (Integer 4)) + () + ) + Eq + (IntegerConstant 0 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_complex_01-a6def58.json b/tests/reference/asr-test_complex_01-a6def58.json index 2a3e22a7fa..ab4945b830 100644 --- a/tests/reference/asr-test_complex_01-a6def58.json +++ b/tests/reference/asr-test_complex_01-a6def58.json @@ -5,9 +5,9 @@ "infile_hash": "e580480b37e5bbfcd01d5eb412375a8a3c1ef374b5fedfb661485763", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_complex_01-a6def58.stderr", - "stderr_hash": "5e372192068e09afc8e388039c24decbd5a11c27b4143b5643bebd10", - "returncode": 2 + "stdout": "asr-test_complex_01-a6def58.stdout", + "stdout_hash": "4ab2fa7e918c8c1e522ff135ff52547786b5dba9449e7eba6bb07c3c", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_complex_01-a6def58.stdout b/tests/reference/asr-test_complex_01-a6def58.stdout new file mode 100644 index 0000000000..97c1c2f37c --- /dev/null +++ b/tests/reference/asr-test_complex_01-a6def58.stdout @@ -0,0 +1,2013 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 125 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 7 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_real_imag + test_complex + test_complex_unary_minus + test_complex_not] + [] + [(SubroutineCall + 2 test_real_imag + () + [] + () + ) + (SubroutineCall + 2 test_complex + () + [] + () + ) + (SubroutineCall + 2 test_complex_unary_minus + () + [] + () + ) + (SubroutineCall + 2 test_complex_not + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_complex: + (Function + (SymbolTable + 4 + { + a: + (Variable + 4 + a + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + a2: + (Variable + 4 + a2 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + a3: + (Variable + 4 + a3 + [] + Local + () + () + Default + (Real 4) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 4 + complex + 8 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_10__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_10__complex + 8 __lpython_overloaded_10__complex + lpython_builtin + [] + __lpython_overloaded_10__complex + Public + ), + complex@__lpython_overloaded_11__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_11__complex + 8 __lpython_overloaded_11__complex + lpython_builtin + [] + __lpython_overloaded_11__complex + Public + ), + complex@__lpython_overloaded_12__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_12__complex + 8 __lpython_overloaded_12__complex + lpython_builtin + [] + __lpython_overloaded_12__complex + Public + ), + complex@__lpython_overloaded_13__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_13__complex + 8 __lpython_overloaded_13__complex + lpython_builtin + [] + __lpython_overloaded_13__complex + Public + ), + complex@__lpython_overloaded_14__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_14__complex + 8 __lpython_overloaded_14__complex + lpython_builtin + [] + __lpython_overloaded_14__complex + Public + ), + complex@__lpython_overloaded_5__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_5__complex + 8 __lpython_overloaded_5__complex + lpython_builtin + [] + __lpython_overloaded_5__complex + Public + ), + complex@__lpython_overloaded_6__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_6__complex + 8 __lpython_overloaded_6__complex + lpython_builtin + [] + __lpython_overloaded_6__complex + Public + ), + complex@__lpython_overloaded_7__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_7__complex + 8 __lpython_overloaded_7__complex + lpython_builtin + [] + __lpython_overloaded_7__complex + Public + ), + complex@__lpython_overloaded_8__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_8__complex + 8 __lpython_overloaded_8__complex + lpython_builtin + [] + __lpython_overloaded_8__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 4 + complex@__lpython_overloaded_9__complex + 8 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ), + eps: + (Variable + 4 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i1: + (Variable + 4 + i1 + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + i2: + (Variable + 4 + i2 + [] + Local + () + () + Default + (Integer 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + x2: + (Variable + 4 + x2 + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ) + }) + test_complex + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_5__complex + complex@__lpython_overloaded_9__complex + complex@__lpython_overloaded_13__complex + complex@__lpython_overloaded_14__complex + complex@__lpython_overloaded_6__complex + complex@__lpython_overloaded_7__complex + complex@__lpython_overloaded_8__complex + complex@__lpython_overloaded_11__complex + complex@__lpython_overloaded_10__complex + complex@__lpython_overloaded_12__complex] + [] + [(= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_5__complex + 4 complex + [((RealConstant + 4.500000 + (Real 8) + )) + ((RealConstant + 6.700000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 4.500000 + 6.700000 + (Complex 8) + ) + () + ) + () + ) + (= + (Var 4 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 4.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 6.700000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_9__complex + 4 complex + [((IntegerUnaryMinus + (IntegerConstant 4 (Integer 4)) + (Integer 4) + (IntegerConstant -4 (Integer 4)) + )) + ((IntegerConstant 2 (Integer 4)))] + (Complex 8) + (ComplexConstant + -4.000000 + 2.000000 + (Complex 8) + ) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 4 x) + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 4.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4.000000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_13__complex + 4 complex + [((IntegerConstant 4 (Integer 4))) + ((RealConstant + 7.890000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 4.000000 + 7.890000 + (Complex 8) + ) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 4.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 7.890000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_14__complex + 4 complex + [((RealConstant + 5.600000 + (Real 8) + )) + ((IntegerConstant 0 (Integer 4)))] + (Complex 8) + (ComplexConstant + 5.600000 + 0.000000 + (Complex 8) + ) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 5.600000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 0.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 a) + (RealConstant + 534.600000 + (Real 8) + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_5__complex + 4 complex + [((Var 4 a)) + ((RealUnaryMinus + (Var 4 a) + (Real 8) + () + ))] + (Complex 8) + () + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 4 x) + (Real 8) + () + ) + Sub + (RealConstant + 534.600000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x) + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 534.600000 + (Real 8) + ) + (Real 8) + (RealConstant + -534.600000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 a2) + (RealUnaryMinus + (Cast + (RealConstant + 423.543081 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 423.543081 + (Real 4) + ) + ) + (Real 4) + (RealConstant + -423.543081 + (Real 4) + ) + ) + () + ) + (= + (Var 4 a3) + (Cast + (RealConstant + 34.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 34.500000 + (Real 4) + ) + ) + () + ) + (= + (Var 4 x2) + (FunctionCall + 4 complex@__lpython_overloaded_6__complex + 4 complex + [((Var 4 a2)) + ((Var 4 a3))] + (Complex 4) + () + () + ) + () + ) + (Assert + (RealCompare + (Cast + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 4 x2) + (Real 4) + () + ) + Sub + (Cast + (RealConstant + 34.500000 + (Real 8) + ) + RealToReal + (Real 4) + (RealConstant + 34.500000 + (Real 4) + ) + ) + (Real 4) + () + )] + 0 + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + LtE + (Var 4 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 4 i1) + (IntegerUnaryMinus + (IntegerConstant 5 (Integer 4)) + (Integer 4) + (IntegerConstant -5 (Integer 4)) + ) + () + ) + (= + (Var 4 i2) + (IntegerUnaryMinus + (Cast + (IntegerConstant 6 (Integer 4)) + IntegerToInteger + (Integer 8) + (IntegerConstant 6 (Integer 8)) + ) + (Integer 8) + (IntegerConstant -6 (Integer 8)) + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_7__complex + 4 complex + [((Var 4 a3)) + ((Var 4 a))] + (Complex 8) + () + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_8__complex + 4 complex + [((Var 4 a)) + ((Var 4 a3))] + (Complex 8) + () + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_11__complex + 4 complex + [((Var 4 i1)) + ((Var 4 i2))] + (Complex 8) + () + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_9__complex + 4 complex + [((Var 4 i1)) + ((IntegerUnaryMinus + (Var 4 i1) + (Integer 4) + () + ))] + (Complex 8) + () + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_10__complex + 4 complex + [((IntegerUnaryMinus + (Var 4 i2) + (Integer 8) + () + )) + ((IntegerUnaryMinus + (Var 4 i2) + (Integer 8) + () + ))] + (Complex 8) + () + () + ) + () + ) + (= + (Var 4 x) + (FunctionCall + 4 complex@__lpython_overloaded_12__complex + 4 complex + [((Var 4 i2)) + ((IntegerUnaryMinus + (Var 4 i1) + (Integer 4) + () + ))] + (Complex 8) + () + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_complex_not: + (Function + (SymbolTable + 6 + { + b: + (Variable + 6 + b + [] + Local + () + () + Default + (Logical 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 6 + c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c2: + (Variable + 6 + c2 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 6 + complex + 8 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 6 + complex@__lpython_overloaded_9__complex + 8 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ) + }) + test_complex_not + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_9__complex] + [] + [(= + (Var 6 c) + (Cast + (FunctionCall + 6 complex@__lpython_overloaded_9__complex + 6 complex + [((IntegerConstant 4 (Integer 4))) + ((IntegerConstant 5 (Integer 4)))] + (Complex 8) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 6 b) + (LogicalNot + (Cast + (Var 6 c) + ComplexToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (LogicalNot + (Var 6 b) + (Logical 4) + () + ) + () + ) + (= + (Var 6 c2) + (FunctionCall + 6 complex@__lpython_overloaded_9__complex + 6 complex + [((IntegerConstant 0 (Integer 4))) + ((IntegerConstant 0 (Integer 4)))] + (Complex 8) + (ComplexConstant + 0.000000 + 0.000000 + (Complex 8) + ) + () + ) + () + ) + (= + (Var 6 b) + (LogicalNot + (Cast + (Var 6 c2) + ComplexToLogical + (Logical 4) + () + ) + (Logical 4) + () + ) + () + ) + (Assert + (Var 6 b) + () + )] + () + Public + .false. + .false. + () + ), + test_complex_unary_minus: + (Function + (SymbolTable + 5 + { + _c: + (Variable + 5 + _c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + c2: + (Variable + 5 + c2 + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + complex: + (ExternalSymbol + 5 + complex + 8 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_13__complex: + (ExternalSymbol + 5 + complex@__lpython_overloaded_13__complex + 8 __lpython_overloaded_13__complex + lpython_builtin + [] + __lpython_overloaded_13__complex + Public + ), + complex@__lpython_overloaded_5__complex: + (ExternalSymbol + 5 + complex@__lpython_overloaded_5__complex + 8 __lpython_overloaded_5__complex + lpython_builtin + [] + __lpython_overloaded_5__complex + Public + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 5 + complex@__lpython_overloaded_9__complex + 8 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ) + }) + test_complex_unary_minus + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_13__complex + complex@__lpython_overloaded_9__complex + complex@__lpython_overloaded_5__complex] + [] + [(= + (Var 5 c) + (Cast + (FunctionCall + 5 complex@__lpython_overloaded_13__complex + 5 complex + [((IntegerConstant 3 (Integer 4))) + ((RealConstant + 4.500000 + (Real 8) + ))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.500000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 3.000000 + 4.500000 + (Complex 4) + ) + ) + () + ) + (= + (Var 5 _c) + (ComplexUnaryMinus + (Var 5 c) + (Complex 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Cast + (ComplexRe + (Var 5 _c) + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -3.000000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Cast + (ComplexIm + (Var 5 _c) + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 4.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -4.500000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 _c) + (Cast + (FunctionCall + 5 complex@__lpython_overloaded_9__complex + 5 complex + [((IntegerConstant 5 (Integer 4))) + ((IntegerUnaryMinus + (IntegerConstant 78 (Integer 4)) + (Integer 4) + (IntegerConstant -78 (Integer 4)) + ))] + (Complex 8) + (ComplexConstant + 5.000000 + -78.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 5.000000 + -78.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 5 _c) + (ComplexUnaryMinus + (Var 5 _c) + (Complex 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Cast + (ComplexRe + (Var 5 _c) + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -5.000000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Cast + (ComplexIm + (Var 5 _c) + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Sub + (RealConstant + 78.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 c2) + (FunctionCall + 5 complex@__lpython_overloaded_5__complex + 5 complex + [((RealUnaryMinus + (RealConstant + 4.500000 + (Real 8) + ) + (Real 8) + (RealConstant + -4.500000 + (Real 8) + ) + )) + ((RealUnaryMinus + (RealConstant + 7.800000 + (Real 8) + ) + (Real 8) + (RealConstant + -7.800000 + (Real 8) + ) + ))] + (Complex 8) + (ComplexConstant + -4.500000 + -7.800000 + (Complex 8) + ) + () + ) + () + ) + (= + (Var 5 c2) + (ComplexUnaryMinus + (Var 5 c2) + (Complex 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 5 c2) + (Real 8) + () + ) + Sub + (RealConstant + 4.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 5 c2) + (Real 8) + () + ) + Sub + (RealConstant + 7.800000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (= + (Var 5 c2) + (ComplexBinOp + (Cast + (IntegerConstant 3 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 3.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 4.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 5 c2) + (ComplexUnaryMinus + (Var 5 c2) + (Complex 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexRe + (Var 5 c2) + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -3.000000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ComplexIm + (Var 5 c2) + (Real 8) + () + ) + Sub + (RealUnaryMinus + (RealConstant + 4.000000 + (Real 8) + ) + (Real 8) + (RealConstant + -4.000000 + (Real 8) + ) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (RealConstant + 0.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_real_imag: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 3 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ) + }) + test_real_imag + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 3 x) + (ComplexBinOp + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 2.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 3.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 3 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 3 a) + (ComplexRe + (Var 3 x) + (Real 8) + () + ) + () + ) + (= + (Var 3 b) + (ComplexIm + (Var 3 x) + (Real 8) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 a) + Sub + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Var 3 b) + Sub + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 3 eps) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 126 + { + __main__global_stmts: + (ExternalSymbol + 126 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 126 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_complex_02-782ba2d.json b/tests/reference/asr-test_complex_02-782ba2d.json index 3fa259e305..aaae96d603 100644 --- a/tests/reference/asr-test_complex_02-782ba2d.json +++ b/tests/reference/asr-test_complex_02-782ba2d.json @@ -5,9 +5,9 @@ "infile_hash": "e6ee66d952deccec11d316a09f1d5b4bb4916ceb56a41a11dee03ae9", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_complex_02-782ba2d.stderr", - "stderr_hash": "dc3a153532aa537903852b8334a63d785edb99a11aff4e951c28b5c6", - "returncode": 2 + "stdout": "asr-test_complex_02-782ba2d.stdout", + "stdout_hash": "9d48f746f6667e237566131eacf2d1892d5bcfa64337722fcfacaaaa", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_complex_02-782ba2d.stdout b/tests/reference/asr-test_complex_02-782ba2d.stdout new file mode 100644 index 0000000000..6580d5d90d --- /dev/null +++ b/tests/reference/asr-test_complex_02-782ba2d.stdout @@ -0,0 +1,718 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 124 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 6 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_complex_abs + test_complex_binop_32 + test_complex_binop_64] + [] + [(SubroutineCall + 2 test_complex_abs + () + [] + () + ) + (SubroutineCall + 2 test_complex_binop_32 + () + [] + () + ) + (SubroutineCall + 2 test_complex_binop_64 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_complex_abs: + (Function + (SymbolTable + 3 + { + complex: + (ExternalSymbol + 3 + complex + 7 complex + lpython_builtin + [] + complex + Private + ), + complex@__lpython_overloaded_9__complex: + (ExternalSymbol + 3 + complex@__lpython_overloaded_9__complex + 7 __lpython_overloaded_9__complex + lpython_builtin + [] + __lpython_overloaded_9__complex + Public + ), + eps: + (Variable + 3 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 3 + x + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 3 + y + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ) + }) + test_complex_abs + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [complex@__lpython_overloaded_9__complex] + [] + [(= + (Var 3 x) + (Cast + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 3 (Integer 4))) + ((IntegerConstant 4 (Integer 4)))] + (Complex 8) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 8) + ) + () + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 3.000000 + 4.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 3 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (Cast + (IntrinsicScalarFunction + Abs + [(Var 3 x)] + 0 + (Real 4) + () + ) + RealToReal + (Real 8) + () + ) + Sub + (RealConstant + 5.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + ) + (= + (Var 3 y) + (FunctionCall + 3 complex@__lpython_overloaded_9__complex + 3 complex + [((IntegerConstant 6 (Integer 4))) + ((IntegerConstant 8 (Integer 4)))] + (Complex 8) + (ComplexConstant + 6.000000 + 8.000000 + (Complex 8) + ) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (IntrinsicScalarFunction + Abs + [(Var 3 y)] + 0 + (Real 8) + () + ) + Sub + (RealConstant + 10.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 3 eps) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_complex_binop_32: + (Function + (SymbolTable + 4 + { + x: + (Variable + 4 + x + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + y: + (Variable + 4 + y + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ), + z: + (Variable + 4 + z + [] + Local + () + () + Default + (Complex 4) + () + Source + Public + Required + .false. + ) + }) + test_complex_binop_32 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 4 x) + (Cast + (ComplexBinOp + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 2.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 3.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 8) + ) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 4 y) + (Cast + (ComplexBinOp + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 4.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 5.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 8) + ) + ) + ComplexToComplex + (Complex 4) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 4) + ) + ) + () + ) + (= + (Var 4 z) + (ComplexBinOp + (Var 4 x) + Add + (Var 4 y) + (Complex 4) + () + ) + () + ) + (= + (Var 4 z) + (ComplexBinOp + (Var 4 x) + Sub + (Var 4 y) + (Complex 4) + () + ) + () + ) + (= + (Var 4 z) + (ComplexBinOp + (Var 4 x) + Mul + (Var 4 y) + (Complex 4) + () + ) + () + ) + (= + (Var 4 z) + (ComplexBinOp + (Var 4 x) + Pow + (Var 4 y) + (Complex 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_complex_binop_64: + (Function + (SymbolTable + 5 + { + x: + (Variable + 5 + x + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + y: + (Variable + 5 + y + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ), + z: + (Variable + 5 + z + [] + Local + () + () + Default + (Complex 8) + () + Source + Public + Required + .false. + ) + }) + test_complex_binop_64 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 x) + (ComplexBinOp + (Cast + (IntegerConstant 2 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 2.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 3.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 2.000000 + 3.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 5 y) + (ComplexBinOp + (Cast + (IntegerConstant 4 (Integer 4)) + IntegerToComplex + (Complex 8) + (ComplexConstant + 4.000000 + 0.000000 + (Complex 8) + ) + ) + Add + (ComplexConstant + 0.000000 + 5.000000 + (Complex 8) + ) + (Complex 8) + (ComplexConstant + 4.000000 + 5.000000 + (Complex 8) + ) + ) + () + ) + (= + (Var 5 z) + (ComplexBinOp + (Var 5 x) + Add + (Var 5 y) + (Complex 8) + () + ) + () + ) + (= + (Var 5 z) + (ComplexBinOp + (Var 5 x) + Sub + (Var 5 y) + (Complex 8) + () + ) + () + ) + (= + (Var 5 z) + (ComplexBinOp + (Var 5 x) + Mul + (Var 5 y) + (Complex 8) + () + ) + () + ) + (= + (Var 5 z) + (ComplexBinOp + (Var 5 x) + Pow + (Var 5 y) + (Complex 8) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 125 + { + __main__global_stmts: + (ExternalSymbol + 125 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 125 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_dict13-683b290.json b/tests/reference/asr-test_dict13-683b290.json index 3f08b12f0a..982bd80540 100644 --- a/tests/reference/asr-test_dict13-683b290.json +++ b/tests/reference/asr-test_dict13-683b290.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_dict13-683b290.stderr", - "stderr_hash": "26039da2a42594ace7df2672a7bec3e88607caa7b45e35024b33df62", + "stderr_hash": "60bc3be332a1b638ade1cf40068ee4381ba4a79942a76c104c9cdebd", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_dict13-683b290.stderr b/tests/reference/asr-test_dict13-683b290.stderr index b22b070fa2..9dc7b6ef9c 100644 --- a/tests/reference/asr-test_dict13-683b290.stderr +++ b/tests/reference/asr-test_dict13-683b290.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/errors/test_dict13.py:2:12 +semantic error: 'dict' key type cannot be float/complex because resolving collisions by exact comparison of float/complex values will result in unexpected behaviours. In addition fuzzy equality checks with a certain tolerance does not follow transitivity with float/complex values. + --> tests/errors/test_dict13.py:2:11 | 2 | print({complex(0.0, 1.0): 1.1}) # constant dict with complex value as key - | ^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.json b/tests/reference/asr-test_max_min-3c2fc51.json index 7c51d764ca..33f72d8194 100644 --- a/tests/reference/asr-test_max_min-3c2fc51.json +++ b/tests/reference/asr-test_max_min-3c2fc51.json @@ -5,9 +5,9 @@ "infile_hash": "1aba932852adf8cc5dbff4a6ff83aa5de030dba5a5721eeace90a5d4", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_max_min-3c2fc51.stderr", - "stderr_hash": "bc3642925ccc0f3f61e37e0bd20fc7100fddbfb37c06a3609ff78daf", - "returncode": 2 + "stdout": "asr-test_max_min-3c2fc51.stdout", + "stdout_hash": "0737db3b75fc1a40cec30cff3e48c0ea621fad7872c77dab74ff0388", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_max_min-3c2fc51.stdout b/tests/reference/asr-test_max_min-3c2fc51.stdout new file mode 100644 index 0000000000..635593464e --- /dev/null +++ b/tests/reference/asr-test_max_min-3c2fc51.stdout @@ -0,0 +1,814 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 125 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 7 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_max_int + test_max_float + test_min_int + test_min_float] + [] + [(SubroutineCall + 2 test_max_int + () + [] + () + ) + (SubroutineCall + 2 test_max_float + () + [] + () + ) + (SubroutineCall + 2 test_min_int + () + [] + () + ) + (SubroutineCall + 2 test_min_float + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_max_float: + (Function + (SymbolTable + 4 + { + d: + (Variable + 4 + d + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + e: + (Variable + 4 + e + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + f: + (Variable + 4 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + max: + (ExternalSymbol + 4 + max + 8 max + lpython_builtin + [] + max + Private + ), + max@__lpython_overloaded_2__max: + (ExternalSymbol + 4 + max@__lpython_overloaded_2__max + 8 __lpython_overloaded_2__max + lpython_builtin + [] + __lpython_overloaded_2__max + Public + ), + max@__lpython_overloaded_3__max: + (ExternalSymbol + 4 + max@__lpython_overloaded_3__max + 8 __lpython_overloaded_3__max + lpython_builtin + [] + __lpython_overloaded_3__max + Public + ) + }) + test_max_float + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [max@__lpython_overloaded_2__max + max@__lpython_overloaded_3__max] + [] + [(= + (Var 4 d) + (RealConstant + 23.233000 + (Real 8) + ) + () + ) + (= + (Var 4 e) + (RealConstant + 23.223300 + (Real 8) + ) + () + ) + (= + (Var 4 f) + (RealConstant + 21.230000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (FunctionCall + 4 max@__lpython_overloaded_2__max + 4 max + [((Var 4 d)) + ((Var 4 e)) + ((Var 4 f))] + (Real 8) + () + () + ) + Eq + (Var 4 d) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (FunctionCall + 4 max@__lpython_overloaded_3__max + 4 max + [((Var 4 e)) + ((Var 4 f))] + (Real 8) + () + () + ) + Eq + (Var 4 e) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_max_int: + (Function + (SymbolTable + 3 + { + a: + (Variable + 3 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 3 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 3 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + max: + (ExternalSymbol + 3 + max + 8 max + lpython_builtin + [] + max + Private + ), + max@__lpython_overloaded_0__max: + (ExternalSymbol + 3 + max@__lpython_overloaded_0__max + 8 __lpython_overloaded_0__max + lpython_builtin + [] + __lpython_overloaded_0__max + Public + ), + max@__lpython_overloaded_1__max: + (ExternalSymbol + 3 + max@__lpython_overloaded_1__max + 8 __lpython_overloaded_1__max + lpython_builtin + [] + __lpython_overloaded_1__max + Public + ) + }) + test_max_int + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [max@__lpython_overloaded_0__max + max@__lpython_overloaded_1__max] + [] + [(= + (Var 3 a) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 3 b) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 3 c) + (IntegerConstant 3 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 max@__lpython_overloaded_0__max + 3 max + [((Var 3 a)) + ((Var 3 b))] + (Integer 4) + () + () + ) + Eq + (Var 3 b) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 max@__lpython_overloaded_1__max + 3 max + [((Var 3 a)) + ((Var 3 b)) + ((Var 3 c))] + (Integer 4) + () + () + ) + Eq + (Var 3 c) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (FunctionCall + 3 max@__lpython_overloaded_1__max + 3 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 + (IntegerCompare + (FunctionCall + 3 max@__lpython_overloaded_0__max + 3 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) + ) + ) + () + )] + () + Public + .false. + .false. + () + ), + test_min_float: + (Function + (SymbolTable + 6 + { + d: + (Variable + 6 + d + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + e: + (Variable + 6 + e + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + f: + (Variable + 6 + f + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ) + }) + test_min_float + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 6 d) + (RealConstant + 23.233000 + (Real 8) + ) + () + ) + (= + (Var 6 e) + (RealConstant + 23.223300 + (Real 8) + ) + () + ) + (= + (Var 6 f) + (RealConstant + 21.230000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Min + [(Var 6 d) + (Var 6 e) + (Var 6 f)] + 0 + (Real 8) + () + ) + Eq + (Var 6 f) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Min + [(Var 6 e) + (Var 6 f)] + 0 + (Real 8) + () + ) + Eq + (Var 6 f) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_min_int: + (Function + (SymbolTable + 5 + { + a: + (Variable + 5 + a + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + b: + (Variable + 5 + b + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + c: + (Variable + 5 + c + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_min_int + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 5 a) + (IntegerConstant 1 (Integer 4)) + () + ) + (= + (Var 5 b) + (IntegerConstant 2 (Integer 4)) + () + ) + (= + (Var 5 c) + (IntegerConstant 3 (Integer 4)) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Min + [(Var 5 a) + (Var 5 b)] + 0 + (Integer 4) + () + ) + Eq + (Var 5 a) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Min + [(Var 5 a) + (Var 5 b) + (Var 5 c)] + 0 + (Integer 4) + () + ) + Eq + (Var 5 a) + (Logical 4) + () + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Min + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + 0 + (Integer 4) + (IntegerConstant 1 (Integer 4)) + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + ) + (Assert + (IntegerCompare + (IntrinsicScalarFunction + Min + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 6 (Integer 4))] + 0 + (Integer 4) + (IntegerConstant 1 (Integer 4)) + ) + Eq + (IntegerConstant 1 (Integer 4)) + (Logical 4) + (LogicalConstant + .true. + (Logical 4) + ) + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 126 + { + __main__global_stmts: + (ExternalSymbol + 126 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 126 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_numpy_03-e600a49.json b/tests/reference/asr-test_numpy_03-e600a49.json index 11537ffe29..1d1df0b8cd 100644 --- a/tests/reference/asr-test_numpy_03-e600a49.json +++ b/tests/reference/asr-test_numpy_03-e600a49.json @@ -5,9 +5,9 @@ "infile_hash": "5c3ea7436668441c056bd576ea77cdfb49e44a5f0e95088d0f62184e", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_numpy_03-e600a49.stderr", - "stderr_hash": "934ed2ca36b7a4e431b1e4fc8dbd37edd550f7dbb5d9dca7ed49ce61", - "returncode": 2 + "stdout": "asr-test_numpy_03-e600a49.stdout", + "stdout_hash": "327db223a7c8892168c63f6c33339d0b81db8c8bb152b119a2c92591", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_03-e600a49.stdout b/tests/reference/asr-test_numpy_03-e600a49.stdout new file mode 100644 index 0000000000..e238153e7f --- /dev/null +++ b/tests/reference/asr-test_numpy_03-e600a49.stdout @@ -0,0 +1,1938 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 220 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_reshape_with_argument] + [] + [(SubroutineCall + 2 test_reshape_with_argument + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_1d_to_nd: + (Function + (SymbolTable + 204 + { + a: + (Variable + 204 + a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 204 + b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 204 + c + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 204 + d + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 204 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 204 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 204 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 204 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 204 + l + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + newshape: + (Variable + 204 + newshape + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + newshape1: + (Variable + 204 + newshape1 + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + test_1d_to_nd + (FunctionType + [(Array + (Real 8) + [(() + ())] + DescriptorArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 204 d)] + [(= + (Var 204 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 204 b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 204 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 256 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 255 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 204 i) + (IntrinsicScalarFunction + FloorDiv + [(Var 204 k) + (IntegerConstant 16 (Integer 4))] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 204 j) + (IntegerBinOp + (Var 204 k) + Sub + (IntegerBinOp + (Var 204 i) + Mul + (IntegerConstant 16 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (ArrayItem + (Var 204 b) + [(() + (Var 204 k) + ())] + (Real 8) + RowMajor + () + ) + (RealBinOp + (Cast + (IntegerBinOp + (Var 204 i) + Add + (Var 204 j) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + ) + () + )] + ) + (= + (Var 204 a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 204 newshape) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 204 newshape) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 16 (Integer 4)) + () + ) + (= + (ArrayItem + (Var 204 newshape) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 16 (Integer 4)) + () + ) + (= + (Var 204 a) + (ArrayReshape + (Var 204 b) + (ArrayPhysicalCast + (Var 204 newshape) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 2 (Integer 4)))] + DescriptorArray + ) + () + ) + (Array + (Real 8) + [(() + ())] + FixedSizeArray + ) + () + ) + () + ) + (DoLoop + () + ((Var 204 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 204 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (ArrayItem + (Var 204 a) + [(() + (Var 204 i) + ()) + (() + (Var 204 j) + ())] + (Real 8) + RowMajor + () + ) + Sub + (Cast + (IntegerBinOp + (Var 204 i) + Add + (Var 204 j) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 204 eps) + (Logical 4) + () + ) + () + )] + )] + ) + (= + (Var 204 c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 204 newshape1) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 204 newshape1) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 16 (Integer 4)) + () + ) + (= + (ArrayItem + (Var 204 newshape1) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 16 (Integer 4)) + () + ) + (= + (ArrayItem + (Var 204 newshape1) + [(() + (IntegerConstant 2 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 16 (Integer 4)) + () + ) + (= + (Var 204 c) + (ArrayReshape + (Var 204 d) + (ArrayPhysicalCast + (Var 204 newshape1) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + DescriptorArray + ) + () + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + ) + () + ) + (DoLoop + () + ((Var 204 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 204 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 204 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (ArrayItem + (Var 204 c) + [(() + (Var 204 i) + ()) + (() + (Var 204 j) + ()) + (() + (Var 204 k) + ())] + (Real 8) + RowMajor + () + ) + Sub + (Cast + (IntegerBinOp + (IntegerBinOp + (Var 204 i) + Add + (Var 204 j) + (Integer 4) + () + ) + Add + (Var 204 k) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 204 eps) + (Logical 4) + () + ) + () + )] + )] + )] + )] + () + Public + .false. + .false. + () + ), + test_nd_to_1d: + (Function + (SymbolTable + 203 + { + a: + (Variable + 203 + a + [] + InOut + () + () + Default + (Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 203 + b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + c: + (Variable + 203 + c + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 203 + d + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4096 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + eps: + (Variable + 203 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + i: + (Variable + 203 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 203 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 203 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 203 + l + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + newshape: + (Variable + 203 + newshape + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + newshape1: + (Variable + 203 + newshape1 + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + test_nd_to_1d + (FunctionType + [(Array + (Real 8) + [(() + ()) + (() + ())] + DescriptorArray + )] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 203 a)] + [(= + (Var 203 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (= + (Var 203 b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 256 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 203 newshape) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 203 newshape) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 256 (Integer 4)) + () + ) + (= + (Var 203 b) + (ArrayReshape + (Var 203 a) + (ArrayPhysicalCast + (Var 203 newshape) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + DescriptorArray + ) + () + ) + (Array + (Real 8) + [(() + ())] + DescriptorArray + ) + () + ) + () + ) + (DoLoop + () + ((Var 203 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 256 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 255 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 203 i) + (IntrinsicScalarFunction + FloorDiv + [(Var 203 k) + (IntegerConstant 16 (Integer 4))] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 203 j) + (IntegerBinOp + (Var 203 k) + Sub + (IntegerBinOp + (Var 203 i) + Mul + (IntegerConstant 16 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (ArrayItem + (Var 203 b) + [(() + (Var 203 k) + ())] + (Real 8) + RowMajor + () + ) + Sub + (Cast + (IntegerBinOp + (Var 203 i) + Add + (Var 203 j) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 203 eps) + (Logical 4) + () + ) + () + )] + ) + (= + (Var 203 c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 203 c) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 203 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 203 k) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 203 c) + [(() + (Var 203 i) + ()) + (() + (Var 203 j) + ()) + (() + (Var 203 k) + ())] + (Real 8) + RowMajor + () + ) + (RealBinOp + (Cast + (IntegerBinOp + (IntegerBinOp + (Var 203 i) + Add + (Var 203 j) + (Integer 4) + () + ) + Add + (Var 203 k) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + ) + () + )] + )] + )] + ) + (= + (Var 203 d) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4096 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 203 newshape1) + (ArrayConstant + [] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (ArrayItem + (Var 203 newshape1) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + (IntegerConstant 4096 (Integer 4)) + () + ) + (= + (Var 203 d) + (ArrayReshape + (Var 203 c) + (ArrayPhysicalCast + (Var 203 newshape1) + FixedSizeArray + DescriptorArray + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 1 (Integer 4)))] + DescriptorArray + ) + () + ) + (Array + (Real 8) + [(() + ())] + FixedSizeArray + ) + () + ) + () + ) + (DoLoop + () + ((Var 203 l) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 4096 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 4095 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 203 i) + (Cast + (RealBinOp + (Cast + (Var 203 l) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (IntegerConstant 256 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 256.000000 + (Real 8) + ) + ) + (Real 8) + () + ) + RealToInteger + (Integer 4) + () + ) + () + ) + (= + (Var 203 j) + (IntrinsicScalarFunction + FloorDiv + [(IntegerBinOp + (Var 203 l) + Sub + (IntegerBinOp + (Var 203 i) + Mul + (IntegerConstant 256 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + (IntegerConstant 16 (Integer 4))] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 203 k) + (IntegerBinOp + (IntegerBinOp + (Var 203 l) + Sub + (IntegerBinOp + (Var 203 i) + Mul + (IntegerConstant 256 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + Sub + (IntegerBinOp + (Var 203 j) + Mul + (IntegerConstant 16 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (RealBinOp + (ArrayItem + (Var 203 d) + [(() + (Var 203 l) + ())] + (Real 8) + RowMajor + () + ) + Sub + (Cast + (IntegerBinOp + (IntegerBinOp + (Var 203 i) + Add + (Var 203 j) + (Integer 4) + () + ) + Add + (Var 203 k) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + (Real 8) + () + ) + Sub + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + LtE + (Var 203 eps) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ), + test_reshape_with_argument: + (Function + (SymbolTable + 205 + { + a: + (Variable + 205 + a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + d: + (Variable + 205 + d + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4096 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 205 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + j: + (Variable + 205 + j + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + k: + (Variable + 205 + k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + l: + (Variable + 205 + l + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + test_reshape_with_argument + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_nd_to_1d + test_1d_to_nd] + [] + [(= + (Var 205 a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 205 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(DoLoop + () + ((Var 205 j) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 16 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 15 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 205 a) + [(() + (Var 205 i) + ()) + (() + (Var 205 j) + ())] + (Real 8) + RowMajor + () + ) + (RealBinOp + (Cast + (IntegerBinOp + (Var 205 i) + Add + (Var 205 j) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + ) + () + )] + )] + ) + (SubroutineCall + 2 test_nd_to_1d + () + [((ArrayPhysicalCast + (Var 205 a) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4))) + ((IntegerConstant 0 (Integer 4)) + (IntegerConstant 16 (Integer 4)))] + DescriptorArray + ) + () + ))] + () + ) + (= + (Var 205 d) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4096 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 205 l) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 4096 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 4095 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (Var 205 i) + (Cast + (RealBinOp + (Cast + (Var 205 l) + IntegerToReal + (Real 8) + () + ) + Div + (Cast + (IntegerConstant 256 (Integer 4)) + IntegerToReal + (Real 8) + (RealConstant + 256.000000 + (Real 8) + ) + ) + (Real 8) + () + ) + RealToInteger + (Integer 4) + () + ) + () + ) + (= + (Var 205 j) + (IntrinsicScalarFunction + FloorDiv + [(IntegerBinOp + (Var 205 l) + Sub + (IntegerBinOp + (Var 205 i) + Mul + (IntegerConstant 256 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + (IntegerConstant 16 (Integer 4))] + 0 + (Integer 4) + () + ) + () + ) + (= + (Var 205 k) + (IntegerBinOp + (IntegerBinOp + (Var 205 l) + Sub + (IntegerBinOp + (Var 205 i) + Mul + (IntegerConstant 256 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + Sub + (IntegerBinOp + (Var 205 j) + Mul + (IntegerConstant 16 (Integer 4)) + (Integer 4) + () + ) + (Integer 4) + () + ) + () + ) + (= + (ArrayItem + (Var 205 d) + [(() + (Var 205 l) + ())] + (Real 8) + RowMajor + () + ) + (RealBinOp + (Cast + (IntegerBinOp + (IntegerBinOp + (Var 205 i) + Add + (Var 205 j) + (Integer 4) + () + ) + Add + (Var 205 k) + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Add + (RealConstant + 0.500000 + (Real 8) + ) + (Real 8) + () + ) + () + )] + ) + (SubroutineCall + 2 test_1d_to_nd + () + [((ArrayPhysicalCast + (Var 205 d) + FixedSizeArray + DescriptorArray + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 4096 (Integer 4)))] + DescriptorArray + ) + () + ))] + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 221 + { + __main__global_stmts: + (ExternalSymbol + 221 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 221 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-test_numpy_04-ecbb614.json b/tests/reference/asr-test_numpy_04-ecbb614.json index a0e2dcecdb..2b9536df32 100644 --- a/tests/reference/asr-test_numpy_04-ecbb614.json +++ b/tests/reference/asr-test_numpy_04-ecbb614.json @@ -5,9 +5,9 @@ "infile_hash": "0fbd0a4280966dd9a917d3a005887954325fb1ea5468fd28dcae930f", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-test_numpy_04-ecbb614.stderr", - "stderr_hash": "8f73238d34192a66d0659b3cc8e5f8a5339755da83a50790689cf53b", - "returncode": 2 + "stdout": "asr-test_numpy_04-ecbb614.stdout", + "stdout_hash": "d1ea2156aa8b19fa86f88a074c69680f1acefe00084af7dbc7caefc2", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stdout b/tests/reference/asr-test_numpy_04-ecbb614.stdout new file mode 100644 index 0000000000..03f436c422 --- /dev/null +++ b/tests/reference/asr-test_numpy_04-ecbb614.stdout @@ -0,0 +1,519 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 206 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [check] + [] + [(SubroutineCall + 2 check + () + [] + () + )] + () + Public + .false. + .false. + () + ), + check: + (Function + (SymbolTable + 205 + { + + }) + check + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [test_array_01 + test_array_02] + [] + [(SubroutineCall + 2 test_array_01 + () + [] + () + ) + (SubroutineCall + 2 test_array_02 + () + [] + () + )] + () + Public + .false. + .false. + () + ), + test_array_01: + (Function + (SymbolTable + 203 + { + eps: + (Variable + 203 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 203 + x + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + test_array_01 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 203 x) + (ArrayConstant + [(RealConstant + 1.000000 + (Real 8) + ) + (RealConstant + 2.000000 + (Real 8) + ) + (RealConstant + 3.000000 + (Real 8) + )] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (= + (Var 203 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ArrayItem + (Var 203 x) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + Sub + (RealConstant + 1.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 203 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ArrayItem + (Var 203 x) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + Sub + (RealConstant + 2.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 203 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (IntrinsicScalarFunction + Abs + [(RealBinOp + (ArrayItem + (Var 203 x) + [(() + (IntegerConstant 2 (Integer 4)) + ())] + (Real 8) + RowMajor + () + ) + Sub + (RealConstant + 3.000000 + (Real 8) + ) + (Real 8) + () + )] + 0 + (Real 8) + () + ) + Lt + (Var 203 eps) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ), + test_array_02: + (Function + (SymbolTable + 204 + { + eps: + (Variable + 204 + eps + [] + Local + () + () + Default + (Real 8) + () + Source + Public + Required + .false. + ), + x: + (Variable + 204 + x + [] + Local + () + () + Default + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ) + }) + test_array_02 + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 204 x) + (ArrayConstant + [(IntegerConstant 1 (Integer 4)) + (IntegerConstant 2 (Integer 4)) + (IntegerConstant 3 (Integer 4))] + (Array + (Integer 4) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 3 (Integer 4)))] + PointerToDataArray + ) + RowMajor + ) + () + ) + (= + (Var 204 eps) + (RealConstant + 0.000000 + (Real 8) + ) + () + ) + (Assert + (RealCompare + (Cast + (IntrinsicScalarFunction + Abs + [(IntegerBinOp + (ArrayItem + (Var 204 x) + [(() + (IntegerConstant 0 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Lt + (Var 204 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (IntrinsicScalarFunction + Abs + [(IntegerBinOp + (ArrayItem + (Var 204 x) + [(() + (IntegerConstant 1 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + Sub + (IntegerConstant 2 (Integer 4)) + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Lt + (Var 204 eps) + (Logical 4) + () + ) + () + ) + (Assert + (RealCompare + (Cast + (IntrinsicScalarFunction + Abs + [(IntegerBinOp + (ArrayItem + (Var 204 x) + [(() + (IntegerConstant 2 (Integer 4)) + ())] + (Integer 4) + RowMajor + () + ) + Sub + (IntegerConstant 3 (Integer 4)) + (Integer 4) + () + )] + 0 + (Integer 4) + () + ) + IntegerToReal + (Real 8) + () + ) + Lt + (Var 204 eps) + (Logical 4) + () + ) + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 207 + { + __main__global_stmts: + (ExternalSymbol + 207 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 207 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/asr-test_pow-3f5d550.json b/tests/reference/asr-test_pow-3f5d550.json index 95344abe65..c42f85ff02 100644 --- a/tests/reference/asr-test_pow-3f5d550.json +++ b/tests/reference/asr-test_pow-3f5d550.json @@ -5,9 +5,9 @@ "infile_hash": "073bf734150500a8b5e46940a9b0440e7e0fe30d0e2789ca049cef17", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "asr-test_pow-3f5d550.stdout", + "stdout_hash": "571772fdecca3b238429cfeb145ccf7f8d5d02a022f75056289ed4da", "stderr": "asr-test_pow-3f5d550.stderr", - "stderr_hash": "13a950a0d1f29b9a7cf4484858b22246b086a24919ca22f6b1d410b3", - "returncode": 2 + "stderr_hash": "3d950301563cce75654f28bf41f6f53428ed1f5ae997774345f374a3", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow-3f5d550.stderr b/tests/reference/asr-test_pow-3f5d550.stderr index c955d6b4bc..712d80384b 100644 --- a/tests/reference/asr-test_pow-3f5d550.stderr +++ b/tests/reference/asr-test_pow-3f5d550.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/errors/test_pow.py:2:11 | 2 | print(pow(2, 2)) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/asr-test_pow-3f5d550.stdout b/tests/reference/asr-test_pow-3f5d550.stdout new file mode 100644 index 0000000000..de8035313a --- /dev/null +++ b/tests/reference/asr-test_pow-3f5d550.stdout @@ -0,0 +1,159 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 121 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [main] + [] + [(SubroutineCall + 2 main + () + [] + () + )] + () + Public + .false. + .false. + () + ), + main: + (Function + (SymbolTable + 3 + { + pow: + (ExternalSymbol + 3 + pow + 4 pow + lpython_builtin + [] + pow + Private + ), + pow@__lpython_overloaded_0__pow: + (ExternalSymbol + 3 + pow@__lpython_overloaded_0__pow + 4 __lpython_overloaded_0__pow + lpython_builtin + [] + __lpython_overloaded_0__pow + Public + ) + }) + main + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [pow@__lpython_overloaded_0__pow] + [] + [(Print + () + [(FunctionCall + 3 pow@__lpython_overloaded_0__pow + 3 pow + [((IntegerConstant 2 (Integer 4))) + ((IntegerConstant 2 (Integer 4)))] + (Real 8) + (RealConstant + 4.000000 + (Real 8) + ) + () + )] + () + () + ) + (Print + () + [(IntegerBinOp + (IntegerConstant 2 (Integer 4)) + Pow + (IntegerConstant 2 (Integer 4)) + (Integer 4) + (IntegerConstant 4 (Integer 4)) + )] + () + () + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [lpython_builtin] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 122 + { + __main__global_stmts: + (ExternalSymbol + 122 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 122 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ) + }) + [] +) diff --git a/tests/reference/asr-test_pow1-581ef42.json b/tests/reference/asr-test_pow1-581ef42.json index 2ef657f3ac..a5584b1bc7 100644 --- a/tests/reference/asr-test_pow1-581ef42.json +++ b/tests/reference/asr-test_pow1-581ef42.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow1-581ef42.stderr", - "stderr_hash": "32fe0eecb3687de0e976228815c25c96f3dc3e8f6491adb21c105ee6", + "stderr_hash": "7f7cc07cf6f08f2d953d6e6c1f4892e6379faaf8aa668117234293d0", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow1-581ef42.stderr b/tests/reference/asr-test_pow1-581ef42.stderr index f1693701de..fa7160f584 100644 --- a/tests/reference/asr-test_pow1-581ef42.stderr +++ b/tests/reference/asr-test_pow1-581ef42.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/errors/test_pow1.py:4:11 | 4 | print(pow(x,3)) - | ^^^^^^^^ imported here + | ^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Arguments do not match for any generic procedure, pow + --> tests/errors/test_pow1.py:4:11 + | +4 | print(pow(x,3)) + | ^^^^^^^^ diff --git a/tests/reference/asr-test_pow2-0dcbd7d.json b/tests/reference/asr-test_pow2-0dcbd7d.json index 129acc3859..083bc76b8d 100644 --- a/tests/reference/asr-test_pow2-0dcbd7d.json +++ b/tests/reference/asr-test_pow2-0dcbd7d.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow2-0dcbd7d.stderr", - "stderr_hash": "54113068b55d3eab93cd04927b2fbf6a384a4a0ed64f02aa6ea18f9b", + "stderr_hash": "1d1d3a4a308e068439ac40685fcad6f29750560722b910be3341ce3c", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow2-0dcbd7d.stderr b/tests/reference/asr-test_pow2-0dcbd7d.stderr index edc4007245..896faa98e5 100644 --- a/tests/reference/asr-test_pow2-0dcbd7d.stderr +++ b/tests/reference/asr-test_pow2-0dcbd7d.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/errors/test_pow2.py:12:11 | 12 | print(pow(a, b, c, d)) - | ^^^^^^^^^^^^^^^ imported here + | ^^^^^^^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Arguments do not match for any generic procedure, pow + --> tests/errors/test_pow2.py:12:11 + | +12 | print(pow(a, b, c, d)) + | ^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_pow3-79749ed.json b/tests/reference/asr-test_pow3-79749ed.json index 7c5d30d4da..cd0f9f0d33 100644 --- a/tests/reference/asr-test_pow3-79749ed.json +++ b/tests/reference/asr-test_pow3-79749ed.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow3-79749ed.stderr", - "stderr_hash": "199c8dc10f23e2053ec5498131683383bb4b20bf06b05bf1c5f7d747", + "stderr_hash": "4a6600740ad466d250f39b76130ab5ab796312b1ee89c2d72847500f", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow3-79749ed.stderr b/tests/reference/asr-test_pow3-79749ed.stderr index 3a157a0866..6456498803 100644 --- a/tests/reference/asr-test_pow3-79749ed.stderr +++ b/tests/reference/asr-test_pow3-79749ed.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/errors/test_pow3.py:8:11 | 8 | print(pow(x, a)) - | ^^^^^^^^^ imported here + | ^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Arguments do not match for any generic procedure, pow + --> tests/errors/test_pow3.py:8:11 + | +8 | print(pow(x, a)) + | ^^^^^^^^^ diff --git a/tests/reference/asr-test_pow4-ef60978.json b/tests/reference/asr-test_pow4-ef60978.json index 8cfd3c1460..2e98c401ce 100644 --- a/tests/reference/asr-test_pow4-ef60978.json +++ b/tests/reference/asr-test_pow4-ef60978.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_pow4-ef60978.stderr", - "stderr_hash": "e4796a76ca15b125485b820d259be4ce20ed67f403953372685b98d5", + "stderr_hash": "ddc8a81609479bf82d256c9cb8d4d54526bd6656632a0d1e2f1ada2c", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_pow4-ef60978.stderr b/tests/reference/asr-test_pow4-ef60978.stderr index 2dc752cd36..0663475b44 100644 --- a/tests/reference/asr-test_pow4-ef60978.stderr +++ b/tests/reference/asr-test_pow4-ef60978.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/errors/test_pow4.py:10:11 | 10 | print(pow(x, a, b)) - | ^^^^^^^^^^^^ imported here + | ^^^^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +semantic error: Arguments do not match for any generic procedure, pow + --> tests/errors/test_pow4.py:10:11 + | +10 | print(pow(x, a, b)) + | ^^^^^^^^^^^^ diff --git a/tests/reference/asr-test_zero_division-3dd84e8.json b/tests/reference/asr-test_zero_division-3dd84e8.json index 129e181bef..5c135e76d4 100644 --- a/tests/reference/asr-test_zero_division-3dd84e8.json +++ b/tests/reference/asr-test_zero_division-3dd84e8.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_zero_division-3dd84e8.stderr", - "stderr_hash": "9403e36c7ace95241bf1d59a108732b298fbee5425c44455fb81ac77", + "stderr_hash": "e1770a0ba87c5155926e3d6bb3bd67e14a5c040b7584c4cf114a41b2", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division-3dd84e8.stderr b/tests/reference/asr-test_zero_division-3dd84e8.stderr index 7403437c96..57611f2b32 100644 --- a/tests/reference/asr-test_zero_division-3dd84e8.stderr +++ b/tests/reference/asr-test_zero_division-3dd84e8.stderr @@ -1,5 +1,5 @@ -semantic error: integer division by zero is not allowed +semantic error: Division by 0 is not allowed --> tests/errors/test_zero_division.py:4:16 | 4 | print(i // 0) - | ^ integer division by zero + | ^ diff --git a/tests/reference/asr-test_zero_division2-d84989f.json b/tests/reference/asr-test_zero_division2-d84989f.json index b9a7de7d1e..f1fb7cbb0e 100644 --- a/tests/reference/asr-test_zero_division2-d84989f.json +++ b/tests/reference/asr-test_zero_division2-d84989f.json @@ -8,6 +8,6 @@ "stdout": null, "stdout_hash": null, "stderr": "asr-test_zero_division2-d84989f.stderr", - "stderr_hash": "09fcb9f6244ddf2c2d14cd76ec91274cffd240e24e2b2f1c0697c8b5", + "stderr_hash": "d2bac61e7df0875a7c93edb706661c80154b7b4d05dbf26663c36176", "returncode": 2 } \ No newline at end of file diff --git a/tests/reference/asr-test_zero_division2-d84989f.stderr b/tests/reference/asr-test_zero_division2-d84989f.stderr index 8dc523a2a5..438ee0b6d4 100644 --- a/tests/reference/asr-test_zero_division2-d84989f.stderr +++ b/tests/reference/asr-test_zero_division2-d84989f.stderr @@ -1,5 +1,5 @@ -semantic error: float floor division by zero is not allowed +semantic error: Division by 0 is not allowed --> tests/errors/test_zero_division2.py:4:16 | 4 | print(v // 0.0) - | ^^^ float floor division by zero + | ^^^ diff --git a/tests/reference/asr-vec_01-66ac423.json b/tests/reference/asr-vec_01-66ac423.json index abd51bc145..3a816642b1 100644 --- a/tests/reference/asr-vec_01-66ac423.json +++ b/tests/reference/asr-vec_01-66ac423.json @@ -5,9 +5,9 @@ "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-vec_01-66ac423.stderr", - "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", - "returncode": 2 + "stdout": "asr-vec_01-66ac423.stdout", + "stdout_hash": "1ea0f258aa80b56382bd3f3df5439aeecc176af372c79c00a402ae57", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-vec_01-66ac423.stdout b/tests/reference/asr-vec_01-66ac423.stdout new file mode 100644 index 0000000000..fb0b8bb903 --- /dev/null +++ b/tests/reference/asr-vec_01-66ac423.stdout @@ -0,0 +1,295 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 207 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [loop_vec] + [] + [(SubroutineCall + 2 loop_vec + () + [] + () + )] + () + Public + .false. + .false. + () + ), + loop_vec: + (Function + (SymbolTable + 203 + { + a: + (Variable + 203 + a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 203 + b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 203 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + loop_vec + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [] + [(= + (Var 203 a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 203 b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 9216 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9215 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 203 b) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + (RealConstant + 5.000000 + (Real 8) + ) + () + )] + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 9216 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9215 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 203 a) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + (ArrayItem + (Var 203 b) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + () + )] + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 9216 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9215 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (ArrayItem + (Var 203 a) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + Eq + (RealConstant + 5.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 208 + { + __main__global_stmts: + (ExternalSymbol + 208 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 208 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) diff --git a/tests/reference/c-expr7-bb2692a.json b/tests/reference/c-expr7-bb2692a.json index c0fcdfcb2c..84ee9e5ed5 100644 --- a/tests/reference/c-expr7-bb2692a.json +++ b/tests/reference/c-expr7-bb2692a.json @@ -5,9 +5,9 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "c-expr7-bb2692a.stdout", + "stdout_hash": "1d75b4cf61dcee73adafec2a5448c953bae5476aab2502115df2eecb", "stderr": "c-expr7-bb2692a.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 + "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/c-expr7-bb2692a.stderr b/tests/reference/c-expr7-bb2692a.stderr index d1b84ec030..a4fad29beb 100644 --- a/tests/reference/c-expr7-bb2692a.stderr +++ b/tests/reference/c-expr7-bb2692a.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here + | ^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +style suggestion: Could have used '**' instead of 'pow' + --> tests/expr7.py:8:15 + | +8 | res = i32(pow(a, b)) + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/c-expr7-bb2692a.stdout b/tests/reference/c-expr7-bb2692a.stdout new file mode 100644 index 0000000000..b85fda16c9 --- /dev/null +++ b/tests/reference/c-expr7-bb2692a.stdout @@ -0,0 +1,362 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +float _lcompilers_optimization_floordiv_f32(float a, float b); +double _lcompilers_optimization_floordiv_f64(double a, double b); +int16_t _lcompilers_optimization_floordiv_i16(int16_t a, int16_t b); +int32_t _lcompilers_optimization_floordiv_i32(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i321(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i3210(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i322(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i323(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i324(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i325(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i326(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i327(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i328(int32_t a, int32_t b); +int32_t _lcompilers_optimization_floordiv_i329(int32_t a, int32_t b); +int64_t _lcompilers_optimization_floordiv_i64(int64_t a, int64_t b); +int8_t _lcompilers_optimization_floordiv_i8(int8_t a, int8_t b); +uint16_t _lcompilers_optimization_floordiv_u16(uint16_t a, uint16_t b); +uint32_t _lcompilers_optimization_floordiv_u32(uint32_t a, uint32_t b); +uint64_t _lcompilers_optimization_floordiv_u64(uint64_t a, uint64_t b); +uint8_t _lcompilers_optimization_floordiv_u8(uint8_t a, uint8_t b); +void test_pow(); +int32_t test_pow_1(int32_t a, int32_t b); +void main0(); +void __main__global_stmts(); + + + +// Implementations +float _lcompilers_optimization_floordiv_f32(float a, float b) +{ + double r; + float result; + int64_t tmp; + r = a/b; + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (float)(tmp); + return result; +} + +double _lcompilers_optimization_floordiv_f64(double a, double b) +{ + double r; + double result; + int64_t tmp; + r = a/b; + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (double)(tmp); + return result; +} + +int16_t _lcompilers_optimization_floordiv_i16(int16_t a, int16_t b) +{ + double r; + int16_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i32(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i321(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i3210(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i322(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i323(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i324(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i325(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i326(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i327(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i328(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int32_t _lcompilers_optimization_floordiv_i329(int32_t a, int32_t b) +{ + double r; + int32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int64_t _lcompilers_optimization_floordiv_i64(int64_t a, int64_t b) +{ + double r; + int64_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +int8_t _lcompilers_optimization_floordiv_i8(int8_t a, int8_t b) +{ + double r; + int8_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = tmp; + return result; +} + +uint16_t _lcompilers_optimization_floordiv_u16(uint16_t a, uint16_t b) +{ + double r; + uint16_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (uint16_t)(tmp); + return result; +} + +uint32_t _lcompilers_optimization_floordiv_u32(uint32_t a, uint32_t b) +{ + double r; + uint32_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (uint32_t)(tmp); + return result; +} + +uint64_t _lcompilers_optimization_floordiv_u64(uint64_t a, uint64_t b) +{ + double r; + uint64_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (uint64_t)(tmp); + return result; +} + +uint8_t _lcompilers_optimization_floordiv_u8(uint8_t a, uint8_t b) +{ + double r; + uint8_t result; + int64_t tmp; + r = (double)(a)/(double)(b); + tmp = (int64_t)(r); + if (r < 0.00000000000000000e+00 && (double)(tmp) != r) { + tmp = tmp - 1; + } + result = (uint8_t)(tmp); + return result; +} + +double __lpython_overloaded_0__pow(int32_t x, int32_t y) +{ + double _lpython_return_variable; + _lpython_return_variable = (double)(pow(x, y)); + return _lpython_return_variable; +} + +float _lfortran_caimag(float_complex_t x); + +double _lfortran_zaimag(double_complex_t x); + +void test_pow() +{ + int32_t a; + a = (int32_t)( 4.00000000000000000e+00); +} + +int32_t test_pow_1(int32_t a, int32_t b) +{ + int32_t _lpython_return_variable; + int32_t res; + res = (int32_t)(__lpython_overloaded_0__pow(a, b)); + _lpython_return_variable = res; + return _lpython_return_variable; +} + +void main0() +{ + int32_t c; + test_pow(); + c = test_pow_1(1, 2); +} + +void __main__global_stmts() +{ + main0(); +} + +int main(int argc, char* argv[]) +{ + _lpython_set_argv(argc, argv); + __main__global_stmts(); + return 0; +} diff --git a/tests/reference/cpp-expr15-1661c0d.json b/tests/reference/cpp-expr15-1661c0d.json index 812a9c4978..a75de781fb 100644 --- a/tests/reference/cpp-expr15-1661c0d.json +++ b/tests/reference/cpp-expr15-1661c0d.json @@ -5,9 +5,9 @@ "infile_hash": "f3fa7c8efa999392edc0a94ff9c7820ed0c3f1e849c77655151b8d72", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-expr15-1661c0d.stderr", - "stderr_hash": "abb193cadddd4745a52610eabc746e5facafefb220f85ba3310a7498", - "returncode": 2 + "stdout": "cpp-expr15-1661c0d.stdout", + "stdout_hash": "c6660bd5efa0a0602ea96a86d5c44220cb4390dea4eebf4cb16211bc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/cpp-expr15-1661c0d.stdout b/tests/reference/cpp-expr15-1661c0d.stdout new file mode 100644 index 0000000000..f1932205ba --- /dev/null +++ b/tests/reference/cpp-expr15-1661c0d.stdout @@ -0,0 +1,92 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +double test1(); +std::complex test2(); +int32_t test3(); +std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y); +float _lfortran_caimag(std::complex x); +double _lfortran_zaimag(std::complex x); +namespace { +} + +// Implementations +std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y) +{ + std::complex _lpython_return_variable; + _lpython_return_variable = std::complex(x) + std::complex(y)*std::complex(0.000000, 1.000000); + return _lpython_return_variable; +} + +float _lfortran_caimag(std::complex x); + +double _lfortran_zaimag(std::complex x); + +double test1() +{ + double _lpython_return_variable; + double x; + x = 1.00000000000000000e+00; + _lpython_return_variable = x; + return _lpython_return_variable; +} + +std::complex test2() +{ + std::complex _lpython_return_variable; + std::complex x; + x = __lpython_overloaded_9__complex(2, 2); + _lpython_return_variable = x; + return _lpython_return_variable; +} + +int32_t test3() +{ + int32_t _lpython_return_variable; + std::complex x; + std::complex y; + x = std::complex(0.000000, 4.000000); + y = std::complex(0.000000, 4.000000); + _lpython_return_variable = 0; + return _lpython_return_variable; +} + +void __main__global_stmts() +{ + std::cout << test1() << std::endl; + std::cout << test2() << std::endl; + std::cout << test3() << std::endl; +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr7-529bd53.json b/tests/reference/cpp-expr7-529bd53.json index be1428115b..9697eaa92d 100644 --- a/tests/reference/cpp-expr7-529bd53.json +++ b/tests/reference/cpp-expr7-529bd53.json @@ -5,9 +5,9 @@ "infile_hash": "7ef1383d1798621ee35adb7296bfe66dcdc08a21ac8dc86b9ce42878", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "cpp-expr7-529bd53.stdout", + "stdout_hash": "8f72ce4b2d8f170884e171b1bdfa4a4ea07344825b6787d814a446cf", "stderr": "cpp-expr7-529bd53.stderr", - "stderr_hash": "4d93a6488abad28138f2713c11c47b2f02e87e530f1bf6e2e38e88bf", - "returncode": 2 + "stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/cpp-expr7-529bd53.stderr b/tests/reference/cpp-expr7-529bd53.stderr index d1b84ec030..a4fad29beb 100644 --- a/tests/reference/cpp-expr7-529bd53.stderr +++ b/tests/reference/cpp-expr7-529bd53.stderr @@ -1,11 +1,11 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/expr7.py:4:13 | 4 | a = i32(pow(2, 2)) - | ^^^^^^^^^ imported here + | ^^^^^^^^^ '**' could be used instead -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ +style suggestion: Could have used '**' instead of 'pow' + --> tests/expr7.py:8:15 + | +8 | res = i32(pow(a, b)) + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/cpp-expr7-529bd53.stdout b/tests/reference/cpp-expr7-529bd53.stdout new file mode 100644 index 0000000000..81158df8ae --- /dev/null +++ b/tests/reference/cpp-expr7-529bd53.stdout @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void main0(); +void test_pow(); +int32_t test_pow_1(int32_t a, int32_t b); +double __lpython_overloaded_0__pow(int32_t x, int32_t y); +float _lfortran_caimag(std::complex x); +double _lfortran_zaimag(std::complex x); +namespace { +} + +// Implementations +double __lpython_overloaded_0__pow(int32_t x, int32_t y) +{ + double _lpython_return_variable; + _lpython_return_variable = (double)(std::pow(x, y)); + return _lpython_return_variable; +} + +float _lfortran_caimag(std::complex x); + +double _lfortran_zaimag(std::complex x); + +void test_pow() +{ + int32_t a; + a = (int32_t)(__lpython_overloaded_0__pow(2, 2)); +} + +int32_t test_pow_1(int32_t a, int32_t b) +{ + int32_t _lpython_return_variable; + int32_t res; + res = (int32_t)(__lpython_overloaded_0__pow(a, b)); + _lpython_return_variable = res; + return _lpython_return_variable; +} + +void main0() +{ + int32_t c; + test_pow(); + c = test_pow_1(1, 2); +} + +void __main__global_stmts() +{ + main0(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-expr8-704cece.json b/tests/reference/cpp-expr8-704cece.json index 5478fb2f70..1fac6d1530 100644 --- a/tests/reference/cpp-expr8-704cece.json +++ b/tests/reference/cpp-expr8-704cece.json @@ -5,9 +5,9 @@ "infile_hash": "6966e19cf343700cbc11ec1bf6a495e43c685c6fa065669875aa61ce", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "cpp-expr8-704cece.stderr", - "stderr_hash": "94db9a9e4af4eda9b774a82fb4f55aa3413db82da5be0160bde72352", - "returncode": 2 + "stdout": "cpp-expr8-704cece.stdout", + "stdout_hash": "7ac638e8146f048bd5444436ee2b2ac4f85ffa7a1d791cf526adacb4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/cpp-expr8-704cece.stdout b/tests/reference/cpp-expr8-704cece.stdout new file mode 100644 index 0000000000..ea744708f9 --- /dev/null +++ b/tests/reference/cpp-expr8-704cece.stdout @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +namespace { +} + +// Implementations +namespace { + +void main2() { +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.json b/tests/reference/cpp-test_builtin_pow-56b3f92.json index 346ddf6b70..a18ad0aab9 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.json +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.json @@ -5,9 +5,9 @@ "infile_hash": "b7d1d5e1592f5078961eb228c756e424d394f5f0383a1577f1cced1b", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, + "stdout": "cpp-test_builtin_pow-56b3f92.stdout", + "stdout_hash": "dec0af96e013cd38032672f4812f876e586bf697757278addd17b591", "stderr": "cpp-test_builtin_pow-56b3f92.stderr", - "stderr_hash": "6935bb3dd01caf67154e6dee0bb6480b2d3ecb270bc5038444391acc", - "returncode": 2 + "stderr_hash": "859ce76c74748f2d32c7eab92cfbba789a78d4cbf5818646b99806ea", + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr index e2d434b6f1..5dbb75ad24 100644 --- a/tests/reference/cpp-test_builtin_pow-56b3f92.stderr +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.stderr @@ -1,11 +1,5 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded +style suggestion: Could have used '**' instead of 'pow' --> tests/../integration_tests/test_builtin_pow.py:11:16 | 11 | assert i32(pow(a, b)) == 32 - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ + | ^^^^^^^^^ '**' could be used instead diff --git a/tests/reference/cpp-test_builtin_pow-56b3f92.stdout b/tests/reference/cpp-test_builtin_pow-56b3f92.stdout new file mode 100644 index 0000000000..8c7a59f313 --- /dev/null +++ b/tests/reference/cpp-test_builtin_pow-56b3f92.stdout @@ -0,0 +1,269 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +Kokkos::View from_std_vector(const std::vector &v) +{ + Kokkos::View r("r", v.size()); + for (size_t i=0; i < v.size(); i++) { + r(i) = v[i]; + } + return r; +} + +// Forward declarations +void __main__global_stmts(); +void test_pow(); +double __lpython_overloaded_0__pow(int32_t x, int32_t y); +int32_t __lpython_overloaded_10__pow(int32_t x, int32_t y, int32_t z); +int64_t __lpython_overloaded_11__pow(int64_t x, int64_t y, int64_t z); +double __lpython_overloaded_1__pow(int64_t x, int64_t y); +int32_t __lpython_overloaded_2___mod(int32_t a, int32_t b); +float __lpython_overloaded_2__pow(float x, float y); +double __lpython_overloaded_3__pow(double x, double y); +float __lpython_overloaded_4__pow(int32_t x, float y); +float __lpython_overloaded_5__pow(float x, int32_t y); +double __lpython_overloaded_6__pow(int32_t x, double y); +double __lpython_overloaded_7__pow(double x, int32_t y); +int64_t __lpython_overloaded_8___mod(int64_t a, int64_t b); +int32_t __lpython_overloaded_8__pow(bool x, bool y); +std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y); +std::complex __lpython_overloaded_9__pow(std::complex c, int32_t y); +float _lfortran_caimag(std::complex x); +double _lfortran_zaimag(std::complex x); +namespace { +} + +// Implementations +double __lpython_overloaded_0__pow(int32_t x, int32_t y) +{ + double _lpython_return_variable; + _lpython_return_variable = (double)(std::pow(x, y)); + return _lpython_return_variable; +} + +int32_t __lpython_overloaded_2___mod(int32_t a, int32_t b) +{ + int32_t _lpython_return_variable; + _lpython_return_variable = a - floordiv(a)*b; + return _lpython_return_variable; +} + +int32_t __lpython_overloaded_10__pow(int32_t x, int32_t y, int32_t z) +{ + int32_t _lpython_return_variable; + int32_t result; + if (y < 0) { + std::cerr << "ERROR STOP" << std::endl; + exit(1); + } + result = __lpython_overloaded_2___mod(std::pow(x, y), z); + _lpython_return_variable = result; + return _lpython_return_variable; +} + +int64_t __lpython_overloaded_8___mod(int64_t a, int64_t b) +{ + int64_t _lpython_return_variable; + _lpython_return_variable = a - floordiv(a)*b; + return _lpython_return_variable; +} + +int64_t __lpython_overloaded_11__pow(int64_t x, int64_t y, int64_t z) +{ + int64_t _lpython_return_variable; + int64_t result; + if (y < 0) { + std::cerr << "ERROR STOP" << std::endl; + exit(1); + } + result = __lpython_overloaded_8___mod(std::pow(x, y), z); + _lpython_return_variable = result; + return _lpython_return_variable; +} + +double __lpython_overloaded_1__pow(int64_t x, int64_t y) +{ + double _lpython_return_variable; + _lpython_return_variable = (double)(std::pow(x, y)); + return _lpython_return_variable; +} + +float __lpython_overloaded_2__pow(float x, float y) +{ + float _lpython_return_variable; + _lpython_return_variable = std::pow(x, y); + return _lpython_return_variable; +} + +double __lpython_overloaded_3__pow(double x, double y) +{ + double _lpython_return_variable; + _lpython_return_variable = std::pow(x, y); + return _lpython_return_variable; +} + +float __lpython_overloaded_4__pow(int32_t x, float y) +{ + float _lpython_return_variable; + _lpython_return_variable = std::pow((float)(x), y); + return _lpython_return_variable; +} + +float __lpython_overloaded_5__pow(float x, int32_t y) +{ + float _lpython_return_variable; + _lpython_return_variable = std::pow(x, (float)(y)); + return _lpython_return_variable; +} + +double __lpython_overloaded_6__pow(int32_t x, double y) +{ + double _lpython_return_variable; + _lpython_return_variable = std::pow((double)(x), y); + return _lpython_return_variable; +} + +double __lpython_overloaded_7__pow(double x, int32_t y) +{ + double _lpython_return_variable; + _lpython_return_variable = std::pow(x, (double)(y)); + return _lpython_return_variable; +} + +int32_t __lpython_overloaded_8__pow(bool x, bool y) +{ + int32_t _lpython_return_variable; + if (y && !x) { + _lpython_return_variable = 0; + return _lpython_return_variable; + } + _lpython_return_variable = 1; + return _lpython_return_variable; +} + +std::complex __lpython_overloaded_9__complex(int32_t x, int32_t y) +{ + std::complex _lpython_return_variable; + _lpython_return_variable = std::complex(x) + std::complex(y)*std::complex(0.000000, 1.000000); + return _lpython_return_variable; +} + +std::complex __lpython_overloaded_9__pow(std::complex c, int32_t y) +{ + std::complex _lpython_return_variable; + _lpython_return_variable = std::pow(c, std::complex(y)); + return _lpython_return_variable; +} + +float _lfortran_caimag(std::complex x); + +double _lfortran_zaimag(std::complex x); + +void test_pow() +{ + int32_t a; + double a1; + double a2; + int32_t b; + bool b1; + bool b2; + std::complex c1; + double eps; + float f1; + float f2; + int64_t i; + int64_t i1; + int64_t i2; + int64_t j; + int64_t k; + float p; + int32_t x; + double y; + eps = 9.99999999999999980e-13; + a = 2; + b = 5; + assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 32); + a = 6; + b = 3; + assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 216); + a = 2; + b = 0; + assert ((int32_t)(__lpython_overloaded_0__pow(a, b)) == 1); + a = 2; + b = -1; + a = 6; + b = -4; + i1 = 2; + i2 = 5; + assert ((int64_t)(__lpython_overloaded_1__pow(i1, i2)) == 32); + i1 = 6; + i2 = -3; + f1 = (double)(525346)/(double)(66456); + 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); + b1 = true; + b2 = false; + assert (__lpython_overloaded_8__pow(b1, b2) == 1); + assert (__lpython_overloaded_8__pow(b2, b1) == 0); + assert (__lpython_overloaded_8__pow(b1, b2) == 1); + assert (__lpython_overloaded_8__pow(false, false) == 1); + a1 = 4.50000000000000000e+00; + a2 = 2.29999999999999982e+00; + assert (abs(__lpython_overloaded_3__pow(a1, a2) - 3.17971929089206000e+01) < eps); + assert (abs(__lpython_overloaded_3__pow(a2, a1) - 4.24399889427765871e+01) < eps); + x = 3; + y = 2.29999999999999982e+00; + assert (abs(__lpython_overloaded_6__pow(x, y) - 1.25135025328431819e+01) < eps); + assert (abs(__lpython_overloaded_7__pow(y, x) - 1.21669999999999980e+01) < eps); + assert (abs(__lpython_overloaded_6__pow(x, 5.50000000000000000e+00) - 4.20888346239237194e+02) < eps); + assert (abs(__lpython_overloaded_1__pow(2, -1) - 5.00000000000000000e-01) < eps); + assert (abs(__lpython_overloaded_1__pow(6, -4) - 7.71604938271604895e-04) < eps); + assert (abs(__lpython_overloaded_1__pow(-3, -5) + 4.11522633744856002e-03) < eps); + assert (abs(__lpython_overloaded_1__pow(6, -4) - 7.71604938271604895e-04) < eps); + assert (abs(__lpython_overloaded_3__pow( 4.50000000000000000e+00, 2.29999999999999982e+00) - 3.17971929089206000e+01) < eps); + assert (abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, 0.00000000000000000e+00) - 1.00000000000000000e+00) < eps); + assert (abs(__lpython_overloaded_3__pow( 2.29999999999999982e+00, - 1.50000000000000000e+00) - 2.86687162345994395e-01) < eps); + assert (abs(__lpython_overloaded_6__pow(2, 3.39999999999999991e+00) - 1.05560632861831536e+01) < eps); + assert (abs(__lpython_overloaded_6__pow(2, - 3.39999999999999991e+00) - 9.47322854068998882e-02) < eps); + assert (abs(__lpython_overloaded_7__pow( 3.39999999999999991e+00, 9) - 6.07169927664639836e+04) < eps); + assert (abs(__lpython_overloaded_7__pow( 0.00000000000000000e+00, 53) - 0.00000000000000000e+00) < eps); + assert ((int32_t)(__lpython_overloaded_0__pow(4, 2)) == 16); + assert (abs(__lpython_overloaded_7__pow(- 4.23500000000000000e+03, 52) - 3.94800380598526379e+188) < eps); + i = 7; + j = 2; + k = 5; + assert (__lpython_overloaded_11__pow(i, j, k) == 4); + assert (__lpython_overloaded_10__pow(102, 3, 121) == 38); + c1 = __lpython_overloaded_9__complex(4, 5); + c1 = __lpython_overloaded_9__pow(c1, 4); +} + +void __main__global_stmts() +{ + test_pow(); +} + +namespace { + +void main2() { + __main__global_stmts(); +} + +} +int main(int argc, char* argv[]) +{ + Kokkos::initialize(argc, argv); + main2(); + Kokkos::finalize(); + return 0; +} diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json index e023d7e0eb..c5e89043a1 100644 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.json +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.json @@ -5,9 +5,9 @@ "infile_hash": "f85ca108780c53c54878d119822d56fb834cf4b5121511cbaca2c2fe", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "pass_loop_vectorise-vec_01-be9985e.stderr", - "stderr_hash": "67b435304368f453ffeda263b2c1c1a591ce3e9a4100d21fbf1ec7a5", - "returncode": 2 + "stdout": "pass_loop_vectorise-vec_01-be9985e.stdout", + "stdout_hash": "eaa2378bdc2d4a369ca7cce31084f626594f2e649116e7634df8f034", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout new file mode 100644 index 0000000000..26b99df62d --- /dev/null +++ b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stdout @@ -0,0 +1,527 @@ +(TranslationUnit + (SymbolTable + 1 + { + __main__: + (Module + (SymbolTable + 2 + { + __main__global_stmts: + (Function + (SymbolTable + 207 + { + + }) + __main__global_stmts + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [loop_vec] + [] + [(SubroutineCall + 2 loop_vec + () + [] + () + )] + () + Public + .false. + .false. + () + ), + loop_vec: + (Function + (SymbolTable + 203 + { + a: + (Variable + 203 + a + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + b: + (Variable + 203 + b + [] + Local + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + i: + (Variable + 203 + i + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization: + (Function + (SymbolTable + 209 + { + __1_k: + (Variable + 209 + __1_k + [] + Local + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + arg0: + (Variable + 209 + arg0 + [] + In + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + arg1: + (Variable + 209 + arg1 + [] + In + () + () + Default + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + () + Source + Public + Required + .false. + ), + arg2: + (Variable + 209 + arg2 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + arg3: + (Variable + 209 + arg3 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + arg4: + (Variable + 209 + arg4 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ), + arg5: + (Variable + 209 + arg5 + [] + In + () + () + Default + (Integer 4) + () + Source + Public + Required + .false. + ) + }) + vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization + (FunctionType + [(Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + (Integer 4) + (Integer 4) + (Integer 4) + (Integer 4)] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [] + [(Var 209 arg0) + (Var 209 arg1) + (Var 209 arg2) + (Var 209 arg3) + (Var 209 arg4) + (Var 209 arg5)] + [(= + (Var 209 __1_k) + (IntegerBinOp + (Var 209 arg2) + Sub + (Var 209 arg4) + (Integer 4) + () + ) + () + ) + (WhileLoop + () + (IntegerCompare + (IntegerBinOp + (Var 209 __1_k) + Add + (Var 209 arg4) + (Integer 4) + () + ) + Lt + (Var 209 arg3) + (Logical 4) + () + ) + [(= + (Var 209 __1_k) + (IntegerBinOp + (Var 209 __1_k) + Add + (Var 209 arg4) + (Integer 4) + () + ) + () + ) + (= + (ArrayItem + (Var 209 arg0) + [(() + (Var 209 __1_k) + ())] + (Real 8) + RowMajor + () + ) + (ArrayItem + (Var 209 arg1) + [(() + (Var 209 __1_k) + ())] + (Real 8) + RowMajor + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + loop_vec + (FunctionType + [] + () + Source + Implementation + () + .false. + .false. + .false. + .false. + .false. + [] + .false. + ) + [vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization] + [] + [(= + (Var 203 a) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (= + (Var 203 b) + (ArrayConstant + [] + (Array + (Real 8) + [((IntegerConstant 0 (Integer 4)) + (IntegerConstant 9216 (Integer 4)))] + FixedSizeArray + ) + RowMajor + ) + () + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 9216 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9215 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(= + (ArrayItem + (Var 203 b) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + (RealConstant + 5.000000 + (Real 8) + ) + () + )] + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerConstant 1151 (Integer 4)) + (IntegerConstant 1 (Integer 4))) + [(SubroutineCall + 203 vector_copy_f64[9216]f64[9216]i32@IntrinsicOptimization + () + [((Var 203 a)) + ((Var 203 b)) + ((IntegerBinOp + (Var 203 i) + Mul + (IntegerConstant 8 (Integer 4)) + (Integer 4) + () + )) + ((IntegerBinOp + (IntegerBinOp + (Var 203 i) + Add + (IntegerConstant 1 (Integer 4)) + (Integer 4) + () + ) + Mul + (IntegerConstant 8 (Integer 4)) + (Integer 4) + () + )) + ((IntegerConstant 1 (Integer 4))) + ((IntegerConstant 8 (Integer 4)))] + () + )] + ) + (DoLoop + () + ((Var 203 i) + (IntegerConstant 0 (Integer 4)) + (IntegerBinOp + (IntegerConstant 9216 (Integer 4)) + Sub + (IntegerConstant 1 (Integer 4)) + (Integer 4) + (IntegerConstant 9215 (Integer 4)) + ) + (IntegerConstant 1 (Integer 4))) + [(Assert + (RealCompare + (ArrayItem + (Var 203 a) + [(() + (Var 203 i) + ())] + (Real 8) + RowMajor + () + ) + Eq + (RealConstant + 5.000000 + (Real 8) + ) + (Logical 4) + () + ) + () + )] + )] + () + Public + .false. + .false. + () + ) + }) + __main__ + [numpy] + .false. + .false. + ), + lpython_builtin: + (IntrinsicModule lpython_builtin), + main_program: + (Program + (SymbolTable + 208 + { + __main__global_stmts: + (ExternalSymbol + 208 + __main__global_stmts + 2 __main__global_stmts + __main__ + [] + __main__global_stmts + Public + ) + }) + main_program + [__main__] + [(SubroutineCall + 208 __main__global_stmts + 2 __main__global_stmts + [] + () + )] + ), + numpy: + (Module numpy) + }) + [] +) From 264203917227e7aa1805b9349ecc365a7e1f204c Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 13:00:58 +0530 Subject: [PATCH 07/18] Delete unnecessary test references --- .../reference/asr-array_01_decl-39cf894.stderr | 17 ----------------- .../reference/asr-array_02_decl-e8f6874.stderr | 17 ----------------- tests/reference/asr-bindc_02-bc1a7ea.stderr | 17 ----------------- tests/reference/asr-cast-435c233.stderr | 11 ----------- tests/reference/asr-complex1-f26c460.stderr | 11 ----------- tests/reference/asr-constants1-5828e8a.stderr | 11 ----------- tests/reference/asr-elemental_01-b58df26.stderr | 17 ----------------- tests/reference/asr-expr10-efcbb1b.stderr | 11 ----------- tests/reference/asr-expr13-81bdb5a.stderr | 11 ----------- tests/reference/asr-expr8-6beda60.stderr | 11 ----------- tests/reference/asr-expr_05-3a37324.stderr | 11 ----------- .../asr-generics_array_01-682b1b2.stderr | 17 ----------------- .../asr-generics_array_02-22c8dc1.stderr | 17 ----------------- .../asr-generics_array_03-fb3706c.stderr | 17 ----------------- tests/reference/asr-structs_05-fa98307.stderr | 17 ----------------- .../asr-test_bool_binop-f856ef0.stderr | 11 ----------- .../asr-test_builtin_bin-52ba9fa.stderr | 11 ----------- .../asr-test_builtin_bool-330223a.stderr | 11 ----------- .../asr-test_builtin_hex-64bd268.stderr | 11 ----------- .../asr-test_builtin_oct-20b9066.stderr | 11 ----------- .../asr-test_builtin_round-7417a21.stderr | 11 ----------- .../asr-test_complex_01-a6def58.stderr | 11 ----------- .../asr-test_complex_02-782ba2d.stderr | 11 ----------- tests/reference/asr-test_max_min-3c2fc51.stderr | 11 ----------- .../reference/asr-test_numpy_03-e600a49.stderr | 17 ----------------- .../reference/asr-test_numpy_04-ecbb614.stderr | 17 ----------------- tests/reference/asr-vec_01-66ac423.stderr | 17 ----------------- tests/reference/cpp-expr15-1661c0d.stderr | 11 ----------- tests/reference/cpp-expr8-704cece.stderr | 11 ----------- .../pass_loop_vectorise-vec_01-be9985e.stderr | 17 ----------------- 30 files changed, 402 deletions(-) delete mode 100644 tests/reference/asr-array_01_decl-39cf894.stderr delete mode 100644 tests/reference/asr-array_02_decl-e8f6874.stderr delete mode 100644 tests/reference/asr-bindc_02-bc1a7ea.stderr delete mode 100644 tests/reference/asr-cast-435c233.stderr delete mode 100644 tests/reference/asr-complex1-f26c460.stderr delete mode 100644 tests/reference/asr-constants1-5828e8a.stderr delete mode 100644 tests/reference/asr-elemental_01-b58df26.stderr delete mode 100644 tests/reference/asr-expr10-efcbb1b.stderr delete mode 100644 tests/reference/asr-expr13-81bdb5a.stderr delete mode 100644 tests/reference/asr-expr8-6beda60.stderr delete mode 100644 tests/reference/asr-expr_05-3a37324.stderr delete mode 100644 tests/reference/asr-generics_array_01-682b1b2.stderr delete mode 100644 tests/reference/asr-generics_array_02-22c8dc1.stderr delete mode 100644 tests/reference/asr-generics_array_03-fb3706c.stderr delete mode 100644 tests/reference/asr-structs_05-fa98307.stderr delete mode 100644 tests/reference/asr-test_bool_binop-f856ef0.stderr delete mode 100644 tests/reference/asr-test_builtin_bin-52ba9fa.stderr delete mode 100644 tests/reference/asr-test_builtin_bool-330223a.stderr delete mode 100644 tests/reference/asr-test_builtin_hex-64bd268.stderr delete mode 100644 tests/reference/asr-test_builtin_oct-20b9066.stderr delete mode 100644 tests/reference/asr-test_builtin_round-7417a21.stderr delete mode 100644 tests/reference/asr-test_complex_01-a6def58.stderr delete mode 100644 tests/reference/asr-test_complex_02-782ba2d.stderr delete mode 100644 tests/reference/asr-test_max_min-3c2fc51.stderr delete mode 100644 tests/reference/asr-test_numpy_03-e600a49.stderr delete mode 100644 tests/reference/asr-test_numpy_04-ecbb614.stderr delete mode 100644 tests/reference/asr-vec_01-66ac423.stderr delete mode 100644 tests/reference/cpp-expr15-1661c0d.stderr delete mode 100644 tests/reference/cpp-expr8-704cece.stderr delete mode 100644 tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr diff --git a/tests/reference/asr-array_01_decl-39cf894.stderr b/tests/reference/asr-array_01_decl-39cf894.stderr deleted file mode 100644 index 2ef3142ddf..0000000000 --- a/tests/reference/asr-array_01_decl-39cf894.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/array_01_decl.py:2:1 - | -2 | from numpy import empty, int16, int32, int64, float32, float64, complex64, complex128 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-array_02_decl-e8f6874.stderr b/tests/reference/asr-array_02_decl-e8f6874.stderr deleted file mode 100644 index 143230f959..0000000000 --- a/tests/reference/asr-array_02_decl-e8f6874.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/array_02_decl.py:2:1 - | -2 | from numpy import empty, int32, int64, float32, float64, complex64, complex128 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-bindc_02-bc1a7ea.stderr b/tests/reference/asr-bindc_02-bc1a7ea.stderr deleted file mode 100644 index 0366febb6a..0000000000 --- a/tests/reference/asr-bindc_02-bc1a7ea.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/bindc_02.py:2:1 - | -2 | from numpy import empty, int16, array - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-cast-435c233.stderr b/tests/reference/asr-cast-435c233.stderr deleted file mode 100644 index 74531e3791..0000000000 --- a/tests/reference/asr-cast-435c233.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/cast.py:5:9 - | -5 | x = list(s) - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-complex1-f26c460.stderr b/tests/reference/asr-complex1-f26c460.stderr deleted file mode 100644 index b6f4d1d8f0..0000000000 --- a/tests/reference/asr-complex1-f26c460.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/complex1.py:11:13 - | -11 | c = c32(complex()) - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-constants1-5828e8a.stderr b/tests/reference/asr-constants1-5828e8a.stderr deleted file mode 100644 index d831d31282..0000000000 --- a/tests/reference/asr-constants1-5828e8a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/constants1.py:5:9 - | -5 | b = bin(5) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-elemental_01-b58df26.stderr b/tests/reference/asr-elemental_01-b58df26.stderr deleted file mode 100644 index 464e01fed8..0000000000 --- a/tests/reference/asr-elemental_01-b58df26.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/elemental_01.py:2:1 - | -2 | from numpy import empty, sin, cos, reshape, int32, float32, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr10-efcbb1b.stderr b/tests/reference/asr-expr10-efcbb1b.stderr deleted file mode 100644 index e35c34b037..0000000000 --- a/tests/reference/asr-expr10-efcbb1b.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr10.py:28:14 - | -28 | c = +c32(complex(1, 2)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr13-81bdb5a.stderr b/tests/reference/asr-expr13-81bdb5a.stderr deleted file mode 100644 index d05293f0a0..0000000000 --- a/tests/reference/asr-expr13-81bdb5a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr13.py:9:9 - | -9 | a = complex(3, 4) == complex(3., 4.) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr8-6beda60.stderr b/tests/reference/asr-expr8-6beda60.stderr deleted file mode 100644 index 6e9d8d0f32..0000000000 --- a/tests/reference/asr-expr8-6beda60.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr8.py:22:13 - | -22 | x = i32(b1//b1) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-expr_05-3a37324.stderr b/tests/reference/asr-expr_05-3a37324.stderr deleted file mode 100644 index a8b017fcee..0000000000 --- a/tests/reference/asr-expr_05-3a37324.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/expr_05.py:7:12 - | -7 | return a%b - | ^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_01-682b1b2.stderr b/tests/reference/asr-generics_array_01-682b1b2.stderr deleted file mode 100644 index 91024d158c..0000000000 --- a/tests/reference/asr-generics_array_01-682b1b2.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_01.py:2:1 - | -2 | from numpy import empty, int32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_02-22c8dc1.stderr b/tests/reference/asr-generics_array_02-22c8dc1.stderr deleted file mode 100644 index 252a42ae21..0000000000 --- a/tests/reference/asr-generics_array_02-22c8dc1.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_02.py:2:1 - | -2 | from numpy import empty, int32, float32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-generics_array_03-fb3706c.stderr b/tests/reference/asr-generics_array_03-fb3706c.stderr deleted file mode 100644 index 873e342ad1..0000000000 --- a/tests/reference/asr-generics_array_03-fb3706c.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/generics_array_03.py:2:1 - | -2 | from numpy import empty, int32, float32 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-structs_05-fa98307.stderr b/tests/reference/asr-structs_05-fa98307.stderr deleted file mode 100644 index ffff18de12..0000000000 --- a/tests/reference/asr-structs_05-fa98307.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/structs_05.py:2:1 - | -2 | from numpy import empty - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_bool_binop-f856ef0.stderr b/tests/reference/asr-test_bool_binop-f856ef0.stderr deleted file mode 100644 index 725d3bd642..0000000000 --- a/tests/reference/asr-test_bool_binop-f856ef0.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_bool_binop.py:14:13 - | -14 | i = i32(True // True) - | ^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr b/tests/reference/asr-test_builtin_bin-52ba9fa.stderr deleted file mode 100644 index 06b339838a..0000000000 --- a/tests/reference/asr-test_builtin_bin-52ba9fa.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_bin.py:6:12 - | -6 | assert bin(i) == "0b101" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_bool-330223a.stderr b/tests/reference/asr-test_builtin_bool-330223a.stderr deleted file mode 100644 index 6061f4823c..0000000000 --- a/tests/reference/asr-test_builtin_bool-330223a.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_bool.py:56:13 - | -56 | c = c32(complex(2, 3)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_hex-64bd268.stderr b/tests/reference/asr-test_builtin_hex-64bd268.stderr deleted file mode 100644 index 40dc59a4e9..0000000000 --- a/tests/reference/asr-test_builtin_hex-64bd268.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_hex.py:6:12 - | -6 | assert hex(i) == "0x22" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_oct-20b9066.stderr b/tests/reference/asr-test_builtin_oct-20b9066.stderr deleted file mode 100644 index 8bde6da6dc..0000000000 --- a/tests/reference/asr-test_builtin_oct-20b9066.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_oct.py:6:12 - | -6 | assert oct(i) == "0o42" - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_builtin_round-7417a21.stderr b/tests/reference/asr-test_builtin_round-7417a21.stderr deleted file mode 100644 index 570365512c..0000000000 --- a/tests/reference/asr-test_builtin_round-7417a21.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_builtin_round.py:6:12 - | -6 | assert round(f) == 6 - | ^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_01-a6def58.stderr b/tests/reference/asr-test_complex_01-a6def58.stderr deleted file mode 100644 index f87f59ca76..0000000000 --- a/tests/reference/asr-test_complex_01-a6def58.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_complex_01.py:17:9 - | -17 | x = complex(4.5, 6.7) - | ^^^^^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_complex_02-782ba2d.stderr b/tests/reference/asr-test_complex_02-782ba2d.stderr deleted file mode 100644 index b61ce381bd..0000000000 --- a/tests/reference/asr-test_complex_02-782ba2d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_complex_02.py:5:13 - | -5 | x = c32(complex(3, 4)) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_max_min-3c2fc51.stderr b/tests/reference/asr-test_max_min-3c2fc51.stderr deleted file mode 100644 index 15c4a4ff5a..0000000000 --- a/tests/reference/asr-test_max_min-3c2fc51.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/../integration_tests/test_max_min.py:7:12 - | -7 | assert max(a, b) == b - | ^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_03-e600a49.stderr b/tests/reference/asr-test_numpy_03-e600a49.stderr deleted file mode 100644 index 74f788b4cf..0000000000 --- a/tests/reference/asr-test_numpy_03-e600a49.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/test_numpy_03.py:2:1 - | -2 | from numpy import reshape, empty, int32, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-test_numpy_04-ecbb614.stderr b/tests/reference/asr-test_numpy_04-ecbb614.stderr deleted file mode 100644 index 7bc395d1fc..0000000000 --- a/tests/reference/asr-test_numpy_04-ecbb614.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/test_numpy_04.py:2:1 - | -2 | from numpy import array - | ^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/asr-vec_01-66ac423.stderr b/tests/reference/asr-vec_01-66ac423.stderr deleted file mode 100644 index 0371022cc6..0000000000 --- a/tests/reference/asr-vec_01-66ac423.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/vec_01.py:2:1 - | -2 | from numpy import empty, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-expr15-1661c0d.stderr b/tests/reference/cpp-expr15-1661c0d.stderr deleted file mode 100644 index 9b4deb20d2..0000000000 --- a/tests/reference/cpp-expr15-1661c0d.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr15.py:11:9 - | -11 | x = complex(2, 2) - | ^^^^^^^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/cpp-expr8-704cece.stderr b/tests/reference/cpp-expr8-704cece.stderr deleted file mode 100644 index 6e9d8d0f32..0000000000 --- a/tests/reference/cpp-expr8-704cece.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> tests/expr8.py:22:13 - | -22 | x = i32(b1//b1) - | ^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ diff --git a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr b/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr deleted file mode 100644 index 0371022cc6..0000000000 --- a/tests/reference/pass_loop_vectorise-vec_01-be9985e.stderr +++ /dev/null @@ -1,17 +0,0 @@ -warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded - --> tests/../integration_tests/vec_01.py:2:1 - | -2 | from numpy import empty, float64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here - -warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded - --> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12 - | -364 | return x1 % x2 - | ^^^^^^^ imported here - -semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin' - --> $DIR/src/bin/../runtime/lpython_builtin.py:209:15 - | -209 | if (n_ - (n_ // 2)*2) == 0: - | ^^^^^^^ From 273844cd5178dd87ff41c81511dc4f1c35455491 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 13:07:55 +0530 Subject: [PATCH 08/18] Resolve symbolic error --- integration_tests/test_str_attributes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/test_str_attributes.py b/integration_tests/test_str_attributes.py index 24e1886dba..ffbb15f17a 100755 --- a/integration_tests/test_str_attributes.py +++ b/integration_tests/test_str_attributes.py @@ -284,7 +284,7 @@ def isspace(): s:str = " " assert s.isspace() == True - s: str = "a" + s = "a" assert s.isspace() == False def check(): From c4af949a8214c061df9b003d35b3667e67c150b5 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 13:40:43 +0530 Subject: [PATCH 09/18] Fix CI --- integration_tests/test_str_attributes.py | 4 ++-- src/runtime/lpython_builtin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration_tests/test_str_attributes.py b/integration_tests/test_str_attributes.py index ffbb15f17a..2124e38026 100755 --- a/integration_tests/test_str_attributes.py +++ b/integration_tests/test_str_attributes.py @@ -277,7 +277,7 @@ def is_ascii(): assert s.isascii() == True -def isspace(): +def is_space(): assert "\n".isspace() == True assert " ".isspace() == True assert "\r".isspace() == True @@ -301,6 +301,6 @@ def check(): is_upper() is_decimal() is_ascii() - isspace() + is_space() check() diff --git a/src/runtime/lpython_builtin.py b/src/runtime/lpython_builtin.py index 4d3101cd28..d48efeb7f9 100644 --- a/src/runtime/lpython_builtin.py +++ b/src/runtime/lpython_builtin.py @@ -862,7 +862,7 @@ def _lpython_str_isascii(s: str) -> bool: def _lpython_str_isspace(s:str) -> bool: ch:str for ch in s: - if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\v': + if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\x0B': return False return True From c576fa40890f5b6ea690f210067899a130692844 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 14:00:16 +0530 Subject: [PATCH 10/18] Add a new escape sequence --- src/libasr/string_utils.cpp | 1 + src/runtime/lpython_builtin.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libasr/string_utils.cpp b/src/libasr/string_utils.cpp index 073167d161..55e5a6b2a3 100644 --- a/src/libasr/string_utils.cpp +++ b/src/libasr/string_utils.cpp @@ -142,6 +142,7 @@ std::string str_escape_c(const std::string &s) { case '\n': o << "\\n"; break; case '\r': o << "\\r"; break; case '\t': o << "\\t"; break; + case '\v': o << "\\v"; break; default: if ('\x00' <= *c && *c <= '\x1f') { o << "\\u" diff --git a/src/runtime/lpython_builtin.py b/src/runtime/lpython_builtin.py index d48efeb7f9..4d3101cd28 100644 --- a/src/runtime/lpython_builtin.py +++ b/src/runtime/lpython_builtin.py @@ -862,7 +862,7 @@ def _lpython_str_isascii(s: str) -> bool: def _lpython_str_isspace(s:str) -> bool: ch:str for ch in s: - if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\x0B': + if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\v': return False return True From a9ac4aff5feaceaef50bbbee73f9582982c20f42 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 14:10:39 +0530 Subject: [PATCH 11/18] Update src/runtime/lpython_builtin.py Co-authored-by: Shaikh Ubaid --- src/runtime/lpython_builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/lpython_builtin.py b/src/runtime/lpython_builtin.py index 4d3101cd28..e35c1a29fb 100644 --- a/src/runtime/lpython_builtin.py +++ b/src/runtime/lpython_builtin.py @@ -860,7 +860,7 @@ def _lpython_str_isascii(s: str) -> bool: @overload def _lpython_str_isspace(s:str) -> bool: - ch:str + ch: str for ch in s: if ch != ' ' and ch != '\t' and ch != '\n' and ch != '\r' and ch != '\f' and ch != '\v': return False From 24ec97641ed412aa32529190f26f47337dc71164 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 17:32:07 +0530 Subject: [PATCH 12/18] Update src/lpython/semantics/python_ast_to_asr.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/lpython/semantics/python_ast_to_asr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index e33f31682d..6c55db5392 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -6651,7 +6651,7 @@ class BodyVisitor : public CommonVisitor { /* String Validation Methods i.e all "is" based functions are handled here */ - std::vector validation_methods{"lower", "upper", "decimal", "ascii","space"}; // Database of validation methods supported + std::vector validation_methods{"lower", "upper", "decimal", "ascii", "space"}; // Database of validation methods supported std::string method_name = attr_name.substr(2); if(std::find(validation_methods.begin(),validation_methods.end(), method_name) == validation_methods.end()) { From 96c069dbcd238e20746087fac16afb26a48e0e70 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 17:32:15 +0530 Subject: [PATCH 13/18] Update src/lpython/semantics/python_ast_to_asr.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/lpython/semantics/python_ast_to_asr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 6c55db5392..95bfc65275 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -6919,7 +6919,7 @@ class BodyVisitor : public CommonVisitor { * islower() method is limited to English Alphabets currently * TODO: We can support other characters from Unicode Library */ - std::vector validation_methods{"lower", "upper", "decimal", "ascii","space"}; // Database of validation methods supported + std::vector validation_methods{"lower", "upper", "decimal", "ascii", "space"}; // Database of validation methods supported std::string method_name = attr_name.substr(2); if(std::find(validation_methods.begin(),validation_methods.end(), method_name) == validation_methods.end()) { throw SemanticError("String method not implemented: " + attr_name, loc); From 8fa3b8daf2f5867ad8da74f8f2256f3286812b68 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 17:33:56 +0530 Subject: [PATCH 14/18] Update src/lpython/semantics/python_ast_to_asr.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/lpython/semantics/python_ast_to_asr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 95bfc65275..7ee3b7111b 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -7003,7 +7003,7 @@ class BodyVisitor : public CommonVisitor { /* * Specification: Return true if all characters in the input string are considered whitespace characters, - as defined by the std::isspace function. Return false otherwise. + as defined by CPython. Return false otherwise. For now we use the std::isspace function, but if we later discover that it differs from CPython, we will have to use something else. */ bool is_space = true; for (char i : s_var) { From ceafe993bdca840d2f03f93e58f2809a5e08eeff Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 18:24:28 +0530 Subject: [PATCH 15/18] Update src/lpython/semantics/python_ast_to_asr.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/lpython/semantics/python_ast_to_asr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 7ee3b7111b..79b225c341 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -6999,7 +6999,7 @@ class BodyVisitor : public CommonVisitor { tmp = ASR::make_LogicalConstant_t(al, loc, is_ascii, ASRUtils::TYPE(ASR::make_Logical_t(al, loc, 4))); return; - } else if(attr_name == "isspace") { + } else if (attr_name == "isspace") { /* * Specification: Return true if all characters in the input string are considered whitespace characters, From ce6917e9d849125207e2da30e4faef0102e73c25 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 18:24:34 +0530 Subject: [PATCH 16/18] Update src/runtime/lpython_builtin.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Čertík --- src/runtime/lpython_builtin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/runtime/lpython_builtin.py b/src/runtime/lpython_builtin.py index e35c1a29fb..15b1e19842 100644 --- a/src/runtime/lpython_builtin.py +++ b/src/runtime/lpython_builtin.py @@ -858,7 +858,6 @@ def _lpython_str_isascii(s: str) -> bool: return False return True -@overload def _lpython_str_isspace(s:str) -> bool: ch: str for ch in s: From c7fcfce5573233370bfcce8a3ce73afdb7314f90 Mon Sep 17 00:00:00 2001 From: Prince Roshan Date: Sun, 8 Oct 2023 18:27:17 +0530 Subject: [PATCH 17/18] Fix comment --- src/lpython/semantics/python_ast_to_asr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 79b225c341..d35eea3b68 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -7003,7 +7003,8 @@ class BodyVisitor : public CommonVisitor { /* * Specification: Return true if all characters in the input string are considered whitespace characters, - as defined by CPython. Return false otherwise. For now we use the std::isspace function, but if we later discover that it differs from CPython, we will have to use something else. + as defined by CPython. Return false otherwise. For now we use the std::isspace function, + but if we later discover that it differs from CPython, we will have to use something else. */ bool is_space = true; for (char i : s_var) { From 58f8dc74de29cfc93befaae488a6003b8ef9980b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Sun, 8 Oct 2023 15:00:39 +0200 Subject: [PATCH 18/18] Update src/lpython/semantics/python_ast_to_asr.cpp --- src/lpython/semantics/python_ast_to_asr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index d35eea3b68..0029536c57 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -7002,9 +7002,10 @@ class BodyVisitor : public CommonVisitor { } else if (attr_name == "isspace") { /* * Specification: - Return true if all characters in the input string are considered whitespace characters, - as defined by CPython. Return false otherwise. For now we use the std::isspace function, - but if we later discover that it differs from CPython, we will have to use something else. +Return true if all characters in the input string are considered whitespace +characters, as defined by CPython. Return false otherwise. For now we use the +std::isspace function, but if we later discover that it differs from CPython, +we will have to use something else. */ bool is_space = true; for (char i : s_var) {