From 7990b229064548dae121242e6fbad41b7d766113 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Fri, 26 Aug 2022 10:52:10 +0530 Subject: [PATCH 01/46] Add AttrParameter --- src/lfortran/semantics/ast_common_visitor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index bf9aaba11d..a69d3873ca 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -889,7 +889,8 @@ class CommonVisitor : public AST::BaseVisitor { ::AttrPrivate) { assgnd_access[sym] = ASR::accessType::Private; } else if (sa->m_attr == AST::simple_attributeType - ::AttrPublic) { + ::AttrPublic || sa->m_attr == AST::simple_attributeType + ::AttrParameter) { assgnd_access[sym] = ASR::accessType::Public; } else if (sa->m_attr == AST::simple_attributeType ::AttrOptional) { From aab24119fc346d42760d9b087dfc87bff0a3d477 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Fri, 26 Aug 2022 11:17:43 +0530 Subject: [PATCH 02/46] Add 3 args max intrinsic --- src/runtime/pure/lfortran_intrinsic_math2.f90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runtime/pure/lfortran_intrinsic_math2.f90 b/src/runtime/pure/lfortran_intrinsic_math2.f90 index 143f763bb8..2da11566f6 100644 --- a/src/runtime/pure/lfortran_intrinsic_math2.f90 +++ b/src/runtime/pure/lfortran_intrinsic_math2.f90 @@ -41,7 +41,7 @@ module lfortran_intrinsic_math2 end interface interface max - module procedure imax, imax8, imax16, imax64, smax, dmax, imax_6args + module procedure imax, imax8, imax16, imax64, smax, dmax, imax_6args, dmax_3args end interface interface huge @@ -423,6 +423,12 @@ elemental real(dp) function dmax(x, y) result(r) end if end function +elemental real(dp) function dmax_3args(x, y, z) result(r) +real(dp), intent(in) :: x, y, z +r = dmax(x, y) +r = dmax(r, z) +end function + ! huge ------------------------------------------------------------------------- elemental integer(i32) function i32huge(x) result(r) From 6fb9d24820383f6431cc6899ccc2e1deeaa40e65 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Fri, 26 Aug 2022 11:21:57 +0530 Subject: [PATCH 03/46] Add and update tests --- tests/parameter1.f90 | 5 +++++ tests/reference/asr-flip_sign-a0cebd4.json | 2 +- tests/reference/asr-flip_sign-a0cebd4.stdout | 2 +- tests/reference/asr-intrinsics_31-9b91cfb.json | 2 +- tests/reference/asr-intrinsics_31-9b91cfb.stdout | 2 +- tests/reference/asr-parameter1-1a7ed3b.json | 13 +++++++++++++ tests/reference/asr-parameter1-1a7ed3b.stdout | 1 + tests/reference/asr-string_19-d880475.json | 2 +- tests/reference/asr-string_19-d880475.stdout | 2 +- .../reference/pass_flip_sign-flip_sign-16b288c.json | 2 +- .../pass_flip_sign-flip_sign-16b288c.stdout | 2 +- tests/tests.toml | 4 ++++ 12 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 tests/parameter1.f90 create mode 100644 tests/reference/asr-parameter1-1a7ed3b.json create mode 100644 tests/reference/asr-parameter1-1a7ed3b.stdout diff --git a/tests/parameter1.f90 b/tests/parameter1.f90 new file mode 100644 index 0000000000..f4ea22ef7f --- /dev/null +++ b/tests/parameter1.f90 @@ -0,0 +1,5 @@ +subroutine dcstep() +double precision zero, p66, two, three, s +parameter (zero=0.0d0,p66=0.66d0,two=2.0d0,three=3.0d0) +s = max(abs(three),abs(two),abs(p66)) +end diff --git a/tests/reference/asr-flip_sign-a0cebd4.json b/tests/reference/asr-flip_sign-a0cebd4.json index aeb771015c..90dc72ebbf 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.json +++ b/tests/reference/asr-flip_sign-a0cebd4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", - "stdout_hash": "f8ca1516a812d4c01d0e729e4b8fce0f69f5dccee8556c0809bae861", + "stdout_hash": "a0b66e571f67dee7b9a63ed9288c4327988250b7260c8ea8c27b007c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-flip_sign-a0cebd4.stdout b/tests/reference/asr-flip_sign-a0cebd4.stdout index 6fcb32449d..3bb1efc86f 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.stdout +++ b/tests/reference/asr-flip_sign-a0cebd4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.json b/tests/reference/asr-intrinsics_31-9b91cfb.json index 2db269b1f2..ef6ca8149c 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.json +++ b/tests/reference/asr-intrinsics_31-9b91cfb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", - "stdout_hash": "20a21c3f7a8c26825076125708516dc19dd5fd4659622228fab8956c", + "stdout_hash": "50fc18dce3d8d5cc827e72f3386c50089203fafc38470c5a1c932be5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.stdout b/tests/reference/asr-intrinsics_31-9b91cfb.stdout index 9ccd02ab8a..6514655f12 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.stdout +++ b/tests/reference/asr-intrinsics_31-9b91cfb.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 101 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 101 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 102 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 102 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-parameter1-1a7ed3b.json b/tests/reference/asr-parameter1-1a7ed3b.json new file mode 100644 index 0000000000..5f0b3c0944 --- /dev/null +++ b/tests/reference/asr-parameter1-1a7ed3b.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-parameter1-1a7ed3b", + "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/parameter1.f90", + "infile_hash": "89e627eefd928ded810c79f57685b062a029d924767fffd996a7552d", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-parameter1-1a7ed3b.stdout", + "stdout_hash": "18efd897c692fdf983befd474fe054f4c3818fc5bdbfc5d4ec2e8910", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-parameter1-1a7ed3b.stdout b/tests/reference/asr-parameter1-1a7ed3b.stdout new file mode 100644 index 0000000000..e9ec84e0c6 --- /dev/null +++ b/tests/reference/asr-parameter1-1a7ed3b.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {dcstep: (Function (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 2 abs@dabs 93 dabs lfortran_intrinsic_math [] dabs Private), max: (ExternalSymbol 2 max 4 max lfortran_intrinsic_math2 [] max Private), max@dmax_3args: (ExternalSymbol 2 max@dmax_3args 4 dmax_3args lfortran_intrinsic_math2 [] dmax_3args Private), p66: (Variable 2 p66 Local () () Default (Real 8 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Real 8 []) Source Public Required .false.), three: (Variable 2 three Local () () Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 8 []) Source Public Required .false.)}) dcstep [] [] [(= (Var 2 s) (FunctionCall 2 max@dmax_3args 2 max [((FunctionCall 2 abs@dabs 2 abs [((Var 2 three))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 two))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 p66))] (Real 8 []) () ()))] (Real 8 []) () ()) ())] () Source Public Implementation () .false. .false. .false.), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-string_19-d880475.json b/tests/reference/asr-string_19-d880475.json index 32b825a8b0..47dd2adb6f 100644 --- a/tests/reference/asr-string_19-d880475.json +++ b/tests/reference/asr-string_19-d880475.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-string_19-d880475.stdout", - "stdout_hash": "9acee2b3d8d9e22546ebc5c64faefbdf61d2a196af24ef1a30f597e1", + "stdout_hash": "c7f6e21d5e652af26c9c4420e0dd237f45f298f2b1a9337a79051594", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-string_19-d880475.stdout b/tests/reference/asr-string_19-d880475.stdout index acbd78a0a6..7c90d3f140 100644 --- a/tests/reference/asr-string_19-d880475.stdout +++ b/tests/reference/asr-string_19-d880475.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 102 {char: (ExternalSymbol 102 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 102 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 102 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 102 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 102 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 102 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 102 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 102 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 102 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 102 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 102 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 102 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 102 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) +(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 103 {char: (ExternalSymbol 103 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 103 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 103 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 103 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 103 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 103 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 103 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 103 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 103 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 103 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 103 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 103 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 103 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.json b/tests/reference/pass_flip_sign-flip_sign-16b288c.json index 93489195b6..7eaca1b99d 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.json +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", - "stdout_hash": "ad289a3ead2f6cdaccfc48a3ded97fe1290da3f6fcb47ccf09e8e996", + "stdout_hash": "99b90c87896b22a5a39d5ee044862fab1d50ef7f75115e47e98319a0", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout index c03ac15ed9..3cd6e69156 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 288 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 288 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 289 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 289 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) diff --git a/tests/tests.toml b/tests/tests.toml index 5408514bae..4848df9678 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2248,3 +2248,7 @@ asr = true filename = "sole_intrinsic.f" ast = true asr = true + +[[test]] +filename = "parameter1.f90" +asr = true From b87ecf984a23c319e82ebbe9e75c3ea8d4b600e1 Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Fri, 26 Aug 2022 12:53:58 +0200 Subject: [PATCH 04/46] initial commit --- src/lfortran/parser/fixedform_tokenizer.cpp | 8 +++++--- tests/fixed_form_simple_continue.f | 3 +++ .../asr-fixed_form_simple_continue-1cd55c6.json | 13 +++++++++++++ .../asr-fixed_form_simple_continue-1cd55c6.stdout | 1 + .../ast-fixed_form_simple_continue-dbefb27.json | 13 +++++++++++++ .../ast-fixed_form_simple_continue-dbefb27.stdout | 1 + tests/tests.toml | 5 +++++ 7 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 tests/fixed_form_simple_continue.f create mode 100644 tests/reference/asr-fixed_form_simple_continue-1cd55c6.json create mode 100644 tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout create mode 100644 tests/reference/ast-fixed_form_simple_continue-dbefb27.json create mode 100644 tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index be78fb4b89..e27f29a436 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -709,9 +709,11 @@ struct FixedFormRecursiveDescent { return true; } - /* - * explicitly DO NOT tokenize `CONTINUE` - */ + // careful addition -- `IF` and `DO` terminals are `CONTINUE`, too + if (next_is(cur, "continue")) { + tokenize_line("continue", cur); + return true; + } if (next_is(cur, "call") && !contains(cur, nline, '=')) { tokenize_line("call", cur); diff --git a/tests/fixed_form_simple_continue.f b/tests/fixed_form_simple_continue.f new file mode 100644 index 0000000000..b71bed51c7 --- /dev/null +++ b/tests/fixed_form_simple_continue.f @@ -0,0 +1,3 @@ + continue + end + diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json new file mode 100644 index 0000000000..8adaae9203 --- /dev/null +++ b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_simple_continue-1cd55c6", + "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_simple_continue.f", + "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-fixed_form_simple_continue-1cd55c6.stdout", + "stdout_hash": "3053ee09aedbc26b3d2babb181ee5dca87e77a41116f20293d534f58", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout new file mode 100644 index 0000000000..dc53d54847 --- /dev/null +++ b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {implicit_program_lfortran: (Program (SymbolTable 2 {}) implicit_program_lfortran [] [])}) []) diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.json b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json new file mode 100644 index 0000000000..43656bdb00 --- /dev/null +++ b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-fixed_form_simple_continue-dbefb27", + "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_simple_continue.f", + "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-fixed_form_simple_continue-dbefb27.stdout", + "stdout_hash": "e2814c25031e04c92830dd6c895f58f1f8265e596da5431b528063d4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout b/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout new file mode 100644 index 0000000000..8b9a5ed3a0 --- /dev/null +++ b/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Continue 0 ())] [])]) diff --git a/tests/tests.toml b/tests/tests.toml index 5408514bae..7430cb2cf2 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2248,3 +2248,8 @@ asr = true filename = "sole_intrinsic.f" ast = true asr = true + +[[test]] +filename = "fixed_form_simple_continue.f" +ast = true +asr = true From 8d6646a295fdeb018d9bdbbad6b1318754be3b1b Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Fri, 26 Aug 2022 13:05:25 +0200 Subject: [PATCH 05/46] add novel test --- src/lfortran/parser/fixedform_tokenizer.cpp | 5 +++++ tests/continue_body_if_loop.f | 11 +++++++++++ .../asr-continue_body_if_loop-670a23a.json | 13 +++++++++++++ .../asr-continue_body_if_loop-670a23a.stdout | 1 + .../ast-continue_body_if_loop-406ed85.json | 13 +++++++++++++ .../ast-continue_body_if_loop-406ed85.stdout | 1 + tests/tests.toml | 5 +++++ 7 files changed, 49 insertions(+) create mode 100644 tests/continue_body_if_loop.f create mode 100644 tests/reference/asr-continue_body_if_loop-670a23a.json create mode 100644 tests/reference/asr-continue_body_if_loop-670a23a.stdout create mode 100644 tests/reference/ast-continue_body_if_loop-406ed85.json create mode 100644 tests/reference/ast-continue_body_if_loop-406ed85.stdout diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index fc00b35476..f04dc352a0 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -750,6 +750,11 @@ struct FixedFormRecursiveDescent { return true; } + if (next_is(cur, "stop")) { + tokenize_line("stop", cur); + return true; + } + return false; } diff --git a/tests/continue_body_if_loop.f b/tests/continue_body_if_loop.f new file mode 100644 index 0000000000..8d60461a4f --- /dev/null +++ b/tests/continue_body_if_loop.f @@ -0,0 +1,11 @@ + REAL U, S + DIMENSION U(100) + S = 0.0 + INTEGER J + DO 1 J = 1, 100 + S = S + U(J) + IF ( S .GE. 1000000 ) GO TO 2 +1 CONTINUE + STOP +2 CONTINUE + END diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.json b/tests/reference/asr-continue_body_if_loop-670a23a.json new file mode 100644 index 0000000000..6306a456fa --- /dev/null +++ b/tests/reference/asr-continue_body_if_loop-670a23a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-continue_body_if_loop-670a23a", + "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/continue_body_if_loop.f", + "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-continue_body_if_loop-670a23a.stdout", + "stdout_hash": "7c427401f472a1acfa09468084f80f708554b38d8fcf1f528d0d922d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.stdout b/tests/reference/asr-continue_body_if_loop-670a23a.stdout new file mode 100644 index 0000000000..fcda9a8172 --- /dev/null +++ b/tests/reference/asr-continue_body_if_loop-670a23a.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {implicit_program_lfortran: (Program (SymbolTable 2 {j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Real 4 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 100 (Integer 4 [])))]) Source Public Required .false.)}) implicit_program_lfortran [] [(= (Var 2 s) (RealConstant 0.000000 (Real 4 [])) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 100 (Integer 4 [])) ()) [(= (Var 2 s) (RealBinOp (Var 2 s) Add (ArrayItem (Var 2 u) [(() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) ()) (If (RealCompare (Var 2 s) GtE (Cast (IntegerConstant 1000000 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1000000.000000 (Real 4 []))) (Logical 4 []) ()) [(GoTo 2)] []) (GoToTarget 1)]) (Stop ()) (GoToTarget 2)])}) []) diff --git a/tests/reference/ast-continue_body_if_loop-406ed85.json b/tests/reference/ast-continue_body_if_loop-406ed85.json new file mode 100644 index 0000000000..f62cace533 --- /dev/null +++ b/tests/reference/ast-continue_body_if_loop-406ed85.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-continue_body_if_loop-406ed85", + "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/continue_body_if_loop.f", + "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-continue_body_if_loop-406ed85.stdout", + "stdout_hash": "76e0f5349eb4e503719ddc923727a2949088c3fe3f8218ae79baa266", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-continue_body_if_loop-406ed85.stdout b/tests/reference/ast-continue_body_if_loop-406ed85.stdout new file mode 100644 index 0000000000..7e4e94ec28 --- /dev/null +++ b/tests/reference/ast-continue_body_if_loop-406ed85.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program implicit_program_lfortran () [] [] [(Declaration (AttrType TypeReal [] () None) [] [(u [] [] () None ()) (s [] [] () None ())] ()) (Declaration () [(AttrDimension [])] [(u [(1 100 DimensionExpr)] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(j [] [] () None ())] ())] [(= 0 s (Real "0.0") ()) (DoLoop 0 () 1 j 1 100 () [(= 0 s (+ s (FuncCallOrArray u [] [(() j ())] [] [])) ()) (If 0 () (>= s 1000000) [(GoTo 0 () 2 [] ())] [] () () ()) (Continue 1 ())] () ()) (Stop 0 () () ()) (Continue 2 ())] [])]) diff --git a/tests/tests.toml b/tests/tests.toml index 17ccc720ec..fefdd36550 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2263,3 +2263,8 @@ asr = true filename = "loop_test2.f" ast = true asr = true + +[[test]] +filename = "continue_body_if_loop.f" +ast = true +asr = true From f07bc66f885d4bc365be140b23a2b62f7e205d85 Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Sun, 28 Aug 2022 10:06:36 +0200 Subject: [PATCH 06/46] Enable goto select (#682) --- src/lfortran/parser/fixedform_tokenizer.cpp | 10 ++++- src/lfortran/semantics/ast_body_visitor.cpp | 42 ++++++++++++++++++- tests/fixed_form_goto_select.f | 12 ++++++ .../asr-fixed_form_goto_select-a0c3483.json | 13 ++++++ .../asr-fixed_form_goto_select-a0c3483.stdout | 1 + .../ast-fixed_form_goto_select-6cc9882.json | 13 ++++++ .../ast-fixed_form_goto_select-6cc9882.stdout | 1 + 7 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 tests/fixed_form_goto_select.f create mode 100644 tests/reference/asr-fixed_form_goto_select-a0c3483.json create mode 100644 tests/reference/asr-fixed_form_goto_select-a0c3483.stdout create mode 100644 tests/reference/ast-fixed_form_goto_select-6cc9882.json create mode 100644 tests/reference/ast-fixed_form_goto_select-6cc9882.stdout diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index be78fb4b89..11847bf3b7 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -704,11 +704,19 @@ struct FixedFormRecursiveDescent { return true; } - if (next_is(cur, "goto")) { + // `GOTO (X,Z,Y) M` translates to (roughly) + // `IF (M .EQ. 1) THEN; GOTO X; ELSE IF (M .EQ. 2) GOTO Z; IF (M .EQ. 3) GOTO Y; ENDIF` + if (next_is(cur, "goto(")) { + // lex_goto_select(cur); tokenize_line("", cur); return true; } + if (next_is(cur, "goto")) { + tokenize_line("goto", cur); + return true; + } + /* * explicitly DO NOT tokenize `CONTINUE` */ diff --git a/src/lfortran/semantics/ast_body_visitor.cpp b/src/lfortran/semantics/ast_body_visitor.cpp index a2f4bcc008..d1f5cbde67 100644 --- a/src/lfortran/semantics/ast_body_visitor.cpp +++ b/src/lfortran/semantics/ast_body_visitor.cpp @@ -1557,7 +1557,47 @@ class BodyVisitor : public CommonVisitor { if (AST::is_a(*x.m_goto_label)) { int goto_label = AST::down_cast(x.m_goto_label)->m_n; tmp = ASR::make_GoTo_t(al, x.base.base.loc, goto_label); - } else { + + } else if (AST::is_a(*x.m_goto_label)) { + auto name = AST::down_cast(x.m_goto_label); + auto sym_name = std::string(name->m_id); + auto sym = current_scope->resolve_symbol(sym_name); + if (sym == nullptr) { + throw SemanticError("Cannot do `GOTO select` for undeclared variable", + x.base.base.loc); + } + if (!ASR::is_a(*sym)) { + throw SemanticError("Symbol needs to be a variable", + x.base.base.loc); + } + // n_labels GOTO + Vec a_body_vec; + a_body_vec.reserve(al, x.n_labels); + + // 1 label SELECT + Vec def_body; + def_body.reserve(al, 1); + + for (size_t i = 0; i < x.n_labels; ++i) { + if (!AST::is_a(*x.m_labels[i])) { + throw SemanticError("Can only `GOTO` integer labels", + x.base.base.loc); + } else { + auto l = AST::down_cast(x.m_labels[i]); // l->m_n gets the target -> if l->m_n == (i+1) ... + Vec body; + body.reserve(al, 1); + body.push_back(al, ASRUtils::STMT(ASR::make_GoTo_t(al, x.base.base.loc, l->m_n))); + Vec comparator_one; + comparator_one.reserve(al, 1); + ASR::ttype_t *int32_type = LFortran::ASRUtils::TYPE(ASR::make_Integer_t(al, x.base.base.loc, 4, nullptr, 0)); + comparator_one.push_back(al, LFortran::ASRUtils::EXPR(ASR::make_IntegerConstant_t(al, x.base.base.loc, i+1, int32_type))); + a_body_vec.push_back(al, ASR::down_cast(ASR::make_CaseStmt_t(al, x.base.base.loc, comparator_one.p, 1, body.p, 1))); + } + } + ASR::expr_t* target_var = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, sym)); + tmp = ASR::make_Select_t(al, x.base.base.loc, target_var, a_body_vec.p, + a_body_vec.size(), def_body.p, def_body.size()); + } else { throw SemanticError("A goto label must be an integer", x.base.base.loc); } diff --git a/tests/fixed_form_goto_select.f b/tests/fixed_form_goto_select.f new file mode 100644 index 0000000000..1b710780b9 --- /dev/null +++ b/tests/fixed_form_goto_select.f @@ -0,0 +1,12 @@ + program main + integer k + k = 1 +100 print *, "hello" +200 k = k+1 + + integer m,n + m = 1 + n = 2 + goto (200, 100) m + goto (100, 200) n + end program diff --git a/tests/reference/asr-fixed_form_goto_select-a0c3483.json b/tests/reference/asr-fixed_form_goto_select-a0c3483.json new file mode 100644 index 0000000000..07fa0cada7 --- /dev/null +++ b/tests/reference/asr-fixed_form_goto_select-a0c3483.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_goto_select-a0c3483", + "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_goto_select.f", + "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-fixed_form_goto_select-a0c3483.stdout", + "stdout_hash": "85be626ff6aa91b2ff7b235d0a6be734ecd1cbf546dc276594bf4cac", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout b/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout new file mode 100644 index 0000000000..e576f13d33 --- /dev/null +++ b/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 2 {k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.)}) main [] [(= (Var 2 k) (IntegerConstant 1 (Integer 4 [])) ()) (GoToTarget 100) (Print () [(StringConstant "hello" (Character 1 5 () []))] () ()) (GoToTarget 200) (= (Var 2 k) (IntegerBinOp (Var 2 k) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 m) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 n) (IntegerConstant 2 (Integer 4 [])) ()) (Select (Var 2 m) [(CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(GoTo 200)]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(GoTo 100)])] []) (Select (Var 2 n) [(CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(GoTo 100)]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(GoTo 200)])] [])])}) []) diff --git a/tests/reference/ast-fixed_form_goto_select-6cc9882.json b/tests/reference/ast-fixed_form_goto_select-6cc9882.json new file mode 100644 index 0000000000..2464f421c5 --- /dev/null +++ b/tests/reference/ast-fixed_form_goto_select-6cc9882.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-fixed_form_goto_select-6cc9882", + "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_goto_select.f", + "infile_hash": "acbe51b93b613a469a6a95e544f8bf2480ad5ea75d6f5e369dcceb9a", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-fixed_form_goto_select-6cc9882.stdout", + "stdout_hash": "22cfa063902cdebe326983d37828571b2f7d8420493d8b5ee12698bd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout b/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout new file mode 100644 index 0000000000..7b20119c0a --- /dev/null +++ b/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(k [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(m [] [] () None ()) (n [] [] () None ())] ())] [(= 0 k 1 ()) (Print 100 () [(String "hello")] ()) (= 200 k (+ k 1) ()) (= 0 m 1 ()) (= 0 n 2 ()) (GoTo 0 () m [200 100] ()) (GoTo 0 () n [100 200] ())] [])]) From 6b969887ce1475d48a882839fc0888364070bb83 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Wed, 24 Aug 2022 15:44:50 +0530 Subject: [PATCH 07/46] Added flag for --allow-implicit-interface Co-Authored-By: Pranavchiku --- src/bin/lfortran.cpp | 2 ++ src/lfortran/semantics/ast_common_visitor.h | 11 ++++++++--- src/libasr/utils.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bin/lfortran.cpp b/src/bin/lfortran.cpp index 8ffe798b0f..bbf3d73d89 100644 --- a/src/bin/lfortran.cpp +++ b/src/bin/lfortran.cpp @@ -1475,6 +1475,8 @@ int main(int argc, char *argv[]) app.add_option("--target", compiler_options.target, "Generate code for the given target")->capture_default_str(); app.add_flag("--print-targets", print_targets, "Print the registered targets"); app.add_flag("--implicit-typing", compiler_options.implicit_typing, "Allow implicit typing"); + app.add_flag("--allow-implicit-interface", compiler_options.implicit_interface, "Allow implicit interface"); + if( compiler_options.fast ) { lfortran_pass_manager.use_optimization_passes(); diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index a69d3873ca..607ad7843c 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -2648,9 +2648,14 @@ class CommonVisitor : public AST::BaseVisitor { ASR::symbol_t* resolve_intrinsic_function(const Location &loc, const std::string &remote_sym) { if (!intrinsic_procedures.is_intrinsic(remote_sym)) { - throw SemanticError("Function '" + remote_sym + "' not found" - " or not implemented yet (if it is intrinsic)", - loc); + if(compiler_options.implicit_interface){ + throw SemanticError("This is the place where we have to create an implicit interface, had put semantic error for reference", loc); + } + else{ + throw SemanticError("Function '" + remote_sym + "' not found" + " or not implemented yet (if it is intrinsic)", + loc); + } } std::string module_name = intrinsic_procedures.get_module(remote_sym, loc); diff --git a/src/libasr/utils.h b/src/libasr/utils.h index 158055acd8..92c4263424 100644 --- a/src/libasr/utils.h +++ b/src/libasr/utils.h @@ -35,6 +35,8 @@ struct CompilerOptions { std::string error_format = "human"; bool new_parser = false; bool implicit_typing = false; + bool implicit_interface = false; + std::string target = ""; Platform platform; From c1ba8d9af19d6b75cea6f70b2f044bfba3cf9653 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Wed, 24 Aug 2022 15:59:36 +0530 Subject: [PATCH 08/46] Added implicit interface function definition --- src/lfortran/semantics/ast_common_visitor.h | 64 ++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index 607ad7843c..05b3758485 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -2502,6 +2502,58 @@ class CommonVisitor : public AST::BaseVisitor { return nullptr; } + void create_implicit_interface_function(const AST::FuncCallOrArray_t &x) { + SymbolTable *parent_scope = current_scope; + current_scope = al.make_new(parent_scope); + + Vec c_args; + visit_expr_list(x.m_args, x.n_args, c_args); + + Vec args; + args.reserve(al, x.n_args); + std::string sym_name = to_lower(x.m_func); + for (size_t i=0; iadd_symbol(arg_name, ASR::down_cast(arg_var)); + args.push_back(al, LFortran::ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + current_scope->get_symbol(arg_name)))); + } + // currently hardcoding the return type to real-8 + ASR::ttype_t *type = LFortran::ASRUtils::TYPE(ASR::make_Real_t(al, x.base.base.loc, + 8, nullptr, 0)); + std::string return_var_name = sym_name + "_return_var_name"; + ASR::asr_t *return_var = ASR::make_Variable_t(al, x.base.base.loc, + current_scope, s2c(al, return_var_name), LFortran::ASRUtils::intent_return_var, nullptr, nullptr, + ASR::storage_typeType::Default, type, + ASR::abiType::Source, ASR::Public, ASR::presenceType::Required, + false); + current_scope->add_symbol(return_var_name, ASR::down_cast(return_var)); + ASR::asr_t *return_var_ref = ASR::make_Var_t(al, x.base.base.loc, + ASR::down_cast(return_var)); + + tmp = ASR::make_Function_t( + al, x.base.base.loc, + /* a_symtab */ current_scope, + /* a_name */ s2c(al, sym_name), + /* a_args */ args.p, + /* n_args */ args.size(), + /* a_type_parameters */ nullptr, + /* n_type_parameters */ 0, + /* a_body */ nullptr, + /* n_body */ 0, + /* a_return_var */ ASRUtils::EXPR(return_var_ref), + ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Interface, + nullptr, false, false, false); + parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); + current_scope = parent_scope; + } + void visit_FuncCallOrArray(const AST::FuncCallOrArray_t &x) { SymbolTable *scope = current_scope; std::string var_name = to_lower(x.m_func); @@ -2530,6 +2582,14 @@ class CommonVisitor : public AST::BaseVisitor { if( !is_function ) { return; } + if (compiler_options.implicit_interface && is_function && !v) { + // Function Call is not defined in this case. + // We need to create an interface and add the Function into + // the symbol table. + create_implicit_interface_function(x); + v = current_scope->resolve_symbol(var_name); + LFORTRAN_ASSERT(v!=nullptr); + } } ASR::symbol_t *f2 = ASRUtils::symbol_get_past_external(v); if (ASR::is_a(*f2)) { @@ -2648,8 +2708,8 @@ class CommonVisitor : public AST::BaseVisitor { ASR::symbol_t* resolve_intrinsic_function(const Location &loc, const std::string &remote_sym) { if (!intrinsic_procedures.is_intrinsic(remote_sym)) { - if(compiler_options.implicit_interface){ - throw SemanticError("This is the place where we have to create an implicit interface, had put semantic error for reference", loc); + if (compiler_options.implicit_interface) { + return nullptr; } else{ throw SemanticError("Function '" + remote_sym + "' not found" From 2bf4f62b4ec3523ba25321887b12abaeb7debf14 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Wed, 24 Aug 2022 16:00:00 +0530 Subject: [PATCH 09/46] Added implicit_interface flag in run_tests.py --- run_tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run_tests.py b/run_tests.py index 84bb75d70b..a5129e6e78 100755 --- a/run_tests.py +++ b/run_tests.py @@ -23,6 +23,7 @@ def single_test(test, specific_test, verbose, no_llvm, update_reference): ast_openmp = test.get("ast_openmp", False) asr = test.get("asr", False) asr_implicit_typing = test.get("asr_implicit_typing", False) + asr_implicit_interface = test.get("asr_implicit_interface", False) asr_preprocess = test.get("asr_preprocess", False) asr_indent = test.get("asr_indent", False) mod_to_asr = test.get("mod_to_asr", False) @@ -137,6 +138,15 @@ def single_test(test, specific_test, verbose, no_llvm, update_reference): update_reference, extra_args) + if asr_implicit_interface: + run_test( + filename, + "asr", + "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", + filename, + update_reference, + extra_args) + if asr_preprocess: run_test( filename, From 8c311897cda1f9f16385a8f490aa2cfb1fa08736 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Tue, 30 Aug 2022 12:06:51 +0530 Subject: [PATCH 10/46] Fix interface and use template so that can be used for subroutine call --- src/lfortran/semantics/ast_body_visitor.cpp | 11 +++++-- src/lfortran/semantics/ast_common_visitor.h | 33 ++++++++++++--------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/lfortran/semantics/ast_body_visitor.cpp b/src/lfortran/semantics/ast_body_visitor.cpp index d1f5cbde67..26d4e3748e 100644 --- a/src/lfortran/semantics/ast_body_visitor.cpp +++ b/src/lfortran/semantics/ast_body_visitor.cpp @@ -883,12 +883,12 @@ class BodyVisitor : public CommonVisitor { } } - // We have to visit unit_decl_2 because in the example, the Template is directly inside the module and + // We have to visit unit_decl_2 because in the example, the Template is directly inside the module and // Template is a unit_decl_2 for (size_t i=0; i { } if (!original_sym) { original_sym = resolve_intrinsic_function(x.base.base.loc, sub_name); + if (!original_sym && compiler_options.implicit_interface) { + create_implicit_interface_function(x, sub_name, false); + original_sym = current_scope->resolve_symbol(sub_name); + LFORTRAN_ASSERT(original_sym!=nullptr); + } } ASR::symbol_t *sym = ASRUtils::symbol_get_past_external(original_sym); if (ASR::is_a(*sym)) { @@ -1306,7 +1311,7 @@ class BodyVisitor : public CommonVisitor { if (!is_int && !is_real) { throw SemanticError("Arithmetic if (x) requires an integer or real for `x`", test_int->base.loc); } - ASR::expr_t *test_lt, *test_gt; + ASR::expr_t *test_lt, *test_gt; int kind = ASRUtils::extract_kind_from_ttype_t(test_int_type); if (is_int) { ASR::ttype_t *type0 = ASRUtils::TYPE( diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index 05b3758485..cdf0c380c8 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -890,7 +890,8 @@ class CommonVisitor : public AST::BaseVisitor { assgnd_access[sym] = ASR::accessType::Private; } else if (sa->m_attr == AST::simple_attributeType ::AttrPublic || sa->m_attr == AST::simple_attributeType - ::AttrParameter) { + ::AttrParameter || sa->m_attr == AST::simple_attributeType + ::AttrExternal) { assgnd_access[sym] = ASR::accessType::Public; } else if (sa->m_attr == AST::simple_attributeType ::AttrOptional) { @@ -2502,7 +2503,8 @@ class CommonVisitor : public AST::BaseVisitor { return nullptr; } - void create_implicit_interface_function(const AST::FuncCallOrArray_t &x) { + template + void create_implicit_interface_function(const Call &x, std::string func_name, bool add_return) { SymbolTable *parent_scope = current_scope; current_scope = al.make_new(parent_scope); @@ -2511,7 +2513,7 @@ class CommonVisitor : public AST::BaseVisitor { Vec args; args.reserve(al, x.n_args); - std::string sym_name = to_lower(x.m_func); + std::string sym_name = to_lower(func_name); for (size_t i=0; i { // currently hardcoding the return type to real-8 ASR::ttype_t *type = LFortran::ASRUtils::TYPE(ASR::make_Real_t(al, x.base.base.loc, 8, nullptr, 0)); - std::string return_var_name = sym_name + "_return_var_name"; - ASR::asr_t *return_var = ASR::make_Variable_t(al, x.base.base.loc, - current_scope, s2c(al, return_var_name), LFortran::ASRUtils::intent_return_var, nullptr, nullptr, - ASR::storage_typeType::Default, type, - ASR::abiType::Source, ASR::Public, ASR::presenceType::Required, - false); - current_scope->add_symbol(return_var_name, ASR::down_cast(return_var)); - ASR::asr_t *return_var_ref = ASR::make_Var_t(al, x.base.base.loc, - ASR::down_cast(return_var)); + ASR::expr_t *to_return = nullptr; + if (add_return) { + std::string return_var_name = sym_name + "_return_var_name"; + ASR::asr_t *return_var = ASR::make_Variable_t(al, x.base.base.loc, + current_scope, s2c(al, return_var_name), LFortran::ASRUtils::intent_return_var, nullptr, nullptr, + ASR::storage_typeType::Default, type, + ASR::abiType::Source, ASR::Public, ASR::presenceType::Required, + false); + current_scope->add_symbol(return_var_name, ASR::down_cast(return_var)); + to_return = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + ASR::down_cast(return_var))); + } tmp = ASR::make_Function_t( al, x.base.base.loc, @@ -2547,7 +2552,7 @@ class CommonVisitor : public AST::BaseVisitor { /* n_type_parameters */ 0, /* a_body */ nullptr, /* n_body */ 0, - /* a_return_var */ ASRUtils::EXPR(return_var_ref), + /* a_return_var */ to_return, ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Interface, nullptr, false, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); @@ -2586,7 +2591,7 @@ class CommonVisitor : public AST::BaseVisitor { // Function Call is not defined in this case. // We need to create an interface and add the Function into // the symbol table. - create_implicit_interface_function(x); + create_implicit_interface_function(x, var_name, true); v = current_scope->resolve_symbol(var_name); LFORTRAN_ASSERT(v!=nullptr); } From 1adc902b078ab83ac288e3ba45231577e6a9073d Mon Sep 17 00:00:00 2001 From: Smit-create Date: Tue, 30 Aug 2022 12:07:03 +0530 Subject: [PATCH 11/46] Add and update tests --- tests/allow_implicit_interface.f90 | 11 +++++++++++ .../asr-allow_implicit_interface-dfa7a9a.json | 13 +++++++++++++ .../asr-allow_implicit_interface-dfa7a9a.stdout | 1 + tests/tests.toml | 4 ++++ 4 files changed, 29 insertions(+) create mode 100644 tests/allow_implicit_interface.f90 create mode 100644 tests/reference/asr-allow_implicit_interface-dfa7a9a.json create mode 100644 tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout diff --git a/tests/allow_implicit_interface.f90 b/tests/allow_implicit_interface.f90 new file mode 100644 index 0000000000..5729c267f5 --- /dev/null +++ b/tests/allow_implicit_interface.f90 @@ -0,0 +1,11 @@ +double precision function prho() +double precision zero, one, two, b, x, y, u, six +data zero, one, two, six /0.0d0, 1.0d0, 2.0d0, 6.0d0/ + +prho = u / exp(y / two) + alnorm(x, .true.) +external dgetrf +call dgetrf(x, y, u) +if (prho < zero) prho = zero +if (prho > one) prho = one +return +end diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json new file mode 100644 index 0000000000..af62070fe3 --- /dev/null +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-allow_implicit_interface-dfa7a9a", + "cmd": "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", + "infile": "tests/allow_implicit_interface.f90", + "infile_hash": "3d73fa8cc6b2a34329665b09295d1469f049597c7ab7f0c1039e4370", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-allow_implicit_interface-dfa7a9a.stdout", + "stdout_hash": "093a1a9707aba10495acc3707b9366b452c59bfde17c243b81538bd3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout new file mode 100644 index 0000000000..b92c75353f --- /dev/null +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), prho: (Function (SymbolTable 2 {alnorm: (Function (SymbolTable 225 {alnorm_arg_0: (Variable 225 alnorm_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), alnorm_arg_1: (Variable 225 alnorm_arg_1 Unspecified () () Default (Logical 4 []) Source Public Required .false.), alnorm_return_var_name: (Variable 225 alnorm_return_var_name ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) alnorm [(Var 225 alnorm_arg_0) (Var 225 alnorm_arg_1)] [] [] (Var 225 alnorm_return_var_name) Source Public Interface () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 8 []) Source Public Required .false.), dgetrf: (Function (SymbolTable 226 {dgetrf_arg_0: (Variable 226 dgetrf_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_1: (Variable 226 dgetrf_arg_1 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_2: (Variable 226 dgetrf_arg_2 Unspecified () () Default (Real 8 []) Source Public Required .false.)}) dgetrf [(Var 226 dgetrf_arg_0) (Var 226 dgetrf_arg_1) (Var 226 dgetrf_arg_2)] [] [] () Source Public Interface () .false. .false. .false.), exp: (ExternalSymbol 2 exp 4 exp lfortran_intrinsic_math [] exp Private), exp@dexp: (ExternalSymbol 2 exp@dexp 4 dexp lfortran_intrinsic_math [] dexp Private), one: (Variable 2 one Local () (RealConstant 1.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), prho: (Variable 2 prho ReturnVar () () Default (Real 8 []) Source Public Required .false.), six: (Variable 2 six Local () (RealConstant 6.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () (RealConstant 2.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () (RealConstant 0.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) prho [] [] [(= (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (FunctionCall 2 exp@dexp 2 exp [((RealBinOp (Var 2 y) Div (Var 2 two) (Real 8 []) ()))] (Real 8 []) () ()) (Real 8 []) ()) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4 [])))] (Real 8 []) () ()) (Real 8 []) ()) ()) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] ()) (If (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 zero) ())] []) (If (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 one) ())] []) (Return)] (Var 2 prho) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/tests.toml b/tests/tests.toml index 4848df9678..c0888ec6aa 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2206,6 +2206,10 @@ asr_implicit_typing = true filename = "implicit_typing2.f90" asr_implicit_typing = true +[[test]] +filename = "allow_implicit_interface.f90" +asr_implicit_interface = true + [[test]] filename = "dimension_attr2.f90" asr_implicit_typing = true From 3d9d047935740084158d4be005b0d17b28336cfc Mon Sep 17 00:00:00 2001 From: Smit-create Date: Tue, 30 Aug 2022 20:59:15 +0530 Subject: [PATCH 12/46] Fix data initialization and use casting --- src/lfortran/semantics/ast_common_visitor.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index a69d3873ca..044c15debe 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -963,9 +963,9 @@ class CommonVisitor : public AST::BaseVisitor { throw SemanticError("Type mismatch during data initialization", x.base.base.loc); } - ASR::expr_t* value_value = ASRUtils::expr_value(value); - if (value_value) { - body.push_back(al, value_value); + ASR::expr_t* expression_value = ASRUtils::expr_value(value); + if (expression_value) { + body.push_back(al, expression_value); } else { throw SemanticError("The value in data must be a constant", x.base.base.loc); @@ -1006,9 +1006,16 @@ class CommonVisitor : public AST::BaseVisitor { // The `visit_expr` ensures it resolves as an expression // which must be a `Var_t` pointing to a `Variable_t`, // so no checks are needed: + ImplicitCastRules::set_converted_value(al, x.base.base.loc, &value, + ASRUtils::expr_type(value), ASRUtils::expr_type(object)); + ASR::expr_t* expression_value = ASRUtils::expr_value(value); + if (!expression_value) { + throw SemanticError("The value in data must be a constant", + x.base.base.loc); + } ASR::Var_t *v = ASR::down_cast(object); ASR::Variable_t *v2 = ASR::down_cast(v->m_v); - v2->m_value = value; + v2->m_value = expression_value; } } else { throw SemanticError("Attribute declaration not supported", From 429bb02a2c54bc09a565b555f7769a887f7f0d2e Mon Sep 17 00:00:00 2001 From: Smit-create Date: Tue, 30 Aug 2022 21:03:34 +0530 Subject: [PATCH 13/46] Add a test --- integration_tests/data_01.f90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration_tests/data_01.f90 b/integration_tests/data_01.f90 index adf5cb98a9..a98f33e51a 100644 --- a/integration_tests/data_01.f90 +++ b/integration_tests/data_01.f90 @@ -1,7 +1,7 @@ program data_01 -integer :: x -real :: y, z, c1(4), bf1, xx90, xx95 -data x /1/ +integer :: x, td +real :: y, z, c1(4), bf1, xx90, xx95, b, p +data x, td, b /1, 4, 3/ data y, z /2.0, 3.0/ data c1 /0.0, 0.22, -0.14, -0.21/ data bf1 /0.8/, xx90, xx95 /0.55, 0.62/ @@ -15,4 +15,6 @@ program data_01 if (abs(bf1-0.8) > 1e-5) error stop if (abs(xx90-0.55) > 1e-5) error stop if (abs(xx95-0.62) > 1e-5) error stop +p = b ** (td-1) +if (abs(p-27.0) > 1e-5) error stop end program From 37492194ffc7517d8a3b3eec15f6c1571728ab02 Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Thu, 1 Sep 2022 10:13:08 +0200 Subject: [PATCH 14/46] Add `DO` nesting edge cases (#679) Tests added. --- src/lfortran/parser/fixedform_tokenizer.cpp | 10 ++++- tests/loop_test1.f | 14 +++++++ tests/loop_test2.f | 37 +++++++++++++++++++ tests/reference/asr-loop_test1-716ccb0.json | 13 +++++++ tests/reference/asr-loop_test1-716ccb0.stdout | 1 + tests/reference/asr-loop_test2-82d82ea.json | 13 +++++++ tests/reference/asr-loop_test2-82d82ea.stdout | 1 + tests/reference/ast-loop_test1-7800c18.json | 13 +++++++ tests/reference/ast-loop_test1-7800c18.stdout | 1 + tests/reference/ast-loop_test2-c76adc4.json | 13 +++++++ tests/reference/ast-loop_test2-c76adc4.stdout | 1 + tests/tests.toml | 11 ++++++ 12 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 tests/loop_test1.f create mode 100644 tests/loop_test2.f create mode 100644 tests/reference/asr-loop_test1-716ccb0.json create mode 100644 tests/reference/asr-loop_test1-716ccb0.stdout create mode 100644 tests/reference/asr-loop_test2-82d82ea.json create mode 100644 tests/reference/asr-loop_test2-82d82ea.stdout create mode 100644 tests/reference/ast-loop_test1-7800c18.json create mode 100644 tests/reference/ast-loop_test1-7800c18.stdout create mode 100644 tests/reference/ast-loop_test2-c76adc4.json create mode 100644 tests/reference/ast-loop_test2-c76adc4.stdout diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index 11847bf3b7..d6cb41446e 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -803,14 +803,15 @@ struct FixedFormRecursiveDescent { } } if (next_is(cur, "enddo")) { + // end one nesting of loop insert_enddo(); next_line(cur); do_levels--; return true; } else if (label_match && next_is(cur, "continue") && all_labels_match(label)) { + // end entire loop nesting with single `CONTINUE` // the usual terminal statement for do loops tokenize_line("continue", cur); - //only append iff (tokens[tokens.size()-2] == yytokentype::TK_LABEL && tokens[tokens.size()-1 == yytokentype::KW_CONTINUE]) for (int i=0;i 1) abort_loop = true; @@ -818,7 +819,12 @@ struct FixedFormRecursiveDescent { do_labels.clear(); return true; } else if (label_match) { - lex_body_statement(cur); + // end one nesting of loop + if (next_is(cur, "continue")) { + tokenize_line("continue", cur); + } else { + lex_body_statement(cur); + } insert_enddo(); do_levels--; return true; diff --git a/tests/loop_test1.f b/tests/loop_test1.f new file mode 100644 index 0000000000..5cd4a2d5b4 --- /dev/null +++ b/tests/loop_test1.f @@ -0,0 +1,14 @@ + program main + integer KP + kp =10 + integer i,j + DO 330 I=1,KP + DO 320 J=I+1,KP + IF (0.GT.1) THEN + print *, i, j + ELSE + print *, j, i + END IF + 320 CONTINUE + 330 CONTINUE + end program diff --git a/tests/loop_test2.f b/tests/loop_test2.f new file mode 100644 index 0000000000..23249b5565 --- /dev/null +++ b/tests/loop_test2.f @@ -0,0 +1,37 @@ +c `--show-llvm` throws with +c assert(Ty && "Invalid GetElementPtrInst indices for type!"); +c +c -> correct as we do not define lower/upper bounds for arrays here + subroutine f() + integer nq, m + real wrk5, v + + integer l1,j,l2 + integer indx + + DO 140 L1 = 1,NQ + DO 110 J = 1,M + WRK5(J) = V(INDX,J,L1) + 110 CONTINUE + DO 120 J = 1,M + VE(INDX,L1,J) = WRK5(J) + 120 CONTINUE + 140 CONTINUE + + indx = 1 + real ve,vev + real zero + zero = 0.0d00 + DO 230 L1 = 1,NQ + DO 220 L2 = 1,L1 + VEV(L1,L2) = ZERO + DO 210 J = 1,M + VEV(L1,L2) = VEV(L1,L2) + VE(INDX,L1,J)*VE(INDX,L2,J) + 210 CONTINUE + VEV(L2,L1) = VEV(L1,L2) + 220 CONTINUE + 230 CONTINUE + + RETURN + END + diff --git a/tests/reference/asr-loop_test1-716ccb0.json b/tests/reference/asr-loop_test1-716ccb0.json new file mode 100644 index 0000000000..41b04a7dad --- /dev/null +++ b/tests/reference/asr-loop_test1-716ccb0.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop_test1-716ccb0", + "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/loop_test1.f", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-loop_test1-716ccb0.stdout", + "stdout_hash": "f82496dd80a07b822f56ba095b1d2e7d6bfdbc6c390b60d5802c2dcc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-loop_test1-716ccb0.stdout b/tests/reference/asr-loop_test1-716ccb0.stdout new file mode 100644 index 0000000000..90d67a4451 --- /dev/null +++ b/tests/reference/asr-loop_test1-716ccb0.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), kp: (Variable 2 kp Local () () Default (Integer 4 []) Source Public Required .false.)}) main [] [(= (Var 2 kp) (IntegerConstant 10 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 kp) ()) [(DoLoop ((Var 2 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Var 2 kp) ()) [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(Print () [(Var 2 i) (Var 2 j)] () ())] [(Print () [(Var 2 j) (Var 2 i)] () ())]) (GoToTarget 320)]) (GoToTarget 330)])])}) []) diff --git a/tests/reference/asr-loop_test2-82d82ea.json b/tests/reference/asr-loop_test2-82d82ea.json new file mode 100644 index 0000000000..316b434c7f --- /dev/null +++ b/tests/reference/asr-loop_test2-82d82ea.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-loop_test2-82d82ea", + "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/loop_test2.f", + "infile_hash": "5b02cea73577663e3bb9327b5fddf12b575369117817950c1f6f88c3", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-loop_test2-82d82ea.stdout", + "stdout_hash": "ab16d86e92a60d1b61cb94b85d58d2e3bdee2c8804b213f57bf991a3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-loop_test2-82d82ea.stdout b/tests/reference/asr-loop_test2-82d82ea.stdout new file mode 100644 index 0000000000..517748a806 --- /dev/null +++ b/tests/reference/asr-loop_test2-82d82ea.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {indx: (Variable 2 indx Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), l1: (Variable 2 l1 Local () () Default (Integer 4 []) Source Public Required .false.), l2: (Variable 2 l2 Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), nq: (Variable 2 nq Local () () Default (Integer 4 []) Source Public Required .false.), v: (Variable 2 v Local () () Default (Real 4 []) Source Public Required .false.), ve: (Variable 2 ve Local () () Default (Real 4 []) Source Public Required .false.), vev: (Variable 2 vev Local () () Default (Real 4 []) Source Public Required .false.), wrk5: (Variable 2 wrk5 Local () () Default (Real 4 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 4 []) Source Public Required .false.)}) f [] [] [(DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4 []) ()) ()) (GoToTarget 110)]) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) ()) (GoToTarget 120)]) (GoToTarget 140)]) (= (Var 2 indx) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 l2) (IntegerConstant 1 (Integer 4 [])) (Var 2 l1) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (Var 2 zero) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ()) (GoToTarget 210)]) (= (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4 []) ()) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) ()) (GoToTarget 220)]) (GoToTarget 230)]) (Return)] () Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/ast-loop_test1-7800c18.json b/tests/reference/ast-loop_test1-7800c18.json new file mode 100644 index 0000000000..2a4ad25620 --- /dev/null +++ b/tests/reference/ast-loop_test1-7800c18.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-loop_test1-7800c18", + "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/loop_test1.f", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-loop_test1-7800c18.stdout", + "stdout_hash": "a233f33eaaeb901073742c4bcfc4f8ebe49b89960d40bcf27992a7cb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-loop_test1-7800c18.stdout b/tests/reference/ast-loop_test1-7800c18.stdout new file mode 100644 index 0000000000..93a60c30da --- /dev/null +++ b/tests/reference/ast-loop_test1-7800c18.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(kp [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(i [] [] () None ()) (j [] [] () None ())] ())] [(= 0 kp 10 ()) (DoLoop 0 () 330 i 1 kp () [(DoLoop 0 () 320 j (+ i 1) kp () [(If 0 () (> 0 1) [(Print 0 () [i j] ())] [(Print 0 () [j i] ())] () () ()) (Continue 320 ())] () ()) (Continue 330 ())] () ())] [])]) diff --git a/tests/reference/ast-loop_test2-c76adc4.json b/tests/reference/ast-loop_test2-c76adc4.json new file mode 100644 index 0000000000..5b934ac66a --- /dev/null +++ b/tests/reference/ast-loop_test2-c76adc4.json @@ -0,0 +1,13 @@ +{ + "basename": "ast-loop_test2-c76adc4", + "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", + "infile": "tests/loop_test2.f", + "infile_hash": "5b02cea73577663e3bb9327b5fddf12b575369117817950c1f6f88c3", + "outfile": null, + "outfile_hash": null, + "stdout": "ast-loop_test2-c76adc4.stdout", + "stdout_hash": "5f59a25d9720073323dfbe851acf529f81d55e43e6a41162f7324dba", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-loop_test2-c76adc4.stdout b/tests/reference/ast-loop_test2-c76adc4.stdout new file mode 100644 index 0000000000..2bc8075471 --- /dev/null +++ b/tests/reference/ast-loop_test2-c76adc4.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(nq [] [] () None ()) (m [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(wrk5 [] [] () None ()) (v [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(l1 [] [] () None ()) (j [] [] () None ()) (l2 [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(indx [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(ve [] [] () None ()) (vev [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(zero [] [] () None ())] ())] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(= 0 (FuncCallOrArray wrk5 [] [(() j ())] [] []) (FuncCallOrArray v [] [(() indx ()) (() j ()) (() l1 ())] [] []) ()) (Continue 110 ())] () ()) (DoLoop 0 () 120 j 1 m () [(= 0 (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray wrk5 [] [(() j ())] [] []) ()) (Continue 120 ())] () ()) (Continue 140 ())] () ()) (= 0 indx 1 ()) (= 0 zero (Real "0.0d00") ()) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) zero ()) (DoLoop 0 () 210 j 1 m () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (+ (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (* (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray ve [] [(() indx ()) (() l2 ()) (() j ())] [] []))) ()) (Continue 210 ())] () ()) (= 0 (FuncCallOrArray vev [] [(() l2 ()) (() l1 ())] [] []) (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) ()) (Continue 220 ())] () ()) (Continue 230 ())] () ()) (Return 0 () ())] [])]) diff --git a/tests/tests.toml b/tests/tests.toml index c0888ec6aa..3682a0e502 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2253,6 +2253,17 @@ filename = "sole_intrinsic.f" ast = true asr = true +[[test]] + +filename = "loop_test1.f" +ast = true +asr = true + +[[test]] +filename = "loop_test2.f" +ast = true +asr = true + [[test]] filename = "parameter1.f90" asr = true From 8b6aa189f492d12674e77e03f0209af77b63e379 Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Thu, 1 Sep 2022 11:45:47 +0200 Subject: [PATCH 15/46] fix merge errs --- tests/loop_test1.f | 3 - tests/loop_test2.f | 4 - tests/reference/asr-allocate_01-f3446f6.json | 2 +- .../reference/asr-allocate_01-f3446f6.stdout | 3 +- tests/reference/asr-allocate_02-3c0d7c8.json | 2 +- .../reference/asr-allocate_02-3c0d7c8.stdout | 1 - tests/reference/asr-allocate_03-8219a72.json | 2 +- .../reference/asr-allocate_03-8219a72.stdout | 3 +- .../asr-allow_implicit_interface-dfa7a9a.json | 10 +- ...sr-allow_implicit_interface-dfa7a9a.stderr | 2 - .../reference/asr-arrays_03_func-7c8d572.json | 2 +- .../asr-arrays_03_func-7c8d572.stdout | 1 - .../reference/asr-arrays_04_func-9f59ad6.json | 2 +- .../asr-arrays_04_func-9f59ad6.stdout | 2 - .../reference/asr-arrays_08_func-2759ced.json | 2 +- .../asr-arrays_08_func-2759ced.stdout | 1 - tests/reference/asr-arrays_op_4-ca3318f.json | 2 +- .../reference/asr-arrays_op_4-ca3318f.stdout | 1 - tests/reference/asr-arrays_op_6-030b24e.json | 2 +- .../reference/asr-arrays_op_6-030b24e.stdout | 1 - tests/reference/asr-callback_01-21b53de.json | 2 +- .../reference/asr-callback_01-21b53de.stdout | 2 - tests/reference/asr-callback_02-aec5457.json | 2 +- .../reference/asr-callback_02-aec5457.stdout | 1 - tests/reference/asr-class_01-704dee8.json | 2 +- tests/reference/asr-class_01-704dee8.stdout | 1 - tests/reference/asr-class_02-b56b852.json | 2 +- tests/reference/asr-class_02-b56b852.stdout | 1 - .../asr-continue_body_if_loop-670a23a.json | 10 +- .../asr-continue_body_if_loop-670a23a.stderr | 5 - .../asr-derived_types_03-b1d32aa.json | 2 +- .../asr-derived_types_03-b1d32aa.stdout | 1 - .../asr-derived_types_05-35150cd.json | 2 +- .../asr-derived_types_05-35150cd.stdout | 4 - .../asr-dimension_attr2-8fda690.json | 2 +- .../asr-dimension_attr2-8fda690.stdout | 1 - .../asr-fixed_form_if_variations-b4dcd1e.json | 10 +- ...sr-fixed_form_if_variations-b4dcd1e.stderr | 9 - ...sr-fixed_form_simple_continue-1cd55c6.json | 10 +- ...-fixed_form_simple_continue-1cd55c6.stderr | 5 - tests/reference/asr-flip_sign-a0cebd4.json | 2 +- tests/reference/asr-flip_sign-a0cebd4.stdout | 2 +- tests/reference/asr-fn2-b585098.json | 2 +- tests/reference/asr-fn2-b585098.stdout | 6 - tests/reference/asr-functions_04-ea50b75.json | 2 +- .../reference/asr-functions_04-ea50b75.stdout | 1 - tests/reference/asr-functions_05-adf0d8b.json | 2 +- .../reference/asr-functions_05-adf0d8b.stdout | 3 - tests/reference/asr-functions_06-83a7aca.json | 2 +- .../reference/asr-functions_06-83a7aca.stdout | 3 - tests/reference/asr-functions_07-2d29eab.json | 2 +- .../reference/asr-functions_07-2d29eab.stdout | 3 - tests/reference/asr-functions_08-23f422a.json | 2 +- .../reference/asr-functions_08-23f422a.stdout | 2 - tests/reference/asr-functions_09-1e51ac7.json | 2 +- .../reference/asr-functions_09-1e51ac7.stdout | 1 - tests/reference/asr-functions_10-0449324.json | 2 +- .../reference/asr-functions_10-0449324.stdout | 3 - .../asr-implicit_typing2-d87e21a.json | 2 +- .../asr-implicit_typing2-d87e21a.stdout | 1 - tests/reference/asr-intent_01-c1f267a.json | 2 +- tests/reference/asr-intent_01-c1f267a.stdout | 1 - tests/reference/asr-interface_05-5639d22.json | 2 +- .../reference/asr-interface_05-5639d22.stdout | 2 - .../reference/asr-intrinsics_26-f10d0e6.json | 2 +- .../asr-intrinsics_26-f10d0e6.stdout | 1 - .../reference/asr-intrinsics_31-9b91cfb.json | 2 +- .../asr-intrinsics_31-9b91cfb.stdout | 2 +- tests/reference/asr-issue532-4bdd3b3.json | 2 +- tests/reference/asr-issue532-4bdd3b3.stdout | 2 - tests/reference/asr-loop_test1-716ccb0.json | 12 +- tests/reference/asr-loop_test1-716ccb0.stderr | 5 - tests/reference/asr-loop_test2-82d82ea.json | 12 +- tests/reference/asr-loop_test2-82d82ea.stderr | 5 - tests/reference/asr-modules_05-f939cc6.json | 2 +- tests/reference/asr-modules_05-f939cc6.stdout | 1 - tests/reference/asr-modules_06-609dd30.json | 2 +- tests/reference/asr-modules_06-609dd30.stdout | 1 - tests/reference/asr-modules_06-821cc56.json | 2 +- tests/reference/asr-modules_06-821cc56.stdout | 2 - tests/reference/asr-modules_15b-09f8335.json | 2 +- .../reference/asr-modules_15b-09f8335.stdout | 9 - tests/reference/asr-nested_01-290187e.json | 2 +- tests/reference/asr-nested_01-290187e.stdout | 2 - tests/reference/asr-nested_04-8423f42.json | 2 +- tests/reference/asr-nested_04-8423f42.stdout | 2 - .../asr-operator_overloading_01-9ec8e71.json | 2 +- ...asr-operator_overloading_01-9ec8e71.stdout | 2 - .../asr-operator_overloading_03-f7a6efe.json | 2 +- ...asr-operator_overloading_03-f7a6efe.stdout | 3 - .../asr-operator_overloading_04-e28fb55.json | 2 +- ...asr-operator_overloading_04-e28fb55.stdout | 2 - tests/reference/asr-parameter1-1a7ed3b.json | 10 +- tests/reference/asr-parameter1-1a7ed3b.stderr | 5 - tests/reference/asr-program3-557dbe8.json | 2 +- tests/reference/asr-program3-557dbe8.stdout | 2 - tests/reference/asr-program4-ba26fd1.json | 2 +- tests/reference/asr-program4-ba26fd1.stdout | 2 - tests/reference/asr-program_03-fbe20e8.json | 2 +- tests/reference/asr-program_03-fbe20e8.stdout | 2 - tests/reference/asr-recursion_02-20a7daf.json | 2 +- .../reference/asr-recursion_02-20a7daf.stdout | 3 - tests/reference/asr-recursion_03-8300fac.json | 2 +- .../reference/asr-recursion_03-8300fac.stdout | 4 - tests/reference/asr-string_17-29e01e3.json | 2 +- tests/reference/asr-string_17-29e01e3.stdout | 2 - tests/reference/asr-string_19-d880475.json | 2 +- tests/reference/asr-string_19-d880475.stdout | 11 +- tests/reference/asr-submodule_02-9152b7b.json | 2 +- .../reference/asr-submodule_02-9152b7b.stdout | 1 - tests/reference/asr-subroutine3-8086030.json | 2 +- .../reference/asr-subroutine3-8086030.stdout | 1 - tests/reference/asr-subroutine3b-4883d18.json | 2 +- .../reference/asr-subroutine3b-4883d18.stdout | 3 - tests/reference/asr-template_add-177bf3c.json | 2 +- .../reference/asr-template_add-177bf3c.stdout | 1 - ...asr_preprocess-preprocessor12-94ccea0.json | 2 +- ...r_preprocess-preprocessor12-94ccea0.stdout | 1 - .../ast-continue_body_if_loop-406ed85.json | 10 +- .../ast-continue_body_if_loop-406ed85.stderr | 5 - .../ast-fixed_form_if_variations-38b0c0a.json | 10 +- ...st-fixed_form_if_variations-38b0c0a.stderr | 9 - ...st-fixed_form_simple_continue-dbefb27.json | 10 +- ...-fixed_form_simple_continue-dbefb27.stderr | 5 - tests/reference/ast-loop_test1-7800c18.json | 12 +- tests/reference/ast-loop_test1-7800c18.stderr | 5 - tests/reference/ast-loop_test1-7800c18.stdout | 4 - tests/reference/ast-loop_test2-c76adc4.json | 12 +- tests/reference/ast-loop_test2-c76adc4.stderr | 5 - tests/reference/ast-loop_test2-c76adc4.stdout | 4 - tests/reference/c-program3-32749e4.json | 2 +- tests/reference/c-program3-32749e4.stdout | 2 - tests/reference/c-program4-d60edeb.json | 2 +- tests/reference/c-program4-d60edeb.stdout | 2 - .../reference/cpp-arrays_03_func-3a62608.json | 2 +- .../cpp-arrays_03_func-3a62608.stdout | 1 - .../reference/cpp-arrays_04_func-68b1437.json | 2 +- .../cpp-arrays_04_func-68b1437.stdout | 2 - tests/reference/cpp-fn2-ff8ef37.json | 2 +- tests/reference/cpp-fn2-ff8ef37.stdout | 6 - tests/reference/cpp-program3-7ea69db.json | 2 +- tests/reference/cpp-program3-7ea69db.stdout | 2 - tests/reference/cpp-program4-1796cb6.json | 2 +- tests/reference/cpp-program4-1796cb6.stdout | 2 - tests/reference/llvm-allocate_01-573b1f6.json | 2 +- .../reference/llvm-allocate_01-573b1f6.stdout | 953 +++++++++--------- tests/reference/llvm-allocate_02-7f23768.json | 2 +- .../reference/llvm-allocate_02-7f23768.stdout | 1 - tests/reference/llvm-allocate_03-495d621.json | 2 +- .../reference/llvm-allocate_03-495d621.stdout | 447 ++++---- .../llvm-arrays_03_func-98941b2.json | 2 +- .../llvm-arrays_03_func-98941b2.stdout | 1 - .../llvm-arrays_04_func-2aa342e.json | 2 +- .../llvm-arrays_04_func-2aa342e.stdout | 2 - .../llvm-arrays_08_func-85e526b.json | 2 +- .../llvm-arrays_08_func-85e526b.stdout | 1 - tests/reference/llvm-arrays_op_4-df4e84d.json | 2 +- .../reference/llvm-arrays_op_4-df4e84d.stdout | 1 - tests/reference/llvm-arrays_op_6-ae38631.json | 2 +- .../reference/llvm-arrays_op_6-ae38631.stdout | 1 - tests/reference/llvm-callback_01-facbb46.json | 2 +- .../reference/llvm-callback_01-facbb46.stdout | 2 - tests/reference/llvm-callback_02-41bc7d7.json | 2 +- .../reference/llvm-callback_02-41bc7d7.stdout | 1 - tests/reference/llvm-callback_03-0f44942.json | 2 +- .../reference/llvm-callback_03-0f44942.stdout | 3 - tests/reference/llvm-class_01-82031c0.json | 2 +- tests/reference/llvm-class_01-82031c0.stdout | 1 - tests/reference/llvm-class_02-82c2f9c.json | 2 +- tests/reference/llvm-class_02-82c2f9c.stdout | 1 - tests/reference/llvm-do7-8069d7a.json | 2 +- tests/reference/llvm-do7-8069d7a.stdout | 1 - tests/reference/llvm-intent_01-6d96ec5.json | 2 +- tests/reference/llvm-intent_01-6d96ec5.stdout | 1 - tests/reference/llvm-issue532-d63b703.json | 2 +- tests/reference/llvm-issue532-d63b703.stdout | 2 - tests/reference/llvm-modules_06-03c75b2.json | 2 +- .../reference/llvm-modules_06-03c75b2.stdout | 1 - tests/reference/llvm-modules_13-6b5ac80.json | 2 +- .../reference/llvm-modules_13-6b5ac80.stdout | 2 - tests/reference/llvm-nested_01-b01694c.json | 2 +- tests/reference/llvm-nested_01-b01694c.stdout | 2 - tests/reference/llvm-nested_04-39da8f9.json | 2 +- tests/reference/llvm-nested_04-39da8f9.stdout | 2 - .../llvm-operator_overloading_01-33c47db.json | 2 +- ...lvm-operator_overloading_01-33c47db.stdout | 2 - .../llvm-operator_overloading_03-d9fd880.json | 2 +- ...lvm-operator_overloading_03-d9fd880.stdout | 3 - tests/reference/llvm-program_03-374e848.json | 2 +- .../reference/llvm-program_03-374e848.stdout | 2 - .../reference/llvm-recursion_02-76da7b3.json | 2 +- .../llvm-recursion_02-76da7b3.stdout | 3 - .../reference/llvm-recursion_03-3285725.json | 2 +- .../llvm-recursion_03-3285725.stdout | 4 - tests/reference/llvm-return_01-495409d.json | 2 +- tests/reference/llvm-return_01-495409d.stdout | 1 - tests/reference/llvm-return_02-99fb0b3.json | 2 +- tests/reference/llvm-return_02-99fb0b3.stdout | 2 - tests/reference/llvm-subroutine3-fb7e0b8.json | 2 +- .../reference/llvm-subroutine3-fb7e0b8.stdout | 1 - tests/reference/obj-subroutine3-942b3d8.json | 4 +- .../reference/obj-subroutine3-942b3d8.stdout | 1 - .../pass_flip_sign-flip_sign-16b288c.json | 2 +- .../pass_flip_sign-flip_sign-16b288c.stdout | 2 +- ...e_function_calls-functions_05-73805d1.json | 2 +- ...function_calls-functions_05-73805d1.stdout | 3 - ...e_function_calls-functions_07-cc20830.json | 2 +- ...function_calls-functions_07-cc20830.stdout | 3 - ...e_function_calls-functions_08-515120b.json | 2 +- ...function_calls-functions_08-515120b.stdout | 2 - tests/reference/wat-types_16-57fa580.json | 2 +- tests/reference/wat-types_16-57fa580.stdout | 6 - tests/reference/wat-wasm1-8a138d6.json | 2 +- tests/reference/wat-wasm1-8a138d6.stdout | 5 - tests/reference/wat-wasm_i64-3afdb24.json | 2 +- tests/reference/wat-wasm_i64-3afdb24.stdout | 3 - .../wat-wasm_main_program-7a34895.json | 2 +- .../wat-wasm_main_program-7a34895.stdout | 1 - .../wat-wasm_unary_minus-81a29ff.json | 2 +- .../wat-wasm_unary_minus-81a29ff.stdout | 3 - 220 files changed, 906 insertions(+), 1100 deletions(-) delete mode 100644 tests/reference/asr-allow_implicit_interface-dfa7a9a.stderr delete mode 100644 tests/reference/asr-continue_body_if_loop-670a23a.stderr delete mode 100644 tests/reference/asr-fixed_form_if_variations-b4dcd1e.stderr delete mode 100644 tests/reference/asr-fixed_form_simple_continue-1cd55c6.stderr delete mode 100644 tests/reference/asr-loop_test1-716ccb0.stderr delete mode 100644 tests/reference/asr-loop_test2-82d82ea.stderr delete mode 100644 tests/reference/asr-parameter1-1a7ed3b.stderr delete mode 100644 tests/reference/ast-continue_body_if_loop-406ed85.stderr delete mode 100644 tests/reference/ast-fixed_form_if_variations-38b0c0a.stderr delete mode 100644 tests/reference/ast-fixed_form_simple_continue-dbefb27.stderr delete mode 100644 tests/reference/ast-loop_test1-7800c18.stderr delete mode 100644 tests/reference/ast-loop_test2-c76adc4.stderr delete mode 100644 tests/reference/obj-subroutine3-942b3d8.stdout diff --git a/tests/loop_test1.f b/tests/loop_test1.f index 6204ef1732..5cd4a2d5b4 100644 --- a/tests/loop_test1.f +++ b/tests/loop_test1.f @@ -1,10 +1,7 @@ program main integer KP kp =10 -<<<<<<< HEAD -======= integer i,j ->>>>>>> gh-main/main DO 330 I=1,KP DO 320 J=I+1,KP IF (0.GT.1) THEN diff --git a/tests/loop_test2.f b/tests/loop_test2.f index 09605b1ba0..8cd780998e 100644 --- a/tests/loop_test2.f +++ b/tests/loop_test2.f @@ -6,12 +6,8 @@ subroutine f() integer nq, m real wrk5, v -<<<<<<< HEAD -======= integer l1,j,l2 integer indx - ->>>>>>> gh-main/main DO 140 L1 = 1,NQ DO 110 J = 1,M WRK5(J) = V(INDX,J,L1) diff --git a/tests/reference/asr-allocate_01-f3446f6.json b/tests/reference/asr-allocate_01-f3446f6.json index 245a87e20a..a44d0d6163 100644 --- a/tests/reference/asr-allocate_01-f3446f6.json +++ b/tests/reference/asr-allocate_01-f3446f6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_01-f3446f6.stdout", - "stdout_hash": "63aeceaec7e1850af2f7f6b40dbecea6d17a40d77a0e03354e761c18", + "stdout_hash": "fced1a1ffe97552fc3d6e6e2886ba48964557815900516ec1115ca73", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_01-f3446f6.stdout b/tests/reference/asr-allocate_01-f3446f6.stdout index a573240d4d..97cf257011 100644 --- a/tests/reference/asr-allocate_01-f3446f6.stdout +++ b/tests/reference/asr-allocate_01-f3446f6.stdout @@ -1,2 +1 @@ -fname reduce_sum -(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) IntegerToComplex (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (If (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4 [])) (RealConstant 0.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 114345.000000 0.000000 (Complex 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (ImplicitDeallocate [2 c]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) IntegerToComplex (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (If (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4 [])) (RealConstant 0.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 114345.000000 0.000000 (Complex 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_02-3c0d7c8.json b/tests/reference/asr-allocate_02-3c0d7c8.json index 75136da404..1ef486ea8d 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.json +++ b/tests/reference/asr-allocate_02-3c0d7c8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_02-3c0d7c8.stdout", - "stdout_hash": "a8a69ef75502402e363ad1e45c0dab953ede3c4bb85e5f2827ad6c1e", + "stdout_hash": "44e573887cff00033271c0288438d6018607ba1a91f4159800b7ae5b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_02-3c0d7c8.stdout b/tests/reference/asr-allocate_02-3c0d7c8.stdout index 77abb7e417..e1a99eacf5 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.stdout +++ b/tests/reference/asr-allocate_02-3c0d7c8.stdout @@ -1,2 +1 @@ -fname whole_square (TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), isource: (Variable 2 isource Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), whole_square: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), a_2: (Variable 3 a_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ab: (Variable 3 ab Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), abc: (Variable 3 abc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b_2: (Variable 3 b_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), bc: (Variable 3 bc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c_2: (Variable 3 c_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ca: (Variable 3 ca Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), status: (Variable 3 status ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) whole_square [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (Allocate [(3 a_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 b_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 c_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (Allocate [(3 ab [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 bc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 ca [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 abc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (= (Var 3 status) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Integer 4 [(() ())]) ()) ()) (= (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 [(() ())]) ()) ()) (= (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Integer 4 [(() ())]) ()) ()) (= (Var 3 ab) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) ()) (= (Var 3 bc) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 ca) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 c) (Integer 4 []) ()) Mul (Var 3 a) (Integer 4 []) ()) ()) (= (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 status) (IntegerConstant 1 (Integer 4 [])) ()) (ImplicitDeallocate [3 a_2 3 ab 3 abc 3 b_2 3 bc 3 c_2 3 ca])] (Var 3 status) Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))])] (Var 2 ierr) () (Var 2 isource)) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 c) (IntegerConstant 3 (Integer 4 [])) ()) (Print () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) () ())] () ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_03-8219a72.json b/tests/reference/asr-allocate_03-8219a72.json index 0dda054cc4..be5c519e9e 100644 --- a/tests/reference/asr-allocate_03-8219a72.json +++ b/tests/reference/asr-allocate_03-8219a72.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_03-8219a72.stdout", - "stdout_hash": "3c4b83d04dbc58bc506c9183e51709a6ee8bbaa700d044b4926aa7cb", + "stdout_hash": "19900d88f80e0e5e756f7d8eafd392863b0d349c6749de42ef78fb79", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_03-8219a72.stdout b/tests/reference/asr-allocate_03-8219a72.stdout index eaa825036e..9dd5fcc505 100644 --- a/tests/reference/asr-allocate_03-8219a72.stdout +++ b/tests/reference/asr-allocate_03-8219a72.stdout @@ -1,2 +1 @@ -fname g -(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [4 x]) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [5 c]) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (ImplicitDeallocate [2 c]) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json index 20dab7a6b3..af62070fe3 100644 --- a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json @@ -5,9 +5,9 @@ "infile_hash": "3d73fa8cc6b2a34329665b09295d1469f049597c7ab7f0c1039e4370", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-allow_implicit_interface-dfa7a9a.stderr", - "stderr_hash": "86c51fad7f0f2b8b7b3b163d5e8d66eba21929a7f76101d3939bfcf9", - "returncode": 109 + "stdout": "asr-allow_implicit_interface-dfa7a9a.stdout", + "stdout_hash": "093a1a9707aba10495acc3707b9366b452c59bfde17c243b81538bd3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stderr b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stderr deleted file mode 100644 index 0e39eb4c7c..0000000000 --- a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stderr +++ /dev/null @@ -1,2 +0,0 @@ -The following argument was not expected: --allow-implicit-interface -Run with --help for more information. diff --git a/tests/reference/asr-arrays_03_func-7c8d572.json b/tests/reference/asr-arrays_03_func-7c8d572.json index 2c87be37f1..4ba8ef320f 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.json +++ b/tests/reference/asr-arrays_03_func-7c8d572.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_03_func-7c8d572.stdout", - "stdout_hash": "582e9904897e9b5bc2f89ecff7d7a8b71d851270a3cb8b578401f76f", + "stdout_hash": "392235bdb644223c34c0c4e780c3be78c415f48328980a0e1c458b9e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_03_func-7c8d572.stdout b/tests/reference/asr-arrays_03_func-7c8d572.stdout index 63228efe84..3c09c5a0af 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.stdout +++ b/tests/reference/asr-arrays_03_func-7c8d572.stdout @@ -1,2 +1 @@ -fname mysum (TranslationUnit (SymbolTable 1 {arrays_03_func: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), mysum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mysum [(Var 3 a)] [] [(= (Var 3 r) (IntegerConstant 0 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) (Integer 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_03_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 s) (FunctionCall 2 mysum () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 s)] () ()) (If (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.json b/tests/reference/asr-arrays_04_func-9f59ad6.json index 0e0628abe0..9002a6514b 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.json +++ b/tests/reference/asr-arrays_04_func-9f59ad6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_04_func-9f59ad6.stdout", - "stdout_hash": "baad265a2a02a3cfbbe616212091a5ca734cafd8a5b53bfc248db04f", + "stdout_hash": "2e8194a7e05c954985951b0d7e2abbb49ab3e386490403e2b082c098", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.stdout b/tests/reference/asr-arrays_04_func-9f59ad6.stdout index cceecf68b7..8b7b102961 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.stdout +++ b/tests/reference/asr-arrays_04_func-9f59ad6.stdout @@ -1,3 +1 @@ -fname sum -fname abs (TranslationUnit (SymbolTable 1 {arrays_04_func: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), abs: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) abs [(Var 4 a)] [] [(Print () [(StringConstant "abs" (Character 1 3 () []))] () ()) (If (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) (Logical 4 []) ()) [(= (Var 4 r) (Var 4 a) ())] [(= (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) sum [(Var 3 a)] [] [(Print () [(StringConstant "sum" (Character 1 3 () []))] () ()) (= (Var 3 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) arrays_04_func [] [(= (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (= (Var 2 b) (FunctionCall 2 sum () [((Var 2 a))] (Real 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_08_func-2759ced.json b/tests/reference/asr-arrays_08_func-2759ced.json index e5ea8cfbec..dcb23f27f3 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.json +++ b/tests/reference/asr-arrays_08_func-2759ced.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_08_func-2759ced.stdout", - "stdout_hash": "e152dee4226b6ccb21574c459298fd2b188e000fe716918c9ddc6d1d", + "stdout_hash": "d7ea665bf0a31ee67d11cd05584d8b2901d626dc04bb891d230b7413", "stderr": "asr-arrays_08_func-2759ced.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 diff --git a/tests/reference/asr-arrays_08_func-2759ced.stdout b/tests/reference/asr-arrays_08_func-2759ced.stdout index 861b7e487c..804edd2eab 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.stdout +++ b/tests/reference/asr-arrays_08_func-2759ced.stdout @@ -1,2 +1 @@ -fname verify (TranslationUnit (SymbolTable 1 {arrays_08_func: (Program (SymbolTable 2 {copy_from_to: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Out () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) copy_from_to [(Var 3 a) (Var 3 b)] [] [(DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4 []) ()) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Logical 4 []) Source Public Required .false.), verify: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 a) (Var 4 b)] [] [(= (Var 4 r) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 4 a) () (Integer 4 []) ()) ()) [(= (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4 []) ()) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_08_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (SubroutineCall 2 copy_from_to () [((Var 2 x)) ((Var 2 y))] ()) (= (Var 2 r) (FunctionCall 2 verify () [((Var 2 x)) ((Var 2 y))] (Logical 4 []) () ()) ()) (Print () [(Var 2 r)] () ()) (If (LogicalNot (Var 2 r) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_op_4-ca3318f.json b/tests/reference/asr-arrays_op_4-ca3318f.json index 5d3ecdd327..173467b7ab 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.json +++ b/tests/reference/asr-arrays_op_4-ca3318f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_4-ca3318f.stdout", - "stdout_hash": "81e2a6c5a468d4ede9de5d9d9cd16d2be9d63334a534629483b8ae1e", + "stdout_hash": "082370c90dfe0b3abde5a219798bd2156881a3d4cd6d3617198b8d99", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_4-ca3318f.stdout b/tests/reference/asr-arrays_op_4-ca3318f.stdout index 681aff1a38..e77a5d6c9e 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.stdout +++ b/tests/reference/asr-arrays_op_4-ca3318f.stdout @@ -1,2 +1 @@ -fname modulo2 (TranslationUnit (SymbolTable 1 {array_op_3: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), dim1: (Variable 2 dim1 Local (IntegerConstant 10 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim2: (Variable 2 dim2 Local (IntegerConstant 100 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim3: (Variable 2 dim3 Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), modulo2: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) modulo2 [(Var 3 x)] [] [(= (Var 3 r) (IntegerCompare (IntegerBinOp (Var 3 x) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (Var 3 x) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.), verify: (Function (SymbolTable 4 {c: (Variable 4 c In () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), op_code: (Variable 4 op_code In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Local () () Default (Logical 4 []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 c) (Var 4 op_code)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 x) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (Var 4 y) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Mul (Var 4 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 j) Mul (Var 4 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 k) Mul (Var 4 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (Select (Var 4 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) And (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Or (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Eqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 3 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) NEqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false.)}) array_op_3 [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))])] () () ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim1) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim2) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim3) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ())])])]) (= (Var 2 c) (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Eqv (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 2 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 3 (Integer 4 [])))] ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-arrays_op_6-030b24e.json b/tests/reference/asr-arrays_op_6-030b24e.json index 92b0bf8d0b..2d71cfdcbd 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.json +++ b/tests/reference/asr-arrays_op_6-030b24e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_6-030b24e.stdout", - "stdout_hash": "313a44f4e308b3cf4d63336a460cc23c66e72279ea8819933244746d", + "stdout_hash": "81225797b0a03a3f8fee30722b5e78cdbff5a1b2bd53e87cd2ced35e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_6-030b24e.stdout b/tests/reference/asr-arrays_op_6-030b24e.stdout index 5806deb14d..7b4f1f82a1 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.stdout +++ b/tests/reference/asr-arrays_op_6-030b24e.stdout @@ -1,2 +1 @@ -fname asquare (TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), asquare: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), d: (Variable 3 d ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.)}) asquare [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 [(() ()) (() ()) (() ())]) ()) Add (Var 3 c) (Real 4 [(() ()) (() ()) (() ())]) ()) ())] (Var 3 d) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.)}) check [(Var 4 c)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()) Pow (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.), d: (Variable 2 d Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 i) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ())])])]) (= (Var 2 d) (FunctionCall 2 asquare () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 check () [((Var 2 d))] ())])}) []) diff --git a/tests/reference/asr-callback_01-21b53de.json b/tests/reference/asr-callback_01-21b53de.json index 69d90eca8e..bfdc215425 100644 --- a/tests/reference/asr-callback_01-21b53de.json +++ b/tests/reference/asr-callback_01-21b53de.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_01-21b53de.stdout", - "stdout_hash": "0ca5ca4e3a96fb6b2aa9a2b6a4d7ea3c71d24088e8b259dd8891decd", + "stdout_hash": "b3c5de75d0cb36f4008a078733458828102d57cf9a4aabaeb89eb37e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_01-21b53de.stdout b/tests/reference/asr-callback_01-21b53de.stdout index d90e0afd83..98e1c5d691 100644 --- a/tests/reference/asr-callback_01-21b53de.stdout +++ b/tests/reference/asr-callback_01-21b53de.stdout @@ -1,3 +1 @@ -fname cb -fname f (TranslationUnit (SymbolTable 1 {callback_01: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), cb: (Variable 3 cb ReturnVar () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [] (Var 4 f) Source Public Interface () .false. .false. .false.)}) cb [(Var 3 f) (Var 3 a) (Var 3 b)] [] [(= (Var 3 cb) (RealBinOp (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 a))] (Real 4 []) () ()) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 b))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 3 cb) Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x)] [] [(= (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] (Var 6 f) Source Public Implementation () .false. .false. .false.)}) foo [(Var 5 c) (Var 5 d)] [] [(Print () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) callback_01 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_01 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_01 [] foo Public)}) main [callback_01] [(SubroutineCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) diff --git a/tests/reference/asr-callback_02-aec5457.json b/tests/reference/asr-callback_02-aec5457.json index a9b14362c5..5931a25ee2 100644 --- a/tests/reference/asr-callback_02-aec5457.json +++ b/tests/reference/asr-callback_02-aec5457.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_02-aec5457.stdout", - "stdout_hash": "04c38e3c28a0975822b87fa27d5128f36b47c2e628078606fc23a68e", + "stdout_hash": "728d29084c9338b0f927f92c075bbf9cd0e687446cedb3a01f9affa0", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_02-aec5457.stdout b/tests/reference/asr-callback_02-aec5457.stdout index 1256390a04..6fbb959833 100644 --- a/tests/reference/asr-callback_02-aec5457.stdout +++ b/tests/reference/asr-callback_02-aec5457.stdout @@ -1,2 +1 @@ -fname foo (TranslationUnit (SymbolTable 1 {callback_02: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {res: (Variable 4 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x) (Var 4 res)] [] [] () Source Public Interface () .false. .false. .false.), res: (Variable 3 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) cb [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (= (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Mul (Var 3 res) (Real 4 []) ()) ()) (Print () [(Var 3 res)] () ())] () Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {res: (Variable 6 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x) (Var 6 res)] [] [(= (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), foo: (Variable 5 foo ReturnVar () () Default (Real 4 []) Source Public Required .false.), res: (Variable 5 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 5 c) (Var 5 d) (Var 5 res)] [] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] ()) (= (Var 5 foo) (Var 5 res) ())] (Var 5 foo) Source Public Implementation () .false. .false. .false.)}) callback_02 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_02 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_02 [] foo Public), res: (Variable 7 res Local (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) main [callback_02] [(= (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 []))) ((Var 7 res))] (Real 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-class_01-704dee8.json b/tests/reference/asr-class_01-704dee8.json index 879fbc9440..3ecdfab9d9 100644 --- a/tests/reference/asr-class_01-704dee8.json +++ b/tests/reference/asr-class_01-704dee8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_01-704dee8.stdout", - "stdout_hash": "1ff0b83f2e9a52b6943113c20cd812e8f08e73313bdb27d340c912f4", + "stdout_hash": "82023f8a7f1ca448f27dc3d94db41107cb5c80b55e2106f354b96d48", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_01-704dee8.stdout b/tests/reference/asr-class_01-704dee8.stdout index fc0094de79..2246bf1fb3 100644 --- a/tests/reference/asr-class_01-704dee8.stdout +++ b/tests/reference/asr-class_01-704dee8.stdout @@ -1,2 +1 @@ -fname circle_area (TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 6 circle []) Source Private Required .false.), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Private)}) circle_test [class_circle1] [(= (Var 6 c) (DerivedTypeConstructor 6 circle [(RealConstant 1.500000 (Real 4 []))] (Derived 6 circle []) ()) ()) (SubroutineCall 3 print () [] (Var 6 c)) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (SubroutineCall 3 print () [] (Var 6 c))]), class_circle1: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {area: (ClassProcedure 3 area circle_area 2 circle_area Source), print: (ClassProcedure 3 print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {area: (Variable 4 area ReturnVar () () Default (Real 4 []) Source Private Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle1 [] .false. .false.)}) []) diff --git a/tests/reference/asr-class_02-b56b852.json b/tests/reference/asr-class_02-b56b852.json index 573d701c78..d1b08583ca 100644 --- a/tests/reference/asr-class_02-b56b852.json +++ b/tests/reference/asr-class_02-b56b852.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_02-b56b852.stdout", - "stdout_hash": "618d7c3773c164f990cd79750da5b0b5583756c4dbe7e4b10be0d5bb", + "stdout_hash": "200e34ddceeb095c18df762b8821004b24578f8f20da5a5d25192bf3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_02-b56b852.stdout b/tests/reference/asr-class_02-b56b852.stdout index 99cd5fa201..15960012c5 100644 --- a/tests/reference/asr-class_02-b56b852.stdout +++ b/tests/reference/asr-class_02-b56b852.stdout @@ -1,2 +1 @@ -fname circle_area (TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 7 {main: (ExternalSymbol 7 main 2 main class_circle2 [] main Private)}) circle_test [class_circle2] [(SubroutineCall 7 main () [] ())]), class_circle2: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {circle_area: (ClassProcedure 3 circle_area circle_area 2 circle_area Source), circle_print: (ClassProcedure 3 circle_print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {circle_area: (Variable 4 circle_area ReturnVar () () Default (Real 4 []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 circle_area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 circle_area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), main: (Function (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 2 circle []) Source Private Required .false.)}) main [] [] [(= (Var 6 c) (DerivedTypeConstructor 2 circle [(RealConstant 1.000000 (Real 4 []))] (Derived 2 circle []) ()) ()) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ()) (SubroutineCall 3 circle_print () [] (Var 6 c))] () Source Public Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle2 [] .false. .false.)}) []) diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.json b/tests/reference/asr-continue_body_if_loop-670a23a.json index 8ca77e179b..6306a456fa 100644 --- a/tests/reference/asr-continue_body_if_loop-670a23a.json +++ b/tests/reference/asr-continue_body_if_loop-670a23a.json @@ -5,9 +5,9 @@ "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-continue_body_if_loop-670a23a.stderr", - "stderr_hash": "c6a4176a2b3ac7a08437edc3587c8ed422ffc1fc68a3b8092f1104a1", - "returncode": 2 + "stdout": "asr-continue_body_if_loop-670a23a.stdout", + "stdout_hash": "7c427401f472a1acfa09468084f80f708554b38d8fcf1f528d0d922d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.stderr b/tests/reference/asr-continue_body_if_loop-670a23a.stderr deleted file mode 100644 index 19835ff447..0000000000 --- a/tests/reference/asr-continue_body_if_loop-670a23a.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/continue_body_if_loop.f:9:8 - | -9 | STOP - | ^ diff --git a/tests/reference/asr-derived_types_03-b1d32aa.json b/tests/reference/asr-derived_types_03-b1d32aa.json index 86752e32c3..bf69385af6 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.json +++ b/tests/reference/asr-derived_types_03-b1d32aa.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_03-b1d32aa.stdout", - "stdout_hash": "02ed9f6742c6161cdbdcec4a8e60363ba7d386e2f5ba184018655543", + "stdout_hash": "0539d13f3206905780ee4674b9e39ac590dc1045dd5c2a59a5ff7dd4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_03-b1d32aa.stdout b/tests/reference/asr-derived_types_03-b1d32aa.stdout index f50f62b9bb..e47c030f0b 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.stdout +++ b/tests/reference/asr-derived_types_03-b1d32aa.stdout @@ -1,2 +1 @@ -fname Z (TranslationUnit (SymbolTable 1 {derived_types_03: (Program (SymbolTable 2 {b: (Variable 2 b Local () () Default (Derived 2 x []) Source Public Required .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) x [i] Source Public ()), y: (Function (SymbolTable 4 {a: (DerivedType (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 4 b Local () () Default (Derived 4 a []) Source Public Required .false.)}) y [] [] [] () Source Public Implementation () .false. .false. .false.), z: (Function (SymbolTable 6 {a: (DerivedType (SymbolTable 7 {i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 6 b Local () () Default (Derived 6 a []) Source Public Required .false.), z: (Variable 6 z ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) z [] [] [(= (Var 6 z) (IntegerConstant 5 (Integer 4 [])) ())] (Var 6 z) Source Public Implementation () .false. .false. .false.)}) derived_types_03 [] [])}) []) diff --git a/tests/reference/asr-derived_types_05-35150cd.json b/tests/reference/asr-derived_types_05-35150cd.json index ffe96d35b9..0be393ca72 100644 --- a/tests/reference/asr-derived_types_05-35150cd.json +++ b/tests/reference/asr-derived_types_05-35150cd.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_05-35150cd.stdout", - "stdout_hash": "e3d0120145636d605491149d0ee0a92ad1605ceca06841024bcc8863", + "stdout_hash": "28d73162cdc59fdefe0c196172ae9ba8afe49e61b3b44a43b3bdc8b2", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_05-35150cd.stdout b/tests/reference/asr-derived_types_05-35150cd.stdout index 992132eca8..31e7d41920 100644 --- a/tests/reference/asr-derived_types_05-35150cd.stdout +++ b/tests/reference/asr-derived_types_05-35150cd.stdout @@ -1,5 +1 @@ -fname new_string -fname new_string_from_integer_int32 -fname new_string_from_integer_int64 -fname new_string_from_logical_lk (TranslationUnit (SymbolTable 1 {derived_type_05: (Program (SymbolTable 13 {}) derived_type_05 [] []), stdlib_string_type: (Module (SymbolTable 2 {new_string: (Function (SymbolTable 4 {new: (Variable 4 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), string: (Variable 4 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 4 string)] [] [] (Var 4 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 5 {new: (Variable 5 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 5 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 5 val)] [] [] (Var 5 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 6 {new: (Variable 6 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 6 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 6 val)] [] [] (Var 6 new) Source Public Interface () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 7 {new: (Variable 7 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 7 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 7 val)] [] [] (Var 7 new) Source Public Interface () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ()), ~string_type: (GenericProcedure 2 ~string_type [2 new_string 2 new_string_from_integer_int32 2 new_string_from_integer_int64 2 new_string_from_logical_lk] Public)}) stdlib_string_type [] .false. .false.), stdlib_string_type_constructor: (Module (SymbolTable 8 {new_string: (Function (SymbolTable 9 {new: (Variable 9 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), string: (Variable 9 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 9 string)] [] [] (Var 9 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 10 {new: (Variable 10 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 10 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 10 val)] [] [] (Var 10 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 11 {new: (Variable 11 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 11 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 11 val)] [] [] (Var 11 new) Source Public Implementation () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 12 {new: (Variable 12 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 12 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 12 val)] [] [] (Var 12 new) Source Public Implementation () .true. .false. .false.), string_type: (ExternalSymbol 8 string_type 2 string_type stdlib_string_type [] string_type Public), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type stdlib_string_type [] ~string_type Public)}) stdlib_string_type_constructor [] .false. .false.)}) []) diff --git a/tests/reference/asr-dimension_attr2-8fda690.json b/tests/reference/asr-dimension_attr2-8fda690.json index 7e2f4bf69f..d382b23094 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.json +++ b/tests/reference/asr-dimension_attr2-8fda690.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr2-8fda690.stdout", - "stdout_hash": "bf93467b6f11c91c1906989e4f07a5cfc664e59af10803a97b0b9c8b", + "stdout_hash": "8cca1169a698173c242b06842c26ea09b65e763bca03e808dc98aba8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dimension_attr2-8fda690.stdout b/tests/reference/asr-dimension_attr2-8fda690.stdout index c5551a42ba..5f99b65495 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.stdout +++ b/tests/reference/asr-dimension_attr2-8fda690.stdout @@ -1,2 +1 @@ -fname f (TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) f [(Var 2 x)] [] [] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json index aecca1e429..062f5b962f 100644 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json +++ b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json @@ -5,9 +5,9 @@ "infile_hash": "8f15672107a6ce738849ac95c05abf87ef22c71914e2dfa402f9d633", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-fixed_form_if_variations-b4dcd1e.stderr", - "stderr_hash": "3c0eaaa52aece36c96edd910d72281cd2f18619dae8d1abfa95b9f5e", - "returncode": 2 + "stdout": "asr-fixed_form_if_variations-b4dcd1e.stdout", + "stdout_hash": "3da1975a13d60a80bbc681a903f5672d9cbdbc9ac7918398a1780839", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stderr b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stderr deleted file mode 100644 index 53349eb693..0000000000 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stderr +++ /dev/null @@ -1,9 +0,0 @@ -syntax error: Newline is unexpected here - --> tests/fixed_form_if_variations.f:20:29 - 21:7 - | -20 | if (0<1) call f(2) - | ... -... - | -21 | end program - | ...^^^^^^^ diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json index 679672a873..8adaae9203 100644 --- a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json +++ b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json @@ -5,9 +5,9 @@ "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-fixed_form_simple_continue-1cd55c6.stderr", - "stderr_hash": "f349a69c74e399b2d03ebec26ae529d38fe746dc17687bcbe9cb9f58", - "returncode": 2 + "stdout": "asr-fixed_form_simple_continue-1cd55c6.stdout", + "stdout_hash": "3053ee09aedbc26b3d2babb181ee5dca87e77a41116f20293d534f58", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stderr b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stderr deleted file mode 100644 index 0f8e1da258..0000000000 --- a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/fixed_form_simple_continue.f:1:7 - | -1 | continue - | ^ diff --git a/tests/reference/asr-flip_sign-a0cebd4.json b/tests/reference/asr-flip_sign-a0cebd4.json index aeb771015c..90dc72ebbf 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.json +++ b/tests/reference/asr-flip_sign-a0cebd4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", - "stdout_hash": "f8ca1516a812d4c01d0e729e4b8fce0f69f5dccee8556c0809bae861", + "stdout_hash": "a0b66e571f67dee7b9a63ed9288c4327988250b7260c8ea8c27b007c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-flip_sign-a0cebd4.stdout b/tests/reference/asr-flip_sign-a0cebd4.stdout index 6fcb32449d..3bb1efc86f 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.stdout +++ b/tests/reference/asr-flip_sign-a0cebd4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-fn2-b585098.json b/tests/reference/asr-fn2-b585098.json index 3102727852..f69c47977a 100644 --- a/tests/reference/asr-fn2-b585098.json +++ b/tests/reference/asr-fn2-b585098.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-fn2-b585098.stdout", - "stdout_hash": "32fc8e855184138678a1558b75d54e148e1da96505ae0d238610158b", + "stdout_hash": "cc309eec2ffc958db5b49b556533ca7a25731586a5ce184a575334a6", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-fn2-b585098.stdout b/tests/reference/asr-fn2-b585098.stdout index 8a27cf357a..3d4ef3a5c0 100644 --- a/tests/reference/asr-fn2-b585098.stdout +++ b/tests/reference/asr-fn2-b585098.stdout @@ -1,7 +1 @@ -fname a -fname b -fname c -fname d -fname e -fname f (TranslationUnit (SymbolTable 1 {a: (Function (SymbolTable 2 {a: (Variable 2 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [] (Var 2 a) Source Public Implementation () .false. .false. .false.), b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) b [] [] [] (Var 3 b) Source Public Implementation () .false. .false. .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) c [] [] [] (Var 4 c) Source Public Implementation () .false. .false. .false.), d: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.), e: (Function (SymbolTable 6 {r: (Variable 6 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) e [] [] [] (Var 6 r) Source Public Implementation () .false. .false. .false.), f: (Function (SymbolTable 7 {r: (Variable 7 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) f [] [] [] (Var 7 r) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/asr-functions_04-ea50b75.json b/tests/reference/asr-functions_04-ea50b75.json index 576293addb..2decd4fcd1 100644 --- a/tests/reference/asr-functions_04-ea50b75.json +++ b/tests/reference/asr-functions_04-ea50b75.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_04-ea50b75.stdout", - "stdout_hash": "70e1e6d4fb294c85a9665c4a5cf2d32a19ef361dfc5f44a8225cba8a", + "stdout_hash": "b8fe67bccdad1ff38b81c7d36289fcc08057de1b0a14e12710df32d3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_04-ea50b75.stdout b/tests/reference/asr-functions_04-ea50b75.stdout index 8d0b5554fe..184e398d21 100644 --- a/tests/reference/asr-functions_04-ea50b75.stdout +++ b/tests/reference/asr-functions_04-ea50b75.stdout @@ -1,2 +1 @@ -fname to_negative (TranslationUnit (SymbolTable 1 {functions_04: (Program (SymbolTable 4 {int: (Variable 4 int Local (IntegerConstant 4 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), to_negative: (ExternalSymbol 4 to_negative 2 to_negative stdlib_int [] to_negative Public), to_negative@to_negative~genericprocedure: (ExternalSymbol 4 to_negative@to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Private), to_negative~genericprocedure: (ExternalSymbol 4 to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Public)}) functions_04 [stdlib_int] [(If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] [])]), stdlib_int: (Module (SymbolTable 2 {to_negative: (GenericProcedure 2 to_negative [2 to_negative~genericprocedure] Public), to_negative~genericprocedure: (Function (SymbolTable 3 {int: (Variable 3 int In () () Default (Integer 4 []) Source Public Required .false.), neg_int: (Variable 3 neg_int ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) to_negative~genericprocedure [(Var 3 int)] [] [(If (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4 []) ()) ())] [(= (Var 3 neg_int) (Var 3 int) ())])] (Var 3 neg_int) Source Public Implementation () .false. .false. .false.)}) stdlib_int [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_05-adf0d8b.json b/tests/reference/asr-functions_05-adf0d8b.json index 8d451831c3..e5a25055b8 100644 --- a/tests/reference/asr-functions_05-adf0d8b.json +++ b/tests/reference/asr-functions_05-adf0d8b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_05-adf0d8b.stdout", - "stdout_hash": "9decffede6e9fec4ac7cbda574ee168874253174c0be5691a9b8d798", + "stdout_hash": "3ddb916043c2b899eb631cf86281af02c7d4a5587d1069e854abb830", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_05-adf0d8b.stdout b/tests/reference/asr-functions_05-adf0d8b.stdout index 61d8bf3403..8995349665 100644 --- a/tests/reference/asr-functions_05-adf0d8b.stdout +++ b/tests/reference/asr-functions_05-adf0d8b.stdout @@ -1,4 +1 @@ -fname f -fname f_real -fname signr32 (TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4 []))) ((Var 4 a))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4 []) () ()) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4 []) () ()) ()) (Print () [(Var 2 c)] () ())])}) []) diff --git a/tests/reference/asr-functions_06-83a7aca.json b/tests/reference/asr-functions_06-83a7aca.json index 456e8dcd9d..442dc8e982 100644 --- a/tests/reference/asr-functions_06-83a7aca.json +++ b/tests/reference/asr-functions_06-83a7aca.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_06-83a7aca.stdout", - "stdout_hash": "9881b36e9146c49ba149a52603dbaccccde6616ac0c9de8f14e446fe", + "stdout_hash": "c9ca90b74522400b4f3d1bc0b01036cbc8e847353a8f6f06e6054125", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_06-83a7aca.stdout b/tests/reference/asr-functions_06-83a7aca.stdout index 92a4454004..19f5824bac 100644 --- a/tests/reference/asr-functions_06-83a7aca.stdout +++ b/tests/reference/asr-functions_06-83a7aca.stdout @@ -1,4 +1 @@ -fname trim_wrapper -fname int_return -fname real_return (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {int_return: (Function (SymbolTable 4 {i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 4 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 4 r ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 4 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) int_return [(Var 4 s)] [] [(DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), real_return: (Function (SymbolTable 29 {i: (Variable 29 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 29 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 29 r ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 29 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) real_return [(Var 29 s)] [] [(DoLoop ((Var 29 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 29 r) [(() (Var 29 i) ())] (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ())])] (Var 29 r) Source Public Implementation () .false. .false. .false.), trim_wrapper: (Function (SymbolTable 3 {len: (ExternalSymbol 3 len 6 len lfortran_intrinsic_builtin [] len Private), len_trim: (ExternalSymbol 3 len_trim 32 len_trim lfortran_intrinsic_string [] len_trim Private), r: (Variable 3 r ReturnVar () () Default (Character 1 -3 (FunctionCall 3 len () [((Var 3 s))] (Integer 4 []) () ()) []) Source Public Required .false.), s: (Variable 3 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.), trim: (ExternalSymbol 3 trim 32 trim lfortran_intrinsic_string [] trim Private)}) trim_wrapper [(Var 3 s)] [] [(= (Var 3 r) (FunctionCall 3 trim () [((Var 3 s))] (Character 1 -3 (FunctionCall 3 len_trim () [((Var 3 s))] (Integer 4 []) () ()) []) () ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a [lfortran_intrinsic_builtin lfortran_intrinsic_string] .false. .false.), functions_06: (Program (SymbolTable 30 {int_return: (ExternalSymbol 30 int_return 2 int_return a [] int_return Public), len: (ExternalSymbol 30 len 6 len lfortran_intrinsic_builtin [] len Private), real_return: (ExternalSymbol 30 real_return 2 real_return a [] real_return Public), string: (Variable 30 string Local (StringConstant " abc" (Character 1 5 () [])) () Save (Character 1 5 () []) Source Public Required .false.), trim_wrapper: (ExternalSymbol 30 trim_wrapper 2 trim_wrapper a [] trim_wrapper Public)}) functions_06 [a] [(Print () [(FunctionCall 30 trim_wrapper () [((Var 30 string))] (Character 1 -3 (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()) []) () ())] () ()) (Print () [(FunctionCall 30 int_return () [((Var 30 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ()) (Print () [(FunctionCall 30 real_return () [((Var 30 string))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_string: (IntrinsicModule lfortran_intrinsic_string)}) []) diff --git a/tests/reference/asr-functions_07-2d29eab.json b/tests/reference/asr-functions_07-2d29eab.json index fe52de4002..02ffc1fb9d 100644 --- a/tests/reference/asr-functions_07-2d29eab.json +++ b/tests/reference/asr-functions_07-2d29eab.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_07-2d29eab.stdout", - "stdout_hash": "e64c274b5207ccf72262064a1ada627e11f828a83ee7bb582f009d18", + "stdout_hash": "bd9acf83184e47ab00702394f439081484be561e267efe4fb1c0903f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_07-2d29eab.stdout b/tests/reference/asr-functions_07-2d29eab.stdout index f5ec1ac631..10d3b9b5b3 100644 --- a/tests/reference/asr-functions_07-2d29eab.stdout +++ b/tests/reference/asr-functions_07-2d29eab.stdout @@ -1,4 +1 @@ -fname f_a -fname f_b -fname f_c (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4 []) () ()) ()) (Print () [(Var 8 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_08-23f422a.json b/tests/reference/asr-functions_08-23f422a.json index d546d09f43..29d8431730 100644 --- a/tests/reference/asr-functions_08-23f422a.json +++ b/tests/reference/asr-functions_08-23f422a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_08-23f422a.stdout", - "stdout_hash": "0e0ef0d3b07cbfb5ab4cfdd0760156c9d0746c959504b70fa7a01873", + "stdout_hash": "48e839556de6ef4c72da2a42898721ef2ce826113c85ea2279a34601", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_08-23f422a.stdout b/tests/reference/asr-functions_08-23f422a.stdout index 4eca6bcc98..a71a9bc380 100644 --- a/tests/reference/asr-functions_08-23f422a.stdout +++ b/tests/reference/asr-functions_08-23f422a.stdout @@ -1,3 +1 @@ -fname f -fname f_real (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4 []) () ()) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4 []) () ()) ()) (Print () [(Var 3 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_09-1e51ac7.json b/tests/reference/asr-functions_09-1e51ac7.json index dfc35dd08f..58388734c4 100644 --- a/tests/reference/asr-functions_09-1e51ac7.json +++ b/tests/reference/asr-functions_09-1e51ac7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_09-1e51ac7.stdout", - "stdout_hash": "1d74050cafd1547fddfa26f4ec098c4966712b395b5ea936a6ff7a21", + "stdout_hash": "bbfb28028a05fa8a3491f00a4f3168ae0fec7ad5d6fc93450864d304", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_09-1e51ac7.stdout b/tests/reference/asr-functions_09-1e51ac7.stdout index ed7ae9c7d3..fa186a914f 100644 --- a/tests/reference/asr-functions_09-1e51ac7.stdout +++ b/tests/reference/asr-functions_09-1e51ac7.stdout @@ -1,2 +1 @@ -fname simps38_weights_dp (TranslationUnit (SymbolTable 1 {stdlib_quadrature: (Program (SymbolTable 5 {simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public), x1: (Variable 5 x1 Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) stdlib_quadrature [stdlib_quadrature_simps] [(Print () [(FunctionCall 5 simps38_weights_dp () [((Var 5 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())]), stdlib_quadrature_simps: (Module (SymbolTable 2 {simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public), simps38_weights_dp: (Function (SymbolTable 3 {w: (Variable 3 w ReturnVar () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp [(Var 3 x)] [] [] (Var 3 w) Source Public Implementation () .false. .false. .false.), simps38_weights_dp_use: (Function (SymbolTable 4 {x1: (Variable 4 x1 In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp_use [(Var 4 x1)] [] [(Print () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) stdlib_quadrature_simps [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_10-0449324.json b/tests/reference/asr-functions_10-0449324.json index b2124a4b56..ca6fd1c598 100644 --- a/tests/reference/asr-functions_10-0449324.json +++ b/tests/reference/asr-functions_10-0449324.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_10-0449324.stdout", - "stdout_hash": "bc9311b2ca357ac0efd9a4283c7be783a962e297ce4e9952088eaa80", + "stdout_hash": "a99c792a0624f651d853558e66244e20adff2711cddf7a1f87a2b55b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_10-0449324.stdout b/tests/reference/asr-functions_10-0449324.stdout index 7b09958d77..2dd7c08f74 100644 --- a/tests/reference/asr-functions_10-0449324.stdout +++ b/tests/reference/asr-functions_10-0449324.stdout @@ -1,4 +1 @@ -fname mergei32 -fname merger32 -fname merger64 (TranslationUnit (SymbolTable 1 {kwarg_gp: (Module (SymbolTable 2 {mergegp: (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public), mergei32: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), m: (Variable 3 m Unspecified () () Default (Integer 4 [(() ())]) Source Public Optional .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mergei32 [(Var 3 a) (Var 3 b) (Var 3 m)] [] [] (Var 3 r) Source Public Implementation () .false. .false. .false.), merger32: (Function (SymbolTable 4 {a: (Variable 4 a Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), m: (Variable 4 m Unspecified () () Default (Real 4 [(() ())]) Source Public Optional .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) merger32 [(Var 4 a) (Var 4 b) (Var 4 m)] [] [] (Var 4 r) Source Public Implementation () .false. .false. .false.), merger64: (Function (SymbolTable 5 {a: (Variable 5 a Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), b: (Variable 5 b Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), m: (Variable 5 m Unspecified () () Default (Real 8 [(() ())]) Source Public Optional .false.), r: (Variable 5 r ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) merger64 [(Var 5 a) (Var 5 b) (Var 5 m)] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.)}) kwarg_gp [] .false. .false.), kwarg_use: (Program (SymbolTable 6 {a1: (Variable 6 a1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), a2: (Variable 6 a2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), b1: (Variable 6 b1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), b2: (Variable 6 b2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), m1: (Variable 6 m1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), m2: (Variable 6 m2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), mergegp: (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public), mergegp@mergei32: (ExternalSymbol 6 mergegp@mergei32 2 mergei32 kwarg_gp [] mergei32 Private), mergegp@merger32: (ExternalSymbol 6 mergegp@merger32 2 merger32 kwarg_gp [] merger32 Private), mergei32: (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public), merger32: (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public), merger64: (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public)}) kwarg_use [kwarg_gp] [(Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ())])}) []) diff --git a/tests/reference/asr-implicit_typing2-d87e21a.json b/tests/reference/asr-implicit_typing2-d87e21a.json index c2f06e0d9b..13f9de6b0a 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.json +++ b/tests/reference/asr-implicit_typing2-d87e21a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing2-d87e21a.stdout", - "stdout_hash": "fad2138bacc4b4da3288b763bd27774542a1f1a0213524ab60f66be1", + "stdout_hash": "63de72db75aa1d64d6c308a037142ada39423fd1f08ac2a17fdf5120", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-implicit_typing2-d87e21a.stdout b/tests/reference/asr-implicit_typing2-d87e21a.stdout index 88e8d062c3..08dcfc311d 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.stdout +++ b/tests/reference/asr-implicit_typing2-d87e21a.stdout @@ -1,2 +1 @@ -fname g (TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), b: (Variable 2 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), ifault: (Variable 2 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [] [(= (Var 2 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.), ifault: (Variable 3 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) g [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [] [(= (Var 3 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] (Var 3 g) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/asr-intent_01-c1f267a.json b/tests/reference/asr-intent_01-c1f267a.json index 58c64eb18a..b837d17656 100644 --- a/tests/reference/asr-intent_01-c1f267a.json +++ b/tests/reference/asr-intent_01-c1f267a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intent_01-c1f267a.stdout", - "stdout_hash": "87b42682729fb6b9a5a4964ac455d10c8affad12d620e84dedbc1430", + "stdout_hash": "5e2ab6b5bbad4d986518726933b02a4274def281bb6020a5741cc11a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intent_01-c1f267a.stdout b/tests/reference/asr-intent_01-c1f267a.stdout index 5d7fb83f38..6553707a41 100644 --- a/tests/reference/asr-intent_01-c1f267a.stdout +++ b/tests/reference/asr-intent_01-c1f267a.stdout @@ -1,2 +1 @@ -fname f (TranslationUnit (SymbolTable 1 {dflt_intent: (Module (SymbolTable 2 {foo: (Function (SymbolTable 3 {c: (Variable 3 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 3 d Unspecified () () Default (Real 4 []) Source Public Required .false.), e: (Variable 3 e Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [(= (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 4 x) (Real 4 []) ()) ()) (Print () [(Var 4 f)] () ())] (Var 4 f) Source Public Implementation () .false. .false. .false.), g: (Variable 3 g Local () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 3 c) (Var 3 d)] [] [(= (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4 []) () ()) ()) (= (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .false. .false.)}) dflt_intent [] .false. .false.), main: (Program (SymbolTable 5 {foo: (ExternalSymbol 5 foo 2 foo dflt_intent [] foo Public)}) main [dflt_intent] [(SubroutineCall 5 foo () [((RealConstant 0.000000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) diff --git a/tests/reference/asr-interface_05-5639d22.json b/tests/reference/asr-interface_05-5639d22.json index 9a04686b98..e6b34dd7ee 100644 --- a/tests/reference/asr-interface_05-5639d22.json +++ b/tests/reference/asr-interface_05-5639d22.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_05-5639d22.stdout", - "stdout_hash": "17d7e58d35a68cee1d15a1624e44d987e0d9865df2fc5323102d0d85", + "stdout_hash": "2d438ea507da62ef6ef7433bd7ee135b115fabb5de48302f2ad6ef8f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_05-5639d22.stdout b/tests/reference/asr-interface_05-5639d22.stdout index 3abaedbd34..5bb4e3cdb8 100644 --- a/tests/reference/asr-interface_05-5639d22.stdout +++ b/tests/reference/asr-interface_05-5639d22.stdout @@ -1,3 +1 @@ -fname a1 -fname a2 (TranslationUnit (SymbolTable 1 {interface_05: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_05_mod [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_05_mod [] a1 Private), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_05_mod [] a2 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_05 [interface_05_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (= (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4 []) () ()) ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_05_mod: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1 2 a2] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), a1: (Variable 3 a1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 3 a1) Source Public Implementation () .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a2: (Variable 4 a2 ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] (Var 4 a2) Source Public Implementation () .false. .false. .false.)}) interface_05_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.json b/tests/reference/asr-intrinsics_26-f10d0e6.json index 0d735e5a5e..991dbc0231 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.json +++ b/tests/reference/asr-intrinsics_26-f10d0e6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_26-f10d0e6.stdout", - "stdout_hash": "6bd6067eb25f4a26c3377189b919b8f70d7a1baf777406fb1f7214f3", + "stdout_hash": "c2a21033a22e37877043ea9f509553066021a6ed1aeb3033beca0c3e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.stdout b/tests/reference/asr-intrinsics_26-f10d0e6.stdout index 6e73aa6086..ee0c9b9860 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.stdout +++ b/tests/reference/asr-intrinsics_26-f10d0e6.stdout @@ -1,2 +1 @@ -fname all_set (TranslationUnit (SymbolTable 1 {intrinsics_26: (Program (SymbolTable 4 {all_set: (ExternalSymbol 4 all_set 2 all_set stdlib_bitsets_64 [] all_set Public), i: (Variable 4 i Local (IntegerConstant 31 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) intrinsics_26 [stdlib_bitsets_64] [(Print () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), stdlib_bitsets_64: (Module (SymbolTable 2 {all_set: (Function (SymbolTable 3 {btest: (ExternalSymbol 3 btest 6 btest lfortran_intrinsic_bit [] btest Private), btest@btest32: (ExternalSymbol 3 btest@btest32 6 btest32 lfortran_intrinsic_bit [] btest32 Private), num_bits: (Variable 3 num_bits In () () Default (Integer 4 []) Source Public Required .false.), pos: (Variable 3 pos Local () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 3 res ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) all_set [(Var 3 x) (Var 3 num_bits)] [] [(= (Var 3 res) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 3 pos) (IntegerConstant 0 (Integer 4 [])) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) [(If (LogicalNot (FunctionCall 3 btest@btest32 3 btest [((Var 3 x)) ((Var 3 pos))] (Logical 4 []) () ()) (Logical 4 []) ()) [(= (Var 3 res) (LogicalConstant .false. (Logical 4 [])) ())] [])])] (Var 3 res) Source Public Implementation () .false. .false. .false.)}) stdlib_bitsets_64 [lfortran_intrinsic_bit] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.json b/tests/reference/asr-intrinsics_31-9b91cfb.json index 2db269b1f2..ef6ca8149c 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.json +++ b/tests/reference/asr-intrinsics_31-9b91cfb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", - "stdout_hash": "20a21c3f7a8c26825076125708516dc19dd5fd4659622228fab8956c", + "stdout_hash": "50fc18dce3d8d5cc827e72f3386c50089203fafc38470c5a1c932be5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.stdout b/tests/reference/asr-intrinsics_31-9b91cfb.stdout index 9ccd02ab8a..6514655f12 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.stdout +++ b/tests/reference/asr-intrinsics_31-9b91cfb.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 101 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 101 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 102 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 102 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-issue532-4bdd3b3.json b/tests/reference/asr-issue532-4bdd3b3.json index d4b5bd2530..924b508aec 100644 --- a/tests/reference/asr-issue532-4bdd3b3.json +++ b/tests/reference/asr-issue532-4bdd3b3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-issue532-4bdd3b3.stdout", - "stdout_hash": "e7014723928c5dae258b20f9acfd1436b97e76cb86467484bc014638", + "stdout_hash": "b08631b7bbf6ae74f52cb7ffc5669878deda272d0fc4bd7a8533c905", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-issue532-4bdd3b3.stdout b/tests/reference/asr-issue532-4bdd3b3.stdout index e49d3bf00b..cd48f2085f 100644 --- a/tests/reference/asr-issue532-4bdd3b3.stdout +++ b/tests/reference/asr-issue532-4bdd3b3.stdout @@ -1,3 +1 @@ -fname sfloor -fname imodulo (TranslationUnit (SymbolTable 1 {issue532: (Program (SymbolTable 5 {}) issue532 [] []), issue532_mod: (Module (SymbolTable 2 {imodulo: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), real: (ExternalSymbol 4 real 7 real lfortran_intrinsic_builtin [] real Private), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 4 y In () () Default (Integer 4 []) Source Public Required .false.)}) imodulo [(Var 4 x) (Var 4 y)] [] [(= (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((Cast (Var 4 x) IntegerToReal (Real 4 []) ()))] (Integer 4 []) () ()) Mul (Var 4 y) (Integer 4 []) ()) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), sfloor: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 4 []) Source Public Required .false.)}) sfloor [(Var 3 x)] [] [(= (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) issue532_mod [lfortran_intrinsic_builtin] .false. .false.), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin)}) []) diff --git a/tests/reference/asr-loop_test1-716ccb0.json b/tests/reference/asr-loop_test1-716ccb0.json index 0b11c57969..41b04a7dad 100644 --- a/tests/reference/asr-loop_test1-716ccb0.json +++ b/tests/reference/asr-loop_test1-716ccb0.json @@ -2,12 +2,12 @@ "basename": "asr-loop_test1-716ccb0", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", - "infile_hash": "f43bdfadffef14934343fab6719fe5b78acc2f77520a8a25e4ac0b9c", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_test1-716ccb0.stderr", - "stderr_hash": "54750ebea2b3fcb97d030aa4eb558a8db5b8cbe789fe772bacf9acc6", - "returncode": 2 + "stdout": "asr-loop_test1-716ccb0.stdout", + "stdout_hash": "f82496dd80a07b822f56ba095b1d2e7d6bfdbc6c390b60d5802c2dcc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-loop_test1-716ccb0.stderr b/tests/reference/asr-loop_test1-716ccb0.stderr deleted file mode 100644 index 5f61305da7..0000000000 --- a/tests/reference/asr-loop_test1-716ccb0.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/loop_test1.f:4:1 - | -4 | <<<<<<< HEAD - | ^ diff --git a/tests/reference/asr-loop_test2-82d82ea.json b/tests/reference/asr-loop_test2-82d82ea.json index 836f8b3de6..32f805ff84 100644 --- a/tests/reference/asr-loop_test2-82d82ea.json +++ b/tests/reference/asr-loop_test2-82d82ea.json @@ -2,12 +2,12 @@ "basename": "asr-loop_test2-82d82ea", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", - "infile_hash": "b46cf8c93329247479184cd8ce1d8948a1302d6c0c4095d991d039a9", + "infile_hash": "eeca40e0ea1de861bd50394bb8dd9b8ffca564f6d72b55497c601fac", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_test2-82d82ea.stderr", - "stderr_hash": "9e91965942cfa80b6ecaecfa88ed41fbda182688cb8b90f1e309ae60", - "returncode": 2 + "stdout": "asr-loop_test2-82d82ea.stdout", + "stdout_hash": "ab16d86e92a60d1b61cb94b85d58d2e3bdee2c8804b213f57bf991a3", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-loop_test2-82d82ea.stderr b/tests/reference/asr-loop_test2-82d82ea.stderr deleted file mode 100644 index f8135a65b2..0000000000 --- a/tests/reference/asr-loop_test2-82d82ea.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for subroutine - --> tests/loop_test2.f:9:1 - | -9 | <<<<<<< HEAD - | ^ diff --git a/tests/reference/asr-modules_05-f939cc6.json b/tests/reference/asr-modules_05-f939cc6.json index ae8fb29342..d95de13740 100644 --- a/tests/reference/asr-modules_05-f939cc6.json +++ b/tests/reference/asr-modules_05-f939cc6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_05-f939cc6.stdout", - "stdout_hash": "8cfe73a6b0e077ce1801b08b76f5f3ddbc68972a39edc386aabbb8ce", + "stdout_hash": "8a064c473731e37fc6eaed51be76a3a60278f236c17696045e300903", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_05-f939cc6.stdout b/tests/reference/asr-modules_05-f939cc6.stdout index 5c3273c8af..3b8f4d6fb8 100644 --- a/tests/reference/asr-modules_05-f939cc6.stdout +++ b/tests/reference/asr-modules_05-f939cc6.stdout @@ -1,2 +1 @@ -fname print_vars (TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Private Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Private Required .false.), print_vars: (Variable 3 print_vars ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) print_vars [(Var 3 a) (Var 3 b)] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 3 a)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 3 b)] () ()) (= (Var 3 print_vars) (IntegerConstant 1 (Integer 4 [])) ())] (Var 3 print_vars) Source Private Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_06-609dd30.json b/tests/reference/asr-modules_06-609dd30.json index a60d166deb..3c25252cb6 100644 --- a/tests/reference/asr-modules_06-609dd30.json +++ b/tests/reference/asr-modules_06-609dd30.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-609dd30.stdout", - "stdout_hash": "14f89eae49bd4a5e2096acce0136340b59bd864b34dca9a60455167d", + "stdout_hash": "d03e6170844b1ab9b9b8da1f94bb69e63225bab76f8d4ec691ac907e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-609dd30.stdout b/tests/reference/asr-modules_06-609dd30.stdout index d49198959f..fb90931a68 100644 --- a/tests/reference/asr-modules_06-609dd30.stdout +++ b/tests/reference/asr-modules_06-609dd30.stdout @@ -1,2 +1 @@ -fname b (TranslationUnit (SymbolTable 1 {a_06: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 r) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a_06 [] .false. .false.), modules_06: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_06 [] b Public), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.)}) modules_06 [a_06] [(= (Var 4 i) (FunctionCall 4 b () [] (Integer 4 []) () ()) ()) (Print () [(Var 4 i)] () ())])}) []) diff --git a/tests/reference/asr-modules_06-821cc56.json b/tests/reference/asr-modules_06-821cc56.json index a6a5c7f2f0..8c80cafd25 100644 --- a/tests/reference/asr-modules_06-821cc56.json +++ b/tests/reference/asr-modules_06-821cc56.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-821cc56.stdout", - "stdout_hash": "e39d493fb6365b1f8f6fac13621f3652b2ae302203e54ec5be2392e4", + "stdout_hash": "b28d1600e77962023c84a49d89a16212dda9ead7e411bee66c487c93", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-821cc56.stdout b/tests/reference/asr-modules_06-821cc56.stdout index c2807c1994..98836e82c2 100644 --- a/tests/reference/asr-modules_06-821cc56.stdout +++ b/tests/reference/asr-modules_06-821cc56.stdout @@ -1,3 +1 @@ -fname b -fname a (TranslationUnit (SymbolTable 1 {modules_06_a: (Module (SymbolTable 4 {a: (Function (SymbolTable 5 {a: (Variable 5 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [(= (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Add (FunctionCall 4 b () [] (Integer 4 []) () ()) (Integer 4 []) ()) ())] (Var 5 a) Source Public Implementation () .false. .false. .false.), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Private)}) modules_06_a [modules_06_b] .false. .false.), modules_06_b: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(= (Var 3 b) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) modules_06_b [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_15b-09f8335.json b/tests/reference/asr-modules_15b-09f8335.json index 22a0256333..2a7d7a3798 100644 --- a/tests/reference/asr-modules_15b-09f8335.json +++ b/tests/reference/asr-modules_15b-09f8335.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_15b-09f8335.stdout", - "stdout_hash": "4f877d271117471e6ee887bdabd980f6a72df1180112643c20238be5", + "stdout_hash": "fcb0a67ac4764012588ecef29174f8fb5307d30c125c868d1ea0dcd5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_15b-09f8335.stdout b/tests/reference/asr-modules_15b-09f8335.stdout index 9721cce500..c71439beef 100644 --- a/tests/reference/asr-modules_15b-09f8335.stdout +++ b/tests/reference/asr-modules_15b-09f8335.stdout @@ -1,10 +1 @@ -fname f_string -fname fortran_i32 -fname fortran_i32_value -fname fortran_i64 -fname fortran_i64_value -fname fortran_f32 -fname fortran_f32_value -fname fortran_f64 -fname fortran_f64_value (TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), modules_15b: (Module (SymbolTable 2 {c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public), call_fortran_f32: (Function (SymbolTable 64 {i: (Variable 64 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 64 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32 [(Var 64 i)] [] [] (Var 64 r) BindC Public Interface () .false. .false. .false.), call_fortran_f32_value: (Function (SymbolTable 65 {i: (Variable 65 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 65 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32_value [(Var 65 i)] [] [] (Var 65 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64: (Function (SymbolTable 66 {i: (Variable 66 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 66 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64 [(Var 66 i)] [] [] (Var 66 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64_value: (Function (SymbolTable 67 {i: (Variable 67 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 67 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64_value [(Var 67 i)] [] [] (Var 67 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32: (Function (SymbolTable 60 {i: (Variable 60 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 60 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32 [(Var 60 i)] [] [] (Var 60 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32_value: (Function (SymbolTable 61 {i: (Variable 61 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 61 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32_value [(Var 61 i)] [] [] (Var 61 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64: (Function (SymbolTable 62 {i: (Variable 62 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 62 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64 [(Var 62 i)] [] [] (Var 62 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64_value: (Function (SymbolTable 63 {i: (Variable 63 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 63 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64_value [(Var 63 i)] [] [] (Var 63 r) BindC Public Interface () .false. .false. .false.), f_double_complex_value_return: (Function (SymbolTable 40 {b: (Variable 40 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 40 r ReturnVar () () Default (Complex 8 []) BindC Public Required .false.)}) f_double_complex_value_return [(Var 40 b)] [] [] (Var 40 r) BindC Public Interface () .false. .false. .false.), f_float_complex_value_return: (Function (SymbolTable 39 {b: (Variable 39 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 39 r ReturnVar () () Default (Complex 4 []) BindC Public Required .false.)}) f_float_complex_value_return [(Var 39 b)] [] [] (Var 39 r) BindC Public Interface () .false. .false. .false.), f_int_double: (Function (SymbolTable 34 {a: (Variable 34 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 34 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 34 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double [(Var 34 a) (Var 34 b)] [] [] (Var 34 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex: (Function (SymbolTable 36 {a: (Variable 36 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 36 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 36 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex [(Var 36 a) (Var 36 b)] [] [] (Var 36 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex_value: (Function (SymbolTable 38 {a: (Variable 38 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 38 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 38 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex_value [(Var 38 a) (Var 38 b)] [] [] (Var 38 r) BindC Public Interface () .false. .false. .false.), f_int_double_value: (Function (SymbolTable 42 {a: (Variable 42 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 42 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 42 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value [(Var 42 a) (Var 42 b)] [] [] (Var 42 r) BindC Public Interface () .false. .false. .false.), f_int_double_value_name: (Function (SymbolTable 46 {a: (Variable 46 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 46 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 46 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value_name [(Var 46 a) (Var 46 b)] [] [] (Var 46 r) BindC Public Interface "f_int_double_value" .false. .false. .false.), f_int_doublearray: (Function (SymbolTable 45 {b: (Variable 45 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 45 n))]) BindC Public Required .false.), n: (Variable 45 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 45 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) f_int_doublearray [(Var 45 n) (Var 45 b)] [] [] (Var 45 r) BindC Public Interface () .false. .false. .false.), f_int_float: (Function (SymbolTable 33 {a: (Variable 33 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 33 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 33 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float [(Var 33 a) (Var 33 b)] [] [] (Var 33 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex: (Function (SymbolTable 35 {a: (Variable 35 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 35 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 35 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex [(Var 35 a) (Var 35 b)] [] [] (Var 35 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex_value: (Function (SymbolTable 37 {a: (Variable 37 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 37 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 37 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex_value [(Var 37 a) (Var 37 b)] [] [] (Var 37 r) BindC Public Interface () .false. .false. .false.), f_int_float_value: (Function (SymbolTable 41 {a: (Variable 41 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 41 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 41 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_value [(Var 41 a) (Var 41 b)] [] [] (Var 41 r) BindC Public Interface () .false. .false. .false.), f_int_floatarray: (Function (SymbolTable 44 {b: (Variable 44 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 44 n))]) BindC Public Required .false.), n: (Variable 44 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 44 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f_int_floatarray [(Var 44 n) (Var 44 b)] [] [] (Var 44 r) BindC Public Interface () .false. .false. .false.), f_int_intarray: (Function (SymbolTable 43 {b: (Variable 43 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 43 n))]) BindC Public Required .false.), n: (Variable 43 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 43 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_intarray [(Var 43 n) (Var 43 b)] [] [] (Var 43 r) BindC Public Interface () .false. .false. .false.), f_string: (Function (SymbolTable 68 {r: (Variable 68 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 68 s In () () Default (Character 1 -1 () []) Source Public Required .false.)}) f_string [(Var 68 s)] [] [(= (Var 68 r) (FunctionCall 2 f_string0 () [((StringConcat (Var 68 s) (Var 2 c_null_char) (Character 1 0 () []) ()))] (Integer 4 []) () ()) ())] (Var 68 r) Source Public Implementation () .false. .false. .false.), f_string0: (Function (SymbolTable 59 {r: (Variable 59 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.), s: (Variable 59 s In () () Default (Character 1 1 () [(() ())]) BindC Public Required .false.)}) f_string0 [(Var 59 s)] [] [] (Var 59 r) BindC Public Interface "f_string" .false. .false. .false.), fortran_f32: (Function (SymbolTable 73 {i: (Variable 73 i In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 73 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32 [(Var 73 i)] [] [(= (Var 73 r) (RealBinOp (Var 73 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 73 r) BindC Public Implementation () .false. .false. .false.), fortran_f32_value: (Function (SymbolTable 74 {i: (Variable 74 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 74 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32_value [(Var 74 i)] [] [(= (Var 74 r) (RealBinOp (Var 74 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 74 r) BindC Public Implementation () .false. .false. .false.), fortran_f64: (Function (SymbolTable 75 {i: (Variable 75 i In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 75 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64 [(Var 75 i)] [] [(= (Var 75 r) (RealBinOp (Var 75 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 75 r) BindC Public Implementation () .false. .false. .false.), fortran_f64_value: (Function (SymbolTable 76 {i: (Variable 76 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 76 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64_value [(Var 76 i)] [] [(= (Var 76 r) (RealBinOp (Var 76 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 76 r) BindC Public Implementation () .false. .false. .false.), fortran_i32: (Function (SymbolTable 69 {i: (Variable 69 i In () () Default (Integer 4 []) BindC Public Required .false.), r: (Variable 69 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32 [(Var 69 i)] [] [(= (Var 69 r) (IntegerBinOp (Var 69 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 69 r) BindC Public Implementation () .false. .false. .false.), fortran_i32_value: (Function (SymbolTable 70 {i: (Variable 70 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 70 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32_value [(Var 70 i)] [] [(= (Var 70 r) (IntegerBinOp (Var 70 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 70 r) BindC Public Implementation () .false. .false. .false.), fortran_i64: (Function (SymbolTable 71 {i: (Variable 71 i In () () Default (Integer 8 []) BindC Public Required .false.), r: (Variable 71 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64 [(Var 71 i)] [] [(= (Var 71 r) (IntegerBinOp (Var 71 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 71 r) BindC Public Implementation () .false. .false. .false.), fortran_i64_value: (Function (SymbolTable 72 {i: (Variable 72 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 72 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64_value [(Var 72 i)] [] [(= (Var 72 r) (IntegerBinOp (Var 72 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 72 r) BindC Public Implementation () .false. .false. .false.), sub_int_double: (Function (SymbolTable 48 {a: (Variable 48 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 48 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 48 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double [(Var 48 a) (Var 48 b) (Var 48 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex: (Function (SymbolTable 50 {a: (Variable 50 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 50 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 50 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex [(Var 50 a) (Var 50 b) (Var 50 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex_value: (Function (SymbolTable 54 {a: (Variable 54 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 54 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 54 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex_value [(Var 54 a) (Var 54 b) (Var 54 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value: (Function (SymbolTable 52 {a: (Variable 52 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 52 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 52 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value [(Var 52 a) (Var 52 b) (Var 52 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value_name: (Function (SymbolTable 58 {a: (Variable 58 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 58 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 58 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value_name [(Var 58 a) (Var 58 b) (Var 58 r)] [] [] () BindC Public Interface "sub_int_double_value" .false. .false. .false.), sub_int_doublearray: (Function (SymbolTable 57 {b: (Variable 57 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 57 n))]) BindC Public Required .false.), n: (Variable 57 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 57 r Out () () Default (Real 8 []) BindC Public Required .false.)}) sub_int_doublearray [(Var 57 n) (Var 57 b) (Var 57 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float: (Function (SymbolTable 47 {a: (Variable 47 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 47 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 47 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float [(Var 47 a) (Var 47 b) (Var 47 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex: (Function (SymbolTable 49 {a: (Variable 49 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 49 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 49 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex [(Var 49 a) (Var 49 b) (Var 49 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex_value: (Function (SymbolTable 53 {a: (Variable 53 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 53 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 53 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex_value [(Var 53 a) (Var 53 b) (Var 53 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_value: (Function (SymbolTable 51 {a: (Variable 51 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 51 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 51 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_value [(Var 51 a) (Var 51 b) (Var 51 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_floatarray: (Function (SymbolTable 56 {b: (Variable 56 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 56 n))]) BindC Public Required .false.), n: (Variable 56 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 56 r Out () () Default (Real 4 []) BindC Public Required .false.)}) sub_int_floatarray [(Var 56 n) (Var 56 b) (Var 56 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_intarray: (Function (SymbolTable 55 {b: (Variable 55 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 55 n))]) BindC Public Required .false.), n: (Variable 55 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 55 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_intarray [(Var 55 n) (Var 55 b) (Var 55 r)] [] [] () BindC Public Interface () .false. .false. .false.)}) modules_15b [iso_c_binding] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_01-290187e.json b/tests/reference/asr-nested_01-290187e.json index d837092bb7..55e4999abe 100644 --- a/tests/reference/asr-nested_01-290187e.json +++ b/tests/reference/asr-nested_01-290187e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_01-290187e.stdout", - "stdout_hash": "7eb9ad4ff9f8a16565a50384bd0971a52123e8e27955c5950400a5a4", + "stdout_hash": "8959dffd708da657c7bceb8b7694d90c8f08bfbd44bbc4ff2616a378", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_01-290187e.stdout b/tests/reference/asr-nested_01-290187e.stdout index 01acb6776d..52ca8441b6 100644 --- a/tests/reference/asr-nested_01-290187e.stdout +++ b/tests/reference/asr-nested_01-290187e.stdout @@ -1,3 +1 @@ -fname b -fname d (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), d: (Function (SymbolTable 4 {d: (Variable 4 d ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ()) (= (Var 4 d) (IntegerConstant 1 (Integer 4 [])) ())] (Var 4 d) Source Public Implementation () .false. .false. .false.), e: (Variable 3 e Local () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 e) (FunctionCall 3 d () [] (Integer 4 []) () ()) ()) (= (Var 3 b) (IntegerConstant 0 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), nested_01: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public), c: (Variable 5 c Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_01 [a] [(= (Var 5 c) (FunctionCall 5 b () [] (Integer 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-nested_04-8423f42.json b/tests/reference/asr-nested_04-8423f42.json index e2268d24fd..2479de781b 100644 --- a/tests/reference/asr-nested_04-8423f42.json +++ b/tests/reference/asr-nested_04-8423f42.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_04-8423f42.stdout", - "stdout_hash": "1375ca41bfd9ab942ba43a5424fc1e13483b67607ad25a4d24a945d1", + "stdout_hash": "0e3fe9033b1ec0c1a7ed271f53b6dac7382bcd398b2d99da2834a92f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_04-8423f42.stdout b/tests/reference/asr-nested_04-8423f42.stdout index ec41c30821..7a385d6d91 100644 --- a/tests/reference/asr-nested_04-8423f42.stdout +++ b/tests/reference/asr-nested_04-8423f42.stdout @@ -1,3 +1 @@ -fname b -fname c (TranslationUnit (SymbolTable 1 {nested_04: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_04_a [] b Public), test: (Variable 5 test Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_04 [nested_04_a] [(= (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) () ()) ())]), nested_04_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Integer 4 []) Source Public Required .false.), z: (Variable 4 z In () () Default (Integer 4 []) Source Public Required .false.)}) c [(Var 4 z)] [] [(Print () [(Var 4 z)] () ()) (Print () [(Var 3 y)] () ()) (Print () [(Var 3 yy)] () ()) (= (Var 4 c) (Var 4 z) ())] (Var 4 c) Source Public Implementation () .false. .false. .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.), yy: (Variable 3 yy Local (RealConstant 6.600000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(= (Var 3 y) (Var 3 x) ()) (Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) () ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) nested_04_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.json b/tests/reference/asr-operator_overloading_01-9ec8e71.json index 25c4c0c87d..a9b4563d1e 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.json +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_01-9ec8e71.stdout", - "stdout_hash": "a68c1f0cfb4e89c2adbf929339b772ab70a117a64217bd2b01152bb2", + "stdout_hash": "928ed3ffcd78a2783a602e3db3efd2727a73990313353988eefd4c9e", "stderr": "asr-operator_overloading_01-9ec8e71.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout index ae0c0b1dae..ef98d4cf5f 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout @@ -1,3 +1 @@ -fname logical_and -fname bin_add (TranslationUnit (SymbolTable 1 {operator_overloading_01: (Program (SymbolTable 5 {bin_add: (ExternalSymbol 5 bin_add 2 bin_add operator_overloading_01_overload_asterisk_m [] bin_add Public), f: (Variable 5 f Local (LogicalConstant .false. (Logical 4 [])) (LogicalConstant .false. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), logical_and: (ExternalSymbol 5 logical_and 2 logical_and operator_overloading_01_overload_asterisk_m [] logical_and Public), t: (Variable 5 t Local (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), ~add: (ExternalSymbol 5 ~add 2 ~add operator_overloading_01_overload_asterisk_m [] ~add Public), ~mul: (ExternalSymbol 5 ~mul 2 ~mul operator_overloading_01_overload_asterisk_m [] ~mul Public)}) operator_overloading_01 [operator_overloading_01_overload_asterisk_m] [(Print () [(StringConstant "T*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "T+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4 []) () ()))] () ())]), operator_overloading_01_overload_asterisk_m: (Module (SymbolTable 2 {bin_add: (Function (SymbolTable 4 {bin_add: (Variable 4 bin_add ReturnVar () () Default (Integer 4 []) Source Public Required .false.), log1: (Variable 4 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 4 log2 In () () Default (Logical 4 []) Source Public Required .false.)}) bin_add [(Var 4 log1) (Var 4 log2)] [] [(If (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 2 (Integer 4 [])) ())] [(If (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4 []) ()) And (LogicalNot (Var 4 log2) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 0 (Integer 4 [])) ())] [(= (Var 4 bin_add) (IntegerConstant 1 (Integer 4 [])) ())])])] (Var 4 bin_add) Source Public Implementation () .false. .false. .false.), logical_and: (Function (SymbolTable 3 {log1: (Variable 3 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 3 log2 In () () Default (Logical 4 []) Source Public Required .false.), logical_and: (Variable 3 logical_and ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) logical_and [(Var 3 log1) (Var 3 log2)] [] [(= (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4 []) ()) ())] (Var 3 logical_and) Source Public Implementation () .false. .false. .false.), ~add: (CustomOperator 2 ~add [2 bin_add] Public), ~mul: (CustomOperator 2 ~mul [2 logical_and] Public)}) operator_overloading_01_overload_asterisk_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.json b/tests/reference/asr-operator_overloading_03-f7a6efe.json index e5e06d940f..514531c181 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.json +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_03-f7a6efe.stdout", - "stdout_hash": "1ac6705b6d044ed1795c5c2ba739f2a6c99467b90708a23ddfd69d8a", + "stdout_hash": "f165faffe8381c5e87436aa30b05dac8294c3aff5b1697ba87c80ec9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout index 05f7d4f57f..0f0fe82e01 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout @@ -1,4 +1 @@ -fname greater_than_inverse -fname less_than_inverse -fname less_than_overload_use (TranslationUnit (SymbolTable 1 {operator_overloading_01: (Program (SymbolTable 6 {f: (Variable 6 f Local (LogicalConstant .false. (Logical 4 [])) (LogicalConstant .false. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), greater_than_inverse: (ExternalSymbol 6 greater_than_inverse 2 greater_than_inverse operator_overloading_01_overload_comp_m [] greater_than_inverse Public), less_than_inverse: (ExternalSymbol 6 less_than_inverse 2 less_than_inverse operator_overloading_01_overload_comp_m [] less_than_inverse Public), less_than_overload_use: (ExternalSymbol 6 less_than_overload_use 2 less_than_overload_use operator_overloading_01_overload_comp_m [] less_than_overload_use Public), t: (Variable 6 t Local (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), ~gt: (ExternalSymbol 6 ~gt 2 ~gt operator_overloading_01_overload_comp_m [] ~gt Public), ~lt: (ExternalSymbol 6 ~lt 2 ~lt operator_overloading_01_overload_comp_m [] ~lt Public)}) operator_overloading_01 [operator_overloading_01_overload_comp_m] [(Print () [(StringConstant "T>T:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>T:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T tests/parameter1.f90:3:1 - | -3 | parameter (zero=0.0d0,p66=0.66d0,two=2.0d0,three=3.0d0) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/reference/asr-program3-557dbe8.json b/tests/reference/asr-program3-557dbe8.json index d70a71afbb..38b871d352 100644 --- a/tests/reference/asr-program3-557dbe8.json +++ b/tests/reference/asr-program3-557dbe8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-program3-557dbe8.stdout", - "stdout_hash": "ffebd264888cff5c4580777383f902c31394ff559ace4a2fa64f41a8", + "stdout_hash": "c805dfe3474dd9650b418a45f542efa9206dea3d55ab4e31a75aa6be", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-program3-557dbe8.stdout b/tests/reference/asr-program3-557dbe8.stdout index 0892908582..81459d3031 100644 --- a/tests/reference/asr-program3-557dbe8.stdout +++ b/tests/reference/asr-program3-557dbe8.stdout @@ -1,3 +1 @@ -fname func1 -fname func2 (TranslationUnit (SymbolTable 1 {program3: (Program (SymbolTable 2 {func1: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) func1 [(Var 3 a) (Var 3 b)] [] [(= (Var 3 c) (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 []) ()) ()) (= (Var 3 c) (FunctionCall 2 func2 () [((Var 3 c)) ((Var 3 c))] (Real 4 []) () ()) ())] (Var 3 c) Source Public Implementation () .false. .false. .false.), func2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b In () () Default (Real 4 []) Source Public Required .false.), c: (Variable 4 c ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) func2 [(Var 4 a) (Var 4 b)] [] [(= (Var 4 c) (RealBinOp (Var 4 a) Mul (Var 4 b) (Real 4 []) ()) ())] (Var 4 c) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local () () Default (Real 4 []) Source Public Required .false.)}) program3 [] [(= (Var 2 x) (RealConstant 5.000000 (Real 4 [])) ()) (= (Var 2 y) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 2 z) (RealBinOp (Var 2 x) Mul (Var 2 y) (Real 4 []) ()) ()) (Print () [(StringConstant "10.0 ==" (Character 1 7 () [])) (Var 2 z)] () ()) (= (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "49.0 ==" (Character 1 7 () [])) (Var 2 z)] () ()) (= (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "10.0 ==" (Character 1 7 () [])) (Var 2 z)] () ())])}) []) diff --git a/tests/reference/asr-program4-ba26fd1.json b/tests/reference/asr-program4-ba26fd1.json index aa157ff1a9..a023bdcd40 100644 --- a/tests/reference/asr-program4-ba26fd1.json +++ b/tests/reference/asr-program4-ba26fd1.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-program4-ba26fd1.stdout", - "stdout_hash": "6eeddc120b708e8456fc547db706da8065b2d40ede0027d761ff0734", + "stdout_hash": "9bd8ece07ebc48d314ae2ec8f5340566dbc5ce887e26c86152ebbae9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-program4-ba26fd1.stdout b/tests/reference/asr-program4-ba26fd1.stdout index 4907b789db..0a2a580c34 100644 --- a/tests/reference/asr-program4-ba26fd1.stdout +++ b/tests/reference/asr-program4-ba26fd1.stdout @@ -1,3 +1 @@ -fname func1 -fname func2 (TranslationUnit (SymbolTable 1 {program4: (Program (SymbolTable 2 {func1: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c ReturnVar () () Default (Real 4 []) Source Public Required .false.), saved: (Variable 3 saved Local (RealConstant 2.000000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) func1 [(Var 3 a) (Var 3 b)] [] [(= (Var 3 saved) (RealBinOp (Var 3 saved) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 3 c) (RealBinOp (RealBinOp (RealBinOp (Var 3 c) Add (Var 3 a) (Real 4 []) ()) Add (Var 3 b) (Real 4 []) ()) Add (Var 3 saved) (Real 4 []) ()) ())] (Var 3 c) Source Public Implementation () .false. .false. .false.), func2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b In () () Default (Real 4 []) Source Public Required .false.), c: (Variable 4 c ReturnVar () () Default (Real 4 []) Source Public Required .false.), d: (Variable 4 d Local () () Default (Real 4 []) Source Public Required .false.), saved1: (Variable 4 saved1 Local (RealConstant 2.000000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), saved2: (Variable 4 saved2 Local () () Save (Real 4 []) Source Public Required .false.)}) func2 [(Var 4 a) (Var 4 b)] [] [(= (Var 4 saved1) (RealBinOp (Var 4 saved1) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 4 c) (RealBinOp (RealBinOp (RealBinOp (RealBinOp (RealBinOp (Var 4 d) Add (Var 4 c) (Real 4 []) ()) Add (Var 4 a) (Real 4 []) ()) Add (Var 4 b) (Real 4 []) ()) Add (Var 4 saved1) (Real 4 []) ()) Add (Var 4 saved2) (Real 4 []) ()) ()) (= (Var 4 saved2) (RealBinOp (Var 4 saved2) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 4 d) (RealBinOp (Var 4 d) Add (RealConstant 3.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 4 c) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local () () Default (Real 4 []) Source Public Required .false.)}) program4 [] [(= (Var 2 x) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 2 y) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "6.0 == " (Character 1 7 () [])) (Var 2 z)] () ()) (= (Var 2 z) (FunctionCall 2 func1 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "7.0 == " (Character 1 7 () [])) (Var 2 z)] () ()) (= (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "6.0 == " (Character 1 7 () [])) (Var 2 z)] () ()) (= (Var 2 z) (FunctionCall 2 func2 () [((Var 2 x)) ((Var 2 y))] (Real 4 []) () ()) ()) (Print () [(StringConstant "8.0 == " (Character 1 7 () [])) (Var 2 z)] () ())])}) []) diff --git a/tests/reference/asr-program_03-fbe20e8.json b/tests/reference/asr-program_03-fbe20e8.json index 05f5709472..4d58473560 100644 --- a/tests/reference/asr-program_03-fbe20e8.json +++ b/tests/reference/asr-program_03-fbe20e8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-program_03-fbe20e8.stdout", - "stdout_hash": "0d4dd4e3b7daa086a211fdffb80d334adb276490d2903faf5d6c5cf9", + "stdout_hash": "fa10134d29dd2039729a08608f608cd0606927a44619fb42a16d4a99", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-program_03-fbe20e8.stdout b/tests/reference/asr-program_03-fbe20e8.stdout index ca5d2b09fe..e59753625c 100644 --- a/tests/reference/asr-program_03-fbe20e8.stdout +++ b/tests/reference/asr-program_03-fbe20e8.stdout @@ -1,3 +1 @@ -fname apply -fname add_z (TranslationUnit (SymbolTable 1 {closuretest: (Program (SymbolTable 2 {add_z: (Function (SymbolTable 5 {x: (Variable 5 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) add_z [(Var 5 x)] [] [(= (Var 5 y) (IntegerBinOp (Var 5 x) Add (Var 2 z) (Integer 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.), apply: (Function (SymbolTable 3 {fun: (Function (SymbolTable 4 {fun: (Variable 4 fun ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) fun [(Var 4 x)] [] [] (Var 4 fun) Source Public Interface () .false. .false. .false.), x: (Variable 3 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) apply [(Var 3 fun) (Var 3 x)] [] [(= (Var 3 y) (FunctionCall 3 fun () [((Var 3 x))] (Integer 4 []) () ()) ())] (Var 3 y) Source Public Implementation () .false. .false. .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) closuretest [] [(DoLoop ((Var 2 z) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])) ()) [(Print () [(FunctionCall 2 apply () [((Var 2 add_z)) ((IntegerConstant 1 (Integer 4 [])))] (Integer 4 []) () ())] () ())])])}) []) diff --git a/tests/reference/asr-recursion_02-20a7daf.json b/tests/reference/asr-recursion_02-20a7daf.json index 412f2f0df6..c2b6b3d723 100644 --- a/tests/reference/asr-recursion_02-20a7daf.json +++ b/tests/reference/asr-recursion_02-20a7daf.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_02-20a7daf.stdout", - "stdout_hash": "e99e78b18eafa38c9c2c6370a694d3f17038361b931504d046cacb5c", + "stdout_hash": "01f046e100dae349d77dc34ecb697b67032e68e6c7a03feea45d4304", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-recursion_02-20a7daf.stdout b/tests/reference/asr-recursion_02-20a7daf.stdout index 5a65b4aa3e..2f6011019b 100644 --- a/tests/reference/asr-recursion_02-20a7daf.stdout +++ b/tests/reference/asr-recursion_02-20a7daf.stdout @@ -1,4 +1 @@ -fname solver -fname sub1 -fname getx (TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 7 {r: (Variable 7 r Local () () Default (Integer 4 []) Source Public Required .false.), solver: (ExternalSymbol 7 solver 2 solver recursion_02 [] solver Public), sub1: (ExternalSymbol 7 sub1 2 sub1 recursion_02 [] sub1 Public)}) main [recursion_02] [(= (Var 7 r) (FunctionCall 7 sub1 () [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) () ()) ()) (Print () [(StringConstant "r =" (Character 1 3 () [])) (Var 7 r)] () ())]), recursion_02: (Module (SymbolTable 2 {solver: (Function (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [] (Var 4 f) Source Public Interface () .false. .false. .false.), iter: (Variable 3 iter In () () Default (Integer 4 []) Source Public Required .false.), solver: (Variable 3 solver ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) solver [(Var 3 f) (Var 3 iter)] [] [(Print () [(StringConstant "before:" (Character 1 7 () [])) (FunctionCall 3 f () [] (Integer 4 []) () ())] () ()) (= (Var 3 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4 []))) ((IntegerBinOp (Var 3 iter) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))] (Integer 4 []) () ()) ()) (Print () [(StringConstant "after:" (Character 1 6 () [])) (FunctionCall 3 f () [] (Integer 4 []) () ())] () ())] (Var 3 solver) Source Public Implementation () .false. .false. .false.), sub1: (Function (SymbolTable 5 {getx: (Function (SymbolTable 6 {getx: (Variable 6 getx ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) getx [] [] [(Print () [(StringConstant "x in getx" (Character 1 9 () [])) (Var 5 x)] () ()) (= (Var 6 getx) (Var 5 x) ())] (Var 6 getx) Source Public Implementation () .false. .false. .false.), iter: (Variable 5 iter In () () Default (Integer 4 []) Source Public Required .false.), sub1: (Variable 5 sub1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.), tmp: (Variable 5 tmp Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 5 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub1 [(Var 5 y) (Var 5 iter)] [] [(= (Var 5 x) (Var 5 y) ()) (Print () [(StringConstant "in sub1" (Character 1 7 () []))] () ()) (If (IntegerCompare (Var 5 iter) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 5 sub1) (IntegerConstant 1 (Integer 4 [])) ()) (Return)] []) (= (Var 5 tmp) (FunctionCall 5 getx () [] (Integer 4 []) () ()) ()) (= (Var 5 sub1) (FunctionCall 2 solver () [((Var 5 getx)) ((Var 5 iter))] (Integer 4 []) () ()) ())] (Var 5 sub1) Source Public Implementation () .false. .false. .false.)}) recursion_02 [] .false. .false.)}) []) diff --git a/tests/reference/asr-recursion_03-8300fac.json b/tests/reference/asr-recursion_03-8300fac.json index 8ea9f8fe64..be761e2954 100644 --- a/tests/reference/asr-recursion_03-8300fac.json +++ b/tests/reference/asr-recursion_03-8300fac.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-recursion_03-8300fac.stdout", - "stdout_hash": "36c3d80b909797b56fc84ece4bdae4948649be7918b0ef332937146c", + "stdout_hash": "1fe55d5806510ea10337196e0c4d8d0a1f750cd2f2fa6ae818af7a9b", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-recursion_03-8300fac.stdout b/tests/reference/asr-recursion_03-8300fac.stdout index fa3ad58103..fe447ce2f9 100644 --- a/tests/reference/asr-recursion_03-8300fac.stdout +++ b/tests/reference/asr-recursion_03-8300fac.stdout @@ -1,5 +1 @@ -fname solver_caller -fname solver -fname sub1 -fname getx (TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 9 {r: (Variable 9 r Local () () Default (Integer 4 []) Source Public Required .false.), solver: (ExternalSymbol 9 solver 2 solver recursion_03 [] solver Public), solver_caller: (ExternalSymbol 9 solver_caller 2 solver_caller recursion_03 [] solver_caller Public), sub1: (ExternalSymbol 9 sub1 2 sub1 recursion_03 [] sub1 Public)}) main [recursion_03] [(= (Var 9 r) (FunctionCall 9 sub1 () [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 3 (Integer 4 [])))] (Integer 4 []) () ()) ()) (Print () [(StringConstant "r =" (Character 1 3 () [])) (Var 9 r)] () ())]), recursion_03: (Module (SymbolTable 2 {solver: (Function (SymbolTable 5 {f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [] (Var 6 f) Source Public Interface () .false. .false. .false.), iter: (Variable 5 iter In () () Default (Integer 4 []) Source Public Required .false.), solver: (Variable 5 solver ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) solver [(Var 5 f) (Var 5 iter)] [] [(Print () [(StringConstant "before:" (Character 1 7 () [])) (FunctionCall 5 f () [] (Integer 4 []) () ())] () ()) (= (Var 5 solver) (FunctionCall 2 sub1 () [((IntegerConstant 2 (Integer 4 []))) ((IntegerBinOp (Var 5 iter) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))] (Integer 4 []) () ()) ()) (Print () [(StringConstant "after:" (Character 1 6 () [])) (FunctionCall 5 f () [] (Integer 4 []) () ())] () ())] (Var 5 solver) Source Public Implementation () .false. .false. .false.), solver_caller: (Function (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [] (Var 4 f) Source Public Interface () .false. .false. .false.), iter: (Variable 3 iter In () () Default (Integer 4 []) Source Public Required .false.), solver_caller: (Variable 3 solver_caller ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) solver_caller [(Var 3 f) (Var 3 iter)] [] [(= (Var 3 solver_caller) (FunctionCall 2 solver () [((Var 3 f)) ((Var 3 iter))] (Integer 4 []) () ()) ())] (Var 3 solver_caller) Source Public Implementation () .false. .false. .false.), sub1: (Function (SymbolTable 7 {getx: (Function (SymbolTable 8 {getx: (Variable 8 getx ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) getx [] [] [(Print () [(StringConstant "x in getx" (Character 1 9 () [])) (Var 7 x)] () ()) (= (Var 8 getx) (Var 7 x) ())] (Var 8 getx) Source Public Implementation () .false. .false. .false.), iter: (Variable 7 iter In () () Default (Integer 4 []) Source Public Required .false.), sub1: (Variable 7 sub1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.), tmp: (Variable 7 tmp Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 7 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 7 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub1 [(Var 7 y) (Var 7 iter)] [] [(= (Var 7 x) (Var 7 y) ()) (Print () [(StringConstant "in sub1" (Character 1 7 () []))] () ()) (If (IntegerCompare (Var 7 iter) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 7 sub1) (IntegerConstant 1 (Integer 4 [])) ()) (Return)] []) (= (Var 7 tmp) (FunctionCall 7 getx () [] (Integer 4 []) () ()) ()) (= (Var 7 sub1) (FunctionCall 2 solver_caller () [((Var 7 getx)) ((Var 7 iter))] (Integer 4 []) () ()) ())] (Var 7 sub1) Source Public Implementation () .false. .false. .false.)}) recursion_03 [] .false. .false.)}) []) diff --git a/tests/reference/asr-string_17-29e01e3.json b/tests/reference/asr-string_17-29e01e3.json index dde88dfe23..c721fd6ede 100644 --- a/tests/reference/asr-string_17-29e01e3.json +++ b/tests/reference/asr-string_17-29e01e3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-string_17-29e01e3.stdout", - "stdout_hash": "857db15ed8da2180767bfeebc918874d39ae7e84f3748c3a7ca776b4", + "stdout_hash": "7a5f36df74cebaee7c77bcb1d329876d6838fc06f244bd4c6f908320", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-string_17-29e01e3.stdout b/tests/reference/asr-string_17-29e01e3.stdout index e44d5b2297..96d084c8ef 100644 --- a/tests/reference/asr-string_17-29e01e3.stdout +++ b/tests/reference/asr-string_17-29e01e3.stdout @@ -1,3 +1 @@ -fname len_string -fname maybe (TranslationUnit (SymbolTable 1 {lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), string_module: (Module (SymbolTable 2 {len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {allocated: (ExternalSymbol 4 allocated 7 allocated lfortran_intrinsic_builtin [] allocated Private), len: (ExternalSymbol 4 len 7 len lfortran_intrinsic_builtin [] len Private), length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Private Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Private Required .false.)}) len_string [(Var 4 string)] [] [(If (FunctionCall 4 allocated () [((DerivedRef (Var 4 string) 3 raw (Character 1 -2 () []) ()))] (Logical 4 []) () ()) [(= (Var 4 length) (FunctionCall 4 len () [((DerivedRef (Var 4 string) 3 raw (Character 1 -2 () []) ()))] (Integer 4 []) () ()) ())] [(= (Var 4 length) (IntegerConstant 0 (Integer 4 [])) ())])] (Var 4 length) Source Private Implementation () .true. .false. .false.), maybe: (Function (SymbolTable 5 {allocated: (ExternalSymbol 5 allocated 7 allocated lfortran_intrinsic_builtin [] allocated Private), maybe_string: (Variable 5 maybe_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Private Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Private Required .false.)}) maybe [(Var 5 string)] [] [(If (FunctionCall 5 allocated () [((DerivedRef (Var 5 string) 3 raw (Character 1 -2 () []) ()))] (Logical 4 []) () ()) [(= (Var 5 maybe_string) (DerivedRef (Var 5 string) 3 raw (Character 1 -2 () []) ()) ())] [(= (Var 5 maybe_string) (StringConstant "" (Character 1 0 () [])) ())])] (Var 5 maybe_string) Source Private Implementation () .false. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Private Required .false.)}) string_type [raw] Source Private ())}) string_module [lfortran_intrinsic_builtin] .false. .false.)}) []) diff --git a/tests/reference/asr-string_19-d880475.json b/tests/reference/asr-string_19-d880475.json index abacdeb190..47dd2adb6f 100644 --- a/tests/reference/asr-string_19-d880475.json +++ b/tests/reference/asr-string_19-d880475.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-string_19-d880475.stdout", - "stdout_hash": "49ddc340612997d7768ef0b76f4e15693c92afe41e3d68be3884660f", + "stdout_hash": "c7f6e21d5e652af26c9c4420e0dd237f45f298f2b1a9337a79051594", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-string_19-d880475.stdout b/tests/reference/asr-string_19-d880475.stdout index f7a7f01dcd..7c90d3f140 100644 --- a/tests/reference/asr-string_19-d880475.stdout +++ b/tests/reference/asr-string_19-d880475.stdout @@ -1,10 +1 @@ -fname len_string -fname char_string -fname compute_lps -fname compute_lps_use -fname compute_lps_use1 -fname padl_string_default -fname padl_string_pad_with -fname padl_char_default -fname padl_char_pad_with -(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 102 {char: (ExternalSymbol 102 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 102 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 102 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 102 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 102 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 102 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 102 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 102 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 102 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 102 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 102 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 102 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 102 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) +(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 103 {char: (ExternalSymbol 103 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 103 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 103 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 103 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 103 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 103 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 103 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 103 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 103 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 103 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 103 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 103 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 103 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) diff --git a/tests/reference/asr-submodule_02-9152b7b.json b/tests/reference/asr-submodule_02-9152b7b.json index c30dd4e946..8a48fb84ae 100644 --- a/tests/reference/asr-submodule_02-9152b7b.json +++ b/tests/reference/asr-submodule_02-9152b7b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-submodule_02-9152b7b.stdout", - "stdout_hash": "573d43138b6f9398f905d9dedf3f54da85b5baa132bdff6d6fa7184f", + "stdout_hash": "377c227ac76ce4bbf01d9ab62c7b17fe9b69687e6f60e53b85c2cdbb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-submodule_02-9152b7b.stdout b/tests/reference/asr-submodule_02-9152b7b.stdout index e40e460b4f..6ad79c64e1 100644 --- a/tests/reference/asr-submodule_02-9152b7b.stdout +++ b/tests/reference/asr-submodule_02-9152b7b.stdout @@ -1,2 +1 @@ -fname point_dist_func (TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), points: (Module (SymbolTable 5 {point: (DerivedType (SymbolTable 6 {x: (Variable 6 x Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 6 y Local () () Default (Real 4 []) Source Public Required .false.)}) point [x y] Source Public ()), point_dist_func: (Function (SymbolTable 7 {a: (Variable 7 a In () () Default (Derived 5 point []) Source Public Required .false.), b: (Variable 7 b In () () Default (Derived 5 point []) Source Public Required .false.), distance: (Variable 7 distance ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) point_dist_func [(Var 7 a) (Var 7 b)] [] [] (Var 7 distance) Source Public Interface () .false. .false. .false.), point_dist_subrout: (Function (SymbolTable 8 {a: (Variable 8 a In () () Default (Derived 5 point []) Source Public Required .false.), b: (Variable 8 b In () () Default (Derived 5 point []) Source Public Required .false.), distance: (Variable 8 distance Out () () Default (Real 4 []) Source Public Required .false.)}) point_dist_subrout [(Var 8 a) (Var 8 b) (Var 8 distance)] [] [] () Source Public Interface () .false. .true. .false.), rkind: (ExternalSymbol 5 rkind1 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public)}) points [stdlib_kinds] .false. .false.), points_a: (Module (SymbolTable 9 {point: (ExternalSymbol 9 point 5 point points [] point Public), point_dist_func: (Function (SymbolTable 10 {a: (Variable 10 a In () () Default (Derived 9 point []) Source Public Required .false.), b: (Variable 10 b In () () Default (Derived 9 point []) Source Public Required .false.), distance: (Variable 10 distance ReturnVar () () Default (Real 4 []) Source Public Required .false.), sqrt: (ExternalSymbol 10 sqrt 14 sqrt lfortran_intrinsic_math [] sqrt Private), sqrt@ssqrt: (ExternalSymbol 10 sqrt@ssqrt 14 ssqrt lfortran_intrinsic_math [] ssqrt Private)}) point_dist_func [(Var 10 a) (Var 10 b)] [] [(= (Var 10 distance) (FunctionCall 10 sqrt@ssqrt 10 sqrt [((RealBinOp (RealBinOp (RealBinOp (DerivedRef (Var 10 a) 6 x (Real 4 []) ()) Sub (DerivedRef (Var 10 b) 6 x (Real 4 []) ()) (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) Add (RealBinOp (RealBinOp (DerivedRef (Var 10 a) 6 y (Real 4 []) ()) Sub (DerivedRef (Var 10 b) 6 y (Real 4 []) ()) (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()))] (Real 4 []) () ()) ())] (Var 10 distance) Source Public Implementation () .false. .false. .false.), point_dist_subrout: (Function (SymbolTable 11 {a: (Variable 11 a In () () Default (Derived 9 point []) Source Public Required .false.), b: (Variable 11 b In () () Default (Derived 9 point []) Source Public Required .false.), distance: (Variable 11 distance Out () () Default (Real 4 []) Source Public Required .false.), sqrt: (ExternalSymbol 11 sqrt 14 sqrt lfortran_intrinsic_math [] sqrt Private), sqrt@ssqrt: (ExternalSymbol 11 sqrt@ssqrt 14 ssqrt lfortran_intrinsic_math [] ssqrt Private)}) point_dist_subrout [(Var 11 a) (Var 11 b) (Var 11 distance)] [] [(= (Var 11 distance) (FunctionCall 11 sqrt@ssqrt 11 sqrt [((RealBinOp (RealBinOp (RealBinOp (DerivedRef (Var 11 a) 6 x (Real 4 []) ()) Sub (DerivedRef (Var 11 b) 6 x (Real 4 []) ()) (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) Add (RealBinOp (RealBinOp (DerivedRef (Var 11 a) 6 y (Real 4 []) ()) Sub (DerivedRef (Var 11 b) 6 y (Real 4 []) ()) (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .true. .false.), rkind: (ExternalSymbol 9 rkind 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public)}) points_a [lfortran_intrinsic_math] .false. .false.), stdlib_kinds: (Module (SymbolTable 2 {int32: (ExternalSymbol 2 int32 4 int32 lfortran_intrinsic_iso_fortran_env [] int32 Public), rkind1: (ExternalSymbol 2 rkind1 4 real32 lfortran_intrinsic_iso_fortran_env [] real32 Public)}) stdlib_kinds [iso_fortran_env] .false. .false.), submodules_02: (Program (SymbolTable 12 {}) submodules_02 [] [])}) []) diff --git a/tests/reference/asr-subroutine3-8086030.json b/tests/reference/asr-subroutine3-8086030.json index 52b111d353..e7fd57e057 100644 --- a/tests/reference/asr-subroutine3-8086030.json +++ b/tests/reference/asr-subroutine3-8086030.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3-8086030.stdout", - "stdout_hash": "8b9c85db107766ef4515d8ceeeb3f2934923e5df42e0eb8bc9bdf690", + "stdout_hash": "e6d5c736ebb9abfbeb9b77d8f9969a88a0dccda498b0bfca3fc28df7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-subroutine3-8086030.stdout b/tests/reference/asr-subroutine3-8086030.stdout index c4c8c0eb53..cb9f1e2b4f 100644 --- a/tests/reference/asr-subroutine3-8086030.stdout +++ b/tests/reference/asr-subroutine3-8086030.stdout @@ -1,2 +1 @@ -fname f (TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 42 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/asr-subroutine3b-4883d18.json b/tests/reference/asr-subroutine3b-4883d18.json index 0de4f7826c..d993c049e3 100644 --- a/tests/reference/asr-subroutine3b-4883d18.json +++ b/tests/reference/asr-subroutine3b-4883d18.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-subroutine3b-4883d18.stdout", - "stdout_hash": "29e6b642bbe1638863fb817c68e1fde7771a56a98aed7d1e58f134fb", + "stdout_hash": "1e92f2fae57f0e976e183cd5f983183700d7395c5be75ee8dff376e9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-subroutine3b-4883d18.stdout b/tests/reference/asr-subroutine3b-4883d18.stdout index 7bd368248e..03a0fb9454 100644 --- a/tests/reference/asr-subroutine3b-4883d18.stdout +++ b/tests/reference/asr-subroutine3b-4883d18.stdout @@ -1,4 +1 @@ -fname f -fname g -fname h (TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 42 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 3 {g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) g [] [] [(= (Var 3 g) (IntegerConstant 42 (Integer 4 [])) ())] (Var 3 g) Source Public Implementation () .false. .false. .false.), h: (Function (SymbolTable 4 {h: (Variable 4 h ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) h [] [] [(= (Var 4 h) (IntegerConstant 42 (Integer 4 [])) ())] (Var 4 h) Source Public Implementation () .false. .false. .false.)}) []) diff --git a/tests/reference/asr-template_add-177bf3c.json b/tests/reference/asr-template_add-177bf3c.json index c014a3a703..05b207c173 100644 --- a/tests/reference/asr-template_add-177bf3c.json +++ b/tests/reference/asr-template_add-177bf3c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-template_add-177bf3c.stdout", - "stdout_hash": "0577cbe833945a107f530379a7394bbdd2297a480d01d3598b5f2834", + "stdout_hash": "68fcc4a9de22b0d9225a4d6362abcf73c8a8fda0a5e7aa8d09843c38", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-template_add-177bf3c.stdout b/tests/reference/asr-template_add-177bf3c.stdout index 7fd8e47798..11a6de4ff6 100644 --- a/tests/reference/asr-template_add-177bf3c.stdout +++ b/tests/reference/asr-template_add-177bf3c.stdout @@ -1,2 +1 @@ -fname add_generic (TranslationUnit (SymbolTable 1 {add_m: (Module (SymbolTable 2 {add_generic: (Function (SymbolTable 4 {add_generic: (Variable 4 add_generic ReturnVar () () Default (TypeParameter t []) Source Private Required .false.), x: (Variable 4 x Unspecified () () Default (TypeParameter t []) Source Private Required .false.), y: (Variable 4 y Unspecified () () Default (TypeParameter t []) Source Private Required .false.)}) add_generic [(Var 4 x) (Var 4 y)] [(TypeParameter t [])] [(= (Var 4 add_generic) (TemplateBinOp (Var 4 x) Add (Var 4 y) (TypeParameter t []) ()) ())] (Var 4 add_generic) Source Private Implementation () .false. .false. .false.), add_integer: (Function (SymbolTable 8 {add_generic: (Variable 8 add_generic ReturnVar () () Default (Integer 4 []) Source Private Required .false.), x: (Variable 8 x Unspecified () () Default (Integer 4 []) Source Private Required .false.), y: (Variable 8 y Unspecified () () Default (Integer 4 []) Source Private Required .false.)}) add_integer [(Var 8 x) (Var 8 y)] [] [(= (Var 8 add_generic) (IntegerBinOp (Var 8 x) Add (Var 8 y) (Integer 4 []) ()) ())] (Var 8 add_generic) Source Private Implementation () .false. .false. .false.), add_real: (Function (SymbolTable 7 {add_generic: (Variable 7 add_generic ReturnVar () () Default (Real 4 []) Source Private Required .false.), x: (Variable 7 x Unspecified () () Default (Real 4 []) Source Private Required .false.), y: (Variable 7 y Unspecified () () Default (Real 4 []) Source Private Required .false.)}) add_real [(Var 7 x) (Var 7 y)] [] [(= (Var 7 add_generic) (RealBinOp (Var 7 x) Add (Var 7 y) (Real 4 []) ()) ())] (Var 7 add_generic) Source Private Implementation () .false. .false. .false.), t: (DerivedType (SymbolTable 3 {}) t [] Source Private ()), test_template: (Function (SymbolTable 5 {a: (Variable 5 a Local () () Default (Integer 4 []) Source Private Required .false.), abs: (ExternalSymbol 5 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 5 abs@sabs 10 sabs lfortran_intrinsic_math [] sabs Private), b: (Variable 5 b Local () () Default (Integer 4 []) Source Private Required .false.), x: (Variable 5 x Local () () Default (Real 4 []) Source Private Required .false.), y: (Variable 5 y Local () () Default (Real 4 []) Source Private Required .false.)}) test_template [] [] [(= (Var 5 x) (RealConstant 5.100000 (Real 4 [])) ()) (= (Var 5 y) (RealConstant 7.200000 (Real 4 [])) ()) (Print () [(StringConstant "The result is " (Character 1 14 () [])) (FunctionCall 2 add_real () [((Var 5 x)) ((Var 5 y))] (Real 4 []) () ())] () ()) (If (RealCompare (FunctionCall 5 abs@sabs 5 abs [((RealBinOp (FunctionCall 2 add_real () [((Var 5 x)) ((Var 5 y))] (Real 4 []) () ()) Sub (RealConstant 12.300000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 a) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 b) (IntegerConstant 9 (Integer 4 [])) ()) (Print () [(StringConstant "The result is " (Character 1 14 () [])) (FunctionCall 2 add_integer () [((Var 5 a)) ((Var 5 b))] (Integer 4 []) () ())] () ()) (If (IntegerCompare (FunctionCall 2 add_integer () [((Var 5 a)) ((Var 5 b))] (Integer 4 []) () ()) NotEq (IntegerConstant 14 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])] () Source Private Implementation () .false. .false. .false.)}) add_m [lfortran_intrinsic_math] .false. .false.), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), use_template_module: (Program (SymbolTable 6 {add_generic: (ExternalSymbol 6 add_generic 2 add_generic add_m [] add_generic Private), t: (ExternalSymbol 6 t 2 t add_m [] t Private), test_template: (ExternalSymbol 6 test_template 2 test_template add_m [] test_template Private)}) use_template_module [add_m] [(SubroutineCall 6 test_template () [] ())])}) []) diff --git a/tests/reference/asr_preprocess-preprocessor12-94ccea0.json b/tests/reference/asr_preprocess-preprocessor12-94ccea0.json index 5bb1766820..82e5121330 100644 --- a/tests/reference/asr_preprocess-preprocessor12-94ccea0.json +++ b/tests/reference/asr_preprocess-preprocessor12-94ccea0.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr_preprocess-preprocessor12-94ccea0.stdout", - "stdout_hash": "5b104248574a22e030addfd0133319ad7bf26035a740a294b034e5e6", + "stdout_hash": "e12499d14ed06704025124bb944c1c8bbe5308625f6473acf58d0fd4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout b/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout index b0111b584b..57e737a807 100644 --- a/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout +++ b/tests/reference/asr_preprocess-preprocessor12-94ccea0.stdout @@ -1,2 +1 @@ -fname fn (TranslationUnit (SymbolTable 1 {preprocessor12: (Program (SymbolTable 2 {f90_assert: (Function (SymbolTable 4 {file: (Variable 4 file In () () Default (Character 1 -1 () []) Source Public Required .false.), line: (Variable 4 line In () () Default (Integer 4 []) Source Public Required .false.)}) f90_assert [(Var 4 file) (Var 4 line)] [] [(Print () [(StringConcat (StringConcat (StringConstant "Assertion failed at " (Character 1 20 () [])) (Var 4 file) (Character 1 19 () []) ()) (StringConstant ":" (Character 1 1 () [])) (Character 1 20 () []) ()) (Var 4 line)] () ()) (ErrorStop ())] () Source Public Implementation () .false. .false. .false.), fn: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Integer 4 []) Source Public Required .false.), fn: (Variable 3 fn ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) fn [(Var 3 a) (Var 3 b)] [] [(= (Var 3 fn) (IntegerCompare (Var 3 a) Lt (Var 3 b) (Logical 4 []) ()) ())] (Var 3 fn) Source Public Implementation () .false. .false. .false.)}) preprocessor12 [] [(If (LogicalNot (LogicalConstant .true. (Logical 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (Character 1 24 () []))) ((IntegerConstant 7 (Integer 4 [])))] ())] []) (If (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4 [])) Gt (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (Character 1 24 () []))) ((IntegerConstant 8 (Integer 4 [])))] ())] []) (If (LogicalNot (IntegerCompare (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (IntegerConstant 8 (Integer 4 [])) (Integer 4 []) (IntegerConstant 24 (Integer 4 []))) (Integer 4 []) (IntegerConstant 29 (Integer 4 []))) Gt (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (Character 1 24 () []))) ((IntegerConstant 9 (Integer 4 [])))] ())] []) (If (LogicalNot (FunctionCall 2 fn () [((IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ()) (Logical 4 []) ()) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (Character 1 24 () []))) ((IntegerConstant 11 (Integer 4 [])))] ())] []) (If (LogicalNot (IntegerCompare (IntegerConstant 5 (Integer 4 [])) Lt (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(SubroutineCall 2 f90_assert () [((StringConstant "tests/preprocessor12.f90" (Character 1 24 () []))) ((IntegerConstant 13 (Integer 4 [])))] ())] [])])}) []) diff --git a/tests/reference/ast-continue_body_if_loop-406ed85.json b/tests/reference/ast-continue_body_if_loop-406ed85.json index 3885396e6f..f62cace533 100644 --- a/tests/reference/ast-continue_body_if_loop-406ed85.json +++ b/tests/reference/ast-continue_body_if_loop-406ed85.json @@ -5,9 +5,9 @@ "infile_hash": "0b34e65df675e3b4009fe5659fbc93ca52002eb7781599ebb9fe7613", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "ast-continue_body_if_loop-406ed85.stderr", - "stderr_hash": "c6a4176a2b3ac7a08437edc3587c8ed422ffc1fc68a3b8092f1104a1", - "returncode": 2 + "stdout": "ast-continue_body_if_loop-406ed85.stdout", + "stdout_hash": "76e0f5349eb4e503719ddc923727a2949088c3fe3f8218ae79baa266", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/ast-continue_body_if_loop-406ed85.stderr b/tests/reference/ast-continue_body_if_loop-406ed85.stderr deleted file mode 100644 index 19835ff447..0000000000 --- a/tests/reference/ast-continue_body_if_loop-406ed85.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/continue_body_if_loop.f:9:8 - | -9 | STOP - | ^ diff --git a/tests/reference/ast-fixed_form_if_variations-38b0c0a.json b/tests/reference/ast-fixed_form_if_variations-38b0c0a.json index f4bd8f17fe..55e640119a 100644 --- a/tests/reference/ast-fixed_form_if_variations-38b0c0a.json +++ b/tests/reference/ast-fixed_form_if_variations-38b0c0a.json @@ -5,9 +5,9 @@ "infile_hash": "8f15672107a6ce738849ac95c05abf87ef22c71914e2dfa402f9d633", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "ast-fixed_form_if_variations-38b0c0a.stderr", - "stderr_hash": "3c0eaaa52aece36c96edd910d72281cd2f18619dae8d1abfa95b9f5e", - "returncode": 2 + "stdout": "ast-fixed_form_if_variations-38b0c0a.stdout", + "stdout_hash": "12f43881ed4d06b2cffe130edde579eed001f5cd719c21071b822c8d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_if_variations-38b0c0a.stderr b/tests/reference/ast-fixed_form_if_variations-38b0c0a.stderr deleted file mode 100644 index 53349eb693..0000000000 --- a/tests/reference/ast-fixed_form_if_variations-38b0c0a.stderr +++ /dev/null @@ -1,9 +0,0 @@ -syntax error: Newline is unexpected here - --> tests/fixed_form_if_variations.f:20:29 - 21:7 - | -20 | if (0<1) call f(2) - | ... -... - | -21 | end program - | ...^^^^^^^ diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.json b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json index fe6f4988c4..43656bdb00 100644 --- a/tests/reference/ast-fixed_form_simple_continue-dbefb27.json +++ b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json @@ -5,9 +5,9 @@ "infile_hash": "3568a4d42a544d5d2bee64f245d7408d7dc0ff795fba79436c728937", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "ast-fixed_form_simple_continue-dbefb27.stderr", - "stderr_hash": "f349a69c74e399b2d03ebec26ae529d38fe746dc17687bcbe9cb9f58", - "returncode": 2 + "stdout": "ast-fixed_form_simple_continue-dbefb27.stdout", + "stdout_hash": "e2814c25031e04c92830dd6c895f58f1f8265e596da5431b528063d4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.stderr b/tests/reference/ast-fixed_form_simple_continue-dbefb27.stderr deleted file mode 100644 index 0f8e1da258..0000000000 --- a/tests/reference/ast-fixed_form_simple_continue-dbefb27.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/fixed_form_simple_continue.f:1:7 - | -1 | continue - | ^ diff --git a/tests/reference/ast-loop_test1-7800c18.json b/tests/reference/ast-loop_test1-7800c18.json index 208b474577..2a4ad25620 100644 --- a/tests/reference/ast-loop_test1-7800c18.json +++ b/tests/reference/ast-loop_test1-7800c18.json @@ -2,12 +2,12 @@ "basename": "ast-loop_test1-7800c18", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", - "infile_hash": "f43bdfadffef14934343fab6719fe5b78acc2f77520a8a25e4ac0b9c", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "ast-loop_test1-7800c18.stderr", - "stderr_hash": "54750ebea2b3fcb97d030aa4eb558a8db5b8cbe789fe772bacf9acc6", - "returncode": 2 + "stdout": "ast-loop_test1-7800c18.stdout", + "stdout_hash": "a233f33eaaeb901073742c4bcfc4f8ebe49b89960d40bcf27992a7cb", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/ast-loop_test1-7800c18.stderr b/tests/reference/ast-loop_test1-7800c18.stderr deleted file mode 100644 index 5f61305da7..0000000000 --- a/tests/reference/ast-loop_test1-7800c18.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for program - --> tests/loop_test1.f:4:1 - | -4 | <<<<<<< HEAD - | ^ diff --git a/tests/reference/ast-loop_test1-7800c18.stdout b/tests/reference/ast-loop_test1-7800c18.stdout index ab30863469..93a60c30da 100644 --- a/tests/reference/ast-loop_test1-7800c18.stdout +++ b/tests/reference/ast-loop_test1-7800c18.stdout @@ -1,5 +1 @@ -<<<<<<< HEAD -(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(kp [] [] () None ())] ())] [(= 0 kp 10 ()) (DoLoop 0 () 330 i 1 kp () [(DoLoop 0 () 320 j (+ i 1) kp () [(If 0 () (> 0 1) [(Print 0 () [i j] ())] [(Print 0 () [j i] ())] () () ()) (Continue 320 ())] () ()) (Continue 330 ())] () ())] [])]) -======= (TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(kp [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(i [] [] () None ()) (j [] [] () None ())] ())] [(= 0 kp 10 ()) (DoLoop 0 () 330 i 1 kp () [(DoLoop 0 () 320 j (+ i 1) kp () [(If 0 () (> 0 1) [(Print 0 () [i j] ())] [(Print 0 () [j i] ())] () () ()) (Continue 320 ())] () ()) (Continue 330 ())] () ())] [])]) ->>>>>>> gh-main/main diff --git a/tests/reference/ast-loop_test2-c76adc4.json b/tests/reference/ast-loop_test2-c76adc4.json index 93067d8887..a062edf3ef 100644 --- a/tests/reference/ast-loop_test2-c76adc4.json +++ b/tests/reference/ast-loop_test2-c76adc4.json @@ -2,12 +2,12 @@ "basename": "ast-loop_test2-c76adc4", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", - "infile_hash": "b46cf8c93329247479184cd8ce1d8948a1302d6c0c4095d991d039a9", + "infile_hash": "eeca40e0ea1de861bd50394bb8dd9b8ffca564f6d72b55497c601fac", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "ast-loop_test2-c76adc4.stderr", - "stderr_hash": "9e91965942cfa80b6ecaecfa88ed41fbda182688cb8b90f1e309ae60", - "returncode": 2 + "stdout": "ast-loop_test2-c76adc4.stdout", + "stdout_hash": "5f59a25d9720073323dfbe851acf529f81d55e43e6a41162f7324dba", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/ast-loop_test2-c76adc4.stderr b/tests/reference/ast-loop_test2-c76adc4.stderr deleted file mode 100644 index f8135a65b2..0000000000 --- a/tests/reference/ast-loop_test2-c76adc4.stderr +++ /dev/null @@ -1,5 +0,0 @@ -tokenizer error: Expecting terminating symbol for subroutine - --> tests/loop_test2.f:9:1 - | -9 | <<<<<<< HEAD - | ^ diff --git a/tests/reference/ast-loop_test2-c76adc4.stdout b/tests/reference/ast-loop_test2-c76adc4.stdout index 9f859a0d6f..2bc8075471 100644 --- a/tests/reference/ast-loop_test2-c76adc4.stdout +++ b/tests/reference/ast-loop_test2-c76adc4.stdout @@ -1,5 +1 @@ -<<<<<<< HEAD -(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(nq [] [] () None ()) (m [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(wrk5 [] [] () None ()) (v [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(ve [] [] () None ()) (vev [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(zero [] [] () None ())] ())] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(= 0 (FuncCallOrArray wrk5 [] [(() j ())] [] []) (FuncCallOrArray v [] [(() indx ()) (() j ()) (() l1 ())] [] []) ()) (Continue 110 ())] () ()) (DoLoop 0 () 120 j 1 m () [(= 0 (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray wrk5 [] [(() j ())] [] []) ()) (Continue 120 ())] () ()) (Continue 140 ())] () ()) (= 0 indx 1 ()) (= 0 zero (Real "0.0d00") ()) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) zero ()) (DoLoop 0 () 210 j 1 m () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (+ (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (* (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray ve [] [(() indx ()) (() l2 ()) (() j ())] [] []))) ()) (Continue 210 ())] () ()) (= 0 (FuncCallOrArray vev [] [(() l2 ()) (() l1 ())] [] []) (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) ()) (Continue 220 ())] () ()) (Continue 230 ())] () ()) (Return 0 () ())] [])]) -======= (TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(nq [] [] () None ()) (m [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(wrk5 [] [] () None ()) (v [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(l1 [] [] () None ()) (j [] [] () None ()) (l2 [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(indx [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(ve [] [] () None ()) (vev [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(zero [] [] () None ())] ())] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(= 0 (FuncCallOrArray wrk5 [] [(() j ())] [] []) (FuncCallOrArray v [] [(() indx ()) (() j ()) (() l1 ())] [] []) ()) (Continue 110 ())] () ()) (DoLoop 0 () 120 j 1 m () [(= 0 (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray wrk5 [] [(() j ())] [] []) ()) (Continue 120 ())] () ()) (Continue 140 ())] () ()) (= 0 indx 1 ()) (= 0 zero (Real "0.0d00") ()) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) zero ()) (DoLoop 0 () 210 j 1 m () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (+ (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (* (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray ve [] [(() indx ()) (() l2 ()) (() j ())] [] []))) ()) (Continue 210 ())] () ()) (= 0 (FuncCallOrArray vev [] [(() l2 ()) (() l1 ())] [] []) (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) ()) (Continue 220 ())] () ()) (Continue 230 ())] () ()) (Return 0 () ())] [])]) ->>>>>>> gh-main/main diff --git a/tests/reference/c-program3-32749e4.json b/tests/reference/c-program3-32749e4.json index 760d15316a..734a258e0c 100644 --- a/tests/reference/c-program3-32749e4.json +++ b/tests/reference/c-program3-32749e4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-program3-32749e4.stdout", - "stdout_hash": "11334d176b838e928ebcddcfedaaedfdb95dd6dde64f82a375525f41", + "stdout_hash": "90a28829e97bde25f1641099a5bc81ec4f02b9eaed92aac0f417d830", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/c-program3-32749e4.stdout b/tests/reference/c-program3-32749e4.stdout index b7c3ffb943..d7e6845a66 100644 --- a/tests/reference/c-program3-32749e4.stdout +++ b/tests/reference/c-program3-32749e4.stdout @@ -1,5 +1,3 @@ -fname func1 -fname func2 #include #include diff --git a/tests/reference/c-program4-d60edeb.json b/tests/reference/c-program4-d60edeb.json index 059f267902..f7ac64190c 100644 --- a/tests/reference/c-program4-d60edeb.json +++ b/tests/reference/c-program4-d60edeb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "c-program4-d60edeb.stdout", - "stdout_hash": "dc055924213cec1833f33fc761fcc2a0e494280152821893cf2ae8c4", + "stdout_hash": "9cb1b6f571d051c3b03084a137dbba9766fdae96ab81f9dd8b2956f8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/c-program4-d60edeb.stdout b/tests/reference/c-program4-d60edeb.stdout index 617a594689..481a1b8c36 100644 --- a/tests/reference/c-program4-d60edeb.stdout +++ b/tests/reference/c-program4-d60edeb.stdout @@ -1,5 +1,3 @@ -fname func1 -fname func2 #include #include diff --git a/tests/reference/cpp-arrays_03_func-3a62608.json b/tests/reference/cpp-arrays_03_func-3a62608.json index 8d6d4d41c9..9e3c6e5300 100644 --- a/tests/reference/cpp-arrays_03_func-3a62608.json +++ b/tests/reference/cpp-arrays_03_func-3a62608.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_03_func-3a62608.stdout", - "stdout_hash": "470fa8b7258b6e3f2beea1fd311b8f92ca8792ba62ce34e6d598f35d", + "stdout_hash": "e44a65a809eab7e8bdcf593d77c14bddcaadfefab1000bb9b72b2506", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-arrays_03_func-3a62608.stdout b/tests/reference/cpp-arrays_03_func-3a62608.stdout index f4ee338f8f..aa89b56c5d 100644 --- a/tests/reference/cpp-arrays_03_func-3a62608.stdout +++ b/tests/reference/cpp-arrays_03_func-3a62608.stdout @@ -1,4 +1,3 @@ -fname mysum #include #include #include diff --git a/tests/reference/cpp-arrays_04_func-68b1437.json b/tests/reference/cpp-arrays_04_func-68b1437.json index d0e6bbccee..4beb9c2da6 100644 --- a/tests/reference/cpp-arrays_04_func-68b1437.json +++ b/tests/reference/cpp-arrays_04_func-68b1437.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-arrays_04_func-68b1437.stdout", - "stdout_hash": "486a6de90cbd988f83a2d9543fc68df3ba514d02b7a1b3a66148e68d", + "stdout_hash": "79cd390c08f5ff374318adc2bd534c9904932b75edbaa037c179c77a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-arrays_04_func-68b1437.stdout b/tests/reference/cpp-arrays_04_func-68b1437.stdout index 370a67bfc3..4489ba4c91 100644 --- a/tests/reference/cpp-arrays_04_func-68b1437.stdout +++ b/tests/reference/cpp-arrays_04_func-68b1437.stdout @@ -1,5 +1,3 @@ -fname sum -fname abs #include #include #include diff --git a/tests/reference/cpp-fn2-ff8ef37.json b/tests/reference/cpp-fn2-ff8ef37.json index 6ce6544a80..3576dbfe9f 100644 --- a/tests/reference/cpp-fn2-ff8ef37.json +++ b/tests/reference/cpp-fn2-ff8ef37.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-fn2-ff8ef37.stdout", - "stdout_hash": "41b17bf784a6ab6f6789c334afe6cb87bf71fc112da56aead4626075", + "stdout_hash": "5106127c43eaf75579dca9c6dffaf2a9415560b60b2cdf57aff1fd19", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-fn2-ff8ef37.stdout b/tests/reference/cpp-fn2-ff8ef37.stdout index 15c36efcb9..31ff86b03f 100644 --- a/tests/reference/cpp-fn2-ff8ef37.stdout +++ b/tests/reference/cpp-fn2-ff8ef37.stdout @@ -1,9 +1,3 @@ -fname a -fname b -fname c -fname d -fname e -fname f #include #include #include diff --git a/tests/reference/cpp-program3-7ea69db.json b/tests/reference/cpp-program3-7ea69db.json index a32f8635e0..e8bc905192 100644 --- a/tests/reference/cpp-program3-7ea69db.json +++ b/tests/reference/cpp-program3-7ea69db.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-program3-7ea69db.stdout", - "stdout_hash": "7926fa24abc36533be2da149f4257fc4f58e779c3b15e0272c109d87", + "stdout_hash": "0228f9c3fae3ff445a12c48e6f517ebdfa99768ed5869bced06a357a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-program3-7ea69db.stdout b/tests/reference/cpp-program3-7ea69db.stdout index c0dbe688d7..5dd6e3ab1b 100644 --- a/tests/reference/cpp-program3-7ea69db.stdout +++ b/tests/reference/cpp-program3-7ea69db.stdout @@ -1,5 +1,3 @@ -fname func1 -fname func2 #include #include #include diff --git a/tests/reference/cpp-program4-1796cb6.json b/tests/reference/cpp-program4-1796cb6.json index 045e4da8fe..9ac3770e34 100644 --- a/tests/reference/cpp-program4-1796cb6.json +++ b/tests/reference/cpp-program4-1796cb6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-program4-1796cb6.stdout", - "stdout_hash": "9f3d072c6f299a63ddff3896e53419d6a136a853489e59fb4d809d70", + "stdout_hash": "98a1c71d406f63c8b533ed6be1228a54f3e32ced5bec2d541b5d695a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-program4-1796cb6.stdout b/tests/reference/cpp-program4-1796cb6.stdout index d39ae0e8ea..bf1915d629 100644 --- a/tests/reference/cpp-program4-1796cb6.stdout +++ b/tests/reference/cpp-program4-1796cb6.stdout @@ -1,5 +1,3 @@ -fname func1 -fname func2 #include #include #include diff --git a/tests/reference/llvm-allocate_01-573b1f6.json b/tests/reference/llvm-allocate_01-573b1f6.json index f6d36bc5df..88214c2d3b 100644 --- a/tests/reference/llvm-allocate_01-573b1f6.json +++ b/tests/reference/llvm-allocate_01-573b1f6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_01-573b1f6.stdout", - "stdout_hash": "587cbccec902524e72293a632690038d4835348272996a34c16c1794", + "stdout_hash": "c39c6245b524426a410b4ac87dbfefe0eba0ac47328cf843004c0af2", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-allocate_01-573b1f6.stdout b/tests/reference/llvm-allocate_01-573b1f6.stdout index 8b06790da5..ce4b13cca5 100644 --- a/tests/reference/llvm-allocate_01-573b1f6.stdout +++ b/tests/reference/llvm-allocate_01-573b1f6.stdout @@ -1,4 +1,3 @@ -fname reduce_sum ; ModuleID = 'LFortran' source_filename = "LFortran" @@ -662,11 +661,11 @@ declare void @_lfortran_free(i8*, ...) define i32 @main() { .entry: + %call_arg_value59 = alloca i32, align 4 + %call_arg_value58 = alloca i32, align 4 + %call_arg_value57 = alloca i32, align 4 %call_arg_value56 = alloca i32, align 4 %call_arg_value55 = alloca i32, align 4 - %call_arg_value54 = alloca i32, align 4 - %call_arg_value53 = alloca i32, align 4 - %call_arg_value52 = alloca i32, align 4 %call_arg_value = alloca i32, align 4 %a = alloca %array, align 8 %0 = getelementptr %array, %array* %a, i32 0, i32 2 @@ -1005,64 +1004,53 @@ loop.end14: ; preds = %loop.head12 br label %loop.head10 loop.end15: ; preds = %loop.head10 - %214 = alloca %array, align 8 - %215 = alloca %array.0, align 8 - %216 = alloca %array.1, align 8 - call void @sum(%array* %a, %array.0* %b, %array.1* %c) - %217 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %218 = load %dimension_descriptor*, %dimension_descriptor** %217, align 8 - %219 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %218, i32 0 - %220 = getelementptr %dimension_descriptor, %dimension_descriptor* %219, i32 0, i32 1 - %221 = load i32, i32* %220, align 4 - %222 = icmp ne i32 %221, 5 - %223 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %224 = load %dimension_descriptor*, %dimension_descriptor** %223, align 8 - %225 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %224, i32 0 - %226 = getelementptr %dimension_descriptor, %dimension_descriptor* %225, i32 0, i32 1 - %227 = load i32, i32* %226, align 4 - %228 = getelementptr %dimension_descriptor, %dimension_descriptor* %225, i32 0, i32 2 - %229 = load i32, i32* %228, align 4 - %230 = add i32 %229, %227 - %231 = sub i32 %230, 1 - %232 = load i32, i32* %n, align 4 - %233 = add i32 %232, 5 - %234 = icmp ne i32 %231, %233 - %235 = or i1 %222, %234 - br i1 %235, label %then16, label %else17 + %214 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + %215 = load i1, i1* %214, align 1 + br i1 %215, label %then16, label %else17 then16: ; preds = %loop.end15 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @2, i32 0, i32 0)) - call void @exit(i32 1) + %216 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 + %217 = load %complex_4*, %complex_4** %216, align 8 + %218 = alloca i8*, align 8 + %219 = bitcast %complex_4* %217 to i8* + store i8* %219, i8** %218, align 8 + %220 = load i8*, i8** %218, align 8 + call void (i8*, ...) @_lfortran_free(i8* %220) + %221 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + store i1 false, i1* %221, align 1 br label %ifcont18 else17: ; preds = %loop.end15 br label %ifcont18 ifcont18: ; preds = %else17, %then16 - %236 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %237 = load %dimension_descriptor*, %dimension_descriptor** %236, align 8 - %238 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %237, i32 1 - %239 = getelementptr %dimension_descriptor, %dimension_descriptor* %238, i32 0, i32 1 - %240 = load i32, i32* %239, align 4 - %241 = load i32, i32* %n, align 4 - %242 = icmp ne i32 %240, %241 - %243 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %244 = load %dimension_descriptor*, %dimension_descriptor** %243, align 8 - %245 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %244, i32 1 - %246 = getelementptr %dimension_descriptor, %dimension_descriptor* %245, i32 0, i32 1 - %247 = load i32, i32* %246, align 4 - %248 = getelementptr %dimension_descriptor, %dimension_descriptor* %245, i32 0, i32 2 - %249 = load i32, i32* %248, align 4 - %250 = add i32 %249, %247 - %251 = sub i32 %250, 1 - %252 = load i32, i32* %n, align 4 - %253 = mul i32 2, %252 - %254 = icmp ne i32 %251, %253 - %255 = or i1 %242, %254 - br i1 %255, label %then19, label %else20 + %222 = alloca %array, align 8 + %223 = alloca %array.0, align 8 + %224 = alloca %array.1, align 8 + call void @sum(%array* %a, %array.0* %b, %array.1* %c) + %225 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %226 = load %dimension_descriptor*, %dimension_descriptor** %225, align 8 + %227 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %226, i32 0 + %228 = getelementptr %dimension_descriptor, %dimension_descriptor* %227, i32 0, i32 1 + %229 = load i32, i32* %228, align 4 + %230 = icmp ne i32 %229, 5 + %231 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %232 = load %dimension_descriptor*, %dimension_descriptor** %231, align 8 + %233 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %232, i32 0 + %234 = getelementptr %dimension_descriptor, %dimension_descriptor* %233, i32 0, i32 1 + %235 = load i32, i32* %234, align 4 + %236 = getelementptr %dimension_descriptor, %dimension_descriptor* %233, i32 0, i32 2 + %237 = load i32, i32* %236, align 4 + %238 = add i32 %237, %235 + %239 = sub i32 %238, 1 + %240 = load i32, i32* %n, align 4 + %241 = add i32 %240, 5 + %242 = icmp ne i32 %239, %241 + %243 = or i1 %230, %242 + br i1 %243, label %then19, label %else20 then19: ; preds = %ifcont18 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @3, i32 0, i32 0)) + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @2, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont21 @@ -1070,30 +1058,30 @@ else20: ; preds = %ifcont18 br label %ifcont21 ifcont21: ; preds = %else20, %then19 - %256 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %257 = load %dimension_descriptor*, %dimension_descriptor** %256, align 8 - %258 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %257, i32 2 - %259 = getelementptr %dimension_descriptor, %dimension_descriptor* %258, i32 0, i32 1 - %260 = load i32, i32* %259, align 4 - %261 = load i32, i32* %n, align 4 - %262 = icmp ne i32 %260, %261 - %263 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %264 = load %dimension_descriptor*, %dimension_descriptor** %263, align 8 - %265 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %264, i32 2 - %266 = getelementptr %dimension_descriptor, %dimension_descriptor* %265, i32 0, i32 1 - %267 = load i32, i32* %266, align 4 - %268 = getelementptr %dimension_descriptor, %dimension_descriptor* %265, i32 0, i32 2 - %269 = load i32, i32* %268, align 4 - %270 = add i32 %269, %267 - %271 = sub i32 %270, 1 - %272 = load i32, i32* %n, align 4 - %273 = mul i32 3, %272 - %274 = icmp ne i32 %271, %273 - %275 = or i1 %262, %274 - br i1 %275, label %then22, label %else23 + %244 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %245 = load %dimension_descriptor*, %dimension_descriptor** %244, align 8 + %246 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %245, i32 1 + %247 = getelementptr %dimension_descriptor, %dimension_descriptor* %246, i32 0, i32 1 + %248 = load i32, i32* %247, align 4 + %249 = load i32, i32* %n, align 4 + %250 = icmp ne i32 %248, %249 + %251 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %252 = load %dimension_descriptor*, %dimension_descriptor** %251, align 8 + %253 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %252, i32 1 + %254 = getelementptr %dimension_descriptor, %dimension_descriptor* %253, i32 0, i32 1 + %255 = load i32, i32* %254, align 4 + %256 = getelementptr %dimension_descriptor, %dimension_descriptor* %253, i32 0, i32 2 + %257 = load i32, i32* %256, align 4 + %258 = add i32 %257, %255 + %259 = sub i32 %258, 1 + %260 = load i32, i32* %n, align 4 + %261 = mul i32 2, %260 + %262 = icmp ne i32 %259, %261 + %263 = or i1 %250, %262 + br i1 %263, label %then22, label %else23 then22: ; preds = %ifcont21 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @4, i32 0, i32 0)) + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @3, i32 0, i32 0)) call void @exit(i32 1) br label %ifcont24 @@ -1101,451 +1089,462 @@ else23: ; preds = %ifcont21 br label %ifcont24 ifcont24: ; preds = %else23, %then22 - %276 = getelementptr %array, %array* %a, i32 0, i32 2 - %277 = load %dimension_descriptor*, %dimension_descriptor** %276, align 8 - %278 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %277, i32 0 - %279 = getelementptr %dimension_descriptor, %dimension_descriptor* %278, i32 0, i32 1 - %280 = load i32, i32* %279, align 4 - %281 = sub i32 %280, 1 - store i32 %281, i32* %i, align 4 - br label %loop.head25 - -loop.head25: ; preds = %ifcont29, %ifcont24 - %282 = load i32, i32* %i, align 4 - %283 = add i32 %282, 1 + %264 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %265 = load %dimension_descriptor*, %dimension_descriptor** %264, align 8 + %266 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %265, i32 2 + %267 = getelementptr %dimension_descriptor, %dimension_descriptor* %266, i32 0, i32 1 + %268 = load i32, i32* %267, align 4 + %269 = load i32, i32* %n, align 4 + %270 = icmp ne i32 %268, %269 + %271 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %272 = load %dimension_descriptor*, %dimension_descriptor** %271, align 8 + %273 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %272, i32 2 + %274 = getelementptr %dimension_descriptor, %dimension_descriptor* %273, i32 0, i32 1 + %275 = load i32, i32* %274, align 4 + %276 = getelementptr %dimension_descriptor, %dimension_descriptor* %273, i32 0, i32 2 + %277 = load i32, i32* %276, align 4 + %278 = add i32 %277, %275 + %279 = sub i32 %278, 1 + %280 = load i32, i32* %n, align 4 + %281 = mul i32 3, %280 + %282 = icmp ne i32 %279, %281 + %283 = or i1 %270, %282 + br i1 %283, label %then25, label %else26 + +then25: ; preds = %ifcont24 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @4, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont27 + +else26: ; preds = %ifcont24 + br label %ifcont27 + +ifcont27: ; preds = %else26, %then25 %284 = getelementptr %array, %array* %a, i32 0, i32 2 %285 = load %dimension_descriptor*, %dimension_descriptor** %284, align 8 %286 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %285, i32 0 %287 = getelementptr %dimension_descriptor, %dimension_descriptor* %286, i32 0, i32 1 %288 = load i32, i32* %287, align 4 - %289 = getelementptr %dimension_descriptor, %dimension_descriptor* %286, i32 0, i32 2 - %290 = load i32, i32* %289, align 4 - %291 = add i32 %290, %288 - %292 = sub i32 %291, 1 - %293 = icmp sle i32 %283, %292 - br i1 %293, label %loop.body26, label %loop.end30 - -loop.body26: ; preds = %loop.head25 - %294 = load i32, i32* %i, align 4 - %295 = add i32 %294, 1 - store i32 %295, i32* %i, align 4 - %296 = load i32, i32* %i, align 4 - %297 = getelementptr %array, %array* %a, i32 0, i32 2 - %298 = load %dimension_descriptor*, %dimension_descriptor** %297, align 8 - %299 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %298, i32 0 - %300 = getelementptr %dimension_descriptor, %dimension_descriptor* %299, i32 0, i32 1 - %301 = load i32, i32* %300, align 4 - %302 = sub i32 %296, %301 - %303 = mul i32 1, %302 - %304 = add i32 0, %303 - %305 = getelementptr %dimension_descriptor, %dimension_descriptor* %299, i32 0, i32 2 - %306 = load i32, i32* %305, align 4 - %307 = mul i32 1, %306 - %308 = getelementptr %array, %array* %a, i32 0, i32 0 - %309 = load i32*, i32** %308, align 8 - %310 = getelementptr inbounds i32, i32* %309, i32 %304 - %311 = load i32, i32* %310, align 4 - %312 = load i32, i32* %i, align 4 - %313 = icmp ne i32 %311, %312 - br i1 %313, label %then27, label %else28 - -then27: ; preds = %loop.body26 + %289 = sub i32 %288, 1 + store i32 %289, i32* %i, align 4 + br label %loop.head28 + +loop.head28: ; preds = %ifcont32, %ifcont27 + %290 = load i32, i32* %i, align 4 + %291 = add i32 %290, 1 + %292 = getelementptr %array, %array* %a, i32 0, i32 2 + %293 = load %dimension_descriptor*, %dimension_descriptor** %292, align 8 + %294 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %293, i32 0 + %295 = getelementptr %dimension_descriptor, %dimension_descriptor* %294, i32 0, i32 1 + %296 = load i32, i32* %295, align 4 + %297 = getelementptr %dimension_descriptor, %dimension_descriptor* %294, i32 0, i32 2 + %298 = load i32, i32* %297, align 4 + %299 = add i32 %298, %296 + %300 = sub i32 %299, 1 + %301 = icmp sle i32 %291, %300 + br i1 %301, label %loop.body29, label %loop.end33 + +loop.body29: ; preds = %loop.head28 + %302 = load i32, i32* %i, align 4 + %303 = add i32 %302, 1 + store i32 %303, i32* %i, align 4 + %304 = load i32, i32* %i, align 4 + %305 = getelementptr %array, %array* %a, i32 0, i32 2 + %306 = load %dimension_descriptor*, %dimension_descriptor** %305, align 8 + %307 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %306, i32 0 + %308 = getelementptr %dimension_descriptor, %dimension_descriptor* %307, i32 0, i32 1 + %309 = load i32, i32* %308, align 4 + %310 = sub i32 %304, %309 + %311 = mul i32 1, %310 + %312 = add i32 0, %311 + %313 = getelementptr %dimension_descriptor, %dimension_descriptor* %307, i32 0, i32 2 + %314 = load i32, i32* %313, align 4 + %315 = mul i32 1, %314 + %316 = getelementptr %array, %array* %a, i32 0, i32 0 + %317 = load i32*, i32** %316, align 8 + %318 = getelementptr inbounds i32, i32* %317, i32 %312 + %319 = load i32, i32* %318, align 4 + %320 = load i32, i32* %i, align 4 + %321 = icmp ne i32 %319, %320 + br i1 %321, label %then30, label %else31 + +then30: ; preds = %loop.body29 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @5, i32 0, i32 0)) call void @exit(i32 1) - br label %ifcont29 + br label %ifcont32 -else28: ; preds = %loop.body26 - br label %ifcont29 +else31: ; preds = %loop.body29 + br label %ifcont32 -ifcont29: ; preds = %else28, %then27 - br label %loop.head25 +ifcont32: ; preds = %else31, %then30 + br label %loop.head28 -loop.end30: ; preds = %loop.head25 - %314 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 - %315 = load %dimension_descriptor*, %dimension_descriptor** %314, align 8 - %316 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %315, i32 0 - %317 = getelementptr %dimension_descriptor, %dimension_descriptor* %316, i32 0, i32 1 - %318 = load i32, i32* %317, align 4 - %319 = sub i32 %318, 1 - store i32 %319, i32* %i, align 4 - br label %loop.head31 - -loop.head31: ; preds = %loop.end38, %loop.end30 - %320 = load i32, i32* %i, align 4 - %321 = add i32 %320, 1 +loop.end33: ; preds = %loop.head28 %322 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 %323 = load %dimension_descriptor*, %dimension_descriptor** %322, align 8 %324 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %323, i32 0 %325 = getelementptr %dimension_descriptor, %dimension_descriptor* %324, i32 0, i32 1 %326 = load i32, i32* %325, align 4 - %327 = getelementptr %dimension_descriptor, %dimension_descriptor* %324, i32 0, i32 2 - %328 = load i32, i32* %327, align 4 - %329 = add i32 %328, %326 - %330 = sub i32 %329, 1 - %331 = icmp sle i32 %321, %330 - br i1 %331, label %loop.body32, label %loop.end39 - -loop.body32: ; preds = %loop.head31 - %332 = load i32, i32* %i, align 4 - %333 = add i32 %332, 1 - store i32 %333, i32* %i, align 4 - %334 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 - %335 = load %dimension_descriptor*, %dimension_descriptor** %334, align 8 - %336 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %335, i32 1 - %337 = getelementptr %dimension_descriptor, %dimension_descriptor* %336, i32 0, i32 1 - %338 = load i32, i32* %337, align 4 - %339 = sub i32 %338, 1 - store i32 %339, i32* %j, align 4 - br label %loop.head33 - -loop.head33: ; preds = %ifcont37, %loop.body32 - %340 = load i32, i32* %j, align 4 + %327 = sub i32 %326, 1 + store i32 %327, i32* %i, align 4 + br label %loop.head34 + +loop.head34: ; preds = %loop.end41, %loop.end33 + %328 = load i32, i32* %i, align 4 + %329 = add i32 %328, 1 + %330 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 + %331 = load %dimension_descriptor*, %dimension_descriptor** %330, align 8 + %332 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %331, i32 0 + %333 = getelementptr %dimension_descriptor, %dimension_descriptor* %332, i32 0, i32 1 + %334 = load i32, i32* %333, align 4 + %335 = getelementptr %dimension_descriptor, %dimension_descriptor* %332, i32 0, i32 2 + %336 = load i32, i32* %335, align 4 + %337 = add i32 %336, %334 + %338 = sub i32 %337, 1 + %339 = icmp sle i32 %329, %338 + br i1 %339, label %loop.body35, label %loop.end42 + +loop.body35: ; preds = %loop.head34 + %340 = load i32, i32* %i, align 4 %341 = add i32 %340, 1 + store i32 %341, i32* %i, align 4 %342 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 %343 = load %dimension_descriptor*, %dimension_descriptor** %342, align 8 %344 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %343, i32 1 %345 = getelementptr %dimension_descriptor, %dimension_descriptor* %344, i32 0, i32 1 %346 = load i32, i32* %345, align 4 - %347 = getelementptr %dimension_descriptor, %dimension_descriptor* %344, i32 0, i32 2 - %348 = load i32, i32* %347, align 4 - %349 = add i32 %348, %346 - %350 = sub i32 %349, 1 - %351 = icmp sle i32 %341, %350 - br i1 %351, label %loop.body34, label %loop.end38 - -loop.body34: ; preds = %loop.head33 - %352 = load i32, i32* %j, align 4 - %353 = add i32 %352, 1 - store i32 %353, i32* %j, align 4 - %354 = load i32, i32* %i, align 4 - %355 = load i32, i32* %j, align 4 - %356 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 - %357 = load %dimension_descriptor*, %dimension_descriptor** %356, align 8 - %358 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %357, i32 0 - %359 = getelementptr %dimension_descriptor, %dimension_descriptor* %358, i32 0, i32 1 - %360 = load i32, i32* %359, align 4 - %361 = sub i32 %354, %360 - %362 = mul i32 1, %361 - %363 = add i32 0, %362 - %364 = getelementptr %dimension_descriptor, %dimension_descriptor* %358, i32 0, i32 2 - %365 = load i32, i32* %364, align 4 - %366 = mul i32 1, %365 - %367 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %357, i32 1 - %368 = getelementptr %dimension_descriptor, %dimension_descriptor* %367, i32 0, i32 1 - %369 = load i32, i32* %368, align 4 - %370 = sub i32 %355, %369 - %371 = mul i32 %366, %370 - %372 = add i32 %363, %371 - %373 = getelementptr %dimension_descriptor, %dimension_descriptor* %367, i32 0, i32 2 - %374 = load i32, i32* %373, align 4 - %375 = mul i32 %366, %374 - %376 = getelementptr %array.0, %array.0* %b, i32 0, i32 0 - %377 = load float*, float** %376, align 8 - %378 = getelementptr inbounds float, float* %377, i32 %372 - %379 = load float, float* %378, align 4 - %380 = load i32, i32* %i, align 4 - %381 = load i32, i32* %j, align 4 - %382 = add i32 %380, %381 - %383 = sitofp i32 %382 to float - %384 = fcmp une float %379, %383 - br i1 %384, label %then35, label %else36 - -then35: ; preds = %loop.body34 + %347 = sub i32 %346, 1 + store i32 %347, i32* %j, align 4 + br label %loop.head36 + +loop.head36: ; preds = %ifcont40, %loop.body35 + %348 = load i32, i32* %j, align 4 + %349 = add i32 %348, 1 + %350 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 + %351 = load %dimension_descriptor*, %dimension_descriptor** %350, align 8 + %352 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %351, i32 1 + %353 = getelementptr %dimension_descriptor, %dimension_descriptor* %352, i32 0, i32 1 + %354 = load i32, i32* %353, align 4 + %355 = getelementptr %dimension_descriptor, %dimension_descriptor* %352, i32 0, i32 2 + %356 = load i32, i32* %355, align 4 + %357 = add i32 %356, %354 + %358 = sub i32 %357, 1 + %359 = icmp sle i32 %349, %358 + br i1 %359, label %loop.body37, label %loop.end41 + +loop.body37: ; preds = %loop.head36 + %360 = load i32, i32* %j, align 4 + %361 = add i32 %360, 1 + store i32 %361, i32* %j, align 4 + %362 = load i32, i32* %i, align 4 + %363 = load i32, i32* %j, align 4 + %364 = getelementptr %array.0, %array.0* %b, i32 0, i32 2 + %365 = load %dimension_descriptor*, %dimension_descriptor** %364, align 8 + %366 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %365, i32 0 + %367 = getelementptr %dimension_descriptor, %dimension_descriptor* %366, i32 0, i32 1 + %368 = load i32, i32* %367, align 4 + %369 = sub i32 %362, %368 + %370 = mul i32 1, %369 + %371 = add i32 0, %370 + %372 = getelementptr %dimension_descriptor, %dimension_descriptor* %366, i32 0, i32 2 + %373 = load i32, i32* %372, align 4 + %374 = mul i32 1, %373 + %375 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %365, i32 1 + %376 = getelementptr %dimension_descriptor, %dimension_descriptor* %375, i32 0, i32 1 + %377 = load i32, i32* %376, align 4 + %378 = sub i32 %363, %377 + %379 = mul i32 %374, %378 + %380 = add i32 %371, %379 + %381 = getelementptr %dimension_descriptor, %dimension_descriptor* %375, i32 0, i32 2 + %382 = load i32, i32* %381, align 4 + %383 = mul i32 %374, %382 + %384 = getelementptr %array.0, %array.0* %b, i32 0, i32 0 + %385 = load float*, float** %384, align 8 + %386 = getelementptr inbounds float, float* %385, i32 %380 + %387 = load float, float* %386, align 4 + %388 = load i32, i32* %i, align 4 + %389 = load i32, i32* %j, align 4 + %390 = add i32 %388, %389 + %391 = sitofp i32 %390 to float + %392 = fcmp une float %387, %391 + br i1 %392, label %then38, label %else39 + +then38: ; preds = %loop.body37 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @6, i32 0, i32 0)) call void @exit(i32 1) - br label %ifcont37 - -else36: ; preds = %loop.body34 - br label %ifcont37 - -ifcont37: ; preds = %else36, %then35 - br label %loop.head33 - -loop.end38: ; preds = %loop.head33 - br label %loop.head31 - -loop.end39: ; preds = %loop.head31 - %385 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %386 = load %dimension_descriptor*, %dimension_descriptor** %385, align 8 - %387 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %386, i32 0 - %388 = getelementptr %dimension_descriptor, %dimension_descriptor* %387, i32 0, i32 1 - %389 = load i32, i32* %388, align 4 - %390 = sub i32 %389, 1 - store i32 %390, i32* %i, align 4 - br label %loop.head40 - -loop.head40: ; preds = %loop.end50, %loop.end39 - %391 = load i32, i32* %i, align 4 - %392 = add i32 %391, 1 + br label %ifcont40 + +else39: ; preds = %loop.body37 + br label %ifcont40 + +ifcont40: ; preds = %else39, %then38 + br label %loop.head36 + +loop.end41: ; preds = %loop.head36 + br label %loop.head34 + +loop.end42: ; preds = %loop.head34 %393 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 %394 = load %dimension_descriptor*, %dimension_descriptor** %393, align 8 %395 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %394, i32 0 %396 = getelementptr %dimension_descriptor, %dimension_descriptor* %395, i32 0, i32 1 %397 = load i32, i32* %396, align 4 - %398 = getelementptr %dimension_descriptor, %dimension_descriptor* %395, i32 0, i32 2 - %399 = load i32, i32* %398, align 4 - %400 = add i32 %399, %397 - %401 = sub i32 %400, 1 - %402 = icmp sle i32 %392, %401 - br i1 %402, label %loop.body41, label %loop.end51 - -loop.body41: ; preds = %loop.head40 - %403 = load i32, i32* %i, align 4 - %404 = add i32 %403, 1 - store i32 %404, i32* %i, align 4 - %405 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %406 = load %dimension_descriptor*, %dimension_descriptor** %405, align 8 - %407 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %406, i32 1 - %408 = getelementptr %dimension_descriptor, %dimension_descriptor* %407, i32 0, i32 1 - %409 = load i32, i32* %408, align 4 - %410 = sub i32 %409, 1 - store i32 %410, i32* %j, align 4 - br label %loop.head42 - -loop.head42: ; preds = %loop.end49, %loop.body41 - %411 = load i32, i32* %j, align 4 + %398 = sub i32 %397, 1 + store i32 %398, i32* %i, align 4 + br label %loop.head43 + +loop.head43: ; preds = %loop.end53, %loop.end42 + %399 = load i32, i32* %i, align 4 + %400 = add i32 %399, 1 + %401 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %402 = load %dimension_descriptor*, %dimension_descriptor** %401, align 8 + %403 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %402, i32 0 + %404 = getelementptr %dimension_descriptor, %dimension_descriptor* %403, i32 0, i32 1 + %405 = load i32, i32* %404, align 4 + %406 = getelementptr %dimension_descriptor, %dimension_descriptor* %403, i32 0, i32 2 + %407 = load i32, i32* %406, align 4 + %408 = add i32 %407, %405 + %409 = sub i32 %408, 1 + %410 = icmp sle i32 %400, %409 + br i1 %410, label %loop.body44, label %loop.end54 + +loop.body44: ; preds = %loop.head43 + %411 = load i32, i32* %i, align 4 %412 = add i32 %411, 1 + store i32 %412, i32* %i, align 4 %413 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 %414 = load %dimension_descriptor*, %dimension_descriptor** %413, align 8 %415 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %414, i32 1 %416 = getelementptr %dimension_descriptor, %dimension_descriptor* %415, i32 0, i32 1 %417 = load i32, i32* %416, align 4 - %418 = getelementptr %dimension_descriptor, %dimension_descriptor* %415, i32 0, i32 2 - %419 = load i32, i32* %418, align 4 - %420 = add i32 %419, %417 - %421 = sub i32 %420, 1 - %422 = icmp sle i32 %412, %421 - br i1 %422, label %loop.body43, label %loop.end50 - -loop.body43: ; preds = %loop.head42 - %423 = load i32, i32* %j, align 4 - %424 = add i32 %423, 1 - store i32 %424, i32* %j, align 4 - %425 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %426 = load %dimension_descriptor*, %dimension_descriptor** %425, align 8 - %427 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %426, i32 2 - %428 = getelementptr %dimension_descriptor, %dimension_descriptor* %427, i32 0, i32 1 - %429 = load i32, i32* %428, align 4 - %430 = sub i32 %429, 1 - store i32 %430, i32* %k, align 4 - br label %loop.head44 - -loop.head44: ; preds = %ifcont48, %loop.body43 - %431 = load i32, i32* %k, align 4 + %418 = sub i32 %417, 1 + store i32 %418, i32* %j, align 4 + br label %loop.head45 + +loop.head45: ; preds = %loop.end52, %loop.body44 + %419 = load i32, i32* %j, align 4 + %420 = add i32 %419, 1 + %421 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %422 = load %dimension_descriptor*, %dimension_descriptor** %421, align 8 + %423 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %422, i32 1 + %424 = getelementptr %dimension_descriptor, %dimension_descriptor* %423, i32 0, i32 1 + %425 = load i32, i32* %424, align 4 + %426 = getelementptr %dimension_descriptor, %dimension_descriptor* %423, i32 0, i32 2 + %427 = load i32, i32* %426, align 4 + %428 = add i32 %427, %425 + %429 = sub i32 %428, 1 + %430 = icmp sle i32 %420, %429 + br i1 %430, label %loop.body46, label %loop.end53 + +loop.body46: ; preds = %loop.head45 + %431 = load i32, i32* %j, align 4 %432 = add i32 %431, 1 + store i32 %432, i32* %j, align 4 %433 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 %434 = load %dimension_descriptor*, %dimension_descriptor** %433, align 8 %435 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %434, i32 2 %436 = getelementptr %dimension_descriptor, %dimension_descriptor* %435, i32 0, i32 1 %437 = load i32, i32* %436, align 4 - %438 = getelementptr %dimension_descriptor, %dimension_descriptor* %435, i32 0, i32 2 - %439 = load i32, i32* %438, align 4 - %440 = add i32 %439, %437 - %441 = sub i32 %440, 1 - %442 = icmp sle i32 %432, %441 - br i1 %442, label %loop.body45, label %loop.end49 - -loop.body45: ; preds = %loop.head44 - %443 = load i32, i32* %k, align 4 - %444 = add i32 %443, 1 - store i32 %444, i32* %k, align 4 - %445 = load i32, i32* %i, align 4 - %446 = load i32, i32* %j, align 4 - %447 = load i32, i32* %k, align 4 - %448 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %449 = load %dimension_descriptor*, %dimension_descriptor** %448, align 8 - %450 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %449, i32 0 - %451 = getelementptr %dimension_descriptor, %dimension_descriptor* %450, i32 0, i32 1 - %452 = load i32, i32* %451, align 4 - %453 = sub i32 %445, %452 - %454 = mul i32 1, %453 - %455 = add i32 0, %454 - %456 = getelementptr %dimension_descriptor, %dimension_descriptor* %450, i32 0, i32 2 - %457 = load i32, i32* %456, align 4 - %458 = mul i32 1, %457 - %459 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %449, i32 1 - %460 = getelementptr %dimension_descriptor, %dimension_descriptor* %459, i32 0, i32 1 - %461 = load i32, i32* %460, align 4 - %462 = sub i32 %446, %461 - %463 = mul i32 %458, %462 - %464 = add i32 %455, %463 - %465 = getelementptr %dimension_descriptor, %dimension_descriptor* %459, i32 0, i32 2 - %466 = load i32, i32* %465, align 4 - %467 = mul i32 %458, %466 - %468 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %449, i32 2 - %469 = getelementptr %dimension_descriptor, %dimension_descriptor* %468, i32 0, i32 1 - %470 = load i32, i32* %469, align 4 - %471 = sub i32 %447, %470 - %472 = mul i32 %467, %471 - %473 = add i32 %464, %472 - %474 = getelementptr %dimension_descriptor, %dimension_descriptor* %468, i32 0, i32 2 - %475 = load i32, i32* %474, align 4 - %476 = mul i32 %467, %475 - %477 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 - %478 = load %complex_4*, %complex_4** %477, align 8 - %479 = getelementptr inbounds %complex_4, %complex_4* %478, i32 %473 - %480 = load %complex_4, %complex_4* %479, align 4 - %481 = load i32, i32* %i, align 4 - %482 = load i32, i32* %j, align 4 - %483 = add i32 %481, %482 - %484 = load i32, i32* %k, align 4 - %485 = add i32 %483, %484 - %486 = sitofp i32 %485 to float - %487 = alloca %complex_4, align 8 - %488 = getelementptr %complex_4, %complex_4* %487, i32 0, i32 0 - %489 = getelementptr %complex_4, %complex_4* %487, i32 0, i32 1 - store float %486, float* %488, align 4 - store float 0.000000e+00, float* %489, align 4 - %490 = load %complex_4, %complex_4* %487, align 4 - %491 = alloca %complex_4, align 8 - store %complex_4 %480, %complex_4* %491, align 4 - %492 = getelementptr %complex_4, %complex_4* %491, i32 0, i32 0 - %493 = load float, float* %492, align 4 - %494 = alloca %complex_4, align 8 - store %complex_4 %490, %complex_4* %494, align 4 - %495 = getelementptr %complex_4, %complex_4* %494, i32 0, i32 0 - %496 = load float, float* %495, align 4 - %497 = alloca %complex_4, align 8 - store %complex_4 %480, %complex_4* %497, align 4 - %498 = getelementptr %complex_4, %complex_4* %497, i32 0, i32 1 - %499 = load float, float* %498, align 4 - %500 = alloca %complex_4, align 8 - store %complex_4 %490, %complex_4* %500, align 4 - %501 = getelementptr %complex_4, %complex_4* %500, i32 0, i32 1 - %502 = load float, float* %501, align 4 - %503 = fcmp une float %493, %496 - %504 = fcmp une float %499, %502 - %505 = and i1 %503, %504 - br i1 %505, label %then46, label %else47 - -then46: ; preds = %loop.body45 + %438 = sub i32 %437, 1 + store i32 %438, i32* %k, align 4 + br label %loop.head47 + +loop.head47: ; preds = %ifcont51, %loop.body46 + %439 = load i32, i32* %k, align 4 + %440 = add i32 %439, 1 + %441 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %442 = load %dimension_descriptor*, %dimension_descriptor** %441, align 8 + %443 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %442, i32 2 + %444 = getelementptr %dimension_descriptor, %dimension_descriptor* %443, i32 0, i32 1 + %445 = load i32, i32* %444, align 4 + %446 = getelementptr %dimension_descriptor, %dimension_descriptor* %443, i32 0, i32 2 + %447 = load i32, i32* %446, align 4 + %448 = add i32 %447, %445 + %449 = sub i32 %448, 1 + %450 = icmp sle i32 %440, %449 + br i1 %450, label %loop.body48, label %loop.end52 + +loop.body48: ; preds = %loop.head47 + %451 = load i32, i32* %k, align 4 + %452 = add i32 %451, 1 + store i32 %452, i32* %k, align 4 + %453 = load i32, i32* %i, align 4 + %454 = load i32, i32* %j, align 4 + %455 = load i32, i32* %k, align 4 + %456 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %457 = load %dimension_descriptor*, %dimension_descriptor** %456, align 8 + %458 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %457, i32 0 + %459 = getelementptr %dimension_descriptor, %dimension_descriptor* %458, i32 0, i32 1 + %460 = load i32, i32* %459, align 4 + %461 = sub i32 %453, %460 + %462 = mul i32 1, %461 + %463 = add i32 0, %462 + %464 = getelementptr %dimension_descriptor, %dimension_descriptor* %458, i32 0, i32 2 + %465 = load i32, i32* %464, align 4 + %466 = mul i32 1, %465 + %467 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %457, i32 1 + %468 = getelementptr %dimension_descriptor, %dimension_descriptor* %467, i32 0, i32 1 + %469 = load i32, i32* %468, align 4 + %470 = sub i32 %454, %469 + %471 = mul i32 %466, %470 + %472 = add i32 %463, %471 + %473 = getelementptr %dimension_descriptor, %dimension_descriptor* %467, i32 0, i32 2 + %474 = load i32, i32* %473, align 4 + %475 = mul i32 %466, %474 + %476 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %457, i32 2 + %477 = getelementptr %dimension_descriptor, %dimension_descriptor* %476, i32 0, i32 1 + %478 = load i32, i32* %477, align 4 + %479 = sub i32 %455, %478 + %480 = mul i32 %475, %479 + %481 = add i32 %472, %480 + %482 = getelementptr %dimension_descriptor, %dimension_descriptor* %476, i32 0, i32 2 + %483 = load i32, i32* %482, align 4 + %484 = mul i32 %475, %483 + %485 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 + %486 = load %complex_4*, %complex_4** %485, align 8 + %487 = getelementptr inbounds %complex_4, %complex_4* %486, i32 %481 + %488 = load %complex_4, %complex_4* %487, align 4 + %489 = load i32, i32* %i, align 4 + %490 = load i32, i32* %j, align 4 + %491 = add i32 %489, %490 + %492 = load i32, i32* %k, align 4 + %493 = add i32 %491, %492 + %494 = sitofp i32 %493 to float + %495 = alloca %complex_4, align 8 + %496 = getelementptr %complex_4, %complex_4* %495, i32 0, i32 0 + %497 = getelementptr %complex_4, %complex_4* %495, i32 0, i32 1 + store float %494, float* %496, align 4 + store float 0.000000e+00, float* %497, align 4 + %498 = load %complex_4, %complex_4* %495, align 4 + %499 = alloca %complex_4, align 8 + store %complex_4 %488, %complex_4* %499, align 4 + %500 = getelementptr %complex_4, %complex_4* %499, i32 0, i32 0 + %501 = load float, float* %500, align 4 + %502 = alloca %complex_4, align 8 + store %complex_4 %498, %complex_4* %502, align 4 + %503 = getelementptr %complex_4, %complex_4* %502, i32 0, i32 0 + %504 = load float, float* %503, align 4 + %505 = alloca %complex_4, align 8 + store %complex_4 %488, %complex_4* %505, align 4 + %506 = getelementptr %complex_4, %complex_4* %505, i32 0, i32 1 + %507 = load float, float* %506, align 4 + %508 = alloca %complex_4, align 8 + store %complex_4 %498, %complex_4* %508, align 4 + %509 = getelementptr %complex_4, %complex_4* %508, i32 0, i32 1 + %510 = load float, float* %509, align 4 + %511 = fcmp une float %501, %504 + %512 = fcmp une float %507, %510 + %513 = and i1 %511, %512 + br i1 %513, label %then49, label %else50 + +then49: ; preds = %loop.body48 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @7, i32 0, i32 0)) call void @exit(i32 1) - br label %ifcont48 - -else47: ; preds = %loop.body45 - br label %ifcont48 - -ifcont48: ; preds = %else47, %then46 - br label %loop.head44 - -loop.end49: ; preds = %loop.head44 - br label %loop.head42 - -loop.end50: ; preds = %loop.head42 - br label %loop.head40 - -loop.end51: ; preds = %loop.head40 - %506 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 - %507 = load %complex_4*, %complex_4** %506, align 8 - %508 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %509 = load %dimension_descriptor*, %dimension_descriptor** %508, align 8 - %510 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %509, i32 0 - %511 = getelementptr %dimension_descriptor, %dimension_descriptor* %510, i32 0, i32 1 - %512 = load i32, i32* %511, align 4 - store i32 %512, i32* %call_arg_value, align 4 - %513 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %514 = load %dimension_descriptor*, %dimension_descriptor** %513, align 8 - %515 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %514, i32 0 - %516 = getelementptr %dimension_descriptor, %dimension_descriptor* %515, i32 0, i32 2 - %517 = load i32, i32* %516, align 4 - store i32 %517, i32* %call_arg_value52, align 4 - %518 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %519 = load %dimension_descriptor*, %dimension_descriptor** %518, align 8 - %520 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %519, i32 1 - %521 = getelementptr %dimension_descriptor, %dimension_descriptor* %520, i32 0, i32 1 - %522 = load i32, i32* %521, align 4 - store i32 %522, i32* %call_arg_value53, align 4 - %523 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %524 = load %dimension_descriptor*, %dimension_descriptor** %523, align 8 - %525 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %524, i32 1 - %526 = getelementptr %dimension_descriptor, %dimension_descriptor* %525, i32 0, i32 2 - %527 = load i32, i32* %526, align 4 - store i32 %527, i32* %call_arg_value54, align 4 - %528 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %529 = load %dimension_descriptor*, %dimension_descriptor** %528, align 8 - %530 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %529, i32 2 - %531 = getelementptr %dimension_descriptor, %dimension_descriptor* %530, i32 0, i32 1 - %532 = load i32, i32* %531, align 4 - store i32 %532, i32* %call_arg_value55, align 4 - %533 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 - %534 = load %dimension_descriptor*, %dimension_descriptor** %533, align 8 - %535 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %534, i32 2 - %536 = getelementptr %dimension_descriptor, %dimension_descriptor* %535, i32 0, i32 2 - %537 = load i32, i32* %536, align 4 - store i32 %537, i32* %call_arg_value56, align 4 - %538 = call %complex_4 @reduce_sum_c(%complex_4* %507, i32* %call_arg_value, i32* %call_arg_value52, i32* %call_arg_value53, i32* %call_arg_value54, i32* %call_arg_value55, i32* %call_arg_value56) - store %complex_4 %538, %complex_4* %r, align 4 - %539 = load %complex_4, %complex_4* %r, align 4 - %540 = alloca %complex_4, align 8 - %541 = getelementptr %complex_4, %complex_4* %540, i32 0, i32 0 - %542 = getelementptr %complex_4, %complex_4* %540, i32 0, i32 1 - store float 1.143450e+05, float* %541, align 4 - store float 0.000000e+00, float* %542, align 4 - %543 = load %complex_4, %complex_4* %540, align 4 - %544 = alloca %complex_4, align 8 - store %complex_4 %539, %complex_4* %544, align 4 - %545 = getelementptr %complex_4, %complex_4* %544, i32 0, i32 0 - %546 = load float, float* %545, align 4 - %547 = alloca %complex_4, align 8 - store %complex_4 %543, %complex_4* %547, align 4 - %548 = getelementptr %complex_4, %complex_4* %547, i32 0, i32 0 - %549 = load float, float* %548, align 4 - %550 = alloca %complex_4, align 8 - store %complex_4 %539, %complex_4* %550, align 4 - %551 = getelementptr %complex_4, %complex_4* %550, i32 0, i32 1 - %552 = load float, float* %551, align 4 - %553 = alloca %complex_4, align 8 - store %complex_4 %543, %complex_4* %553, align 4 - %554 = getelementptr %complex_4, %complex_4* %553, i32 0, i32 1 - %555 = load float, float* %554, align 4 - %556 = fcmp une float %546, %549 - %557 = fcmp une float %552, %555 - %558 = and i1 %556, %557 - br i1 %558, label %then57, label %else58 - -then57: ; preds = %loop.end51 + br label %ifcont51 + +else50: ; preds = %loop.body48 + br label %ifcont51 + +ifcont51: ; preds = %else50, %then49 + br label %loop.head47 + +loop.end52: ; preds = %loop.head47 + br label %loop.head45 + +loop.end53: ; preds = %loop.head45 + br label %loop.head43 + +loop.end54: ; preds = %loop.head43 + %514 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 + %515 = load %complex_4*, %complex_4** %514, align 8 + %516 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %517 = load %dimension_descriptor*, %dimension_descriptor** %516, align 8 + %518 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %517, i32 0 + %519 = getelementptr %dimension_descriptor, %dimension_descriptor* %518, i32 0, i32 1 + %520 = load i32, i32* %519, align 4 + store i32 %520, i32* %call_arg_value, align 4 + %521 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %522 = load %dimension_descriptor*, %dimension_descriptor** %521, align 8 + %523 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %522, i32 0 + %524 = getelementptr %dimension_descriptor, %dimension_descriptor* %523, i32 0, i32 2 + %525 = load i32, i32* %524, align 4 + store i32 %525, i32* %call_arg_value55, align 4 + %526 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %527 = load %dimension_descriptor*, %dimension_descriptor** %526, align 8 + %528 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %527, i32 1 + %529 = getelementptr %dimension_descriptor, %dimension_descriptor* %528, i32 0, i32 1 + %530 = load i32, i32* %529, align 4 + store i32 %530, i32* %call_arg_value56, align 4 + %531 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %532 = load %dimension_descriptor*, %dimension_descriptor** %531, align 8 + %533 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %532, i32 1 + %534 = getelementptr %dimension_descriptor, %dimension_descriptor* %533, i32 0, i32 2 + %535 = load i32, i32* %534, align 4 + store i32 %535, i32* %call_arg_value57, align 4 + %536 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %537 = load %dimension_descriptor*, %dimension_descriptor** %536, align 8 + %538 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %537, i32 2 + %539 = getelementptr %dimension_descriptor, %dimension_descriptor* %538, i32 0, i32 1 + %540 = load i32, i32* %539, align 4 + store i32 %540, i32* %call_arg_value58, align 4 + %541 = getelementptr %array.1, %array.1* %c, i32 0, i32 2 + %542 = load %dimension_descriptor*, %dimension_descriptor** %541, align 8 + %543 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %542, i32 2 + %544 = getelementptr %dimension_descriptor, %dimension_descriptor* %543, i32 0, i32 2 + %545 = load i32, i32* %544, align 4 + store i32 %545, i32* %call_arg_value59, align 4 + %546 = call %complex_4 @reduce_sum_c(%complex_4* %515, i32* %call_arg_value, i32* %call_arg_value55, i32* %call_arg_value56, i32* %call_arg_value57, i32* %call_arg_value58, i32* %call_arg_value59) + store %complex_4 %546, %complex_4* %r, align 4 + %547 = load %complex_4, %complex_4* %r, align 4 + %548 = alloca %complex_4, align 8 + %549 = getelementptr %complex_4, %complex_4* %548, i32 0, i32 0 + %550 = getelementptr %complex_4, %complex_4* %548, i32 0, i32 1 + store float 1.143450e+05, float* %549, align 4 + store float 0.000000e+00, float* %550, align 4 + %551 = load %complex_4, %complex_4* %548, align 4 + %552 = alloca %complex_4, align 8 + store %complex_4 %547, %complex_4* %552, align 4 + %553 = getelementptr %complex_4, %complex_4* %552, i32 0, i32 0 + %554 = load float, float* %553, align 4 + %555 = alloca %complex_4, align 8 + store %complex_4 %551, %complex_4* %555, align 4 + %556 = getelementptr %complex_4, %complex_4* %555, i32 0, i32 0 + %557 = load float, float* %556, align 4 + %558 = alloca %complex_4, align 8 + store %complex_4 %547, %complex_4* %558, align 4 + %559 = getelementptr %complex_4, %complex_4* %558, i32 0, i32 1 + %560 = load float, float* %559, align 4 + %561 = alloca %complex_4, align 8 + store %complex_4 %551, %complex_4* %561, align 4 + %562 = getelementptr %complex_4, %complex_4* %561, i32 0, i32 1 + %563 = load float, float* %562, align 4 + %564 = fcmp une float %554, %557 + %565 = fcmp une float %560, %563 + %566 = and i1 %564, %565 + br i1 %566, label %then60, label %else61 + +then60: ; preds = %loop.end54 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @8, i32 0, i32 0)) call void @exit(i32 1) - br label %ifcont59 - -else58: ; preds = %loop.end51 - br label %ifcont59 - -ifcont59: ; preds = %else58, %then57 - %559 = getelementptr %array, %array* %a, i32 0, i32 3 - %560 = load i1, i1* %559, align 1 - br i1 %560, label %then60, label %else61 - -then60: ; preds = %ifcont59 - %561 = getelementptr %array, %array* %a, i32 0, i32 0 - %562 = load i32*, i32** %561, align 8 - %563 = alloca i8*, align 8 - %564 = bitcast i32* %562 to i8* - store i8* %564, i8** %563, align 8 - %565 = load i8*, i8** %563, align 8 - call void (i8*, ...) @_lfortran_free(i8* %565) - %566 = getelementptr %array, %array* %a, i32 0, i32 3 - store i1 false, i1* %566, align 1 br label %ifcont62 -else61: ; preds = %ifcont59 +else61: ; preds = %loop.end54 br label %ifcont62 ifcont62: ; preds = %else61, %then60 - %567 = getelementptr %array.0, %array.0* %b, i32 0, i32 3 + %567 = getelementptr %array, %array* %a, i32 0, i32 3 %568 = load i1, i1* %567, align 1 br i1 %568, label %then63, label %else64 then63: ; preds = %ifcont62 - %569 = getelementptr %array.0, %array.0* %b, i32 0, i32 0 - %570 = load float*, float** %569, align 8 + %569 = getelementptr %array, %array* %a, i32 0, i32 0 + %570 = load i32*, i32** %569, align 8 %571 = alloca i8*, align 8 - %572 = bitcast float* %570 to i8* + %572 = bitcast i32* %570 to i8* store i8* %572, i8** %571, align 8 %573 = load i8*, i8** %571, align 8 call void (i8*, ...) @_lfortran_free(i8* %573) - %574 = getelementptr %array.0, %array.0* %b, i32 0, i32 3 + %574 = getelementptr %array, %array* %a, i32 0, i32 3 store i1 false, i1* %574, align 1 br label %ifcont65 @@ -1553,19 +1552,19 @@ else64: ; preds = %ifcont62 br label %ifcont65 ifcont65: ; preds = %else64, %then63 - %575 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + %575 = getelementptr %array.0, %array.0* %b, i32 0, i32 3 %576 = load i1, i1* %575, align 1 br i1 %576, label %then66, label %else67 then66: ; preds = %ifcont65 - %577 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 - %578 = load %complex_4*, %complex_4** %577, align 8 + %577 = getelementptr %array.0, %array.0* %b, i32 0, i32 0 + %578 = load float*, float** %577, align 8 %579 = alloca i8*, align 8 - %580 = bitcast %complex_4* %578 to i8* + %580 = bitcast float* %578 to i8* store i8* %580, i8** %579, align 8 %581 = load i8*, i8** %579, align 8 call void (i8*, ...) @_lfortran_free(i8* %581) - %582 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + %582 = getelementptr %array.0, %array.0* %b, i32 0, i32 3 store i1 false, i1* %582, align 1 br label %ifcont68 @@ -1573,6 +1572,26 @@ else67: ; preds = %ifcont65 br label %ifcont68 ifcont68: ; preds = %else67, %then66 + %583 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + %584 = load i1, i1* %583, align 1 + br i1 %584, label %then69, label %else70 + +then69: ; preds = %ifcont68 + %585 = getelementptr %array.1, %array.1* %c, i32 0, i32 0 + %586 = load %complex_4*, %complex_4** %585, align 8 + %587 = alloca i8*, align 8 + %588 = bitcast %complex_4* %586 to i8* + store i8* %588, i8** %587, align 8 + %589 = load i8*, i8** %587, align 8 + call void (i8*, ...) @_lfortran_free(i8* %589) + %590 = getelementptr %array.1, %array.1* %c, i32 0, i32 3 + store i1 false, i1* %590, align 1 + br label %ifcont71 + +else70: ; preds = %ifcont68 + br label %ifcont71 + +ifcont71: ; preds = %else70, %then69 ret i32 0 } diff --git a/tests/reference/llvm-allocate_02-7f23768.json b/tests/reference/llvm-allocate_02-7f23768.json index 8a8ce0f60c..11e11ed010 100644 --- a/tests/reference/llvm-allocate_02-7f23768.json +++ b/tests/reference/llvm-allocate_02-7f23768.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_02-7f23768.stdout", - "stdout_hash": "842bb8a5a9cc45b9b0e722794630905daa2d219244481b82b0a4fde2", + "stdout_hash": "84081f1ab3444064e71790b31e00f5742b4505a761f7793d2e510c6d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-allocate_02-7f23768.stdout b/tests/reference/llvm-allocate_02-7f23768.stdout index e80c719f7b..9f4497b3a8 100644 --- a/tests/reference/llvm-allocate_02-7f23768.stdout +++ b/tests/reference/llvm-allocate_02-7f23768.stdout @@ -1,4 +1,3 @@ -fname whole_square ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-allocate_03-495d621.json b/tests/reference/llvm-allocate_03-495d621.json index 09c973dbac..0854a17473 100644 --- a/tests/reference/llvm-allocate_03-495d621.json +++ b/tests/reference/llvm-allocate_03-495d621.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_03-495d621.stdout", - "stdout_hash": "935acbce419e8d158bd4e88b1b96a499548f045e688febb3c6656749", + "stdout_hash": "771851da5eb2902988bba9d3ff9ad38a25348fa7196b766c53e4dd16", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-allocate_03-495d621.stdout b/tests/reference/llvm-allocate_03-495d621.stdout index 26533090b7..879493ba2d 100644 --- a/tests/reference/llvm-allocate_03-495d621.stdout +++ b/tests/reference/llvm-allocate_03-495d621.stdout @@ -1,4 +1,3 @@ -fname g ; ModuleID = 'LFortran' source_filename = "LFortran" @@ -134,81 +133,101 @@ define i32 @g(%array* %x) { %31 = getelementptr inbounds i32, i32* %30, i32 %25 %32 = load i32, i32* %31, align 4 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)) - %33 = alloca %array, align 8 + %33 = getelementptr %array, %array* %x, i32 0, i32 3 + %34 = load i1, i1* %33, align 1 + br i1 %34, label %then, label %else + +then: ; preds = %.entry + %35 = getelementptr %array, %array* %x, i32 0, i32 0 + %36 = load i32*, i32** %35, align 8 + %37 = alloca i8*, align 8 + %38 = bitcast i32* %36 to i8* + store i8* %38, i8** %37, align 8 + %39 = load i8*, i8** %37, align 8 + call void (i8*, ...) @_lfortran_free(i8* %39) + %40 = getelementptr %array, %array* %x, i32 0, i32 3 + store i1 false, i1* %40, align 1 + br label %ifcont + +else: ; preds = %.entry + br label %ifcont + +ifcont: ; preds = %else, %then + %41 = alloca %array, align 8 call void @f(%array* %x) - %34 = getelementptr %array, %array* %x, i32 0, i32 2 - %35 = load %dimension_descriptor*, %dimension_descriptor** %34, align 8 - %36 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 0 - %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 1 - %38 = load i32, i32* %37, align 4 - %39 = sub i32 1, %38 - %40 = mul i32 1, %39 - %41 = add i32 0, %40 - %42 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 2 - %43 = load i32, i32* %42, align 4 - %44 = mul i32 1, %43 - %45 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 1 - %46 = getelementptr %dimension_descriptor, %dimension_descriptor* %45, i32 0, i32 1 - %47 = load i32, i32* %46, align 4 - %48 = sub i32 1, %47 - %49 = mul i32 %44, %48 - %50 = add i32 %41, %49 - %51 = getelementptr %dimension_descriptor, %dimension_descriptor* %45, i32 0, i32 2 - %52 = load i32, i32* %51, align 4 - %53 = mul i32 %44, %52 - %54 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 2 - %55 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 1 - %56 = load i32, i32* %55, align 4 - %57 = sub i32 1, %56 - %58 = mul i32 %53, %57 - %59 = add i32 %50, %58 - %60 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 2 - %61 = load i32, i32* %60, align 4 - %62 = mul i32 %53, %61 - %63 = getelementptr %array, %array* %x, i32 0, i32 0 - %64 = load i32*, i32** %63, align 8 - %65 = getelementptr inbounds i32, i32* %64, i32 %59 - %66 = load i32, i32* %65, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) - %67 = getelementptr %array, %array* %x, i32 0, i32 2 - %68 = load %dimension_descriptor*, %dimension_descriptor** %67, align 8 - %69 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 0 - %70 = getelementptr %dimension_descriptor, %dimension_descriptor* %69, i32 0, i32 1 - %71 = load i32, i32* %70, align 4 - %72 = sub i32 1, %71 - %73 = mul i32 1, %72 - %74 = add i32 0, %73 - %75 = getelementptr %dimension_descriptor, %dimension_descriptor* %69, i32 0, i32 2 - %76 = load i32, i32* %75, align 4 - %77 = mul i32 1, %76 - %78 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 1 - %79 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 1 - %80 = load i32, i32* %79, align 4 - %81 = sub i32 1, %80 - %82 = mul i32 %77, %81 - %83 = add i32 %74, %82 - %84 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 2 - %85 = load i32, i32* %84, align 4 - %86 = mul i32 %77, %85 - %87 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 2 - %88 = getelementptr %dimension_descriptor, %dimension_descriptor* %87, i32 0, i32 1 - %89 = load i32, i32* %88, align 4 - %90 = sub i32 1, %89 - %91 = mul i32 %86, %90 - %92 = add i32 %83, %91 - %93 = getelementptr %dimension_descriptor, %dimension_descriptor* %87, i32 0, i32 2 - %94 = load i32, i32* %93, align 4 - %95 = mul i32 %86, %94 - %96 = getelementptr %array, %array* %x, i32 0, i32 0 - %97 = load i32*, i32** %96, align 8 - %98 = getelementptr inbounds i32, i32* %97, i32 %92 - store i32 8, i32* %98, align 4 + %42 = getelementptr %array, %array* %x, i32 0, i32 2 + %43 = load %dimension_descriptor*, %dimension_descriptor** %42, align 8 + %44 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 0 + %45 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 1 + %46 = load i32, i32* %45, align 4 + %47 = sub i32 1, %46 + %48 = mul i32 1, %47 + %49 = add i32 0, %48 + %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 2 + %51 = load i32, i32* %50, align 4 + %52 = mul i32 1, %51 + %53 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 1 + %54 = getelementptr %dimension_descriptor, %dimension_descriptor* %53, i32 0, i32 1 + %55 = load i32, i32* %54, align 4 + %56 = sub i32 1, %55 + %57 = mul i32 %52, %56 + %58 = add i32 %49, %57 + %59 = getelementptr %dimension_descriptor, %dimension_descriptor* %53, i32 0, i32 2 + %60 = load i32, i32* %59, align 4 + %61 = mul i32 %52, %60 + %62 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 2 + %63 = getelementptr %dimension_descriptor, %dimension_descriptor* %62, i32 0, i32 1 + %64 = load i32, i32* %63, align 4 + %65 = sub i32 1, %64 + %66 = mul i32 %61, %65 + %67 = add i32 %58, %66 + %68 = getelementptr %dimension_descriptor, %dimension_descriptor* %62, i32 0, i32 2 + %69 = load i32, i32* %68, align 4 + %70 = mul i32 %61, %69 + %71 = getelementptr %array, %array* %x, i32 0, i32 0 + %72 = load i32*, i32** %71, align 8 + %73 = getelementptr inbounds i32, i32* %72, i32 %67 + %74 = load i32, i32* %73, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0)) + %75 = getelementptr %array, %array* %x, i32 0, i32 2 + %76 = load %dimension_descriptor*, %dimension_descriptor** %75, align 8 + %77 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 0 + %78 = getelementptr %dimension_descriptor, %dimension_descriptor* %77, i32 0, i32 1 + %79 = load i32, i32* %78, align 4 + %80 = sub i32 1, %79 + %81 = mul i32 1, %80 + %82 = add i32 0, %81 + %83 = getelementptr %dimension_descriptor, %dimension_descriptor* %77, i32 0, i32 2 + %84 = load i32, i32* %83, align 4 + %85 = mul i32 1, %84 + %86 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 1 + %87 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 1 + %88 = load i32, i32* %87, align 4 + %89 = sub i32 1, %88 + %90 = mul i32 %85, %89 + %91 = add i32 %82, %90 + %92 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 2 + %93 = load i32, i32* %92, align 4 + %94 = mul i32 %85, %93 + %95 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 2 + %96 = getelementptr %dimension_descriptor, %dimension_descriptor* %95, i32 0, i32 1 + %97 = load i32, i32* %96, align 4 + %98 = sub i32 1, %97 + %99 = mul i32 %94, %98 + %100 = add i32 %91, %99 + %101 = getelementptr %dimension_descriptor, %dimension_descriptor* %95, i32 0, i32 2 + %102 = load i32, i32* %101, align 4 + %103 = mul i32 %94, %102 + %104 = getelementptr %array, %array* %x, i32 0, i32 0 + %105 = load i32*, i32** %104, align 8 + %106 = getelementptr inbounds i32, i32* %105, i32 %100 + store i32 8, i32* %106, align 4 store i32 0, i32* %r, align 4 br label %return -return: ; preds = %.entry - %99 = load i32, i32* %r, align 4 - ret i32 %99 +return: ; preds = %ifcont + %107 = load i32, i32* %r, align 4 + ret i32 %107 } define void @h(%array* %c) { @@ -247,78 +266,98 @@ define void @h(%array* %c) { %31 = getelementptr inbounds i32, i32* %30, i32 %25 %32 = load i32, i32* %31, align 4 call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @8, i32 0, i32 0), i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @7, i32 0, i32 0)) - %33 = alloca %array, align 8 + %33 = getelementptr %array, %array* %c, i32 0, i32 3 + %34 = load i1, i1* %33, align 1 + br i1 %34, label %then, label %else + +then: ; preds = %.entry + %35 = getelementptr %array, %array* %c, i32 0, i32 0 + %36 = load i32*, i32** %35, align 8 + %37 = alloca i8*, align 8 + %38 = bitcast i32* %36 to i8* + store i8* %38, i8** %37, align 8 + %39 = load i8*, i8** %37, align 8 + call void (i8*, ...) @_lfortran_free(i8* %39) + %40 = getelementptr %array, %array* %c, i32 0, i32 3 + store i1 false, i1* %40, align 1 + br label %ifcont + +else: ; preds = %.entry + br label %ifcont + +ifcont: ; preds = %else, %then + %41 = alloca %array, align 8 call void @f(%array* %c) - %34 = getelementptr %array, %array* %c, i32 0, i32 2 - %35 = load %dimension_descriptor*, %dimension_descriptor** %34, align 8 - %36 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 0 - %37 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 1 - %38 = load i32, i32* %37, align 4 - %39 = sub i32 1, %38 - %40 = mul i32 1, %39 - %41 = add i32 0, %40 - %42 = getelementptr %dimension_descriptor, %dimension_descriptor* %36, i32 0, i32 2 - %43 = load i32, i32* %42, align 4 - %44 = mul i32 1, %43 - %45 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 1 - %46 = getelementptr %dimension_descriptor, %dimension_descriptor* %45, i32 0, i32 1 - %47 = load i32, i32* %46, align 4 - %48 = sub i32 1, %47 - %49 = mul i32 %44, %48 - %50 = add i32 %41, %49 - %51 = getelementptr %dimension_descriptor, %dimension_descriptor* %45, i32 0, i32 2 - %52 = load i32, i32* %51, align 4 - %53 = mul i32 %44, %52 - %54 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %35, i32 2 - %55 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 1 - %56 = load i32, i32* %55, align 4 - %57 = sub i32 1, %56 - %58 = mul i32 %53, %57 - %59 = add i32 %50, %58 - %60 = getelementptr %dimension_descriptor, %dimension_descriptor* %54, i32 0, i32 2 - %61 = load i32, i32* %60, align 4 - %62 = mul i32 %53, %61 - %63 = getelementptr %array, %array* %c, i32 0, i32 0 - %64 = load i32*, i32** %63, align 8 - %65 = getelementptr inbounds i32, i32* %64, i32 %59 - %66 = load i32, i32* %65, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) - %67 = getelementptr %array, %array* %c, i32 0, i32 2 - %68 = load %dimension_descriptor*, %dimension_descriptor** %67, align 8 - %69 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 0 - %70 = getelementptr %dimension_descriptor, %dimension_descriptor* %69, i32 0, i32 1 - %71 = load i32, i32* %70, align 4 - %72 = sub i32 1, %71 - %73 = mul i32 1, %72 - %74 = add i32 0, %73 - %75 = getelementptr %dimension_descriptor, %dimension_descriptor* %69, i32 0, i32 2 - %76 = load i32, i32* %75, align 4 - %77 = mul i32 1, %76 - %78 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 1 - %79 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 1 - %80 = load i32, i32* %79, align 4 - %81 = sub i32 1, %80 - %82 = mul i32 %77, %81 - %83 = add i32 %74, %82 - %84 = getelementptr %dimension_descriptor, %dimension_descriptor* %78, i32 0, i32 2 - %85 = load i32, i32* %84, align 4 - %86 = mul i32 %77, %85 - %87 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %68, i32 2 - %88 = getelementptr %dimension_descriptor, %dimension_descriptor* %87, i32 0, i32 1 - %89 = load i32, i32* %88, align 4 - %90 = sub i32 1, %89 - %91 = mul i32 %86, %90 - %92 = add i32 %83, %91 - %93 = getelementptr %dimension_descriptor, %dimension_descriptor* %87, i32 0, i32 2 - %94 = load i32, i32* %93, align 4 - %95 = mul i32 %86, %94 - %96 = getelementptr %array, %array* %c, i32 0, i32 0 - %97 = load i32*, i32** %96, align 8 - %98 = getelementptr inbounds i32, i32* %97, i32 %92 - store i32 8, i32* %98, align 4 + %42 = getelementptr %array, %array* %c, i32 0, i32 2 + %43 = load %dimension_descriptor*, %dimension_descriptor** %42, align 8 + %44 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 0 + %45 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 1 + %46 = load i32, i32* %45, align 4 + %47 = sub i32 1, %46 + %48 = mul i32 1, %47 + %49 = add i32 0, %48 + %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %44, i32 0, i32 2 + %51 = load i32, i32* %50, align 4 + %52 = mul i32 1, %51 + %53 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 1 + %54 = getelementptr %dimension_descriptor, %dimension_descriptor* %53, i32 0, i32 1 + %55 = load i32, i32* %54, align 4 + %56 = sub i32 1, %55 + %57 = mul i32 %52, %56 + %58 = add i32 %49, %57 + %59 = getelementptr %dimension_descriptor, %dimension_descriptor* %53, i32 0, i32 2 + %60 = load i32, i32* %59, align 4 + %61 = mul i32 %52, %60 + %62 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %43, i32 2 + %63 = getelementptr %dimension_descriptor, %dimension_descriptor* %62, i32 0, i32 1 + %64 = load i32, i32* %63, align 4 + %65 = sub i32 1, %64 + %66 = mul i32 %61, %65 + %67 = add i32 %58, %66 + %68 = getelementptr %dimension_descriptor, %dimension_descriptor* %62, i32 0, i32 2 + %69 = load i32, i32* %68, align 4 + %70 = mul i32 %61, %69 + %71 = getelementptr %array, %array* %c, i32 0, i32 0 + %72 = load i32*, i32** %71, align 8 + %73 = getelementptr inbounds i32, i32* %72, i32 %67 + %74 = load i32, i32* %73, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i32 %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0)) + %75 = getelementptr %array, %array* %c, i32 0, i32 2 + %76 = load %dimension_descriptor*, %dimension_descriptor** %75, align 8 + %77 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 0 + %78 = getelementptr %dimension_descriptor, %dimension_descriptor* %77, i32 0, i32 1 + %79 = load i32, i32* %78, align 4 + %80 = sub i32 1, %79 + %81 = mul i32 1, %80 + %82 = add i32 0, %81 + %83 = getelementptr %dimension_descriptor, %dimension_descriptor* %77, i32 0, i32 2 + %84 = load i32, i32* %83, align 4 + %85 = mul i32 1, %84 + %86 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 1 + %87 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 1 + %88 = load i32, i32* %87, align 4 + %89 = sub i32 1, %88 + %90 = mul i32 %85, %89 + %91 = add i32 %82, %90 + %92 = getelementptr %dimension_descriptor, %dimension_descriptor* %86, i32 0, i32 2 + %93 = load i32, i32* %92, align 4 + %94 = mul i32 %85, %93 + %95 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %76, i32 2 + %96 = getelementptr %dimension_descriptor, %dimension_descriptor* %95, i32 0, i32 1 + %97 = load i32, i32* %96, align 4 + %98 = sub i32 1, %97 + %99 = mul i32 %94, %98 + %100 = add i32 %91, %99 + %101 = getelementptr %dimension_descriptor, %dimension_descriptor* %95, i32 0, i32 2 + %102 = load i32, i32* %101, align 4 + %103 = mul i32 %94, %102 + %104 = getelementptr %array, %array* %c, i32 0, i32 0 + %105 = load i32*, i32** %104, align 8 + %106 = getelementptr inbounds i32, i32* %105, i32 %100 + store i32 8, i32* %106, align 4 br label %return -return: ; preds = %.entry +return: ; preds = %ifcont ret void } @@ -326,6 +365,8 @@ declare i8* @_lfortran_malloc(i32, ...) declare void @_lfortran_printf(i8*, ...) +declare void @_lfortran_free(i8*, ...) + define i32 @main() { .entry: %c = alloca %array, align 8 @@ -423,68 +464,86 @@ ifcont: ; preds = %else, %then %59 = load i32*, i32** %58, align 8 %60 = getelementptr inbounds i32, i32* %59, i32 %54 store i32 3, i32* %60, align 4 - %61 = alloca %array, align 8 - call void @h(%array* %c) - %62 = alloca %array, align 8 - %63 = call i32 @g(%array* %c) - store i32 %63, i32* %r, align 4 - %64 = getelementptr %array, %array* %c, i32 0, i32 2 - %65 = load %dimension_descriptor*, %dimension_descriptor** %64, align 8 - %66 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %65, i32 0 - %67 = getelementptr %dimension_descriptor, %dimension_descriptor* %66, i32 0, i32 1 - %68 = load i32, i32* %67, align 4 - %69 = sub i32 1, %68 - %70 = mul i32 1, %69 - %71 = add i32 0, %70 - %72 = getelementptr %dimension_descriptor, %dimension_descriptor* %66, i32 0, i32 2 - %73 = load i32, i32* %72, align 4 - %74 = mul i32 1, %73 - %75 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %65, i32 1 - %76 = getelementptr %dimension_descriptor, %dimension_descriptor* %75, i32 0, i32 1 - %77 = load i32, i32* %76, align 4 - %78 = sub i32 1, %77 - %79 = mul i32 %74, %78 - %80 = add i32 %71, %79 - %81 = getelementptr %dimension_descriptor, %dimension_descriptor* %75, i32 0, i32 2 - %82 = load i32, i32* %81, align 4 - %83 = mul i32 %74, %82 - %84 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %65, i32 2 - %85 = getelementptr %dimension_descriptor, %dimension_descriptor* %84, i32 0, i32 1 - %86 = load i32, i32* %85, align 4 - %87 = sub i32 1, %86 - %88 = mul i32 %83, %87 - %89 = add i32 %80, %88 - %90 = getelementptr %dimension_descriptor, %dimension_descriptor* %84, i32 0, i32 2 - %91 = load i32, i32* %90, align 4 - %92 = mul i32 %83, %91 - %93 = getelementptr %array, %array* %c, i32 0, i32 0 - %94 = load i32*, i32** %93, align 8 - %95 = getelementptr inbounds i32, i32* %94, i32 %89 - %96 = load i32, i32* %95, align 4 - call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i32 %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) - %97 = getelementptr %array, %array* %c, i32 0, i32 3 - %98 = load i1, i1* %97, align 1 - br i1 %98, label %then1, label %else2 + %61 = getelementptr %array, %array* %c, i32 0, i32 3 + %62 = load i1, i1* %61, align 1 + br i1 %62, label %then1, label %else2 then1: ; preds = %ifcont - %99 = getelementptr %array, %array* %c, i32 0, i32 0 - %100 = load i32*, i32** %99, align 8 - %101 = alloca i8*, align 8 - %102 = bitcast i32* %100 to i8* - store i8* %102, i8** %101, align 8 - %103 = load i8*, i8** %101, align 8 - call void (i8*, ...) @_lfortran_free(i8* %103) - %104 = getelementptr %array, %array* %c, i32 0, i32 3 - store i1 false, i1* %104, align 1 + %63 = getelementptr %array, %array* %c, i32 0, i32 0 + %64 = load i32*, i32** %63, align 8 + %65 = alloca i8*, align 8 + %66 = bitcast i32* %64 to i8* + store i8* %66, i8** %65, align 8 + %67 = load i8*, i8** %65, align 8 + call void (i8*, ...) @_lfortran_free(i8* %67) + %68 = getelementptr %array, %array* %c, i32 0, i32 3 + store i1 false, i1* %68, align 1 br label %ifcont3 else2: ; preds = %ifcont br label %ifcont3 ifcont3: ; preds = %else2, %then1 + %69 = alloca %array, align 8 + call void @h(%array* %c) + %70 = alloca %array, align 8 + %71 = call i32 @g(%array* %c) + store i32 %71, i32* %r, align 4 + %72 = getelementptr %array, %array* %c, i32 0, i32 2 + %73 = load %dimension_descriptor*, %dimension_descriptor** %72, align 8 + %74 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %73, i32 0 + %75 = getelementptr %dimension_descriptor, %dimension_descriptor* %74, i32 0, i32 1 + %76 = load i32, i32* %75, align 4 + %77 = sub i32 1, %76 + %78 = mul i32 1, %77 + %79 = add i32 0, %78 + %80 = getelementptr %dimension_descriptor, %dimension_descriptor* %74, i32 0, i32 2 + %81 = load i32, i32* %80, align 4 + %82 = mul i32 1, %81 + %83 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %73, i32 1 + %84 = getelementptr %dimension_descriptor, %dimension_descriptor* %83, i32 0, i32 1 + %85 = load i32, i32* %84, align 4 + %86 = sub i32 1, %85 + %87 = mul i32 %82, %86 + %88 = add i32 %79, %87 + %89 = getelementptr %dimension_descriptor, %dimension_descriptor* %83, i32 0, i32 2 + %90 = load i32, i32* %89, align 4 + %91 = mul i32 %82, %90 + %92 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %73, i32 2 + %93 = getelementptr %dimension_descriptor, %dimension_descriptor* %92, i32 0, i32 1 + %94 = load i32, i32* %93, align 4 + %95 = sub i32 1, %94 + %96 = mul i32 %91, %95 + %97 = add i32 %88, %96 + %98 = getelementptr %dimension_descriptor, %dimension_descriptor* %92, i32 0, i32 2 + %99 = load i32, i32* %98, align 4 + %100 = mul i32 %91, %99 + %101 = getelementptr %array, %array* %c, i32 0, i32 0 + %102 = load i32*, i32** %101, align 8 + %103 = getelementptr inbounds i32, i32* %102, i32 %97 + %104 = load i32, i32* %103, align 4 + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i32 %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0)) + %105 = getelementptr %array, %array* %c, i32 0, i32 3 + %106 = load i1, i1* %105, align 1 + br i1 %106, label %then4, label %else5 + +then4: ; preds = %ifcont3 + %107 = getelementptr %array, %array* %c, i32 0, i32 0 + %108 = load i32*, i32** %107, align 8 + %109 = alloca i8*, align 8 + %110 = bitcast i32* %108 to i8* + store i8* %110, i8** %109, align 8 + %111 = load i8*, i8** %109, align 8 + call void (i8*, ...) @_lfortran_free(i8* %111) + %112 = getelementptr %array, %array* %c, i32 0, i32 3 + store i1 false, i1* %112, align 1 + br label %ifcont6 + +else5: ; preds = %ifcont3 + br label %ifcont6 + +ifcont6: ; preds = %else5, %then4 ret i32 0 } declare void @exit(i32) - -declare void @_lfortran_free(i8*, ...) diff --git a/tests/reference/llvm-arrays_03_func-98941b2.json b/tests/reference/llvm-arrays_03_func-98941b2.json index 00745c25ef..b41be1b221 100644 --- a/tests/reference/llvm-arrays_03_func-98941b2.json +++ b/tests/reference/llvm-arrays_03_func-98941b2.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_03_func-98941b2.stdout", - "stdout_hash": "fb14176e1077a338bd7c7d7c52f20f4d0172bd348d928abbb913bd28", + "stdout_hash": "6617d3a322e940b883966a912206ecfefe69f64658899ebcfff9b0c5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-arrays_03_func-98941b2.stdout b/tests/reference/llvm-arrays_03_func-98941b2.stdout index 3873a2aff4..b5debfa4b0 100644 --- a/tests/reference/llvm-arrays_03_func-98941b2.stdout +++ b/tests/reference/llvm-arrays_03_func-98941b2.stdout @@ -1,4 +1,3 @@ -fname mysum ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-arrays_04_func-2aa342e.json b/tests/reference/llvm-arrays_04_func-2aa342e.json index 9a5f1d10c1..7239e55b29 100644 --- a/tests/reference/llvm-arrays_04_func-2aa342e.json +++ b/tests/reference/llvm-arrays_04_func-2aa342e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_04_func-2aa342e.stdout", - "stdout_hash": "a98f93076df276ffdd4e724e1539affa99f4d4770e821d5318c8bd94", + "stdout_hash": "bd050df6987b8c59c05c0bc8b1146194e9314de62d27beb15fc7bb4e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-arrays_04_func-2aa342e.stdout b/tests/reference/llvm-arrays_04_func-2aa342e.stdout index dcbaa01525..798e686401 100644 --- a/tests/reference/llvm-arrays_04_func-2aa342e.stdout +++ b/tests/reference/llvm-arrays_04_func-2aa342e.stdout @@ -1,5 +1,3 @@ -fname sum -fname abs ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-arrays_08_func-85e526b.json b/tests/reference/llvm-arrays_08_func-85e526b.json index 07a6feaae1..094723d2fd 100644 --- a/tests/reference/llvm-arrays_08_func-85e526b.json +++ b/tests/reference/llvm-arrays_08_func-85e526b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_08_func-85e526b.stdout", - "stdout_hash": "9672853568d9cc455568b2fe08311fcf6b60971b4c0b591a2516978c", + "stdout_hash": "05e999ae17bc3dc7eee78d276488d21003fccfe0fb181424948f10bc", "stderr": "llvm-arrays_08_func-85e526b.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 diff --git a/tests/reference/llvm-arrays_08_func-85e526b.stdout b/tests/reference/llvm-arrays_08_func-85e526b.stdout index 1cf11395c4..9ee5b4c384 100644 --- a/tests/reference/llvm-arrays_08_func-85e526b.stdout +++ b/tests/reference/llvm-arrays_08_func-85e526b.stdout @@ -1,4 +1,3 @@ -fname verify ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-arrays_op_4-df4e84d.json b/tests/reference/llvm-arrays_op_4-df4e84d.json index 852368564a..437ceeec10 100644 --- a/tests/reference/llvm-arrays_op_4-df4e84d.json +++ b/tests/reference/llvm-arrays_op_4-df4e84d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_op_4-df4e84d.stdout", - "stdout_hash": "f5c3cd504cc840abe4c603b04666b3fe2edfca6e8e22f3aeaed998d3", + "stdout_hash": "c42c13d54e72608f07282a7f7613eb994b30e6986ebf5ba082068b54", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-arrays_op_4-df4e84d.stdout b/tests/reference/llvm-arrays_op_4-df4e84d.stdout index 41e2da5145..4dac9e41bb 100644 --- a/tests/reference/llvm-arrays_op_4-df4e84d.stdout +++ b/tests/reference/llvm-arrays_op_4-df4e84d.stdout @@ -1,4 +1,3 @@ -fname modulo2 ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-arrays_op_6-ae38631.json b/tests/reference/llvm-arrays_op_6-ae38631.json index 30a77e8b89..56eb3a0549 100644 --- a/tests/reference/llvm-arrays_op_6-ae38631.json +++ b/tests/reference/llvm-arrays_op_6-ae38631.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_op_6-ae38631.stdout", - "stdout_hash": "d34422eb65d57c70c27a82dc899a2050cdf519278ea120f5a48fa245", + "stdout_hash": "9bf76c723e0e16225d4066ad4e6e354f45b1e7ebb34c78713a9366a8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-arrays_op_6-ae38631.stdout b/tests/reference/llvm-arrays_op_6-ae38631.stdout index a00df3ae8a..b7b6e4ea1d 100644 --- a/tests/reference/llvm-arrays_op_6-ae38631.stdout +++ b/tests/reference/llvm-arrays_op_6-ae38631.stdout @@ -1,4 +1,3 @@ -fname asquare ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-callback_01-facbb46.json b/tests/reference/llvm-callback_01-facbb46.json index a7bbe4a36c..ae870f9c67 100644 --- a/tests/reference/llvm-callback_01-facbb46.json +++ b/tests/reference/llvm-callback_01-facbb46.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_01-facbb46.stdout", - "stdout_hash": "8973fed90eeaf063f17a140808c51fcd9469419020b68e907d90be03", + "stdout_hash": "ad1f0e649ea8ddea6d0138ed4bf71427add5a11114b738a059569a74", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-callback_01-facbb46.stdout b/tests/reference/llvm-callback_01-facbb46.stdout index 6b58d1e731..1ca7eb17fe 100644 --- a/tests/reference/llvm-callback_01-facbb46.stdout +++ b/tests/reference/llvm-callback_01-facbb46.stdout @@ -1,5 +1,3 @@ -fname cb -fname f ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-callback_02-41bc7d7.json b/tests/reference/llvm-callback_02-41bc7d7.json index 4870a71245..a5fb7d812d 100644 --- a/tests/reference/llvm-callback_02-41bc7d7.json +++ b/tests/reference/llvm-callback_02-41bc7d7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_02-41bc7d7.stdout", - "stdout_hash": "81d31107d7004c60f885fb6a0491f9e8ac46e09ea69889c854f42fb2", + "stdout_hash": "9ff0a28886008b2ee1663763e4ae3195b6fd49e370f43ff4a34a4731", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-callback_02-41bc7d7.stdout b/tests/reference/llvm-callback_02-41bc7d7.stdout index 8fbb96ac5f..09089d89e8 100644 --- a/tests/reference/llvm-callback_02-41bc7d7.stdout +++ b/tests/reference/llvm-callback_02-41bc7d7.stdout @@ -1,4 +1,3 @@ -fname foo ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-callback_03-0f44942.json b/tests/reference/llvm-callback_03-0f44942.json index 88f2926a39..dfbcd30c20 100644 --- a/tests/reference/llvm-callback_03-0f44942.json +++ b/tests/reference/llvm-callback_03-0f44942.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-callback_03-0f44942.stdout", - "stdout_hash": "cc2233fc42f2f86a3dfef9b2e4e43378cf396ec37d15dbba15df56e2", + "stdout_hash": "990608bd3d3b12d31f6ee86d56f222160e89d7c911ca02203881abe9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-callback_03-0f44942.stdout b/tests/reference/llvm-callback_03-0f44942.stdout index b4c9905252..667f47607d 100644 --- a/tests/reference/llvm-callback_03-0f44942.stdout +++ b/tests/reference/llvm-callback_03-0f44942.stdout @@ -1,6 +1,3 @@ -fname cb -fname f -fname f ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-class_01-82031c0.json b/tests/reference/llvm-class_01-82031c0.json index 6dcd7988d5..e00bc2fffd 100644 --- a/tests/reference/llvm-class_01-82031c0.json +++ b/tests/reference/llvm-class_01-82031c0.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-class_01-82031c0.stdout", - "stdout_hash": "f3f0f0b603fc23f23ddc05ecb1cc57053029386f6b54d77c4c9904aa", + "stdout_hash": "2fc040a78cf407830436d2946dd145b660356f747ca2991dec9572b2", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-class_01-82031c0.stdout b/tests/reference/llvm-class_01-82031c0.stdout index 3318968cf9..ae9d039e74 100644 --- a/tests/reference/llvm-class_01-82031c0.stdout +++ b/tests/reference/llvm-class_01-82031c0.stdout @@ -1,4 +1,3 @@ -fname circle_area ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-class_02-82c2f9c.json b/tests/reference/llvm-class_02-82c2f9c.json index ea8e8c9923..6329939b1f 100644 --- a/tests/reference/llvm-class_02-82c2f9c.json +++ b/tests/reference/llvm-class_02-82c2f9c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-class_02-82c2f9c.stdout", - "stdout_hash": "379382f4ad5aff884a05d02f4b12047f19ceeacdc9cac9053848bb41", + "stdout_hash": "85d45140c4a92e9d3221a44e002dd971647d17c30911a2aec5958171", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-class_02-82c2f9c.stdout b/tests/reference/llvm-class_02-82c2f9c.stdout index 2e0eabae3b..06b0405dc5 100644 --- a/tests/reference/llvm-class_02-82c2f9c.stdout +++ b/tests/reference/llvm-class_02-82c2f9c.stdout @@ -1,4 +1,3 @@ -fname circle_area ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-do7-8069d7a.json b/tests/reference/llvm-do7-8069d7a.json index 255cdba222..2643720051 100644 --- a/tests/reference/llvm-do7-8069d7a.json +++ b/tests/reference/llvm-do7-8069d7a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-do7-8069d7a.stdout", - "stdout_hash": "cc84045cf7269ca366734d02e57e946ff4860eca27b342260abbdfef", + "stdout_hash": "71d02cb309a8e70cfb0a8e1189c4c94fbdcd44563c9aea1849d201a5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-do7-8069d7a.stdout b/tests/reference/llvm-do7-8069d7a.stdout index 7dd068d5bc..6ea9426a8b 100644 --- a/tests/reference/llvm-do7-8069d7a.stdout +++ b/tests/reference/llvm-do7-8069d7a.stdout @@ -1,4 +1,3 @@ -fname f ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-intent_01-6d96ec5.json b/tests/reference/llvm-intent_01-6d96ec5.json index ecc07591e7..6b78849502 100644 --- a/tests/reference/llvm-intent_01-6d96ec5.json +++ b/tests/reference/llvm-intent_01-6d96ec5.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-intent_01-6d96ec5.stdout", - "stdout_hash": "863623059be80a26d288da961ed5b7eb35d0daee03084d508d0a27c8", + "stdout_hash": "899b2681353e35d0758c816b85d56d287843a8bb26c69e67461d9fc2", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-intent_01-6d96ec5.stdout b/tests/reference/llvm-intent_01-6d96ec5.stdout index 396af25474..02d7b4fb07 100644 --- a/tests/reference/llvm-intent_01-6d96ec5.stdout +++ b/tests/reference/llvm-intent_01-6d96ec5.stdout @@ -1,4 +1,3 @@ -fname f ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-issue532-d63b703.json b/tests/reference/llvm-issue532-d63b703.json index 15c7a1a94b..d03cbd4572 100644 --- a/tests/reference/llvm-issue532-d63b703.json +++ b/tests/reference/llvm-issue532-d63b703.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-issue532-d63b703.stdout", - "stdout_hash": "a8c7c4bfc782441c9bac01afa3f6a3f3e42c8bb413c172a080f881a9", + "stdout_hash": "15ce3e69049b4f9641e121bee4134756905d43ff96d6a90a0e563b94", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-issue532-d63b703.stdout b/tests/reference/llvm-issue532-d63b703.stdout index c5d170aa53..02f21b27b3 100644 --- a/tests/reference/llvm-issue532-d63b703.stdout +++ b/tests/reference/llvm-issue532-d63b703.stdout @@ -1,5 +1,3 @@ -fname sfloor -fname imodulo ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-modules_06-03c75b2.json b/tests/reference/llvm-modules_06-03c75b2.json index 63d747d1d1..4f1611fa05 100644 --- a/tests/reference/llvm-modules_06-03c75b2.json +++ b/tests/reference/llvm-modules_06-03c75b2.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_06-03c75b2.stdout", - "stdout_hash": "58d95d9a7b53daa115595e69d9213fae0d44ec16ce3a930d2c1a9834", + "stdout_hash": "70c200b2ff0578dc565a6df03c06315fb5df7a8a4ca5e7500595e326", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-modules_06-03c75b2.stdout b/tests/reference/llvm-modules_06-03c75b2.stdout index 036550afaf..c779d384d9 100644 --- a/tests/reference/llvm-modules_06-03c75b2.stdout +++ b/tests/reference/llvm-modules_06-03c75b2.stdout @@ -1,4 +1,3 @@ -fname b ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-modules_13-6b5ac80.json b/tests/reference/llvm-modules_13-6b5ac80.json index 16e36517e9..581d299a26 100644 --- a/tests/reference/llvm-modules_13-6b5ac80.json +++ b/tests/reference/llvm-modules_13-6b5ac80.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-modules_13-6b5ac80.stdout", - "stdout_hash": "7e6786502d01326effcfe50dd051a8ca998eefbed1ab6f6d1d82e6e7", + "stdout_hash": "68aefb11c2d1ade3006d667069567dff44bfb9e8f933dcf961ebeddf", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-modules_13-6b5ac80.stdout b/tests/reference/llvm-modules_13-6b5ac80.stdout index 2ef1d7c5fc..82c6be56de 100644 --- a/tests/reference/llvm-modules_13-6b5ac80.stdout +++ b/tests/reference/llvm-modules_13-6b5ac80.stdout @@ -1,5 +1,3 @@ -fname f1 -fname f2 ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-nested_01-b01694c.json b/tests/reference/llvm-nested_01-b01694c.json index 1e41a0d958..dd314bea63 100644 --- a/tests/reference/llvm-nested_01-b01694c.json +++ b/tests/reference/llvm-nested_01-b01694c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_01-b01694c.stdout", - "stdout_hash": "1c3e86c6d19668c8f5e33b3d36f38f139f951f4a1d4f8d350a79ebc7", + "stdout_hash": "a558652eaa0877bd7eff516b3971cccc2ccce3d40f5e1c8f3e276099", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-nested_01-b01694c.stdout b/tests/reference/llvm-nested_01-b01694c.stdout index 45bc2cd1fa..9767e1c621 100644 --- a/tests/reference/llvm-nested_01-b01694c.stdout +++ b/tests/reference/llvm-nested_01-b01694c.stdout @@ -1,5 +1,3 @@ -fname b -fname d ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-nested_04-39da8f9.json b/tests/reference/llvm-nested_04-39da8f9.json index f664a2ce73..c5e0c1bd2a 100644 --- a/tests/reference/llvm-nested_04-39da8f9.json +++ b/tests/reference/llvm-nested_04-39da8f9.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-nested_04-39da8f9.stdout", - "stdout_hash": "35afc3026e4928d19434c9203243bf29445be47b608d8d1a7624bc2b", + "stdout_hash": "c9e6b50f161962078e1d579bfc7f0c1cc307537610e6a5fc96f9db69", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-nested_04-39da8f9.stdout b/tests/reference/llvm-nested_04-39da8f9.stdout index b283558f77..6398969504 100644 --- a/tests/reference/llvm-nested_04-39da8f9.stdout +++ b/tests/reference/llvm-nested_04-39da8f9.stdout @@ -1,5 +1,3 @@ -fname b -fname c ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-operator_overloading_01-33c47db.json b/tests/reference/llvm-operator_overloading_01-33c47db.json index 048a33db84..e216f51a16 100644 --- a/tests/reference/llvm-operator_overloading_01-33c47db.json +++ b/tests/reference/llvm-operator_overloading_01-33c47db.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_01-33c47db.stdout", - "stdout_hash": "8f675b73b9990a8c6f761a40a51c2399e192b2487c253fdbe7694dfd", + "stdout_hash": "4544cc4633affe4bc72e3349d97afa57f7e2ccd1a2a195a43fcd886c", "stderr": "llvm-operator_overloading_01-33c47db.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 diff --git a/tests/reference/llvm-operator_overloading_01-33c47db.stdout b/tests/reference/llvm-operator_overloading_01-33c47db.stdout index 57328cde0a..881fcd6b29 100644 --- a/tests/reference/llvm-operator_overloading_01-33c47db.stdout +++ b/tests/reference/llvm-operator_overloading_01-33c47db.stdout @@ -1,5 +1,3 @@ -fname logical_and -fname bin_add ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-operator_overloading_03-d9fd880.json b/tests/reference/llvm-operator_overloading_03-d9fd880.json index dd86fc4fa8..e7a6fb7f3e 100644 --- a/tests/reference/llvm-operator_overloading_03-d9fd880.json +++ b/tests/reference/llvm-operator_overloading_03-d9fd880.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-operator_overloading_03-d9fd880.stdout", - "stdout_hash": "890e2656e778186d3ce73a7dddb62a5cba195351926252f57d0073c2", + "stdout_hash": "0f1975a438cd4488363808d61414280df443dd8f7a43b9763fe54063", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-operator_overloading_03-d9fd880.stdout b/tests/reference/llvm-operator_overloading_03-d9fd880.stdout index fc5afa9020..a8724bdf9b 100644 --- a/tests/reference/llvm-operator_overloading_03-d9fd880.stdout +++ b/tests/reference/llvm-operator_overloading_03-d9fd880.stdout @@ -1,6 +1,3 @@ -fname greater_than_inverse -fname less_than_inverse -fname less_than_overload_use ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-program_03-374e848.json b/tests/reference/llvm-program_03-374e848.json index 0365acf437..3e88f221e9 100644 --- a/tests/reference/llvm-program_03-374e848.json +++ b/tests/reference/llvm-program_03-374e848.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-program_03-374e848.stdout", - "stdout_hash": "a9dcead7d883676b35affc334f60d39b179413772ce2501d806613a1", + "stdout_hash": "22428eb994a0a0f6d2ba2b47d9f1dfd44b86d802eac294b6fa7e3c99", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-program_03-374e848.stdout b/tests/reference/llvm-program_03-374e848.stdout index e62b930a1b..0929af8033 100644 --- a/tests/reference/llvm-program_03-374e848.stdout +++ b/tests/reference/llvm-program_03-374e848.stdout @@ -1,5 +1,3 @@ -fname apply -fname add_z ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-recursion_02-76da7b3.json b/tests/reference/llvm-recursion_02-76da7b3.json index a444bf6ec7..b0d3b3bb8f 100644 --- a/tests/reference/llvm-recursion_02-76da7b3.json +++ b/tests/reference/llvm-recursion_02-76da7b3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_02-76da7b3.stdout", - "stdout_hash": "53a2cab80d5f8779ad271f2acf26b9cbde78b5bec8064846be6d3dff", + "stdout_hash": "629ba196fc2610beda79f024b98af142feec7049f4bd12e472433063", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-recursion_02-76da7b3.stdout b/tests/reference/llvm-recursion_02-76da7b3.stdout index 8c7fd49b50..fd0ded7d04 100644 --- a/tests/reference/llvm-recursion_02-76da7b3.stdout +++ b/tests/reference/llvm-recursion_02-76da7b3.stdout @@ -1,6 +1,3 @@ -fname solver -fname sub1 -fname getx ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-recursion_03-3285725.json b/tests/reference/llvm-recursion_03-3285725.json index 3ab9373133..192836c641 100644 --- a/tests/reference/llvm-recursion_03-3285725.json +++ b/tests/reference/llvm-recursion_03-3285725.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-recursion_03-3285725.stdout", - "stdout_hash": "f00eebaab64360ef8426e23fe95dd5e6b6a54e2dddb32e76389d1d6f", + "stdout_hash": "f0e82260576b560400d33cce939cfa4d8a6e7442a5d4dc31ab479500", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-recursion_03-3285725.stdout b/tests/reference/llvm-recursion_03-3285725.stdout index 60139a033a..a6948fa218 100644 --- a/tests/reference/llvm-recursion_03-3285725.stdout +++ b/tests/reference/llvm-recursion_03-3285725.stdout @@ -1,7 +1,3 @@ -fname solver_caller -fname solver -fname sub1 -fname getx ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-return_01-495409d.json b/tests/reference/llvm-return_01-495409d.json index 703897cac1..235cf51b27 100644 --- a/tests/reference/llvm-return_01-495409d.json +++ b/tests/reference/llvm-return_01-495409d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-return_01-495409d.stdout", - "stdout_hash": "49615fc9616a441e83e95eb2d655b610ab04fdbe93abf8175803fd4d", + "stdout_hash": "192d1098fe399f4630340fbd35e480fb78ba62ed236e8ca903ca7af2", "stderr": "llvm-return_01-495409d.stderr", "stderr_hash": "3c7370e49583f13017d1500c533fc16ec67eefb9732878d66392964c", "returncode": 0 diff --git a/tests/reference/llvm-return_01-495409d.stdout b/tests/reference/llvm-return_01-495409d.stdout index 5e972ed3c7..2d5d699db3 100644 --- a/tests/reference/llvm-return_01-495409d.stdout +++ b/tests/reference/llvm-return_01-495409d.stdout @@ -1,4 +1,3 @@ -fname main1 ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-return_02-99fb0b3.json b/tests/reference/llvm-return_02-99fb0b3.json index 84fb5f19e6..11b6d6ed7c 100644 --- a/tests/reference/llvm-return_02-99fb0b3.json +++ b/tests/reference/llvm-return_02-99fb0b3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-return_02-99fb0b3.stdout", - "stdout_hash": "6eafd647c1ac69c0503c574603ad5a5775c1048d7927d06b30790d8f", + "stdout_hash": "9ac3408e21a4f1c7424a77eb5c37c2431c60a132e8b0deb731b47889", "stderr": "llvm-return_02-99fb0b3.stderr", "stderr_hash": "efcbccc2e2e71c4026b6ef48d5fa977b7432890f8fc2395640038aa4", "returncode": 0 diff --git a/tests/reference/llvm-return_02-99fb0b3.stdout b/tests/reference/llvm-return_02-99fb0b3.stdout index cdb57d350c..4b468f765c 100644 --- a/tests/reference/llvm-return_02-99fb0b3.stdout +++ b/tests/reference/llvm-return_02-99fb0b3.stdout @@ -1,5 +1,3 @@ -fname b -fname d ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/llvm-subroutine3-fb7e0b8.json b/tests/reference/llvm-subroutine3-fb7e0b8.json index 6d176be32a..8ac67643e8 100644 --- a/tests/reference/llvm-subroutine3-fb7e0b8.json +++ b/tests/reference/llvm-subroutine3-fb7e0b8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-subroutine3-fb7e0b8.stdout", - "stdout_hash": "b751b10cfa10576f7262202dac9d08e60d70162ed44f84706f29f239", + "stdout_hash": "203462336eb580ad635038b53ab2235056bb0572890be6c2f2c99fbc", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-subroutine3-fb7e0b8.stdout b/tests/reference/llvm-subroutine3-fb7e0b8.stdout index 60fbeb6702..769fa74ff1 100644 --- a/tests/reference/llvm-subroutine3-fb7e0b8.stdout +++ b/tests/reference/llvm-subroutine3-fb7e0b8.stdout @@ -1,4 +1,3 @@ -fname f ; ModuleID = 'LFortran' source_filename = "LFortran" diff --git a/tests/reference/obj-subroutine3-942b3d8.json b/tests/reference/obj-subroutine3-942b3d8.json index fa2cefde83..56eb19c133 100644 --- a/tests/reference/obj-subroutine3-942b3d8.json +++ b/tests/reference/obj-subroutine3-942b3d8.json @@ -5,8 +5,8 @@ "infile_hash": "174874c0a5fad40d608acbafefcc0c06c96379cc136126d3f05b63e5", "outfile": null, "outfile_hash": null, - "stdout": "obj-subroutine3-942b3d8.stdout", - "stdout_hash": "8f3fce80b81b001a1345648db3c7be71cf0c378ca35d6cda8130ab3e", + "stdout": null, + "stdout_hash": null, "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/obj-subroutine3-942b3d8.stdout b/tests/reference/obj-subroutine3-942b3d8.stdout deleted file mode 100644 index 6e7c16fd6f..0000000000 --- a/tests/reference/obj-subroutine3-942b3d8.stdout +++ /dev/null @@ -1 +0,0 @@ -fname f diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.json b/tests/reference/pass_flip_sign-flip_sign-16b288c.json index 93489195b6..7eaca1b99d 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.json +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", - "stdout_hash": "ad289a3ead2f6cdaccfc48a3ded97fe1290da3f6fcb47ccf09e8e996", + "stdout_hash": "99b90c87896b22a5a39d5ee044862fab1d50ef7f75115e47e98319a0", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout index c03ac15ed9..3cd6e69156 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 288 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 288 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 289 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 289 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_05-73805d1.json b/tests/reference/pass_inline_function_calls-functions_05-73805d1.json index 04ea121814..aa1c7d4893 100644 --- a/tests/reference/pass_inline_function_calls-functions_05-73805d1.json +++ b/tests/reference/pass_inline_function_calls-functions_05-73805d1.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_05-73805d1.stdout", - "stdout_hash": "f91facf864a957c12efb7ba81a20d6a8efaaa70d304d7af89f26fbc4", + "stdout_hash": "b34a1746c92f00eaca90046fd1ac7ce56374858512f8bb2b3b60e192", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout b/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout index 4b1ec380d0..61a448fea3 100644 --- a/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout +++ b/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout @@ -1,4 +1 @@ -fname f -fname f_real -fname signr32 (TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 2 a_f Local () () Default (Integer 4 []) Source Public Required .false.), a_f_real: (Variable 2 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 2 b_f Local () () Default (Integer 4 []) Source Public Required .false.), b_f_real: (Variable 2 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 4 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32: (Variable 4 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32: (Variable 4 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 x_signr32) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 4 y_signr32) (Var 4 a) ()) (= (Var 4 r_signr32) (Var 4 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 4 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 4 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 r_signr32) (Var 4 x_signr32) ())] [(= (Var 4 r_signr32) (RealUnaryMinus (Var 4 x_signr32) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 r_signr32) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 2 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), r_signr32_f_real: (Variable 2 r_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), x_f: (Variable 2 x_f Local () () Default (Integer 4 []) Source Public Required .false.), x_signr32: (Variable 2 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32_f_real: (Variable 2 x_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.), y_signr32: (Variable 2 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32_f_real: (Variable 2 y_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 a_f) (Var 2 x) ()) (= (Var 2 x_f) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b_f) (IntegerBinOp (Var 2 a_f) Add (Var 2 x_f) (Integer 4 []) ()) ()) (= (Var 2 y) (Var 2 b_f) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 a_f_real) (Var 2 p) ()) (= (Var 2 x_signr32_f_real) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 2 y_signr32_f_real) (Var 2 a_f_real) ()) (= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ())] [(= (Var 2 r_signr32_f_real) (RealUnaryMinus (Var 2 x_signr32_f_real) (Real 4 []) ()) ())]) (= (Var 2 b_f_real) (RealBinOp (Var 2 a_f_real) Add (Var 2 r_signr32_f_real) (Real 4 []) ()) ()) (= (Var 2 q) (Var 2 b_f_real) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 x_signr32) (Var 2 a) ()) (= (Var 2 y_signr32) (Var 2 b) ()) (= (Var 2 r_signr32) (Var 2 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32) (Var 2 x_signr32) ())] [(= (Var 2 r_signr32) (RealUnaryMinus (Var 2 x_signr32) (Real 4 []) ()) ())]) (= (Var 2 c) (Var 2 r_signr32) ()) (Print () [(Var 2 c)] () ())])}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_07-cc20830.json b/tests/reference/pass_inline_function_calls-functions_07-cc20830.json index ac755e4a96..744e1009e8 100644 --- a/tests/reference/pass_inline_function_calls-functions_07-cc20830.json +++ b/tests/reference/pass_inline_function_calls-functions_07-cc20830.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_07-cc20830.stdout", - "stdout_hash": "ad7942c6404c1b0c814c1fc7241630876a5617638859db304205f425", + "stdout_hash": "d33bcb9ab5720092c1719919c99d2a4c947b003ff82e056b6d1bd8c9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout b/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout index 6177667c55..45bbc930e5 100644 --- a/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout +++ b/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout @@ -1,4 +1 @@ -fname f_a -fname f_b -fname f_c (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {u_f_a: (Variable 5 u_f_a Local () () Default (Real 4 []) Source Public Required .false.), v_f_a: (Variable 5 v_f_a Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 u_f_a) (Var 5 x) ()) (= (Var 5 v_f_a) (RealBinOp (Var 5 u_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 5 y) (RealBinOp (Var 5 v_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {u_f_a_f_b: (Variable 7 u_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b: (Variable 7 v_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), x_f_b: (Variable 7 x_f_b Local () () Default (Real 4 []) Source Public Required .false.), y_f_b: (Variable 7 y_f_b Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 x_f_b) (Var 7 w) ()) (= (Var 7 u_f_a_f_b) (Var 7 x_f_b) ()) (= (Var 7 v_f_a_f_b) (RealBinOp (Var 7 u_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 y_f_b) (RealBinOp (Var 7 v_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 z) (RealBinOp (Var 7 y_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.), u_f_a_f_b_f_c: (Variable 8 u_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b_f_c: (Variable 8 v_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), w_f_c: (Variable 8 w_f_c Local () () Default (Real 4 []) Source Public Required .false.), x_f_b_f_c: (Variable 8 x_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), y_f_b_f_c: (Variable 8 y_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), z_f_c: (Variable 8 z_f_c Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 w_f_c) (Var 8 p) ()) (= (Var 8 x_f_b_f_c) (Var 8 w_f_c) ()) (= (Var 8 u_f_a_f_b_f_c) (Var 8 x_f_b_f_c) ()) (= (Var 8 v_f_a_f_b_f_c) (RealBinOp (Var 8 u_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 y_f_b_f_c) (RealBinOp (Var 8 v_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 z_f_c) (RealBinOp (Var 8 y_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 q) (Var 8 z_f_c) ()) (Print () [(Var 8 q)] () ())])}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_08-515120b.json b/tests/reference/pass_inline_function_calls-functions_08-515120b.json index ab304d89fd..08c620a7df 100644 --- a/tests/reference/pass_inline_function_calls-functions_08-515120b.json +++ b/tests/reference/pass_inline_function_calls-functions_08-515120b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_08-515120b.stdout", - "stdout_hash": "1d8c78ca9ebe6df3e1deac7f8d443e68c1619ac1e4d40b9ac26bd21c", + "stdout_hash": "a959b41d2e164cbfd346059f1d68ae37f4d59284a051a642cfb030d1", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout b/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout index f2c0b9f26c..7a63e2c4a4 100644 --- a/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout +++ b/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout @@ -1,3 +1 @@ -fname f -fname f_real (TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 3 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 3 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 3 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 3 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 4 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 4 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 a_f_real) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 4 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 4 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 4 b_f_real) (RealBinOp (Var 4 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 b_f_real) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 5 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real_f: (Variable 5 a_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 5 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real_f: (Variable 5 b_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), x_f: (Variable 5 x_f Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(= (Var 5 a_f) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 5 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 5 a_f_real_f) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 5 a_f_real_f) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b_f_real_f) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b_f_real_f) (RealBinOp (Var 5 a_f_real_f) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 5 b_f) (RealBinOp (Var 5 a_f) Add (Var 5 b_f_real_f) (Real 4 []) ()) ()) (If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (Var 5 b_f) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), x_f: (Variable 3 x_f Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 a_f) (Var 3 x) ()) (= (Var 3 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 3 b_f) (RealBinOp (Var 3 a_f) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ()) (= (Var 3 y) (Var 3 b_f) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 a_f_real) (Var 3 p) ()) (If (RealCompare (Var 3 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 3 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 3 b_f_real) (RealBinOp (Var 3 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 3 q) (Var 3 b_f_real) ()) (Print () [(Var 3 q)] () ())])}) []) diff --git a/tests/reference/wat-types_16-57fa580.json b/tests/reference/wat-types_16-57fa580.json index 8eaf35cf1a..59484db52a 100644 --- a/tests/reference/wat-types_16-57fa580.json +++ b/tests/reference/wat-types_16-57fa580.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "wat-types_16-57fa580.stdout", - "stdout_hash": "695015a928a567547ea18cd3b08ab9565f064457f276353f38126748", + "stdout_hash": "688a51e31e2b34c7771f03a8fe0c185655e7abfe8a04fc0bfe3430d5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/wat-types_16-57fa580.stdout b/tests/reference/wat-types_16-57fa580.stdout index ea7f644c65..2649d8bf2c 100644 --- a/tests/reference/wat-types_16-57fa580.stdout +++ b/tests/reference/wat-types_16-57fa580.stdout @@ -1,9 +1,3 @@ -fname sqr -fname add_floats -fname get_pi -fname get_pi_64 -fname get_neg_f32 -fname computeCircleArea (module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) diff --git a/tests/reference/wat-wasm1-8a138d6.json b/tests/reference/wat-wasm1-8a138d6.json index da37bf80c6..c3a51644b5 100644 --- a/tests/reference/wat-wasm1-8a138d6.json +++ b/tests/reference/wat-wasm1-8a138d6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "wat-wasm1-8a138d6.stdout", - "stdout_hash": "66a269079445badaffde5060a12735b359670c926451d392425719de", + "stdout_hash": "e696902b4301d2c0ebbded5f6e87a7df19c576b9dc45c7329476ed0e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/wat-wasm1-8a138d6.stdout b/tests/reference/wat-wasm1-8a138d6.stdout index bd2382febf..8780d003a7 100644 --- a/tests/reference/wat-wasm1-8a138d6.stdout +++ b/tests/reference/wat-wasm1-8a138d6.stdout @@ -1,8 +1,3 @@ -fname sqr -fname add -fname add64 -fname computeCircleArea -fname my_add (module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) diff --git a/tests/reference/wat-wasm_i64-3afdb24.json b/tests/reference/wat-wasm_i64-3afdb24.json index 328da22f7b..7c9584b153 100644 --- a/tests/reference/wat-wasm_i64-3afdb24.json +++ b/tests/reference/wat-wasm_i64-3afdb24.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_i64-3afdb24.stdout", - "stdout_hash": "41ef1eb4907bb5f26b5661468e165659f7b1fca7a45f936a8b5ddd5e", + "stdout_hash": "8de9fc9d6f0ebb745912cb0f0b558a51d0a7f6a0562128affbcb608d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/wat-wasm_i64-3afdb24.stdout b/tests/reference/wat-wasm_i64-3afdb24.stdout index f3c8a1077e..90bf2901fd 100644 --- a/tests/reference/wat-wasm_i64-3afdb24.stdout +++ b/tests/reference/wat-wasm_i64-3afdb24.stdout @@ -1,6 +1,3 @@ -fname a_sqr_i64 -fname add_i64 -fname test_i64 (module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) diff --git a/tests/reference/wat-wasm_main_program-7a34895.json b/tests/reference/wat-wasm_main_program-7a34895.json index 180856981b..84c06cc456 100644 --- a/tests/reference/wat-wasm_main_program-7a34895.json +++ b/tests/reference/wat-wasm_main_program-7a34895.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_main_program-7a34895.stdout", - "stdout_hash": "ba310a708bb2175af88c370a9c67790eac659327999eed5cb9e2ae9e", + "stdout_hash": "8acabe8d7a73ba90d3dcdb024c8dfc9f1a191f04b2cc729e6822b438", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/wat-wasm_main_program-7a34895.stdout b/tests/reference/wat-wasm_main_program-7a34895.stdout index 3dc4e0b59a..c22292adba 100644 --- a/tests/reference/wat-wasm_main_program-7a34895.stdout +++ b/tests/reference/wat-wasm_main_program-7a34895.stdout @@ -1,4 +1,3 @@ -fname sqr (module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) diff --git a/tests/reference/wat-wasm_unary_minus-81a29ff.json b/tests/reference/wat-wasm_unary_minus-81a29ff.json index 7037744e49..07e5b1e3a9 100644 --- a/tests/reference/wat-wasm_unary_minus-81a29ff.json +++ b/tests/reference/wat-wasm_unary_minus-81a29ff.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "wat-wasm_unary_minus-81a29ff.stdout", - "stdout_hash": "9469b03853143c227525d9ea0bc50c66f894051532565d72ddbdeec7", + "stdout_hash": "1380c308782b1f246d8e00666e6f3160507fa60e1d883d128c8fec2c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/wat-wasm_unary_minus-81a29ff.stdout b/tests/reference/wat-wasm_unary_minus-81a29ff.stdout index e59773ae9c..55b5f3854d 100644 --- a/tests/reference/wat-wasm_unary_minus-81a29ff.stdout +++ b/tests/reference/wat-wasm_unary_minus-81a29ff.stdout @@ -1,6 +1,3 @@ -fname get_num_neg_i32 -fname get_num_neg_i64 -fname test_unary_minus (module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) From 8b887e35bb74db48609aa565ac15c50f52d93e5b Mon Sep 17 00:00:00 2001 From: Pranav <85227306+Pranavchiku@users.noreply.github.com> Date: Sun, 4 Sep 2022 14:05:02 +0530 Subject: [PATCH 16/46] Add fixes for ```dmin1```, ```dmax1``` implementation (#685) Co-Authored-By: Pranavchiku Co-authored-by: Smit-create --- integration_tests/intrinsics_22.f90 | 10 +++++++-- src/lfortran/semantics/comptime_eval.h | 16 ++++++++++++++ src/runtime/pure/lfortran_intrinsic_math2.f90 | 22 +++++++++++++++++-- tests/reference/asr-flip_sign-a0cebd4.json | 2 +- tests/reference/asr-flip_sign-a0cebd4.stdout | 2 +- .../reference/asr-intrinsics_31-9b91cfb.json | 2 +- .../asr-intrinsics_31-9b91cfb.stdout | 2 +- tests/reference/asr-parameter1-1a7ed3b.json | 2 +- tests/reference/asr-parameter1-1a7ed3b.stdout | 2 +- tests/reference/asr-string_19-d880475.json | 2 +- tests/reference/asr-string_19-d880475.stdout | 2 +- .../pass_flip_sign-flip_sign-16b288c.json | 2 +- .../pass_flip_sign-flip_sign-16b288c.stdout | 2 +- 13 files changed, 54 insertions(+), 14 deletions(-) diff --git a/integration_tests/intrinsics_22.f90 b/integration_tests/intrinsics_22.f90 index 42e95ccead..9301ba88b0 100644 --- a/integration_tests/intrinsics_22.f90 +++ b/integration_tests/intrinsics_22.f90 @@ -14,15 +14,21 @@ program intrinsics_22 j1b = max(-5, 3) real :: x1, x2 -real(dp) :: y1, y2 +real(dp) :: y1, y2, p1, p2 integer :: i1, i2 i1 = -5; i2 = 3 x1 = i1; y1 = i1; x2 = i2; y2 = i2; +p1 = 5.0; p2 = 23.0; print *, min(-5., 3.), min(-5._dp, 3._dp), min(x1, x2), min(y1, y2), s1, d1 print *, max(-5., 3.), max(-5._dp, 3._dp), max(x1, x2), max(y1, y2), s1b, d1b print *, min(-5, 3), min(i1, i2), j1 print *, max(-5, 3), max(i1, i2), j1b - +if (abs(dmin1(p1, p2) - 5.0) > 1e-5) error stop +if (abs(dmax1(p1, p2) - 23.0) > 1e-5) error stop +if (abs(dmin1(12.0, -13.0) + 13.0) > 1e-5) error stop +if (abs(dmax1(10.5, 12424.0) - 12424.0) > 1e-5) error stop +if (abs(dmax1(0.0, -2.24) - 0.0) > 1e-5) error stop +if (abs(dmin1(-12.3, 0.0) + 12.3) > 1e-5) error stop end diff --git a/src/lfortran/semantics/comptime_eval.h b/src/lfortran/semantics/comptime_eval.h index 68ff25ce28..4a993d9ede 100644 --- a/src/lfortran/semantics/comptime_eval.h +++ b/src/lfortran/semantics/comptime_eval.h @@ -85,7 +85,9 @@ struct IntrinsicProcedures { {"min", {m_math2, &eval_min, true}}, {"max", {m_math2, &eval_max, true}}, {"min0", {m_math2, &eval_min0, true}}, + {"dmin1", {m_math2, &eval_dmin1, true}}, {"max0", {m_math2, &eval_max0, true}}, + {"dmax1", {m_math2, &eval_dmax1, true}}, {"merge", {m_math2, ¬_implemented, false}}, {"selected_int_kind", {m_kind, &eval_selected_int_kind, true}}, {"selected_real_kind", {m_kind, &eval_selected_real_kind, true}}, @@ -613,6 +615,13 @@ TRIG2(log, zlog) true); } + static ASR::expr_t *eval_dmin1(Allocator &al, const Location &loc, Vec &args) { + return eval_2args_ri(al, loc, args, + &IntrinsicProcedures::lfortran_min, + &IntrinsicProcedures::lfortran_min_i, + true); + } + static ASR::expr_t *eval_min0(Allocator &al, const Location &loc, Vec &args) { return eval_2args_ri(al, loc, args, &IntrinsicProcedures::lfortran_min, @@ -635,6 +644,13 @@ TRIG2(log, zlog) true); } + static ASR::expr_t *eval_dmax1(Allocator &al, const Location &loc, Vec &args) { + return eval_2args_ri(al, loc, args, + &IntrinsicProcedures::lfortran_max, + &IntrinsicProcedures::lfortran_max_i, + true); + } + static ASR::expr_t *eval_max0(Allocator &al, const Location &loc, Vec &args) { return eval_2args_ri(al, loc, args, &IntrinsicProcedures::lfortran_max, diff --git a/src/runtime/pure/lfortran_intrinsic_math2.f90 b/src/runtime/pure/lfortran_intrinsic_math2.f90 index 2da11566f6..6b3324fba3 100644 --- a/src/runtime/pure/lfortran_intrinsic_math2.f90 +++ b/src/runtime/pure/lfortran_intrinsic_math2.f90 @@ -37,11 +37,11 @@ module lfortran_intrinsic_math2 end interface interface min - module procedure imin, imin8, imin16, imin64, smin, dmin, imin_6args + module procedure imin, imin8, imin16, imin64, smin, dmin, dmin1, imin_6args end interface interface max - module procedure imax, imax8, imax16, imax64, smax, dmax, imax_6args, dmax_3args + module procedure imax, imax8, imax16, imax64, smax, dmax, dmax1, imax_6args, dmax_3args end interface interface huge @@ -315,6 +315,15 @@ elemental real(dp) function dmin(x, y) result(r) end if end function +elemental real(dp) function dmin1(x, y) result(r) +real(dp), intent(in) :: x, y +if (x < y) then + r = x +else + r = y +end if +end function + elemental integer function imin_6args(a, b, c, d, e, f) result(r) integer, intent(in) :: a, b, c, d, e, f integer :: args(6) @@ -423,6 +432,15 @@ elemental real(dp) function dmax(x, y) result(r) end if end function +elemental real(dp) function dmax1(x, y) result(r) +real(dp), intent(in) :: x, y +if (x > y) then + r = x +else + r = y +end if +end function + elemental real(dp) function dmax_3args(x, y, z) result(r) real(dp), intent(in) :: x, y, z r = dmax(x, y) diff --git a/tests/reference/asr-flip_sign-a0cebd4.json b/tests/reference/asr-flip_sign-a0cebd4.json index 90dc72ebbf..4314dd4801 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.json +++ b/tests/reference/asr-flip_sign-a0cebd4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", - "stdout_hash": "a0b66e571f67dee7b9a63ed9288c4327988250b7260c8ea8c27b007c", + "stdout_hash": "5d19ed950f020a87a2502896687158653411823f4c8d93161e34c32c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-flip_sign-a0cebd4.stdout b/tests/reference/asr-flip_sign-a0cebd4.stdout index 3bb1efc86f..5092c5160b 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.stdout +++ b/tests/reference/asr-flip_sign-a0cebd4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 95 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 95 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.json b/tests/reference/asr-intrinsics_31-9b91cfb.json index ef6ca8149c..22bc79dde4 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.json +++ b/tests/reference/asr-intrinsics_31-9b91cfb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", - "stdout_hash": "50fc18dce3d8d5cc827e72f3386c50089203fafc38470c5a1c932be5", + "stdout_hash": "b6065d364bc2d09c44b8b793f6613c27a9274018a014204b09df007d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.stdout b/tests/reference/asr-intrinsics_31-9b91cfb.stdout index 6514655f12..9d96fb1ad6 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.stdout +++ b/tests/reference/asr-intrinsics_31-9b91cfb.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 102 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 102 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 104 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 104 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-parameter1-1a7ed3b.json b/tests/reference/asr-parameter1-1a7ed3b.json index 5f0b3c0944..cd96583307 100644 --- a/tests/reference/asr-parameter1-1a7ed3b.json +++ b/tests/reference/asr-parameter1-1a7ed3b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-parameter1-1a7ed3b.stdout", - "stdout_hash": "18efd897c692fdf983befd474fe054f4c3818fc5bdbfc5d4ec2e8910", + "stdout_hash": "3d1707d7e28d8f044b30a13e47672ea1fdf209f8cfffa2f45e247de0", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-parameter1-1a7ed3b.stdout b/tests/reference/asr-parameter1-1a7ed3b.stdout index e9ec84e0c6..4345267721 100644 --- a/tests/reference/asr-parameter1-1a7ed3b.stdout +++ b/tests/reference/asr-parameter1-1a7ed3b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {dcstep: (Function (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 2 abs@dabs 93 dabs lfortran_intrinsic_math [] dabs Private), max: (ExternalSymbol 2 max 4 max lfortran_intrinsic_math2 [] max Private), max@dmax_3args: (ExternalSymbol 2 max@dmax_3args 4 dmax_3args lfortran_intrinsic_math2 [] dmax_3args Private), p66: (Variable 2 p66 Local () () Default (Real 8 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Real 8 []) Source Public Required .false.), three: (Variable 2 three Local () () Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 8 []) Source Public Required .false.)}) dcstep [] [] [(= (Var 2 s) (FunctionCall 2 max@dmax_3args 2 max [((FunctionCall 2 abs@dabs 2 abs [((Var 2 three))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 two))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 p66))] (Real 8 []) () ()))] (Real 8 []) () ()) ())] () Source Public Implementation () .false. .false. .false.), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {dcstep: (Function (SymbolTable 2 {abs: (ExternalSymbol 2 abs 95 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 2 abs@dabs 95 dabs lfortran_intrinsic_math [] dabs Private), max: (ExternalSymbol 2 max 4 max lfortran_intrinsic_math2 [] max Private), max@dmax_3args: (ExternalSymbol 2 max@dmax_3args 4 dmax_3args lfortran_intrinsic_math2 [] dmax_3args Private), p66: (Variable 2 p66 Local () () Default (Real 8 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Real 8 []) Source Public Required .false.), three: (Variable 2 three Local () () Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 8 []) Source Public Required .false.)}) dcstep [] [] [(= (Var 2 s) (FunctionCall 2 max@dmax_3args 2 max [((FunctionCall 2 abs@dabs 2 abs [((Var 2 three))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 two))] (Real 8 []) () ())) ((FunctionCall 2 abs@dabs 2 abs [((Var 2 p66))] (Real 8 []) () ()))] (Real 8 []) () ()) ())] () Source Public Implementation () .false. .false. .false.), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-string_19-d880475.json b/tests/reference/asr-string_19-d880475.json index 47dd2adb6f..f36b16afe3 100644 --- a/tests/reference/asr-string_19-d880475.json +++ b/tests/reference/asr-string_19-d880475.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-string_19-d880475.stdout", - "stdout_hash": "c7f6e21d5e652af26c9c4420e0dd237f45f298f2b1a9337a79051594", + "stdout_hash": "6eb29af81dc29888a51e2c719284bede9151f2b45afa0a31a9f66382", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-string_19-d880475.stdout b/tests/reference/asr-string_19-d880475.stdout index 7c90d3f140..fb4a8764b0 100644 --- a/tests/reference/asr-string_19-d880475.stdout +++ b/tests/reference/asr-string_19-d880475.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 103 {char: (ExternalSymbol 103 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 103 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 103 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 103 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 103 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 103 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 103 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 103 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 103 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 103 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 103 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 103 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 103 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) +(TranslationUnit (SymbolTable 1 {iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), stdlib_string_type: (Module (SymbolTable 2 {char: (GenericProcedure 2 char [2 char_string] Public), char_string: (Function (SymbolTable 5 {character_string: (Variable 5 character_string ReturnVar () () Default (Character 1 -3 (FunctionCall 2 len_string 2 len [((Var 5 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 5 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) char_string [(Var 5 string)] [] [] (Var 5 character_string) Source Public Implementation () .false. .false. .false.), len: (GenericProcedure 2 len [2 len_string] Public), len_string: (Function (SymbolTable 4 {length: (Variable 4 length ReturnVar () () Default (Integer 4 []) Source Public Required .false.), string: (Variable 4 string In () () Default (Derived 2 string_type []) Source Public Required .false.)}) len_string [(Var 4 string)] [] [] (Var 4 length) Source Public Implementation () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ())}) stdlib_string_type [] .false. .false.), stdlib_strings: (Module (SymbolTable 6 {char: (ExternalSymbol 6 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 6 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (Function (SymbolTable 7 {len: (ExternalSymbol 7 len 9 len lfortran_intrinsic_builtin [] len Private), lps_array: (Variable 7 lps_array ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 7 len () [((Var 7 string))] (Integer 4 []) () ()))]) Source Public Required .false.), string: (Variable 7 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps [(Var 7 string)] [] [] (Var 7 lps_array) Source Public Implementation () .false. .false. .false.), compute_lps_use: (Function (SymbolTable 32 {l: (Variable 32 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 32 len 9 len lfortran_intrinsic_builtin [] len Private), string: (Variable 32 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) compute_lps_use [(Var 32 string)] [] [(Print () [(FunctionCall 6 compute_lps () [((Var 32 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 32 len () [((Var 32 string))] (Integer 4 []) () ()))]) () ())] () ())] (Var 32 l) Source Public Implementation () .false. .false. .false.), compute_lps_use1: (Function (SymbolTable 33 {char@char_string: (ExternalSymbol 33 char@char_string 2 char_string stdlib_string_type [] char_string Private), l: (Variable 33 l ReturnVar () () Default (Integer 4 []) Source Public Required .false.), len_string: (ExternalSymbol 33 len_string 2 len_string stdlib_string_type [] len_string Private), string: (Variable 33 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) compute_lps_use1 [(Var 33 string)] [] [(Print () [(FunctionCall 33 char@char_string 6 char [((Var 33 string))] (Character 1 -3 (FunctionCall 33 len_string 2 len [((Var 33 string))] (Integer 4 []) () ()) []) () ())] () ())] (Var 33 l) Source Public Implementation () .false. .false. .false.), len: (ExternalSymbol 6 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 6 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (GenericProcedure 6 padl [6 padl_char_default 6 padl_char_pad_with] Public), padl_char_default: (Function (SymbolTable 36 {imax: (ExternalSymbol 36 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 36 len 9 len lfortran_intrinsic_builtin [] len Private), output_length: (Variable 36 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 36 res ReturnVar () () Default (Character 1 -3 (FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 36 string In () () Default (Character 1 -1 () []) Source Public Required .false.)}) padl_char_default [(Var 36 string) (Var 36 output_length)] [] [(= (Var 36 res) (FunctionCall 6 padl_char_pad_with 6 padl [((Var 36 string)) ((Var 36 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 36 imax 37 max [((FunctionCall 36 len () [((Var 36 string))] (Integer 4 []) () ())) ((Var 36 output_length))] (Integer 4 []) () ()) []) () ()) ())] (Var 36 res) Source Public Implementation () .false. .false. .false.), padl_char_pad_with: (Function (SymbolTable 37 {len: (ExternalSymbol 37 len 9 len lfortran_intrinsic_builtin [] len Private), max: (ExternalSymbol 37 max 39 max lfortran_intrinsic_math2 [] max Private), max@imax: (ExternalSymbol 37 max@imax 39 imax lfortran_intrinsic_math2 [] imax Private), output_length: (Variable 37 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 37 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 37 res ReturnVar () () Default (Character 1 -3 (FunctionCall 37 max@imax 37 max [((FunctionCall 37 len () [((Var 37 string))] (Integer 4 []) () ())) ((Var 37 output_length))] (Integer 4 []) () ()) []) Source Public Required .false.), string: (Variable 37 string In () () Default (Character 1 -1 () []) Source Public Required .false.), string_length: (Variable 37 string_length Local () () Default (Integer 4 []) Source Public Required .false.)}) padl_char_pad_with [(Var 37 string) (Var 37 output_length) (Var 37 pad_with)] [] [] (Var 37 res) Source Public Implementation () .false. .false. .false.), padl_string_default: (Function (SymbolTable 34 {char@char_string: (ExternalSymbol 34 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 34 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 34 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 34 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 34 output_length In () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 34 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 34 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_default [(Var 34 string) (Var 34 output_length)] [] [(= (Var 34 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ())) ((Var 34 output_length)) ((StringConstant " " (Character 1 1 () [])))] (Character 1 -3 (FunctionCall 34 imax 37 max [((FunctionCall 34 len () [((FunctionCall 34 char@char_string 6 char [((Var 34 string))] (Character 1 -3 (FunctionCall 34 len_string 2 len [((Var 34 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 34 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 34 res) Source Public Implementation () .false. .false. .false.), padl_string_pad_with: (Function (SymbolTable 35 {char@char_string: (ExternalSymbol 35 char@char_string 2 char_string stdlib_string_type [] char_string Private), imax: (ExternalSymbol 35 imax 39 imax lfortran_intrinsic_math2 [] imax Private), len: (ExternalSymbol 35 len 9 len lfortran_intrinsic_builtin [] len Private), len_string: (ExternalSymbol 35 len_string 2 len_string stdlib_string_type [] len_string Private), output_length: (Variable 35 output_length In () () Default (Integer 4 []) Source Public Required .false.), pad_with: (Variable 35 pad_with In () () Default (Character 1 1 () []) Source Public Required .false.), res: (Variable 35 res ReturnVar () () Default (Derived 6 string_type []) Source Public Required .false.), string: (Variable 35 string In () () Default (Derived 6 string_type []) Source Public Required .false.)}) padl_string_pad_with [(Var 35 string) (Var 35 output_length) (Var 35 pad_with)] [] [(= (Var 35 res) (DerivedTypeConstructor 6 string_type [(FunctionCall 6 padl_char_pad_with 6 padl [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ())) ((Var 35 output_length)) ((Var 35 pad_with))] (Character 1 -3 (FunctionCall 35 imax 37 max [((FunctionCall 35 len () [((FunctionCall 35 char@char_string 6 char [((Var 35 string))] (Character 1 -3 (FunctionCall 35 len_string 2 len [((Var 35 string))] (Integer 4 []) () ()) []) () ()))] (Integer 4 []) () ())) ((Var 35 output_length))] (Integer 4 []) () ()) []) () ())] (Derived 6 string_type []) ()) ())] (Var 35 res) Source Public Implementation () .false. .false. .false.), string_type: (ExternalSymbol 6 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings [stdlib_string_type lfortran_intrinsic_builtin] .false. .false.), stdlib_strings_use: (Program (SymbolTable 105 {char: (ExternalSymbol 105 char 2 char stdlib_string_type [] char Public), char_string: (ExternalSymbol 105 char_string 2 char_string stdlib_string_type [] char_string Public), compute_lps: (ExternalSymbol 105 compute_lps 6 compute_lps stdlib_strings [] compute_lps Public), compute_lps_use: (ExternalSymbol 105 compute_lps_use 6 compute_lps_use stdlib_strings [] compute_lps_use Public), compute_lps_use1: (ExternalSymbol 105 compute_lps_use1 6 compute_lps_use1 stdlib_strings [] compute_lps_use1 Public), len: (ExternalSymbol 105 len 2 len stdlib_string_type [] len Public), len_string: (ExternalSymbol 105 len_string 2 len_string stdlib_string_type [] len_string Public), padl: (ExternalSymbol 105 padl 6 padl stdlib_strings [] padl Public), padl_char_default: (ExternalSymbol 105 padl_char_default 6 padl_char_default stdlib_strings [] padl_char_default Public), padl_char_pad_with: (ExternalSymbol 105 padl_char_pad_with 6 padl_char_pad_with stdlib_strings [] padl_char_pad_with Public), padl_string_default: (ExternalSymbol 105 padl_string_default 6 padl_string_default stdlib_strings [] padl_string_default Public), padl_string_pad_with: (ExternalSymbol 105 padl_string_pad_with 6 padl_string_pad_with stdlib_strings [] padl_string_pad_with Public), string_type: (ExternalSymbol 105 string_type 2 string_type stdlib_string_type [] string_type Public)}) stdlib_strings_use [stdlib_strings] [])}) []) diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.json b/tests/reference/pass_flip_sign-flip_sign-16b288c.json index 7eaca1b99d..bea87b2cfe 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.json +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", - "stdout_hash": "99b90c87896b22a5a39d5ee044862fab1d50ef7f75115e47e98319a0", + "stdout_hash": "920af2c584fc2fc8c1513f6f93c44d315c38e94d06c279238617f448", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout index 3cd6e69156..422127c11b 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 93 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 93 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 289 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 289 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 95 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 95 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 291 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 291 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) From 81e4a8b6fdc327f3d014290626a810c313a671e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Tue, 23 Aug 2022 00:54:22 +0000 Subject: [PATCH 17/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 64.0% (536 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 149 ++++++++++++++------------- 1 file changed, 78 insertions(+), 71 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index e8aa7b3152..06887cc104 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" -"Last-Translator: St Maxwell \n" +"PO-Revision-Date: 2022-08-26 12:30+0000\n" +"Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -948,10 +948,10 @@ msgid "" "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" -"网站:[https://lfortran.org/](https://lfortran.org/) " -"主存储库:[https://github.com/lfortran/lfortran](https://github.com/lfortran/" -"lfortran) 使用 Binder 在线尝试:[![Binder](https://mybinder.org/badge_logo." -"svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/" +"网站:[https://lfortran.org/](https://lfortran.org/" +");主存储库:[https://github.com/lfortran/lfortran](https://github.com/" +"lfortran/lfortran);使用 Binder 在线尝试:[![Binder](https://mybinder.org/" +"badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/" "master?filepath=Demo.ipynb)" #: ../../doc/src/index.md:9 @@ -969,9 +969,9 @@ msgid "" "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" -"LFortran 正在开发中,有些功能现在可以使用,有些功能正在实现中。您还可以查看 [" +"LFortran 正在开发中,有些功能现在可以使用,有些功能正在实现中。你还可以查看 [" "Development Status](progress.md) " -"部分,了解有关受支持和正在开发的功能的更多信息。" +"部分,了解有关被支持和正在开发的功能的更多信息。" #: ../../doc/src/index.md:21 msgid "Works today" @@ -988,11 +988,11 @@ msgid "" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" -"**交互式,Jupyter 支持** LFortran 可以从 Jupyter 用作 Fortran 内核,允许 " +"**交互式,Jupyter 支持**:LFortran 可以在 Jupyter 中用作 Fortran 内核,允许 " "Python/Julia 风格的快速原型设计和探索性工作流程(参见示例笔记: " -"[静态(https://nbviewer.jupyter.org/gist/certik/" -"f1d28a486510810d824869ab0c491b1c) 或 [交互](https://mybinder.org/v2/gl/" -"lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb)。或者," +"[静态](https://nbviewer.jupyter.org/gist/certik/" +"f1d28a486510810d824869ab0c491b1c) 或 [交互](https://mybinder.org/v2/gl/" +"lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb))。或者," "它可以在交互式提示 (REPL) 中的命令行中使用。" #: ../../doc/src/index.md:32 @@ -1004,7 +1004,7 @@ msgid "" "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" -"**简洁、模块化设计,可用作库** LFortran 围绕两个独立模块 AST 和 ASR " +"**简洁、模块化设计,可用作库**:LFortran 围绕两个独立模块 AST 和 ASR " "构建,这两个模块都是独立的(完全独立于 LFortran 的其余部分),鼓励用户将它们" "独立用于其他应用程序并在上面构建工具。有关详细信息,请参阅 [Design](design." "md) 和 [Developer Tutorial](developer_tutorial.md) 文档。" @@ -1016,21 +1016,21 @@ msgid "" "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" -"**与 GFortran 的互操作** LFortran 可以将 GFortran 模块文件解析为 ASR " -"并生成一个 Fortran 包装器,该包装器可以用任何 Fortran 编译器编译并与原始 " +"**与 GFortran 的互操作**:LFortran 可以将 GFortran 模块文件解析为 ASR " +"并生成一个 Fortran 包装器,该包装器可以用任何 Fortran 编译器编译并与原 " "GFortran 编译模块链接。" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." -msgstr "**创建可执行文件** 它可以像其他 Fortran 编译器一样创建可执行文件。" +msgstr "**创建可执行文件**:它可以像其他 Fortran 编译器一样创建可执行文件。" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." -msgstr "**在 Linux、Mac 和 Windows 上运行** 所有三个平台都由我们的 CI 定期测试。" +msgstr "**在 Linux、Mac 和 Windows 上运行**:所有三个平台都由我们的 CI 定期测试。" #: ../../doc/src/index.md:51 msgid "Planned" @@ -1040,7 +1040,7 @@ msgstr "计划" msgid "" "These features are under development, there is a link to the " "corresponding issue so that you can track the progress by following it." -msgstr "已计划这些功能正在开发中,有对应 issue 的链接,方便大家关注跟踪进度。" +msgstr "已计划这些功能正在开发中,有对应议题的链接,方便大家关注跟踪进度。" #: ../../doc/src/index.md:56 msgid "" @@ -1053,12 +1053,12 @@ msgid "" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" -"**与其他语言(以及其他 Fortran 编译器)的原生互操作** 只需使用 `use` " +"**与其他语言(以及其他 Fortran 编译器)的原生互操作**:只需使用 `use` " "语句即可自动调用其他语言(如 C 或 Python)编写的代码,参见 " "[#44](https://gitlab.com/lfortran/lfortran/issues/44)。它理解其他 Fortran " "编译器模块文件(可以`use`它们)及其 ABI 以正确链接(支持 " -"GFortran,计划使用其他编译器,请参阅 [#56](https://gitlab.com/lfortran/" -"lfortran/问题/56)),它允许今天将 LFortran 与生产代码一起使用。" +"GFortran,计划使用其它编译器,请参阅 [#56](https://gitlab.com/lfortran/" +"lfortran/问题/56)),它允许将 LFortran 与如今的生产代码一起使用。" #: ../../doc/src/index.md:65 msgid "" @@ -1067,7 +1067,7 @@ msgid "" "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" -"**现代硬件支持**感谢 LLVM,LFortran 的目标是在现代硬件上运行,并利用原生 " +"**现代硬件支持**:得益于 LLVM,LFortran 的目标是在现代硬件上运行,并利用原生 " "Fortran 语言结构(例如 `do concurrent`)在多核 CPU 和 GPU 上运行,请参阅 [# " "57](https://gitlab.com/lfortran/lfortran/issues/57)。" @@ -1078,7 +1078,7 @@ msgid "" "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" -"**完整的 Fortran 2018 支持** 目前只实现了 Fortran 的一个子集," +"**完整的 Fortran 2018 支持**:目前只实现了 Fortran 的一个子集," "但目标是完整实现最新的 Fortran 2018 标准,请参阅 [#58](https://gitlab.com/" "lfortran/lfortran/issue/58)。" @@ -1088,7 +1088,7 @@ msgid "" "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" -"请在我们的 [问题跟踪器](https://gitlab.com/lfortran/lfortran/issues) 中对您希" +"请在我们的 [议题跟踪器](https://gitlab.com/lfortran/lfortran/issues) 中对你希" "望我们优先考虑的问题进行投票(如果我们遗漏任何内容,请随时创建新问题)。" #: ../../doc/src/index.md:81 @@ -1157,14 +1157,15 @@ msgid "" "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" -"c) 实现所有其他很酷的功能:用于 C 和 Python 的 `use` 模块和自动包装器 " -"([#44](https://gitlab.com/lfortran/lfortran/issues/44)),现代硬件支持 ([# " -"57](https://gitlab.com/lfortran/lfortran/issues/57)),生成较旧的 Fortran " -"标准 ([#72](https://gitlab.com/lfortran/lfortran/issues/72)) , Fortran " -"doctest 功能 ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy " -"集成 ([#71](https://gitlab.com/lfortran/lfortran/issues/71))、IDE 的语言服务 " -"([#12](https://gitlab.com/lfortran/lfortran/issues/12)) 和其他想法 " -"([#29](https://gitlab.com/lfortran/lfortran/issues/29))。" +"c) 实现所有其他很酷的功能:用于 C 和 Python 的 `use` " +"模块和自动包装器([#44](https://gitlab.com/lfortran/lfortran/issues/" +"44))、现代硬件支持([# 57](https://gitlab.com/lfortran/lfortran/issues/" +"57))、生成较旧的 Fortran 标准([#72](https://gitlab.com/lfortran/lfortran/" +"issues/72))、Fortran doctest 功能([#73](https://gitlab.com/lfortran/" +"lfortran/issues/73)), SymPy 集成([#71](https://gitlab.com/lfortran/" +"lfortran/issues/71))、IDE 的语言服务([#12](https://gitlab.com/lfortran/" +"lfortran/issues/12))和其他想法([#29](https://gitlab.com/lfortran/lfortran/" +"issues/29))。" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." @@ -1184,10 +1185,10 @@ msgid "" "of summer 2019, hopefully sooner." msgstr "" "第 2 步将允许 LFortran 立即与生产代码交互使用(生产代码将使用 GFortran " -"编译,然后“使用”LFortran 中的任何模块,并且可以交互调用函数/子例程," -"模块本身可以使用任何GFortran 支持的功能,但 API 必须适合 LFortran 理解的子集 " -"--- 对于大量应用程序,带有数组参数的简单函数/子例程就足够了)。这将使 " -"LFortran 可供第一批用户使用,并且在 LFortran 支持给定功能之前," +"编译,然后“使用” LFortran 中的任何模块,并且可以交互调用函数/子例程," +"模块本身可以使用任何 GFortran 支持的功能,但 API 必须适合 LFortran " +"理解的子集 —— 对于大量应用程序,带有数组参数的简单函数/子例程就足够了)。" +"这将使 LFortran 可供第一批用户使用,并且在 LFortran 支持给定功能之前," "始终可以临时使用 GFortran。我们预计在 2019 年夏末完成第 2 步,希望能更快。" #: ../../doc/src/index.md:130 @@ -2030,14 +2031,14 @@ msgstr "`allocated(x)` 检查整数输入参数的分配状态。 " #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "类型" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 #: ../../doc/src/intrinsics/character/achar.md:39 #: ../../doc/src/intrinsics/character/char.md:40 msgid "Supported argument type is integer." -msgstr "" +msgstr "支持的参数类型是整型。" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 @@ -2086,7 +2087,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "示例" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -2100,7 +2101,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**结果**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -2153,32 +2154,32 @@ msgstr "也可以看看" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" -msgstr "" +msgstr "cshift(A, shift [, dim]): 循环移位" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." -msgstr "" +msgstr "数组元素的循环移位。" #: ../../doc/src/intrinsics/array/cshift.md:16 #: ../../doc/src/intrinsics/array/size.md:16 msgid "`A` the input array of any type or rank." -msgstr "" +msgstr "`A` 为任何类型或维度的输入数组。" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." -msgstr "" +msgstr "`shift` 为整型类型的输入值。" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." -msgstr "" +msgstr "`dim` 可选维度,如果存在,`cshift` 返回此维度的结果。" #: ../../doc/src/intrinsics/array/cshift.md:24 msgid "" "The return value is of input array type and rank as the `A` array input " "argument." -msgstr "" +msgstr "返回值与数组输入参数 `A` 的类型与维度相同。" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" @@ -2186,47 +2187,50 @@ msgid "" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" +"**cshift(A, shift [, dim])** 沿 `dim` 的维度对 `A` 数组的元素执行循环移位。" +"当 `dim` 未传递时使用,`dim` 的默认值为 1。" #: ../../doc/src/intrinsics/array/cshift.md:32 msgid "" "If the rank of array is 1, then all elements of array are shifted by " "`shift` places. If rank is greater than one, then all complexte rank one " "sections of array along the given dimension are shifted." -msgstr "" +msgstr "如果数组的维度数为 1,则数组的所有元素都会移动 `shift` 位。如果维度数大于 " +"1,则沿给定维度的数组元素都被移动。" #: ../../doc/src/intrinsics/array/cshift.md:36 msgid "" "Elements shifted out one end of each rank one section are shifted back in" " the other end." -msgstr "" +msgstr "元素从每一列的一端移出,在另一端移回。" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." -msgstr "" +msgstr "支持的参数类型是 `A` 的数组和 `shift` 和 `dim` 的整数。" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" -msgstr "" +msgstr "size(x): 数组大小" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." -msgstr "" +msgstr "返回数组 `x` 的大小。" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." -msgstr "" +msgstr "`dim` 可选维度,如果存在,`size` 返回此维度的大小。" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." -msgstr "" +msgstr "`kind` 可选返回值的种类。" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." -msgstr "" +msgstr "`n` 数组的大小(整型)。" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" @@ -2235,42 +2239,45 @@ msgid "" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" +"`size` 内部函数返回数组的大小。它返回所有维度的乘积,除非指定了 `dim` " +"参数,在这种情况下,它只返回这个特定维度的大小。 `kind` " +"参数可用于指定结果的整数类型。" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](),[reshape]()。" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "位操作内置函数" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" -msgstr "" +msgstr "bge(x, y):按位大于或等于" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." -msgstr "" +msgstr "按位大于或等于。" #: ../../doc/src/intrinsics/bit/bge.md:16 #: ../../doc/src/intrinsics/bit/bgt.md:16 #: ../../doc/src/intrinsics/bit/ble.md:16 #: ../../doc/src/intrinsics/bit/blt.md:16 msgid "`x` and `y` are integer input values. Both input values are of same kind." -msgstr "" +msgstr "`x` 和 `y` 是整数输入值。两个输入值是同一类型的。" #: ../../doc/src/intrinsics/bit/bge.md:20 #: ../../doc/src/intrinsics/bit/bgt.md:20 #: ../../doc/src/intrinsics/bit/ble.md:20 #: ../../doc/src/intrinsics/bit/blt.md:20 msgid "The return value is of type logical and of the default kind." -msgstr "" +msgstr "返回值是逻辑类型和默认类型。" #: ../../doc/src/intrinsics/bit/bge.md:24 msgid "" "`bge(x, y)` calculates if two integer input values is bitwise greater " "than or equal to another." -msgstr "" +msgstr "`bge(x, y)` 计算两个整数输入值是否按位大于或等于另一个。" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 @@ -2278,7 +2285,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:29 #: ../../doc/src/intrinsics/bit/btest.md:34 msgid "Supported input types is integer of 32 bit and 64 bit size." -msgstr "" +msgstr "支持的输入类型是 32 位和 64 位大小的整数。" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 @@ -2316,29 +2323,29 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**结果:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md),[ble](ble.md),[blt](blt.md)。" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" -msgstr "" +msgstr "bgt(x, y):按位大于" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "按位大于。" #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." -msgstr "" +msgstr "`bgt(x, y)` 计算一个整数输入值是否按位大于另一个。" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md),[ble](ble.md),[blt](blt.md)。" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" @@ -3054,7 +3061,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." -msgstr "" +msgstr "[asinh](asinh.md),[acosh](acosh.md)。" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" @@ -3088,7 +3095,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" -msgstr "" +msgstr "$x * {radix(x)}^{(-exponent(x))}$" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" @@ -3313,7 +3320,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/dim.md:29 #: ../../doc/src/intrinsics/numeric/mod.md:45 msgid "Supported argument types are real and integer." -msgstr "" +msgstr "支持的参数类型是实数和整数。" #: ../../doc/src/intrinsics/numeric/abs.md:98 #: ../../doc/src/intrinsics/numeric/aimag.md:70 From 0883900c408f9f575e99ad79ba98f4a9467eaa28 Mon Sep 17 00:00:00 2001 From: Ys413 <2020172007@stu.mdjnu.edu.cn> Date: Tue, 23 Aug 2022 05:13:48 +0000 Subject: [PATCH 18/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 64.0% (536 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 491 ++++++++++++++------------- 1 file changed, 260 insertions(+), 231 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index 06887cc104..159c1a2c26 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2022-08-26 12:30+0000\n" -"Last-Translator: 左志华 \n" +"Last-Translator: Ys413 <2020172007@stu.mdjnu.edu.cn>\n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -75,7 +75,6 @@ msgid "" msgstr "AST 必须代表所有的 ``use`` 语句和 ``interface`` 块,并保持语义一致。" #: ../../doc/src/ast_and_asr.ipynb:162 -#, fuzzy msgid "" "ASR, on the other hand, keeps track of the ``c_desc1_int32``, " "``c_desc1_t`` and ``f2b_c_wrapper`` in the symbol table and it knows they" @@ -1315,9 +1314,7 @@ msgstr "克隆 LFortran git 存储库:" msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" -msgstr "" -"Generate files that are needed for the build (this step depends on `re2c`, " -"`bison` and `python`):" +msgstr "生成构建所需的文件(此步骤取决于 `re2c`、`bison` 和 `python`):" #: ../../doc/src/installation.md:86 msgid "" @@ -1355,7 +1352,6 @@ msgstr "" "miniforge。" #: ../../doc/src/installation.md:109 -#, fuzzy msgid "Launch the Miniforge Prompt from the Desktop." msgstr "从桌面上启动 Miniforge Prompt。" @@ -1547,8 +1543,8 @@ msgid "" "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" -"如果你想不给`nix`提供机器的root权限,在Linux发行版上,我们可以使用[nix-" -"portable] (https://github.com/DavHau/nix-portable)。" +"如果你想不给`nix`提供机器的root权限,在Linux发行版上,我们可以使用 [nix-" +"portable](https://github.com/DavHau/nix-portable).。" #: ../../doc/src/installation.md:270 msgid "" @@ -1591,8 +1587,9 @@ msgid "" "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" -"我们鼓励终端用户(和发行版)使用来自 [https://lfortran.org/download/] " -"(https://lfortran.org/download/)的tarball,它只依赖于LLVM、CMake和C++编译器。" +"我们鼓励终端用户(和发行版)使用来自 [https://lfortran.org/download/" +"](https://lfortran.org/download/" +")的tarball,它只依赖于LLVM、CMake和C++编译器。" #: ../../doc/src/installation.md:303 msgid "" @@ -1612,19 +1609,16 @@ msgid "Note for users who do not use Conda" msgstr "不使用Conda的用户注意" #: ../../doc/src/installation.md:311 -#, fuzzy msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "以下是在开发模式下安装此版本库的必要依赖," #: ../../doc/src/installation.md:314 -#, fuzzy msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 -#, fuzzy msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" @@ -1633,7 +1627,6 @@ msgstr "" "llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 -#, fuzzy msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" @@ -1668,16 +1661,14 @@ msgstr "" "的说明安装先决条件后,用`-DWITH_STACKTRACE=yes` cmake选项编译LFortran。" #: ../../doc/src/installation.md:328 -#, fuzzy msgid "Ubuntu" -msgstr "Ubuntu" +msgstr "乌班图(Ubuntu)" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." msgstr "在Ubuntu系统, `apt install binutils-dev`." #: ../../doc/src/installation.md:332 -#, fuzzy msgid "macOS" msgstr "macOS" @@ -2349,84 +2340,85 @@ msgstr "[bge](bge.md),[ble](ble.md),[blt](blt.md)。" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): 位大小" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." -msgstr "" +msgstr "位大小。" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." -msgstr "" +msgstr "`x` 是整数输入值。" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." -msgstr "" +msgstr "返回值是整数类型。" #: ../../doc/src/intrinsics/bit/bit_size.md:24 msgid "" "`bit_size(x)` calculates the number of bits including sign bit of binary " "representation of `x`." -msgstr "" +msgstr "`bit_size(x)` 计算 `x` 的二进制表示的包括符号位在内的位数。" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." -msgstr "" +msgstr "支持的输入类型是整数。" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" -msgstr "" +msgstr "bge(x, y):按位小于或等于" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." -msgstr "" +msgstr "按位小于或等于。" #: ../../doc/src/intrinsics/bit/ble.md:24 msgid "" "`ble(x, y)` calculates if one integer input values is bitwise less than " "or equal to other." -msgstr "" +msgstr "`ble(x, y)` 计算一个整数输入值是否按位小于或等于另一个。" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" -msgstr "" +msgstr "blt(x, y):按位小于" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "按位小于。" #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." -msgstr "" +msgstr "`blt(x, y)` 计算一个整数输入值是否按位小于另一个。" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" -msgstr "" +msgstr "btest(x, pos):位置位测试" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "位测试。" #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" "`x` and `pos` are integer input values. Both input values are of same " "kind. `pos` represents position in `x`." -msgstr "" +msgstr "`x` 和 `pos` 是整数输入值。 两个输入值是同一种类型。 `pos` 表示在 `x` " +"中的位置。" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." -msgstr "" +msgstr "返回值是逻辑类型。" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" @@ -2434,37 +2426,40 @@ msgid "" "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" +"`btest(x, pos)` 计算输入整数值 `x` 中的 `pos` 位是否已设置。 位的计数从 0 " +"开始,至少是有效位 (LSB),即“x”中的最右边位。" #: ../../doc/src/intrinsics/bit/btest.md:29 msgid "" "If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors" " with not allowed message." -msgstr "" +msgstr "如果 `pos` 小于 0 或大于 `bit_size()`,则 `btest(x, pos)` " +"错误并显示不允许的消息。" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" -msgstr "" +msgstr "shiftl(x, shift): 左移" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." -msgstr "" +msgstr "逻辑左移函数。" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." -msgstr "" +msgstr "`x` 是一个整数输入值。" #: ../../doc/src/intrinsics/bit/shiftl.md:18 #: ../../doc/src/intrinsics/bit/shiftr.md:18 msgid "" "`shift` an unsigned integer value less than or equal to the bit size of " "`x`. The possible values are 7, 31, and 63." -msgstr "" +msgstr "`shift` 一个小于或等于 `x` 位大小的无符号整数值。 可能的值为 7、31 和 63。" #: ../../doc/src/intrinsics/bit/shiftl.md:23 #: ../../doc/src/intrinsics/bit/shiftr.md:23 msgid "The return value is of type integer and of the same kind as `x`." -msgstr "" +msgstr "返回值是整数类型,与 `x` 类型相同。" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" @@ -2473,25 +2468,29 @@ msgid "" "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" +"**shiftl(x, shift)** 逻辑上将“x”左移“shift”位数。 `shiftl` 从 LSB(**L**east " +"**S**significant **B**it) 转换为 MSB(**M**ost **S**significant **B**it)。 " +"从左端移位的位,即 MSB 位丢失。 零被附加到相反的右端。" #: ../../doc/src/intrinsics/bit/shiftl.md:34 #: ../../doc/src/intrinsics/bit/shiftr.md:34 msgid "" "Supported types in unsigned integer value `x` and unsigned integer value " "`shift` from (7, 31, 63) less than or equal to bit size of `x`." -msgstr "" +msgstr "无符号整数值`x`和无符号整数值`shift`中支持的类型(7、31、63)小于或等于`x`的" +"位大小。" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" -msgstr "" +msgstr "shiftr(x, shift): 右移" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." -msgstr "" +msgstr "逻辑右移功能。" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" @@ -2500,28 +2499,31 @@ msgid "" "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" +"**shiftr(x, shift)** 将“x”逻辑右移“shift”位数。 `shiftr` 从 MSB(**M**ost " +"**S**significant **B**it) 转换为 LSB(**L**east **S**significant **B**it)。 " +"从右端移位的位,即 LSB 位丢失。 零被附加到相对的左端。" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "字符内在函数" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." -msgstr "" +msgstr "achar(x, kind): ASCII 集中的字符。" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." -msgstr "" +msgstr "ASCII 字符集中由 表示的字符。" #: ../../doc/src/intrinsics/character/achar.md:16 msgid "" "`x`: the input value of integer type. `kind`: an optional input value of " "type integer constant expression for initialization." -msgstr "" +msgstr "`x`:整数类型的输入值。 `kind`:用于初始化的整数常量表达式类型的可选输入值。" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 @@ -2529,25 +2531,25 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "返回值" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 msgid "The return value is of type character of length 1." -msgstr "" +msgstr "返回值是长度为 1 的字符类型。" #: ../../doc/src/intrinsics/character/achar.md:24 #: ../../doc/src/intrinsics/character/char.md:25 msgid "" "The return value is of kind `kind` if optional input value is passed, " "otherwise the kind is default kind." -msgstr "" +msgstr "如果传入可选输入值,则返回值为 kind `kind`,否则为默认 kind。" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." -msgstr "" +msgstr "**achar(x, kind)** 返回由 ASCII 字符集在 `x` 位置表示的字符。" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 @@ -2555,160 +2557,165 @@ msgid "" "If `x` is outside the ASCII character set integer value, i.e., if `x` is " "not represented in the ASCII character set, the return value is " "undefined." -msgstr "" +msgstr "如果 `x` 在 ASCII 字符集整数值之外,即,如果 `x` 没有在 ASCII " +"字符集中表示,则返回值未定义。" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." -msgstr "" +msgstr "它是一个运行时内置函数。" #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" -msgstr "" +msgstr "adjustl(string): 左调整字符串" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." -msgstr "" +msgstr "左调整一个字符串。" #: ../../doc/src/intrinsics/character/adjustl.md:16 #: ../../doc/src/intrinsics/character/adjustr.md:16 msgid "`string`: the input value must be of character type." -msgstr "" +msgstr "`string`:输入值必须是字符类型。" #: ../../doc/src/intrinsics/character/adjustl.md:20 msgid "" "The return value is of type character and of the same kind as of input " "value `string`, with leading spaces removed and same number of spaces " "appended." -msgstr "" +msgstr "返回值是字符类型,与输入值`string`的类型相同,删除了前导空格并附加了相同数量" +"的空格。" #: ../../doc/src/intrinsics/character/adjustl.md:25 msgid "" "**adjustl(string)** adjusts input string by removing any leading spaces " "and appending same number of spaces." -msgstr "" +msgstr "**adjustl(string)** " +"通过删除任何前导空格并附加相同数量的空格来调整输入字符串。" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." -msgstr "" +msgstr "支持的参数类型是字符。" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" -msgstr "" +msgstr "调整器(字符串):右调整字符串" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." -msgstr "" +msgstr "右调整一个字符串。" #: ../../doc/src/intrinsics/character/adjustr.md:20 msgid "" "The return value is of type character and of the same kind as of input " "value `string`, with trailing spaces removed and same number of spaces " "added at the start." -msgstr "" +msgstr "返回值是字符类型,与输入值`string`的类型相同,删除了尾随空格并在开头添加了相" +"同数量的空格。" #: ../../doc/src/intrinsics/character/adjustr.md:26 msgid "" "**adjustr(string)** adjusts input string by removing any trailing spaces " "and adding same number of spaces at the start of the input string." -msgstr "" +msgstr "**adjustr(string)** " +"通过删除任何尾随空格并在输入字符串的开头添加相同数量的空格来调整输入字符串。" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" -msgstr "" +msgstr "char(x, [, kind]):整数到字符" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." -msgstr "" +msgstr "整数到字符的转换。" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." -msgstr "" +msgstr "`x`:整数类型的输入值。" #: ../../doc/src/intrinsics/character/char.md:18 msgid "" "`kind`: an optional input value of type integer constant expression for " "initialization. This indicates the kind parameter of the result." -msgstr "" +msgstr "`kind`:用于初始化的整数常量表达式类型的可选输入值。 这表示结果的种类参数。" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." -msgstr "" +msgstr "**char(x)** 返回由 ASCII 字符集在 `x` 位置表示的字符。" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" -msgstr "" +msgstr "len_trim(string): 忽略尾随空格的长度" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." -msgstr "" +msgstr "忽略尾随空白字符的字符串长度。" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." -msgstr "" +msgstr "`string` 字符类型的输入值。" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." -msgstr "" +msgstr "返回值是无符号整数类型。" #: ../../doc/src/intrinsics/character/len_trim.md:24 msgid "" "**len_trim(string)** returns the length of the character argument without" " including trailing blank character(s)." -msgstr "" +msgstr "**len_trim(string)** 返回字符参数的长度,不包括尾随空白字符。" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." -msgstr "" +msgstr "支持的参数类型是字符标量。" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" -msgstr "" +msgstr "lge(x, y):词法上大于或等于" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." -msgstr "" +msgstr "词法上大于或等于。" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." -msgstr "" +msgstr "`x` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." -msgstr "" +msgstr "`y` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." -msgstr "" +msgstr "`x` 和 `y` 可以看作是字符串 A 和字符串 B。" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." -msgstr "" +msgstr "返回值是逻辑 `true` 或 `false` 类型。" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." -msgstr "" +msgstr "如果 `x` 字符串在词法上大于或等于 `y`,则为 `True`。" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." -msgstr "" +msgstr "如果不是,则为`False`。" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" @@ -2716,46 +2723,49 @@ msgid "" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" +"**lge(x, y)** 确定输入字符串 `x` 在词法上是否大于或等于输入字符串 `y`。 " +"比较的两个字符串被解释为包含 ASCII 字符代码。" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." -msgstr "" +msgstr "参数类型应该是字符文字类型。" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." -msgstr "" +msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" -msgstr "" +msgstr "种类类型内在函数" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" -msgstr "" +msgstr "kind(x):实体的种类" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." -msgstr "" +msgstr "一种实体。" #: ../../doc/src/intrinsics/kind-type/kind.md:16 msgid "" "`x` the input value, can be logical, integer, real, complex, or " "character. It may be a scalar or array valued i.e., any intrinsic type." -msgstr "" +msgstr "`x` 输入值,可以是逻辑、整数、实数、复数或字符。 " +"它可以是标量或数组值,即任何内在类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." -msgstr "" +msgstr "返回值是整数类型和默认整数类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." -msgstr "" +msgstr "**kind(x)** 返回输入参数 `x` 的种类参数。" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." -msgstr "" +msgstr "支持的参数类型是逻辑、整数、实数、复数或字符。" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 @@ -2767,21 +2777,21 @@ msgstr "无。" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" -msgstr "" +msgstr "数学内在函数" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" -msgstr "" +msgstr "acos(x):三角反余弦" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." -msgstr "" +msgstr "三角反余弦(反余弦)函数。" #: ../../doc/src/intrinsics/mathematical/acos.md:16 #: ../../doc/src/intrinsics/mathematical/asin.md:16 #: ../../doc/src/intrinsics/mathematical/atan.md:16 msgid "`x` the input value, can be real or complex; less than or equal to 1." -msgstr "" +msgstr "`x` 输入值,可以是实数或复数; 小于或等于 1。" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 @@ -2792,18 +2802,19 @@ msgstr "" msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." -msgstr "" +msgstr "返回值具有输入值的种类,TYPE 可能是实数或复数。" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." -msgstr "" +msgstr "**acos(x)** 计算参数 **x** 的反正弦值。" #: ../../doc/src/intrinsics/mathematical/acos.md:27 msgid "" "The arc cosine is the inverse function of the cosine function. It is " "commonly used in trigonometry to find the angle when the lengths of the " "hypotenuse and the base side of a right triangle are known." -msgstr "" +msgstr "反余弦是余弦函数的反函数。 " +"当已知直角三角形的斜边和底边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 @@ -2812,19 +2823,19 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:33 #: ../../doc/src/intrinsics/mathematical/atanh.md:41 msgid "Supported argument types float, double, complex float, complex double." -msgstr "" +msgstr "支持的参数类型 float、double、complex float、complex double。" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." -msgstr "" +msgstr "[asin](asin.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" -msgstr "" +msgstr "acosh(x):反双曲余弦" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." -msgstr "" +msgstr "反双曲余弦函数。" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 @@ -2832,108 +2843,110 @@ msgstr "" msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." -msgstr "" +msgstr "`x` 输入值,可以是大于或等于 1 的实数,也可以是复数类型。" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." -msgstr "" +msgstr "**acosh(x)** 计算 **x** 的反双曲余弦函数。" #: ../../doc/src/intrinsics/mathematical/acosh.md:28 #: ../../doc/src/intrinsics/mathematical/asinh.md:28 #: ../../doc/src/intrinsics/mathematical/atanh.md:28 msgid "The result type and kind are the same as input value `x`." -msgstr "" +msgstr "结果类型和种类与输入值`x`相同。" #: ../../doc/src/intrinsics/mathematical/acosh.md:30 msgid "" "If the result is complex, the real part is non-negative, and the " "imaginary part is expressed in radians and lients in the range" -msgstr "" +msgstr "如果结果为复数,则实部为非负数,虚部以弧度和范围内的 lients 表示" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" -msgstr "" +msgstr "$-\\pi <= img (acosh(x)) <= \\pi$" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" -msgstr "" +msgstr "对于域 $x > 1$ 中的实数值 $x$,反双曲余弦满足:" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" -msgstr "" +msgstr "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" #: ../../doc/src/intrinsics/mathematical/acosh.md:40 msgid "" "For complex numbers $x = x + iy$, as well as real values in the domain " "$-\\infty < z <= 1$, the call $acosh(z)$ returns complex results." -msgstr "" +msgstr "对于复数 $x = x + iy$,以及域 $-\\infty < z <= 1$ 中的实数值,调用 $acosh(z)$" +" 返回复数结果。" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[asinh](asinh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" -msgstr "" +msgstr "asin(x):三角反正弦" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." -msgstr "" +msgstr "三角反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." -msgstr "" +msgstr "**asin(x)** 计算参数 **x** 的反正弦值。" #: ../../doc/src/intrinsics/mathematical/asin.md:27 msgid "" "The arcsine is the inverse function of the sine function. It is commonly " "used in trigonometry to find the angle when the lengths of the hypotenuse" " and the opposite side of a right triangle are known." -msgstr "" +msgstr "反正弦是正弦函数的反函数。 " +"当已知直角三角形的斜边和对边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." -msgstr "" +msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" -msgstr "" +msgstr "asinh(x):反双曲反正弦" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." -msgstr "" +msgstr "反双曲反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." -msgstr "" +msgstr "**asinh(x)** 计算 **x** 的反双曲反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asinh.md:30 msgid "" "If the result is complex, the real part is non-negative, and the " "imaginary part is expressed in radians and lies in the range" -msgstr "" +msgstr "如果结果为复数,则实部为非负数,虚部以弧度表示,位于范围内" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" -msgstr "" +msgstr "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" -msgstr "" +msgstr "atan(x):三角函数 ArcTangent" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." -msgstr "" +msgstr "三角反正切(反正切)函数。" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." -msgstr "" +msgstr "**atan(x)** 计算参数 **x** 的反正切。" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" @@ -2941,40 +2954,42 @@ msgid "" " commonly used in trigonometry to find the angle when the lengths of the " "opposite side of a right triangle and base are known, i.e., perpendicular" " and base length." -msgstr "" +msgstr "反正切是反正切函数的反函数。 当直角三角形的对边和底边的长度已知时,即垂直和底" +"边长度,它通常用于三角学中找到角度。" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." -msgstr "" +msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" -msgstr "" +msgstr "atan2(y, x): 反正切" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." -msgstr "" +msgstr "反正切函数或反正切函数。" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" -msgstr "" +msgstr "`y` 输入值是复数表达式的虚部" #: ../../doc/src/intrinsics/mathematical/atan2.md:17 #: ../../doc/src/intrinsics/numeric/aimag.md:29 #: ../../doc/src/intrinsics/numeric/cmplx.md:43 msgid "$x + iy$" -msgstr "" +msgstr "$x + iy$" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." -msgstr "" +msgstr "`x` 输入值,必须是复数表达式的实部。" #: ../../doc/src/intrinsics/mathematical/atan2.md:23 msgid "" "The returned value has the kind and TYPE as of the input value `y`. The " "principal value of the argument function of the complex expression $x + " "iy$ is returned." -msgstr "" +msgstr "返回值具有与输入值 `y` 相同的种类和类型。 返回复杂表达式 $x + iy$ " +"的参数函数的主值。" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" @@ -2983,81 +2998,83 @@ msgid "" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" +"**atan2(y, x)** 计算复数表达式 $x + iy$ 的参数函数的主值。 " +"这用于从笛卡尔坐标转换为极坐标,并允许确定正确象限中的角度。" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" -msgstr "" +msgstr "它也表示为:" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" -msgstr "" +msgstr "$tan^{-1}(\\frac{y}{x})$" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" -msgstr "" +msgstr "如果 `x` 不为零,则结果位于以下范围内:" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" -msgstr "" +msgstr "$-\\pi <= atan(x) <= \\pi$" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." -msgstr "" +msgstr "如果`y`为正,则符号为正。" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." -msgstr "" +msgstr "如果 `y` 为零且 `x` 严格为正,则结果为 0。" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." -msgstr "" +msgstr "如果 `x` 为负数且 `y` 为正零,则结果为 $\\pi$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." -msgstr "" +msgstr "如果 `x` 为负且 `y` 为负零,则结果为 $-\\pi$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." -msgstr "" +msgstr "如果 `x` 为零,则结果的大小为 $\\frac{\\pi}{2}$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." -msgstr "" +msgstr "如果 `y` 为负实零,则结果为 $\\frac{-\\pi}{2}$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." -msgstr "" +msgstr "支持的参数类型是真实的。" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" -msgstr "" +msgstr "atanh(x):反双曲正切" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." -msgstr "" +msgstr "反双曲正切函数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." -msgstr "" +msgstr "**atanh(x)** 计算 **x** 的反双曲正切函数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:30 msgid "" "If the result is complex, the imaginary part is expressed in radians and " "lies in the range" -msgstr "" +msgstr "如果结果为复数,则虚部以弧度表示,位于范围内" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" -msgstr "" +msgstr "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" -msgstr "" +msgstr "如果结果是真实的,它位于范围内" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" -msgstr "" +msgstr "$-1.0 < atanh(x) < 1.0$" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." @@ -3065,33 +3082,33 @@ msgstr "[asinh](asinh.md),[acosh](acosh.md)。" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" -msgstr "" +msgstr "fraction(x):模型表示中的小数部分" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." -msgstr "" +msgstr "模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." -msgstr "" +msgstr "`x` 输入值,必须是真实的。" #: ../../doc/src/intrinsics/mathematical/fraction.md:19 msgid "" "The returned value has the kind of the input value. The fractional part " "of the model representation of the input value is returned." -msgstr "" +msgstr "返回值具有输入值的种类。 返回输入值的模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." -msgstr "" +msgstr "**fraction(x)** 计算 **x** 的模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:26 #: ../../doc/src/intrinsics/numeric/erf.md:29 #: ../../doc/src/intrinsics/numeric/erfc.md:29 msgid "It is calculated using:" -msgstr "" +msgstr "它是使用以下方法计算的:" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" @@ -3099,41 +3116,41 @@ msgstr "$x * {radix(x)}^{(-exponent(x))}$" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" -msgstr "" +msgstr "其他内在函数" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" -msgstr "" +msgstr "command_argument_count():命令行参数的数量" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." -msgstr "" +msgstr "获取命令行参数的数量。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." -msgstr "" +msgstr "返回值是整数类型和默认类型。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:24 msgid "" "**command_argument_count()** returns the number of arguments passed on " "the command line when the named program was invoked." -msgstr "" +msgstr "**command_argument_count()** 返回调用指定程序时在命令行上传递的参数数量。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." -msgstr "" +msgstr "任意。" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" -msgstr "" +msgstr "cpu_time(x):CPU 运行时间" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." -msgstr "" +msgstr "CPU 运行时间(以秒为单位)。" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." -msgstr "" +msgstr "`x` 输入值应该是带有 `intent(out)` 的实数类型。" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" @@ -3142,42 +3159,50 @@ msgid "" "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" +"**cpu_time(time)** 返回一个实数值,以秒为单位表示经过的 CPU 时间。 " +"如果齿源可用,时间将以微秒分辨率报告。 如果没有可用的时间源,则将 TIME " +"设置为 -1.0。" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." -msgstr "" +msgstr "这对于测试代码段以确定计算时间很有用。" #: ../../doc/src/intrinsics/misc/cpu_time.md:30 msgid "" "For `cpu_time(time)` the absolute value is meaningless, only differences " "between subsequent calls to this subroutine, as shown in the example " "below, should be used." -msgstr "" +msgstr "`cpu_time(time)` 的绝对值是没有意义的,只有后续调用这个子程序之间的差异,如下" +"例所示,应该被使用。" #: ../../doc/src/intrinsics/misc/cpu_time.md:35 #: ../../doc/src/intrinsics/misc/date_and_time.md:55 msgid "Supported input parameter types is real with `intent(out)`." -msgstr "" +msgstr "支持的输入参数类型在 `intent(out)` 中是真实的。" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" -msgstr "" +msgstr "date_and_time([date, time, zone, values]):日期和时间" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." -msgstr "" +msgstr "日期和时间子程序。" #: ../../doc/src/intrinsics/misc/date_and_time.md:16 msgid "" "`date` the input value of character type, which has length 8 or larger. " "It is of default kind. It is `intent(out)` and has form `ccyymmdd`." msgstr "" +"`date` 字符类型的输入值,长度为 8 或更大。 它是默认类型。 它是 `intent(out)` " +"并且具有 `ccyymmdd` 的形式。" #: ../../doc/src/intrinsics/misc/date_and_time.md:19 msgid "" "`time` the input value of character type, which has length 10 or larger. " "It is of default kind. It is `intent(out)` and has form `hhmmss.sss`." msgstr "" +"`time` 字符类型的输入值,长度为 10 或更大。 它是默认类型。 它是 `intent(out)`" +" 并且具有 `hhmmss.sss` 的形式。" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" @@ -3186,134 +3211,138 @@ msgid "" "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" +"`zone` 字符类型的输入值,长度为 5 或更大。 它是默认类型。 它是 `intent(out)` " +"并且来自 `(+-)hhmm`,表示相对于坐标世界时 (UTC) 的差异。 " +"不可用的时间和日期参数返回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:27 msgid "" "`values` the input value of integer type, 8 bits. It is `intent(out)`. It" " provides the following:" -msgstr "" +msgstr "`values`整数类型的输入值,8位。 它是`intent(out)`。 它提供以下内容:" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." -msgstr "" +msgstr "`value(1)`:年份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." -msgstr "" +msgstr "`value(2)`:月份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." -msgstr "" +msgstr "`value(3)`:一个月中的哪一天。" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." -msgstr "" +msgstr "`value(4)`:与 UTC 的时差,以分钟为单位。" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." -msgstr "" +msgstr "`value(5)`:一天中的小时。" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." -msgstr "" +msgstr "`value(6)`:小时的分钟数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." -msgstr "" +msgstr "`value(7)`:分钟的秒数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." -msgstr "" +msgstr "`value(8)`:秒的毫秒数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:45 msgid "" "**date_and_time([date, time, zone, values])** reports the corresponding " "date and time information from the real time system clock." -msgstr "" +msgstr "**date_and_time([date, time, zone, values])** " +"从实时系统时钟报告相应的日期和时间信息。" #: ../../doc/src/intrinsics/misc/date_and_time.md:48 msgid "" "`date`, `time`, `zone`, `values` represents date, time, zone, and values" " as decribed in arguments above." -msgstr "" +msgstr "`date`、`time`、`zone`、`values` 表示日期、时间、区域和值,如上述参数中所述。" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." -msgstr "" +msgstr "不可用或错误的日期和时间参数返回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." -msgstr "" +msgstr "[cpu_time](cpu_time.md)." #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" -msgstr "" +msgstr "new_line(x):换行符" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." -msgstr "" +msgstr "换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:16 msgid "" "The input parameter `x` must be of type character. It can be a scalar or " "an array." -msgstr "" +msgstr "输入参数 `x` 必须是字符类型。 它可以是标量或数组。" #: ../../doc/src/intrinsics/misc/new_line.md:21 msgid "" "The return value is a character of length one with the new line character" " appended of the same kind as of `x`." -msgstr "" +msgstr "返回值是一个长度为 1 的字符,并附加了与 `x` 相同类型的换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:26 msgid "" "**new_line(x)** returns the new line character. The return value is the " "ASCII newline character." -msgstr "" +msgstr "**new_line(x)** 返回换行符。 返回值是 ASCII 换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." -msgstr "" +msgstr "支持的输入参数类型是字符。" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" -msgstr "" +msgstr "数值内在函数" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" -msgstr "" +msgstr "abs(x):绝对值" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." -msgstr "" +msgstr "绝对值。" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." -msgstr "" +msgstr "`x` 输入值,可以是整数、实数或复数。" #: ../../doc/src/intrinsics/numeric/abs.md:21 msgid "" "The return value is of type and kind same as of `x`. For complex input " "value, return value is real." -msgstr "" +msgstr "返回值的类型和种类与 `x` 相同。 对于复数输入值,返回值是实数。" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" -msgstr "" +msgstr "**abs(x)** 计算并返回 `x` 的绝对值。 结果使用数学公式计算:" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" -msgstr "" +msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" -msgstr "" +msgstr "如果 `x` 是复数,则使用数学公式计算结果:" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" -msgstr "" +msgstr "$\\sqrt{(x^2 + y^2)}$" #: ../../doc/src/intrinsics/numeric/abs.md:37 #: ../../doc/src/intrinsics/numeric/digits.md:28 @@ -3326,27 +3355,27 @@ msgstr "支持的参数类型是实数和整数。" #: ../../doc/src/intrinsics/numeric/aimag.md:70 #: ../../doc/src/intrinsics/numeric/mod.md:97 msgid "[ceiling](ceiling.md), [floor](floor.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [floor](floor.md)." #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" -msgstr "" +msgstr "目标: 第一部分" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." -msgstr "" +msgstr "复数的虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." -msgstr "" +msgstr "`x` ,输入值必须是复合类型。" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." -msgstr "" +msgstr "返回值是类型为实数的虚数部分,种类与`x` 相同。" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." -msgstr "" +msgstr "**aimag(x)** 返回输入复参数 `x` 的虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 @@ -3354,25 +3383,25 @@ msgstr "" msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" -msgstr "" +msgstr "对于 `x` 复数输入值,使用数学公式计算结果:" #: ../../doc/src/intrinsics/numeric/aimag.md:31 #: ../../doc/src/intrinsics/numeric/cmplx.md:45 #: ../../doc/src/intrinsics/numeric/conjg.md:31 msgid "$i$ the imaginary part is the result." -msgstr "" +msgstr "$i$ 虚部是结果。" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." -msgstr "" +msgstr "支持的参数类型很复杂。" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" -msgstr "" +msgstr "aint(x, [kind]):截断为整数" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." -msgstr "" +msgstr "截断到一个整数。" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 @@ -3381,36 +3410,37 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:16 #: ../../doc/src/intrinsics/numeric/floor.md:16 msgid "`x` the input value must be of type real." -msgstr "" +msgstr "`x` ,输入值必须是实数类型。" #: ../../doc/src/intrinsics/numeric/aint.md:18 #: ../../doc/src/intrinsics/numeric/anint.md:18 msgid "`kind` the optional input parameter initialises the kind of the result." -msgstr "" +msgstr "`kind` 可选的输入参数,初始化结果的种类。" #: ../../doc/src/intrinsics/numeric/aint.md:22 #: ../../doc/src/intrinsics/numeric/anint.md:22 msgid "" "The return value is of type integer(kind) if kind is passed as input " "parameter. If not, default kind real is returned." -msgstr "" +msgstr "如果 kind 作为输入参数传递,则返回值是 integer(kind) 类型。如果不是," +"则返回默认类型 real。" #: ../../doc/src/intrinsics/numeric/aint.md:25 msgid "" "The return value is equal to or nearest largest whole number greater than" " or equal to `x` not exceeding its magnitude." -msgstr "" +msgstr "返回值等于或最接近大于或等于 `x` 且不超过其大小的最大整数。" #: ../../doc/src/intrinsics/numeric/aint.md:30 msgid "" "**aint(x)** returns the nearest largest whole number greater than or " "equal to `x` not exceeding input value's magnitude." -msgstr "" +msgstr "**aint(x)** 返回大于或等于 `x` 且不超过输入值大小的最接近的最大整数。" #: ../../doc/src/intrinsics/numeric/aint.md:33 #: ../../doc/src/intrinsics/numeric/anint.md:36 msgid "The optional parameter `kind` specifies the kind of the result." -msgstr "" +msgstr "可选参数`kind` ,指定结果的种类。" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 @@ -3420,38 +3450,38 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." -msgstr "" +msgstr "支持的参数类型是真实的。" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" -msgstr "" +msgstr "anint(x, [kind]):四舍五入到最近的整数" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." -msgstr "" +msgstr "四舍五入到最近的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." -msgstr "" +msgstr "返回值等于四舍五入的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." -msgstr "" +msgstr "**anint(x)** 计算输入参数 `x` 的舍入值。" #: ../../doc/src/intrinsics/numeric/anint.md:31 msgid "" "If `x` is less than or equal to 0 i.e., if `x` is negative or 0, " "`anint(x)` returns `aint(x - 0.5)`." -msgstr "" +msgstr "如果`x` 小于或等于0,即如果`x` 是负数或0,`anint(x)` 返回`aint(x - 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." -msgstr "" +msgstr "如果`x` 大于0,`anint(x)` 返回`aint(x + 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." @@ -4760,7 +4790,6 @@ msgid "Directory: `tests/intrinsic/nint`" msgstr "" #: ../../doc/src/progress.md -#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" From 6f596c0be7cc88fb777050013d0e181f77805466 Mon Sep 17 00:00:00 2001 From: Asdrubal Lozada-Blanco Date: Tue, 23 Aug 2022 12:06:51 +0000 Subject: [PATCH 19/46] Translated using Weblate (Spanish) Currently translated at 41.4% (347 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/es/ --- doc/locale/es/LC_MESSAGES/docs.po | 629 +++++++++++++++++++++++------- 1 file changed, 484 insertions(+), 145 deletions(-) diff --git a/doc/locale/es/LC_MESSAGES/docs.po b/doc/locale/es/LC_MESSAGES/docs.po index b0d837eb2f..9cd7898ef8 100644 --- a/doc/locale/es/LC_MESSAGES/docs.po +++ b/doc/locale/es/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" +"PO-Revision-Date: 2022-08-27 14:18+0000\n" "Last-Translator: Asdrubal Lozada-Blanco \n" "Language-Team: Spanish \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -755,10 +755,14 @@ msgid "" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" +"Nota: También puede ser una unidad de programa de _bloques de datos_, que se " +"utiliza para proporcionar valores iniciales para objetos de datos en " +"_bloques comunes_ con nombre, pero no recomendamos el uso de _bloques " +"comunes_ (utilice módulos en su lugar)." #: ../../doc/src/design.md:124 msgid "LFortran Extension" -msgstr "" +msgstr "Extensión LFortran" #: ../../doc/src/design.md:126 msgid "" @@ -767,22 +771,26 @@ msgid "" "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" +"Extendemos el lenguaje Fortran introduciendo un _alcance global_, que no es " +"sola la lista de _unidades de programa_ (como en F2800) sino que puede " +"también incluir declaraciones, expresiones y declaraciones de uso. Definimos " +"_alcance global_ como una colección de los elementos siguientes:" #: ../../doc/src/design.md:134 msgid "use statement" -msgstr "" +msgstr "declaración de uso" #: ../../doc/src/design.md:135 msgid "declaration" -msgstr "" +msgstr "declaración" #: ../../doc/src/design.md:136 msgid "statement" -msgstr "" +msgstr "declaración" #: ../../doc/src/design.md:137 msgid "expression" -msgstr "" +msgstr "expresión" #: ../../doc/src/design.md:139 msgid "" @@ -793,6 +801,13 @@ msgid "" "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" +"Además, si una variable no está definida en una instrucción de asignación (" +"como `x = 5+3`), el tipo de variable se deduce del lado derecho (por " +"ejemplo, `x` en `x = 5+3`). ` sería de tipo `integer`, y `y` en `y = 5._dp` " +"sería de tipo `real(dp)`). Esta regla solo se aplica en el nivel superior de " +"_alcance global_. Los tipos deben especificarse completamente dentro de los " +"programas, módulos, funciones y subrutinas principales, al igual que en " +"F2008." #: ../../doc/src/design.md:146 msgid "" @@ -801,24 +816,34 @@ msgid "" "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" +"El _alcance global_ tiene su propia tabla de símbolos. El programa principal " +"y el módulo/submódulo no ven ningún símbolo de esta tabla de símbolos. Pero " +"las funciones, subrutinas, declaraciones y expresiones en el nivel superior " +"del _alcance global_ usan y operan en esta tabla de símbolos." #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" +"El _alcance global_ tiene los siguientes símbolos predefinidos en la tabla " +"de símbolos:" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" +"el conjunto estándar habitual de funciones de Fortran (como `size`, `sin`, " +"`cos`, ...)" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" +"el símbolo de doble precisión `dp`, por lo que se puede usar `5._dp` para " +"doble precisión." #: ../../doc/src/design.md:158 msgid "" @@ -832,6 +857,15 @@ msgid "" "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" +"Cada elemento del _alcance global_ se interpreta de la siguiente manera: el " +"programa principal se compila en un ejecutable con el mismo nombre y se " +"ejecuta; se compilan y cargan módulos, funciones y subrutinas; use sentencia " +"y declaración agrega esos símbolos con el tipo adecuado en la tabla de " +"símbolos _alcance global_, pero no genera ningún código; la declaración se " +"envuelve en una subrutina anónima sin argumentos, se compila, se carga y se " +"ejecuta; expresión se envuelve en una función anónima sin argumentos que " +"devuelven la expresión, compilada, cargada, ejecutada y el valor de retorno " +"se devuelve al usuario." #: ../../doc/src/design.md:168 msgid "" @@ -843,30 +877,37 @@ msgid "" "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" +"El _alcance global_ siempre se interpreta, elemento por elemento, según el " +"párrafo anterior. Está destinado a permitir el uso interactivo, la " +"experimentación y la escritura de scripts simples. El código en _alcance " +"global_ debe interpretarse usando `lfortran`. Para código más complejo (de " +"producción), se recomienda convertirlo en módulos y programas (envolviendo " +"sentencias sueltas en subrutinas o funciones y agregando declaraciones de " +"tipo) y compilarlo con `lfortran` o cualquier otro compilador de Fortran." #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" -msgstr "" +msgstr "Aquí algunos ejemplos de código válidos en _alcance global_:" #: ../../doc/src/design.md:178 msgid "Example 1" -msgstr "" +msgstr "Ejemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" -msgstr "" +msgstr "Ejemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" -msgstr "" +msgstr "Ejemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" -msgstr "" +msgstr "Ejemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" -msgstr "" +msgstr "Consideraciones de diseño" #: ../../doc/src/design.md:219 msgid "" @@ -877,6 +918,12 @@ msgid "" "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" +"La extensión LFortran de Fortran se eligió de manera que se minimice el " +"número de cambios. En particular, solo el nivel superior del _alcance " +"global_ ha relajado algunas de las reglas de Fortran (como hacer que la " +"especificación de tipos sea opcional) para permitir un uso interactivo " +"simple y rápido, pero dentro de las funciones, subrutinas, módulos o " +"programas, esta relajación no se aplica." #: ../../doc/src/design.md:225 msgid "" @@ -885,20 +932,26 @@ msgid "" "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" +"El número de cambios se mantuvo al mínimo para que sea sencillo convertir el " +"código en _alcance global_ en código Fortran compatible con el estándar " +"utilizando programas y módulos, de modo que pueda ser compilado por " +"cualquier compilador de Fortran." #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" -msgstr "" +msgstr "Tutorial para desarrolladores" #: ../../doc/src/developer_tutorial.ipynb:11 msgid "" "This is a tutorial for anybody who wants to either develop LFortran or " "build tools on top." msgstr "" +"Este es un tutorial para cualquiera que quiera desarrollar LFortran o " +"construir herramientas sobre este." #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" -msgstr "" +msgstr "Introducción" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" @@ -906,6 +959,9 @@ msgid "" "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" +"Árbol de sintaxis abstracta (AST): Representa cualquier código fuente " +"Fortran, basado estrictamente en la sintaxis, la semántica no está incluida. " +"El módulo AST puede convertirse en código fuente de Fortran." #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" @@ -913,59 +969,69 @@ msgid "" " code, all semantic is included. Invalid Fortran code is not allowed (an " "error will be given). The ASR module can convert itself to an AST." msgstr "" +"Representación de semántica abstracta (ASR): Representa un código fuente " +"Fortran válido, toda la semántica está incluida. Código Fortran inválido no " +"es permitido (un error será emitido). El módulo ASR puede convertirse en un " +"AST." #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" +"Código fuente Fortran puede ser analizado en un AST usando la función " +"``src_to_ast()``:" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" -msgstr "" +msgstr "Podemos imprimir usando el truco ``%%showast``:" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" -msgstr "" +msgstr "Podemos convertir un AST a código fuente Fortran usando ``%%showfmt``:" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" +"Todos los nodos AST y sus argumentos están descritos en `AST.asdl " +"`__." #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" -msgstr "" +msgstr "Podemos imprimir usando el truco ``%%showasr``:" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" +"Todos los nodos ASR y sus argumentos están descritos en `ASR.asdl " +"`__." #: ../../doc/src/index.md:134 msgid "Getting started" -msgstr "" +msgstr "Iniciando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" -msgstr "" +msgstr "Estado del desarrollo de LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" -msgstr "" +msgstr "Guía del desarrollador" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "" +msgstr "Intrínsecos de LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" -msgstr "" +msgstr "Documentación de LFortran" #: ../../doc/src/index.md:3 msgid "" @@ -975,6 +1041,12 @@ msgid "" "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" +"LFortran es un moderno compilador interactivo de Fortran de código abierto (" +"bajo la licencia BSD) construido sobre LLVM. Este puede ejecutar código de " +"usuario interactivamente para permitir trabajo exploratório (similar a " +"Python, MATLAB o Julia) , así como compilar para generar archivos binarios " +"con el objetivo de ejecutar el código de usuario en arquitecturas modernas, " +"como CPU y GPU de varios núcleos." #: ../../doc/src/index.md:9 #, python-format @@ -986,6 +1058,11 @@ msgid "" "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" +"Página web: [https://lfortran.org/](https://lfortran.org/) Main repository:" +" [https://github.com/lfortran/lfortran](https://github.com/lfortran/lfortran)" +" Try online using Binder: [![Binder](https://mybinder.org/badge_logo." +"svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/" +"master?filepath=Demo.ipynb)" #: ../../doc/src/index.md:9 msgid "Binder" @@ -993,7 +1070,7 @@ msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" -msgstr "" +msgstr "Características destacadas" #: ../../doc/src/index.md:18 msgid "" @@ -1002,10 +1079,14 @@ msgid "" "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" +"LFortran está en desarrollo, hay características que funcionan actualmente y " +"hay características que se están implementando. También puede consultar la " +"sección [Estado de desarrollo](progress.md) para obtener más información " +"sobre las funciones compatibles y en las que se está trabajando." #: ../../doc/src/index.md:21 msgid "Works today" -msgstr "" +msgstr "Trabajando actualmente" #: ../../doc/src/index.md:23 #, python-format @@ -1018,6 +1099,14 @@ msgid "" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" +"**Interactivo, compatible con Jupyter** LFortran se puede usar desde Jupyter " +"como un kernel de Fortran, lo que permite un flujo de trabajo exploratorio y " +"de creación rápida de prototipos al estilo de Python/Julia (ver " +"[static](https://nbviewer.jupyter.org/gist/certik " +"/f1d28a486510810d824869ab0c491b1c) o [interactivo](https://mybinder.org/v2/" +"gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) cuaderno de " +"ejemplo). O se puede usar desde la línea de comandos en un indicador " +"interactivo (REPL)." #: ../../doc/src/index.md:32 msgid "" @@ -1028,6 +1117,13 @@ msgid "" "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" +"**Diseño limpio y modular, utilizable como biblioteca** LFortran está " +"estructurado en torno a dos módulos independientes, AST y ASR, ambos " +"independientes (completamente independientes del resto de LFortran) y se " +"recomienda a los usuarios que los utilicen de forma independiente para otras " +"aplicaciones y construir herramientas en la parte superior. Consulte los " +"documentos [Diseño](design.md) y [Tutorial para " +"desarrolladores](developer_tutorial.md) para obtener más detalles." #: ../../doc/src/index.md:39 msgid "" @@ -1036,28 +1132,38 @@ msgid "" "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" +"**Interoperación con GFortran** LFortran puede analizar los archivos del " +"módulo GFortran en una ASR y generar un contenedor Fortran que se puede " +"compilar con cualquier compilador Fortran y vincular con el módulo compilado " +"GFortran original." #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" +"**Crear ejecutables** Puede crear ejecutables como otros compiladores de " +"Fortran." #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" +"**Se ejecuta en Linux, Mac y Windows** Las tres plataformas son probadas " +"regularmente por nuestro CI." #: ../../doc/src/index.md:51 msgid "Planned" -msgstr "" +msgstr "Planificación" #: ../../doc/src/index.md:53 msgid "" "These features are under development, there is a link to the " "corresponding issue so that you can track the progress by following it." msgstr "" +"Estas características están en desarrollo, hay un enlace al problema " +"correspondiente para que pueda seguir el avance." #: ../../doc/src/index.md:56 msgid "" @@ -1070,6 +1176,15 @@ msgid "" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" +"**Interoperación nativa con otros lenguajes (y otros compiladores de " +"Fortran)** Esta puede puede llamar automáticamente código escrito en otros " +"lenguajes (tales como C o Python) simplemente usando la instrucción `use`, " +"ver [#44](https://gitlab.com/lfortran/lfortran/issues/44). Comprende otros " +"archivos de módulos de compiladores de Fortran (uno puede simplemente " +"\"usarlos\") y su ABI para enlazar correctamente (se admite GFortran, se " +"planean otros compiladores, consulte [# 56](https://gitlab.com/lfortran/" +"lfortran/ issues/56)), que permite utilizar LFortran con códigos de " +"producción en la actualidad." #: ../../doc/src/index.md:65 msgid "" @@ -1078,6 +1193,11 @@ msgid "" "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" +"**Compatibilidad con hardware moderno** Gracias a LLVM, el objetivo de " +"LFortran es ejecutarse en hardware moderno y aprovechar las construcciones " +"nativas del lenguaje Fortran (como `do concurrent`) para ejecutarse en CPU y " +"GPU multinúcleo, consulte [# 57](https://gitlab.com/lfortran/lfortran/issues/" +"57)." #: ../../doc/src/index.md:71 msgid "" @@ -1086,6 +1206,10 @@ msgid "" "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" +"**Compatibilidad completa con Fortran 2018** Actualmente solo se implementa " +"un subconjunto de Fortran, pero el objetivo es tener una implementación " +"completa del último estándar de Fortran 2018, consulte [#58](https://gitlab." +"com/lfortran/lfortran /temas/58)." #: ../../doc/src/index.md:77 msgid "" @@ -1093,14 +1217,19 @@ msgid "" "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" +"Vote sobre los problemas en nuestro [seguidor de problemas](https://gitlab." +"com/lfortran/lfortran/issues) que desea que prioricemos (no dude en crear " +"nuevos si nos falta algo)." #: ../../doc/src/index.md:81 msgid "Roadmap" -msgstr "" +msgstr "Guía" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" +"Aquí está nuestra guía sobre cómo implementar todas las funciones " +"planificadas anteriormente:" #: ../../doc/src/index.md:85 msgid "" @@ -1109,6 +1238,10 @@ msgid "" "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" +"Generación de código de puerto para usar una ASR y pasar todas las pruebas " +"actuales ([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Elimine la " +"generación de código anterior y la semántica anterior, que solía anotar el " +"árbol AST, que estaba desordenado." #: ../../doc/src/index.md:89 msgid "" @@ -1117,16 +1250,23 @@ msgid "" "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" +"Obtenga los archivos del módulo GFortran que funcionan con el módulo `use`, " +"tanto matrices de tamaño supuesto como de forma supuesta " +"([#52](https://gitlab.com/lfortran/lfortran/issues/52)). Esto permitirá de " +"inmediato utilizar códigos de producción con LFortran." #: ../../doc/src/index.md:93 msgid "Do these at the same time:" -msgstr "" +msgstr "Hacer esto al mismo tiempo:" #: ../../doc/src/index.md:95 msgid "" "a) Implement more Fortran features, until eventually full Fortran 2018 is" " supported ([#58](https://gitlab.com/lfortran/lfortran/issues/58))." msgstr "" +"a) Implementar más funciones de Fortran, hasta que finalmente se admita " +"Fortran 2018 completo ([#58](https://gitlab.com/lfortran/lfortran/issues/" +"58))." #: ../../doc/src/index.md:98 msgid "" @@ -1135,6 +1275,10 @@ msgid "" "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" +"b) Muévase gradualmente a C++ para obtener robustez y velocidad " +"([#70](https://gitlab.com/lfortran/lfortran/issues/70)). La API de Python no " +"cambiará (o solo mínimamente), por lo que la experiencia del usuario de " +"Python no cambiará." #: ../../doc/src/index.md:103 msgid "" @@ -1150,10 +1294,20 @@ msgid "" "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" +"c) Implemente todas las demás funciones interesantes: módulo `use` para C y " +"Python y envoltorios automáticos ([#44](https://gitlab.com/lfortran/lfortran/" +"issues/44)), soporte de hardware moderno ([# 57](https://gitlab.com/lfortran/" +"lfortran/issues/57)), generando un estándar anterior de Fortran " +"([#72](https://gitlab.com/lfortran/lfortran/issues/72)) , función de prueba " +"de documentos de Fortran ([#73](https://gitlab.com/lfortran/lfortran/issues/" +"73)), integración de SymPy ([#71](https://gitlab.com/lfortran/lfortran/" +"issues/ 71)), servicio de lenguaje para IDE ([#12](https://gitlab.com/" +"lfortran/lfortran/issues/12)), y otras ideas ([#29](https://gitlab.com/" +"lfortran /lfortran/issues/29))." #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." -msgstr "" +msgstr "El paso 1. es una restauración interna que no llevará mucho tiempo." #: ../../doc/src/index.md:120 msgid "" @@ -1168,6 +1322,17 @@ msgid "" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" +"El paso 2 permitirá que LFortran se use de forma interactiva con los códigos " +"de producción de inmediato (el código de producción se compilará con " +"GFortran, luego uno \"usa\" cualquier módulo en LFortran y las funciones/" +"subrutinas se pueden llamar de forma interactiva, el módulo en sí puede usar " +"cualquier Función compatible con GFortran, pero la API debe encajar en el " +"subconjunto que comprende LFortran --- para una gran cantidad de " +"aplicaciones, las funciones/subrutinas simples con argumentos de matriz son " +"suficientes). Esto hará que LFortran sea utilizable para los primeros " +"usuarios y siempre se puede usar GFortran temporalmente hasta que LFortran " +"admita la función dada. Esperamos terminar con el paso 2 a fines del verano " +"de 2019, con suerte antes." #: ../../doc/src/index.md:130 msgid "" @@ -1175,18 +1340,22 @@ msgid "" "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" +"Finalmente, el paso 3 mejorará LFortran en general, permitiendo que los " +"primeros usuarios contribuyan, haciendo crecer la comunidad y haciendo que " +"LFortran sea gradualmente útil para más y más personas." #: ../../doc/src/installation.md:1 msgid "Installation" -msgstr "" +msgstr "Instalación" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" +"Todas las instruciones a continuación funcionan en Linux, macOS y Windows." #: ../../doc/src/installation.md:5 msgid "Binaries" -msgstr "" +msgstr "Binarios" #: ../../doc/src/installation.md:7 msgid "" @@ -1197,10 +1366,15 @@ msgid "" "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" +"La forma recomendada de instalar LFortran es usando Conda. Instale Conda, " +"por ejemplo, instalando la instalación de [Miniconda](https://conda.io/en/" +"latest/miniconda.html) siguiendo las instrucciones allí para su plataforma. " +"Luego cree un nuevo entorno (puede elegir cualquier nombre, aquí elegimos " +"`lf`) y actívelo:" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" -msgstr "" +msgstr "Luego instale LFortran haciendo:" #: ../../doc/src/installation.md:20 msgid "" @@ -1208,24 +1382,29 @@ msgid "" "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" +"Ahora que el entorno `lf` tiene disponible el compilador `lfortran`, puede " +"iniciar el aviso interactivo ejecutando `lfortran`, o ver las opciones de la " +"línea de comando usando `lfortran -h`." #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" +"El núcleo Jupyter es automáticamente instalado con el comando anterior, por " +"lo que después de instalar Jupyter:" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" -msgstr "" +msgstr "Puede crear un cuaderno Jupyter basado en Fortran ejecutando:" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "" +msgstr "y seleccionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" -msgstr "" +msgstr "Construir desde una fuente de archivo tar" #: ../../doc/src/installation.md:37 msgid "" @@ -1234,72 +1413,86 @@ msgid "" "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" +"Este método es el método recomendado si solo desea instalar LFortran, ya sea " +"usted mismo o en un administrador de paquetes (Spack, Conda, Debian, etc.). " +"La fuente de archivo tar tiene todos los archivos generados incluidos y " +"tiene dependencias mínimas." #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" -msgstr "" +msgstr "Primero tenemos que instalar dependencias, por ejemplo usando Conda:" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" +"Luego descargue un archivo tar de [https://lfortran.org/download/" +"](https://lfortran.org/download/), por ejemplo:" #: ../../doc/src/installation.md:52 msgid "And build:" -msgstr "" +msgstr "Y construir:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." -msgstr "" +msgstr "Esto instalará `lfortran` en `inst/bin`." #: ../../doc/src/installation.md:60 msgid "Build From Git" -msgstr "" +msgstr "Construir desde Git" #: ../../doc/src/installation.md:62 msgid "" "We assume you have C++ compilers installed, as well as `git` and `wget`. " "In Ubuntu, you can also install `binutils-dev` for stacktraces." msgstr "" +"Suponemos que tiene instalados compiladores de C++, así como `git` y `wget`. " +"En Ubuntu, también puede instalar `binutils-dev` para stacktraces." #: ../../doc/src/installation.md:65 msgid "" "If you do not have Conda installed, you can do so on Linux (and similarly" " on other platforms):" msgstr "" +"Si no tiene Conda instalado, puede hacerlo en Linux (y de manera similar en " +"otras plataformas):" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" -msgstr "" +msgstr "Luego prepara el ambiente:" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" -msgstr "" +msgstr "Clone el repositorio git de LFortran:" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" +"Genere los archivos necesarios para la compilación (este paso depende de " +"`re2c`, `bison` y `python`):" #: ../../doc/src/installation.md:86 msgid "" "Now the process is the same as installing from the source tarball. For " "example to build in Debug mode:" msgstr "" +"Ahora el proceso es el mismo que el de la instalación desde el tarball de " +"origen. Por ejemplo, para compilar en modo de depuración:" #: ../../doc/src/installation.md:92 msgid "Run tests:" -msgstr "" +msgstr "Ejecutar pruebas:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" -msgstr "" +msgstr "Ejecute un aviso interactivo:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" -msgstr "" +msgstr "Cree desde Git en Windows con Visual Studio" #: ../../doc/src/installation.md:104 msgid "" @@ -1307,40 +1500,45 @@ msgid "" "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" +"Instale Visual Studio (MSVC), por ejemplo la versión 2022, puede descargar " +"la versión Community de forma gratuita desde: https://visualstudio.microsoft." +"com/downloads/." #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" +"Instale miniforge usando el instalador de Windows desde https://github.com/" +"conda-forge/miniforge." #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." -msgstr "" +msgstr "Inicie el indicador de Miniforge desde el escritorio." #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" -msgstr "" +msgstr "En la interfaz, inicialice el compilador MSVC usando:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" -msgstr "" +msgstr "Opcionalmente, puede probar que MSVC funciona:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." -msgstr "" +msgstr "Ambos comandos deben imprimir ayuda (varias páginas)." #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" -msgstr "" +msgstr "Ahora puede descargar y compilar LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" -msgstr "" +msgstr "Si todo está compilado, puede usar LFortran de la siguiente manera:" #: ../../doc/src/installation.md:140 msgid "And so on." -msgstr "" +msgstr "Y así." #: ../../doc/src/installation.md:142 msgid "" @@ -1348,6 +1546,9 @@ msgid "" "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" +"Nota: LFortran actualmente usa el programa enlazador de MSVC (`link`), que " +"solo está disponible cuando se ejecuta el script bat de MSVC anterior. Si " +"olvida activarlo, la vinculación de LFortran fallará." #: ../../doc/src/installation.md:146 msgid "" @@ -1357,10 +1558,15 @@ msgid "" "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" +"Nota: la terminal de miniforge parece estar ejecutando alguna versión de " +"`git-bash` (aunque es `cmd.exe`), que tiene un sistema de archivos tipo Unix " +"montado en `/usr` y varios comandos disponibles como `ls` , `cuál`, `git`, " +"`vim`. Por esta razón, la compilación de Conda `environment_win.yml` " +"contiene todo lo necesario, incluido `git`." #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" -msgstr "" +msgstr "Construya desde Git en Windows con WSL" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." @@ -1368,105 +1574,115 @@ msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." -msgstr "" +msgstr "Marque el subsistema de Windows para Linux." #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." -msgstr "" +msgstr "Presione Aceptar y reinicie la computadora." #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." -msgstr "" +msgstr "Vaya a la tienda de Microsoft, descargue Ubuntu 20.04 y ejecútelo." #: ../../doc/src/installation.md:157 msgid "Run the following commands." -msgstr "" +msgstr "Ejecute los siguientes comandos." #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" -msgstr "" +msgstr "Ahora haga lo siguiente para configurar la ruta" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" -msgstr "" +msgstr "Luego ve al final del archivo y pega lo siguiente" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" -msgstr "" +msgstr "Luego presione ctrl + O (guardar), Enter (confirmar), ctrl + X (salir)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" -msgstr "" +msgstr "Después de eso, reinicie Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" -msgstr "" +msgstr "Ejecute lo siguiente" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "" +msgstr "Reinicie Ubuntu de nuevo" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" +"Puede cambiar el directorio a una ubicación de Windows usando `cd /mnt/[" +"letra de unidad]/[ubicación de Windows]`." #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" -msgstr "" +msgstr "p.ej. `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" -msgstr "" +msgstr "Ahora clone el repositorio LFortran git" #: ../../doc/src/installation.md:196 msgid "Run the following commands" -msgstr "" +msgstr "Ejecute los siguientes comandos" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" -msgstr "" +msgstr "Si todo se compila, puede usar LFortran de la siguiente manera" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" -msgstr "" +msgstr "Ejecutar un aviso interactivo" #: ../../doc/src/installation.md:215 msgid "Run tests" -msgstr "" +msgstr "Ejecutar pruebas" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" -msgstr "" +msgstr "Habilitación del núcleo de Jupyter" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" +"Para instalar el kernel de Jupyter, instale también los siguientes paquetes " +"de Conda:" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" +"y habilite el núcleo con `-DWITH_XEUS=yes` e instálelo en `$CONDA_PREFIX`. " +"Por ejemplo:" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" +"Para usarlo, instale Jupyter (`conda install jupyter`) y pruebe que se " +"encontró el núcleo de LFortran:" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" -msgstr "" +msgstr "Luego inicie un cuaderno Jupyter de la siguiente manera:" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" +"Haga clic en `New->Fortran`. Para iniciar una consola terminal jupyter " +"LFortran:" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" -msgstr "" +msgstr "Construir desde Git con Nix" #: ../../doc/src/installation.md:256 msgid "" @@ -1475,6 +1691,10 @@ msgid "" "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" +"Una de las formas de garantizar el entorno y las dependencias exactos es con " +"`nix`. Esto garantizará que las dependencias del sistema no interfieran con " +"el entorno de desarrollo. Si lo desea, puede informar de errores en un " +"entorno `nix-shell` para que sea más fácil para otros reproducirlos." #: ../../doc/src/installation.md:258 msgid "With Root" @@ -1486,6 +1706,9 @@ msgid "" "work on any machine with a Linux distribution, MacOS or Windows (via " "WSL):" msgstr "" +"Empezamos por obtener `nix`. La siguiente instalación multiusuario " +"funcionará en cualquier máquina con una distribución de Linux, MacOS o " +"Windows (a través de WSL):" #: ../../doc/src/installation.md:264 msgid "Without Root" @@ -1497,40 +1720,49 @@ msgid "" "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" +"Si no desea proporcionar a `nix` acceso raíz a su máquina, en las " +"distribuciones de Linux podemos usar [nix-portable](https://github.com/" +"DavHau/nix-portable)." #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" +"Ahora solo anteponga todos los comandos `nix-shell` con `NP_RUNTIME=bwrap " +"./nix-portable`. Asi que:" #: ../../doc/src/installation.md:278 msgid "Development" -msgstr "" +msgstr "Desarrollo" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" -msgstr "" +msgstr "Ahora podemos entrar en el entorno de desarrollo:" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" +"El indicador `--pure` garantiza que no se utilicen dependencias del sistema " +"en el entorno." #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" -msgstr "" +msgstr "Los pasos de compilación son los mismos que con el `ci`:" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" +"Para cambiar el entorno de compilación de `gcc` (predeterminado) a `clang` " +"podemos usar `--argstr`:" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" -msgstr "" +msgstr "Nota sobre las dependencias" #: ../../doc/src/installation.md:299 msgid "" @@ -1538,6 +1770,9 @@ msgid "" "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" +"Se alienta a los usuarios finales (y las distribuciones) a usar el archivo " +"tar de [https://lfortran.org/download/](https://lfortran.org/download/), que " +"solo depende de LLVM, CMake y un compilador de C++." #: ../../doc/src/installation.md:303 msgid "" @@ -1545,34 +1780,42 @@ msgid "" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" +"El archivo tar es generado automáticamente por nuestro CI (integración " +"continua) y contiene algunos archivos generados automáticamente: el " +"analizador, los nodos AST y ASR, que es generado por un traductor ASDL (" +"requiere Python)." #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." -msgstr "" +msgstr "Las instrucciones de git deben usarse al desarrollar LFortran en sí." #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" -msgstr "" +msgstr "Nota para usuarios que no utilizan Conda" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" +"Las siguientes son las dependencias necesarias para instalar este " +"repositorio en modo de desarrollo," #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" -msgstr "" +msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" msgstr "" +"[LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/" +"llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" -msgstr "" +msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" @@ -1581,6 +1824,10 @@ msgid "" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" +"[binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2." +"31.90.tar.xz): asegúrese de habilitar las opciones necesarias relacionadas " +"con esta dependencia para crear la dinámica bibliotecas (las que terminan en " +"`.so`)." #: ../../doc/src/installation.md:319 msgid "Stacktraces" @@ -1596,18 +1843,25 @@ msgid "" "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" +"LFortran puede imprimir stacktraces cuando hay una excepción no controlada, " +"así como en cualquier error del compilador con la opción `--show-stacktrace`" +". Esto es muy útil para desarrollar el propio compilador para ver dónde está " +"el problema en LFortran. La compatibilidad con stacktrace está desactivada " +"de manera predeterminada; para habilitarla, compile LFortran con la opción " +"cmake `-DWITH_STACKTRACE=yes` después de instalar los requisitos previos en " +"cada plataforma según las instrucciones a continuación." #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." -msgstr "" +msgstr "En Ubuntu, `apt install binutils-dev`." #: ../../doc/src/installation.md:332 msgid "macOS" -msgstr "" +msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" @@ -1617,18 +1871,29 @@ msgid "" "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" +"Si usa el compilador Clang predeterminado en macOS, entonces los " +"seguimientos de pila deberían funcionar tanto en macOS basados en Intel como " +"en M1 (el sistema de compilación CMake invoca automáticamente la herramienta " +"`dsymtuil` y nuestras secuencias de comandos de Python para almacenar la " +"información de depuración, consulte `src/bin /CMakeLists.txt` para más " +"detalles). Si no funciona, informe un error." #: ../../doc/src/installation.md:340 msgid "" "If you do not like the default way, an alternative is to use bintutils. " "For that, first install [Spack](https://spack.io/), then:" msgstr "" +"Si no le gusta la forma predeterminada, una alternativa es usar bintutils. " +"Para eso, primero instale [Spack](https://spack.io/), luego:" #: ../../doc/src/installation.md:347 msgid "" "The last command will show a full path to the installed `binutils` " "package. Add this path to your shell config file, e.g.:" msgstr "" +"El último comando mostrará una ruta completa al paquete `binutils` " +"instalado. Agregue esta ruta a su archivo de configuración de la interfaz, " +"por ejemplo:" #: ../../doc/src/installation.md:352 msgid "" @@ -1637,18 +1902,22 @@ msgid "" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" +"y compile LFortran con la opción cmake `-DCMAKE_PREFIX_PATH=\"" +"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"`. El `$CONDA_PREFIX` está ahí si " +"instala algunas otras dependencias (como `llvm`) usando Conda, de lo " +"contrario, puede eliminarlo." #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de matriz" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "" +msgstr "allocated(x): verificación de estado" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." -msgstr "" +msgstr "Estado lógico de un entero asignable." #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 @@ -1695,7 +1964,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" -msgstr "" +msgstr "Declaración" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 @@ -1742,7 +2011,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "" +msgstr "Sintaxis" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1791,11 +2060,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "" +msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." -msgstr "" +msgstr "`x` es un parámetro de entrada entero." #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 @@ -1839,13 +2108,15 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" -msgstr "" +msgstr "Valores devueltos" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" +"El valor devuelto es un escalar lógico con el parámetro de tipo de tipo " +"lógico predeterminado." #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 @@ -1894,7 +2165,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" -msgstr "" +msgstr "Descripción" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" @@ -1902,6 +2173,9 @@ msgid "" " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" +"`allocated(x)` comprueba el estado de asignación de un parámetro de entrada " +"entero. Devuelve un valor lógico como `VERDADERO` si se asigna el argumento " +"de entrada `x`, `FALSO` en caso contrario." #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 @@ -1950,14 +2224,14 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "Tipos" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 #: ../../doc/src/intrinsics/character/achar.md:39 #: ../../doc/src/intrinsics/character/char.md:40 msgid "Supported argument type is integer." -msgstr "" +msgstr "El tipo de argumento admitido es entero." #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 @@ -2006,7 +2280,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "Ejemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -2020,7 +2294,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**Result**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -2069,36 +2343,40 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" -msgstr "" +msgstr "Ver también" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" -msgstr "" +msgstr "cshift(A, shift [, dim]): Desplazamiento circular" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." -msgstr "" +msgstr "Elementos de desplazamiento circular de una matriz." #: ../../doc/src/intrinsics/array/cshift.md:16 #: ../../doc/src/intrinsics/array/size.md:16 msgid "`A` the input array of any type or rank." -msgstr "" +msgstr "`A` la matriz de entrada de cualquier tipo o rango." #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." -msgstr "" +msgstr "`shift` el valor de entrada de tipo entero." #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" +"Dimensión opcional `dim`, si está presente, `cshift` devuelve el resultado " +"de esta dimensión." #: ../../doc/src/intrinsics/array/cshift.md:24 msgid "" "The return value is of input array type and rank as the `A` array input " "argument." msgstr "" +"El valor devuelto es del tipo de matriz de entrada y se clasifica como el " +"argumento de entrada de la matriz `A`." #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" @@ -2106,6 +2384,9 @@ msgid "" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" +"**cshift(A, shift [, dim])** realiza un desplazamiento circular en los " +"elementos de la matriz `A` a lo largo de la dimensión de `dim`. El valor " +"predeterminado de `dim` es 1, se usa cuando no se pasa `dim`." #: ../../doc/src/intrinsics/array/cshift.md:32 msgid "" @@ -2113,40 +2394,50 @@ msgid "" "`shift` places. If rank is greater than one, then all complexte rank one " "sections of array along the given dimension are shifted." msgstr "" +"Si el rango de la matriz es 1, entonces todos los elementos de la matriz se " +"desplazan en lugares de `shift`. Si el rango es mayor que uno, todas las " +"secciones complejas de rango uno de la matriz a lo largo de la dimensión " +"dada se desplazan." #: ../../doc/src/intrinsics/array/cshift.md:36 msgid "" "Elements shifted out one end of each rank one section are shifted back in" " the other end." msgstr "" +"Los elementos desplazados en un extremo de cada rango de una sección se " +"desplazan hacia atrás en el otro extremo." #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" +"El tipo de argumento admitido es una matriz para `A` y un número entero para " +"`shift` y `dim`." #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" -msgstr "" +msgstr "size(x): tamaño de la matriz" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." -msgstr "" +msgstr "Devuelve el tamaño de una matriz `x`." #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" +"Dimensión opcional `dim`, si está presente, `size` devuelve el tamaño de " +"esta dimensión." #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." -msgstr "" +msgstr "`kind` opcional el tipo del valor de retorno." #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." -msgstr "" +msgstr "`n` el tamaño de una matriz (entero)." #: ../../doc/src/intrinsics/array/size.md:28 msgid "" @@ -2155,22 +2446,27 @@ msgid "" " which case it only returns the size of this particular dimension. The " "`kind` argument can be used to specify the integer kind of the result." msgstr "" +"La función intrínseca `size` devuelve el tamaño de una matriz. Devuelve el " +"producto de todas las dimensiones, a menos que se especifique el argumento " +"`dim`, en cuyo caso solo devuelve el tamaño de esta dimensión en particular. " +"El argumento `kind` se puede utilizar para especificar el tipo entero del " +"resultado." #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" -msgstr "" +msgstr "bge(x, y): bit a bit mayor o igual" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." -msgstr "" +msgstr "Bit a bit mayor o igual que." #: ../../doc/src/intrinsics/bit/bge.md:16 #: ../../doc/src/intrinsics/bit/bgt.md:16 @@ -2178,19 +2474,23 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:16 msgid "`x` and `y` are integer input values. Both input values are of same kind." msgstr "" +"`x` e `y` son valores de entrada enteros. Ambos valores de entrada son del " +"mismo tipo." #: ../../doc/src/intrinsics/bit/bge.md:20 #: ../../doc/src/intrinsics/bit/bgt.md:20 #: ../../doc/src/intrinsics/bit/ble.md:20 #: ../../doc/src/intrinsics/bit/blt.md:20 msgid "The return value is of type logical and of the default kind." -msgstr "" +msgstr "El valor devuelto es de tipo lógico y del tipo predeterminado." #: ../../doc/src/intrinsics/bit/bge.md:24 msgid "" "`bge(x, y)` calculates if two integer input values is bitwise greater " "than or equal to another." msgstr "" +"`bge(x, y)` calcula si dos valores de entrada enteros son bit a bit mayores " +"o iguales que otro." #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 @@ -2199,6 +2499,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:34 msgid "Supported input types is integer of 32 bit and 64 bit size." msgstr "" +"Los tipos de entrada admitidos son números enteros de 32 bits y 64 bits." #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 @@ -2236,110 +2537,120 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**Result:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" -msgstr "" +msgstr "bgt(x, y): bit a bit mayor que" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "Bit a bit mayor que." #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." msgstr "" +"`bgt(x, y)` calcula si un valor de entrada entero es bit a bit mayor que el " +"otro." #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): tamaño de bit" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." -msgstr "" +msgstr "Tamaño de bits." #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." -msgstr "" +msgstr "`x` es un valor de entrada entero." #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." -msgstr "" +msgstr "El valor devuelto es de tipo entero." #: ../../doc/src/intrinsics/bit/bit_size.md:24 msgid "" "`bit_size(x)` calculates the number of bits including sign bit of binary " "representation of `x`." msgstr "" +"`bit_size(x)` calcula el número de bits, incluido el bit de signo de la " +"representación binaria de `x`." #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." -msgstr "" +msgstr "Los tipos de entrada admitidos son enteros." #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" -msgstr "" +msgstr "bge(x, y): bit a bit menor o igual" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." -msgstr "" +msgstr "Bit a bit menor o igual que." #: ../../doc/src/intrinsics/bit/ble.md:24 msgid "" "`ble(x, y)` calculates if one integer input values is bitwise less than " "or equal to other." msgstr "" +"`ble(x, y)` calcula si un valor de entrada entero es bit a bit menor o igual " +"que otro." #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" -msgstr "" +msgstr "blt(x, y): bit a bit menor que" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "Bit a bit menor que." #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." msgstr "" +"`blt(x, y)` calcula si un valor de entrada entero es bit a bit menor que el " +"otro." #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" -msgstr "" +msgstr "btest(x, pos): Prueba de bits en la posición" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "Prueba de bits." #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" "`x` and `pos` are integer input values. Both input values are of same " "kind. `pos` represents position in `x`." msgstr "" +"`x` y `pos` son valores de entrada enteros. Ambos valores de entrada son del " +"mismo tipo. `pos` representa la posición en `x`." #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." -msgstr "" +msgstr "El valor de retorno es de tipo lógico." #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" @@ -2347,25 +2658,30 @@ msgid "" "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" +"`btest(x, pos)` calcula si el bit `pos` en el valor entero de entrada `x` " +"está establecido. El conteo de bits comienza en 0, al menos el bit " +"significativo (LSB), es decir, el bit más a la derecha en `x`." #: ../../doc/src/intrinsics/bit/btest.md:29 msgid "" "If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors" " with not allowed message." msgstr "" +"Si `pos` es menor que 0 o mayor que `bit_size()`, `btest(x, pos)` tiene un " +"mensaje de error no permitido." #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" -msgstr "" +msgstr "shiftl(x, shift): Desplazamiento a la izquierda" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." -msgstr "" +msgstr "Función de desplazamiento lógico a la izquierda." #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." -msgstr "" +msgstr "`x` es un valor de entrada entero." #: ../../doc/src/intrinsics/bit/shiftl.md:18 #: ../../doc/src/intrinsics/bit/shiftr.md:18 @@ -2373,11 +2689,13 @@ msgid "" "`shift` an unsigned integer value less than or equal to the bit size of " "`x`. The possible values are 7, 31, and 63." msgstr "" +"`shift` un valor entero sin signo menor o igual que el tamaño de bit de `x`. " +"Los valores posibles son 7, 31 y 63." #: ../../doc/src/intrinsics/bit/shiftl.md:23 #: ../../doc/src/intrinsics/bit/shiftr.md:23 msgid "The return value is of type integer and of the same kind as `x`." -msgstr "" +msgstr "El valor devuelto es de tipo entero y del mismo tipo que `x`." #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" @@ -2386,6 +2704,11 @@ msgid "" "MSB(**M**ost **S**ignificant **B**it). Bits shifted from the left end " "i.e., MSB bits are lost. Zeroes are appended to the opposite right end." msgstr "" +"**shiftl(x, shift)** desplaza lógicamente a la izquierda `x` por el número " +"de bits de `shift`. `shiftl` cambia de LSB(**L**este **S**significativo " +"**B**it) a MSB(**M**más **S**significativo **B**it). Bits desplazados desde " +"el extremo izquierdo, es decir, se pierden bits MSB. Los ceros se agregan al " +"extremo derecho opuesto." #: ../../doc/src/intrinsics/bit/shiftl.md:34 #: ../../doc/src/intrinsics/bit/shiftr.md:34 @@ -2393,18 +2716,20 @@ msgid "" "Supported types in unsigned integer value `x` and unsigned integer value " "`shift` from (7, 31, 63) less than or equal to bit size of `x`." msgstr "" +"Tipos admitidos en valor entero sin signo `x` y valor entero sin signo " +"`shift` de (7, 31, 63) menor o igual que el tamaño de bit de `x`." #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" -msgstr "" +msgstr "shiftr(x, shift): Desplazamiento a la derecha" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." -msgstr "" +msgstr "Función de desplazamiento lógico a la derecha." #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" @@ -2413,28 +2738,35 @@ msgid "" "LSB(**L**east **S**ignificant **B**it). Bits shifted from the right end " "i.e., LSB bits are lost. Zeroes are appended to the opposite left end." msgstr "" +"**shiftr(x, shift)** lógicamente desplaza a la derecha `x` por el número de " +"bits de `shift`. `shiftr` cambia de MSB(**M**más **S**significativo **B**it) " +"a LSB(**L**este **S**significativo **B**it). Bits desplazados desde el " +"extremo derecho, es decir, los bits LSB se pierden. Los ceros se añaden al " +"extremo izquierdo opuesto." #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de carácter" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." -msgstr "" +msgstr "achar(x, kind): Para Carácter en conjunto ASCII." #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." -msgstr "" +msgstr "Carácter representado por en el juego de caracteres ASCII." #: ../../doc/src/intrinsics/character/achar.md:16 msgid "" "`x`: the input value of integer type. `kind`: an optional input value of " "type integer constant expression for initialization." msgstr "" +"`x`: el valor de entrada de tipo entero. `kind`: un valor de entrada " +"opcional de expresión constante de tipo entero para la inicialización." #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 @@ -2442,12 +2774,12 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "Valor devuelto" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 msgid "The return value is of type character of length 1." -msgstr "" +msgstr "El valor de retorno es de tipo carácter de longitud 1." #: ../../doc/src/intrinsics/character/achar.md:24 #: ../../doc/src/intrinsics/character/char.md:25 @@ -2455,12 +2787,16 @@ msgid "" "The return value is of kind `kind` if optional input value is passed, " "otherwise the kind is default kind." msgstr "" +"El valor devuelto es del tipo `kind` si se pasa un valor de entrada opcional;" +" de lo contrario, el tipo es el tipo predeterminado." #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" +"**achar(x, kind)** devuelve el carácter representado por el juego de " +"caracteres ASCII en la posición `x`." #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 @@ -2469,25 +2805,28 @@ msgid "" "not represented in the ASCII character set, the return value is " "undefined." msgstr "" +"Si `x` está fuera del valor entero del juego de caracteres ASCII, es decir, " +"si `x` no está representado en el juego de caracteres ASCII, el valor " +"devuelto no está definido." #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." -msgstr "" +msgstr "Es una función incorporada en tiempo de ejecución." #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" -msgstr "" +msgstr "adjustl(string): ajuste de cadena a izquierda" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." -msgstr "" +msgstr "Ajusta a izquierda una cadena." #: ../../doc/src/intrinsics/character/adjustl.md:16 #: ../../doc/src/intrinsics/character/adjustr.md:16 From d9cba6d1b8494af59c55fd7289c91a3f0bd90dcb Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Mon, 22 Aug 2022 20:46:21 +0000 Subject: [PATCH 20/46] Translated using Weblate (Portuguese) Currently translated at 18.6% (156 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/pt/ --- doc/locale/pt/LC_MESSAGES/docs.po | 556 +++++++++++++++++++++++------- 1 file changed, 426 insertions(+), 130 deletions(-) diff --git a/doc/locale/pt/LC_MESSAGES/docs.po b/doc/locale/pt/LC_MESSAGES/docs.po index ec55fb50b6..9068b9bf60 100644 --- a/doc/locale/pt/LC_MESSAGES/docs.po +++ b/doc/locale/pt/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" +"PO-Revision-Date: 2022-08-27 14:18+0000\n" "Last-Translator: Ian Giestas Pauli \n" "Language-Team: Portuguese \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -388,7 +388,7 @@ msgstr "" #: ../../doc/src/contributing.md:242 msgid "Reach Out" -msgstr "" +msgstr "Entre em contato" #: ../../doc/src/contributing.md:244 msgid "" @@ -396,6 +396,9 @@ msgid "" "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" +"Se você tiver alguma dúvida ou precisa de ajuda, por favor pergunte na nossa " +"[lista de e-mail](https://groups.io/g/lfortran) ou no [chat](https://lfortran" +".zulipchat.com/)." #: ../../doc/src/contributing.md:248 msgid "" @@ -404,6 +407,10 @@ msgid "" "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" +"Por favor, note que todos os participantes deste projeto devem seguir nosso " +"Código de Conduta. Ao participar deste projeto, você concorda em cumprir " +"seus termos. Consulte [CODE_OF_CONDUCT.md](https://github.com/lfortran/" +"lfortran/blob/main/CODE_OF_CONDUCT.md)." #: ../../doc/src/contributing.md:252 msgid "" @@ -412,14 +419,17 @@ msgid "" "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" +"Ao enviar um PR, você concorda em licenciar sua contribuição sob a [licença " +"BSD](https://github.com/lfortran/lfortran/blob/main/LICENSE) da LFortran, " +"menos nos casos em que é explicitamente dito o contrário." #: ../../doc/src/design.md:1 msgid "LFortran Design" -msgstr "" +msgstr "Design do LFortran" #: ../../doc/src/design.md:3 msgid "High Level Overview" -msgstr "" +msgstr "Visão Geral de Alto Nível" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" @@ -428,6 +438,10 @@ msgid "" "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" +"LFortran está estruturado em torno de dois módulos independentes, AST e ASR, " +"ambos autônomos (completamente independentes do resto do projeto) e os " +"utilizadores são encorajados a utilizá-los independentemente para outras " +"aplicações e a construir ferramentas com base nisso:" #: ../../doc/src/design.md:10 msgid "" @@ -435,6 +449,9 @@ msgid "" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" +"Árvore de Sintaxe Abstrata (AST), módulo `lfortran.ast`: representa qualquer " +"código-fonte Fortran, estritamente baseado na sintaxe, nenhuma semântica " +"está incluída. O módulo AST pode ser convertido em código em Fortran." #: ../../doc/src/design.md:14 msgid "" @@ -443,20 +460,25 @@ msgid "" "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" +"Representação Semântica Abstrata (ASR), o módulo `lfortran.asr`: representa " +"um código-fonte Fortran válido, toda a semântica está incluída. Não é " +"permitido códigos inválidos em Fortran (será dado um erro). O módulo ASR " +"pode ser convertido em uma AST." #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" +"O compilador LFortran é então composto pelas seguintes etapas independentes:" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" -msgstr "" +msgstr "Análise: converte o código-fonte Fortran em uma AST" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" -msgstr "" +msgstr "Semântica: converte uma AST em uma ASR" #: ../../doc/src/design.md:23 msgid "" @@ -464,6 +486,9 @@ msgid "" "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" +"Otimizações de alto nível: otimiza a ASR para uma simplificá-la e " +"possivelmente torná-la mais rápida (coisas como alinhamento de funções, " +"eliminação de expressões ou comandos redundantes, etc.)" #: ../../doc/src/design.md:26 msgid "" @@ -471,6 +496,9 @@ msgid "" " an LLVM IR. This stage also does all other optimizations that do not " "produce an ASR, but still make sense to do before passing to LLVM IR." msgstr "" +"Geração de código LLVM IR e otimizações de baixo nível: converte uma ASR em " +"uma LLVM IR. Nesta etapa são feitas outras otimizações que não produzem uma " +"ASR, porém ainda faz sentido fazê-las antes de passá-las ao LLVM IR." #: ../../doc/src/design.md:29 msgid "" @@ -479,6 +507,10 @@ msgid "" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" +"Geração de código de máquina: LLVM fará todas as suas otimizações e gerará " +"código de máquina (como um executável, uma biblioteca, um arquivo objeto, ou " +"carregado e executado usando JIT como parte de uma sessão interativa " +"LFortran ou em um kernel do Jupyter)." #: ../../doc/src/design.md:34 msgid "" @@ -573,7 +605,7 @@ msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" -msgstr "" +msgstr "Notas:" #: ../../doc/src/design.md:84 msgid "" @@ -623,7 +655,7 @@ msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" -msgstr "" +msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" @@ -635,7 +667,7 @@ msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" -msgstr "" +msgstr "Programa principal" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" @@ -654,7 +686,7 @@ msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" -msgstr "" +msgstr "Extensão do LFortran" #: ../../doc/src/design.md:126 msgid "" @@ -666,19 +698,19 @@ msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" -msgstr "" +msgstr "comando use" #: ../../doc/src/design.md:135 msgid "declaration" -msgstr "" +msgstr "declaração" #: ../../doc/src/design.md:136 msgid "statement" -msgstr "" +msgstr "comando" #: ../../doc/src/design.md:137 msgid "expression" -msgstr "" +msgstr "expressão" #: ../../doc/src/design.md:139 msgid "" @@ -746,23 +778,23 @@ msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" -msgstr "" +msgstr "Exemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" -msgstr "" +msgstr "Exemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" -msgstr "" +msgstr "Exemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" -msgstr "" +msgstr "Exemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" -msgstr "" +msgstr "Considerações de Design" #: ../../doc/src/design.md:219 msgid "" @@ -784,7 +816,7 @@ msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" -msgstr "" +msgstr "Tutorial de Desenvolvedor" #: ../../doc/src/developer_tutorial.ipynb:11 msgid "" @@ -794,7 +826,7 @@ msgstr "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" -msgstr "" +msgstr "Introdução" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" @@ -845,7 +877,7 @@ msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" -msgstr "" +msgstr "Começando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" @@ -853,15 +885,15 @@ msgstr "" #: ../../doc/src/index.md:147 msgid "Developer's Guide" -msgstr "" +msgstr "Guia do Desenvolvedor" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "" +msgstr "Funções Intrínsecas do LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" -msgstr "" +msgstr "Documentação do LFortran" #: ../../doc/src/index.md:3 msgid "" @@ -885,11 +917,11 @@ msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" -msgstr "" +msgstr "Binder" #: ../../doc/src/index.md:16 msgid "Feature Highlights" -msgstr "" +msgstr "Recursos em Destaque" #: ../../doc/src/index.md:18 msgid "" @@ -901,7 +933,7 @@ msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" -msgstr "" +msgstr "Funciona atualmente" #: ../../doc/src/index.md:23 #, python-format @@ -947,7 +979,7 @@ msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" -msgstr "" +msgstr "Planejado" #: ../../doc/src/index.md:53 msgid "" @@ -991,8 +1023,9 @@ msgid "" msgstr "" #: ../../doc/src/index.md:81 +#, fuzzy msgid "Roadmap" -msgstr "" +msgstr "Guia dos planos" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" @@ -1074,7 +1107,7 @@ msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" -msgstr "" +msgstr "Instalação" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." @@ -1082,7 +1115,7 @@ msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" -msgstr "" +msgstr "Binários" #: ../../doc/src/installation.md:7 msgid "" @@ -1143,7 +1176,7 @@ msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" -msgstr "" +msgstr "E compile:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." @@ -1187,7 +1220,7 @@ msgstr "" #: ../../doc/src/installation.md:92 msgid "Run tests:" -msgstr "" +msgstr "Rode os testes:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" @@ -1330,7 +1363,7 @@ msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" -msgstr "" +msgstr "Rode os testes" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" @@ -1374,7 +1407,7 @@ msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" -msgstr "" +msgstr "Com Root" #: ../../doc/src/installation.md:260 msgid "" @@ -1385,7 +1418,7 @@ msgstr "" #: ../../doc/src/installation.md:264 msgid "Without Root" -msgstr "" +msgstr "Sem Root" #: ../../doc/src/installation.md:266 msgid "" @@ -1402,7 +1435,7 @@ msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" -msgstr "" +msgstr "Desenvolvimento" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" @@ -1479,8 +1512,9 @@ msgid "" msgstr "" #: ../../doc/src/installation.md:319 +#, fuzzy msgid "Stacktraces" -msgstr "" +msgstr "Stacktraces" #: ../../doc/src/installation.md:321 msgid "" @@ -1495,7 +1529,7 @@ msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." @@ -1503,7 +1537,7 @@ msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" -msgstr "" +msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" @@ -1590,8 +1624,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 +#, fuzzy msgid "Declaration" -msgstr "" +msgstr "Declaração" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 @@ -1638,7 +1673,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "" +msgstr "Sintaxe" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1687,7 +1722,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "" +msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." @@ -1735,7 +1770,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" -msgstr "" +msgstr "Valores de retorno" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" @@ -1790,7 +1825,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" -msgstr "" +msgstr "Descrição" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" @@ -1846,7 +1881,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "Tipos" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 @@ -1902,7 +1937,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "Exemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -1916,7 +1951,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**Resultado**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -1965,7 +2000,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" -msgstr "" +msgstr "Veja Também" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" @@ -2053,8 +2088,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 +#, fuzzy msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" @@ -2132,7 +2168,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**Resultado:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." @@ -2291,8 +2327,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 +#, fuzzy msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" @@ -2311,8 +2348,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 +#, fuzzy msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" @@ -2338,7 +2376,7 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "Valor de retorno" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 @@ -2374,8 +2412,9 @@ msgstr "" #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 +#, fuzzy msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" @@ -2430,8 +2469,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:65 +#, fuzzy msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" @@ -2531,8 +2571,9 @@ msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 +#, fuzzy msgid "[len_trim](len_trim.md)." -msgstr "" +msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" @@ -2572,7 +2613,7 @@ msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." -msgstr "" +msgstr "Nenhum." #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" @@ -2624,8 +2665,9 @@ msgid "Supported argument types float, double, complex float, complex double." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 +#, fuzzy msgid "[asin](asin.md), [atan](atan.md)." -msgstr "" +msgstr "[asin](asin.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" @@ -2680,8 +2722,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 +#, fuzzy msgid "[asinh](asinh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[asinh](asinh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" @@ -2703,8 +2746,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 +#, fuzzy msgid "[acos](acos.md), [atan](atan.md)." -msgstr "" +msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" @@ -2729,8 +2773,9 @@ msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 +#, fuzzy msgid "[acosh](acosh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" @@ -2753,8 +2798,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 +#, fuzzy msgid "[asin](asin.md), [acos](acos.md)." -msgstr "" +msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" @@ -2798,8 +2844,9 @@ msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 +#, fuzzy msgid "$tan^{-1}(\\frac{y}{x})$" -msgstr "" +msgstr "$tan^{-1}(\\frac{y}{x})$" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" @@ -2869,8 +2916,9 @@ msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 +#, fuzzy msgid "[asinh](asinh.md), [acosh](acosh.md)." -msgstr "" +msgstr "[asinh](asinh.md), [acosh](acosh.md)." #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" @@ -2930,7 +2978,7 @@ msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." -msgstr "" +msgstr "Qualquer um." #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" @@ -3051,8 +3099,9 @@ msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 +#, fuzzy msgid "[cpu_time](cpu_time.md)." -msgstr "" +msgstr "[cpu_time](cpu_time.md)." #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" @@ -3094,7 +3143,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." -msgstr "" +msgstr "Valor absoluto." #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." @@ -3113,8 +3162,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 +#, fuzzy msgid "$|x|$" -msgstr "" +msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" @@ -3134,8 +3184,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:98 #: ../../doc/src/intrinsics/numeric/aimag.md:70 #: ../../doc/src/intrinsics/numeric/mod.md:97 +#, fuzzy msgid "[ceiling](ceiling.md), [floor](floor.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [floor](floor.md)." #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" @@ -3233,8 +3284,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 +#, fuzzy msgid "[ceiling](ceiling.md), [mod](mod.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" @@ -3263,8 +3315,9 @@ msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 +#, fuzzy msgid "[aint](aint.md)." -msgstr "" +msgstr "[aint](aint.md)." #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" @@ -3291,8 +3344,9 @@ msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 +#, fuzzy msgid "[floor](floor.md), [mod](mod.md)." -msgstr "" +msgstr "[floor](floor.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" @@ -3417,12 +3471,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 +#, fuzzy msgid "epsilon(x): Epsilon" -msgstr "" +msgstr "epsilon(x): Epsilon" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." -msgstr "" +msgstr "Função Epsilon." #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." @@ -3440,11 +3495,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" -msgstr "" +msgstr "erf(x): Erro" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." -msgstr "" +msgstr "Função Erro." #: ../../doc/src/intrinsics/numeric/erf.md:20 msgid "" @@ -3464,12 +3519,14 @@ msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 +#, fuzzy msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 +#, fuzzy msgid "[erfc](erfc.md)." -msgstr "" +msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" @@ -3490,8 +3547,9 @@ msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 +#, fuzzy msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erfc.md:33 msgid "" @@ -3500,16 +3558,17 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 +#, fuzzy msgid "[erf](erf.md)." -msgstr "" +msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" -msgstr "" +msgstr "exp(x): Exponencial" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." -msgstr "" +msgstr "Função Exponencial." #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." @@ -3568,11 +3627,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" -msgstr "" +msgstr "gamma(x): Gama" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." -msgstr "" +msgstr "Função Gama." #: ../../doc/src/intrinsics/numeric/gamma.md:16 msgid "" @@ -3613,8 +3672,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 +#, fuzzy msgid "[epsilon](epsilon.md)" -msgstr "" +msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" @@ -3670,7 +3730,7 @@ msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" -msgstr "" +msgstr "Linguagem Fortran" #: ../../doc/src/language.md:3 msgid "Background and Motivation" @@ -3689,7 +3749,7 @@ msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" -msgstr "" +msgstr "Alguns destaques:" #: ../../doc/src/language.md:14 msgid "" @@ -3706,11 +3766,11 @@ msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" -msgstr "" +msgstr "Números complexos;" #: ../../doc/src/language.md:20 msgid "Special functions;" -msgstr "" +msgstr "Funções especiais;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." @@ -3806,7 +3866,7 @@ msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" -msgstr "" +msgstr "Tópicos" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" @@ -3822,35 +3882,41 @@ msgstr "" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md +#, fuzzy msgid "BIN" -msgstr "" +msgstr "BIN" #: ../../doc/src/progress.md +#, fuzzy msgid "RUN" -msgstr "" +msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" -msgstr "" +msgstr "Nome do arquivo" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "✅" -msgstr "" +msgstr "✅" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90)" msgstr "" +"[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/programs/numerics/t01_sin_implementation.f90)" #: ../../doc/src/progress.md:45 msgid "Modules" -msgstr "" +msgstr "Módulos" #: ../../doc/src/progress.md:47 msgid "Basic Usage" @@ -3865,8 +3931,11 @@ msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/basic/t01.f90)" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" @@ -3881,28 +3950,37 @@ msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t01.f90)" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t02.f90)" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" +"[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t03.f90)" #: ../../doc/src/progress.md:67 msgid "Expressions" -msgstr "" +msgstr "Expressões" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" @@ -3913,44 +3991,58 @@ msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`+,-,*,/,**`" -msgstr "" +msgstr "`+,-,*,/,**`" #: ../../doc/src/progress.md +#, fuzzy msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" +"[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/arit/basic_operations.f90)" #: ../../doc/src/progress.md:78 msgid "Integers" -msgstr "" +msgstr "Inteiros" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`integers`" -msgstr "" +msgstr "`integers`" #: ../../doc/src/progress.md +#, fuzzy msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" +"[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/integers/integer_kind.f90)" #: ../../doc/src/progress.md msgid "`relational operations`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90)" msgstr "" +"[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/integers/t01_rel_operations.f90)" #: ../../doc/src/progress.md msgid "`logical operations`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90)" msgstr "" +"[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/integers/t02_logical_operations.f90)" #: ../../doc/src/progress.md:89 msgid "Real Numbers" @@ -3965,20 +4057,27 @@ msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" +"[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/real_kind.f90)" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "❌" -msgstr "" +msgstr "❌" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" msgstr "" +"[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/t01_def_op.f90)" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" @@ -3993,36 +4092,46 @@ msgid "`single/double complex`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" +"[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/complex/complex_kind.f90)" #: ../../doc/src/progress.md:108 msgid "Strings" -msgstr "" +msgstr "Cadeia de Caracteres" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`character`" -msgstr "" +msgstr "`character`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" +"[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/character/t01_character.f90)" #: ../../doc/src/progress.md msgid "`string concatenation`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" msgstr "" +"[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/character/t02_concat_operation.f90)" #: ../../doc/src/progress.md:118 msgid "Derived Types" -msgstr "" +msgstr "Tipos Derivados" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" @@ -4033,12 +4142,15 @@ msgid "`basic derived types`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90)" msgstr "" +"[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/derived_type/t01_derived_type.f90)" #: ../../doc/src/progress.md:127 msgid "Statements" -msgstr "" +msgstr "Comandos" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" @@ -4053,8 +4165,11 @@ msgid "`allocate statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/allocate/t01.f90)" #: ../../doc/src/progress.md:138 msgid "Block Statement" @@ -4069,8 +4184,11 @@ msgid "`block statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/block/t01.f90)" #: ../../doc/src/progress.md:147 msgid "Goto Statement" @@ -4085,16 +4203,22 @@ msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t01.f90)" #: ../../doc/src/progress.md msgid "`go-to statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t02.f90)" #: ../../doc/src/progress.md:157 msgid "If Statement" @@ -4109,32 +4233,44 @@ msgid "`Test .false.`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" +"[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_01.f90)" #: ../../doc/src/progress.md msgid "`single line if statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" +"[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_02.f90)" #: ../../doc/src/progress.md msgid "`multi line if statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" +"[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_03.f90)" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" +"[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_04.f90)" #: ../../doc/src/progress.md:169 msgid "While Statement" @@ -4149,16 +4285,22 @@ msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" +"[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_01.f90)" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" +"[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_02.f90)" #: ../../doc/src/progress.md:179 msgid "Print Statement" @@ -4173,8 +4315,11 @@ msgid "`Basic print`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/print/t01.f90)" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" @@ -4185,12 +4330,16 @@ msgid "Directory: `tests/statements/file_io`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`open/read/write/close`" -msgstr "" +msgstr "`open/read/write/close`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/file_io/t01.f90)" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" @@ -4198,7 +4347,7 @@ msgstr "" #: ../../doc/src/progress.md:199 msgid "abs" -msgstr "" +msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" @@ -4209,365 +4358,512 @@ msgid "`scalar single/double real`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t03_array1d_real.f90)" #: ../../doc/src/progress.md:210 msgid "exp" -msgstr "" +msgstr "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t03_array1d_real.f90)" #: ../../doc/src/progress.md:221 msgid "log" -msgstr "" +msgstr "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t03_array1d_real.f90)" #: ../../doc/src/progress.md:232 msgid "sqrt" -msgstr "" +msgstr "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t03_array1d_real.f90)" #: ../../doc/src/progress.md:243 msgid "sin" -msgstr "" +msgstr "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:254 msgid "cos" -msgstr "" +msgstr "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:265 msgid "tan" -msgstr "" +msgstr "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:276 msgid "sinh" -msgstr "" +msgstr "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:287 msgid "cosh" -msgstr "" +msgstr "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:298 msgid "tanh" -msgstr "" +msgstr "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:309 msgid "asin" -msgstr "" +msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:320 msgid "acos" -msgstr "" +msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:331 msgid "atan" -msgstr "" +msgstr "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:342 msgid "modulo" -msgstr "" +msgstr "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t03_array1d_real.f90)" #: ../../doc/src/progress.md:352 msgid "mod" -msgstr "" +msgstr "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t03_array1d_real.f90)" #: ../../doc/src/progress.md:362 msgid "min" -msgstr "" +msgstr "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/min/t01_scalar_real.f90)" #: ../../doc/src/progress.md:371 msgid "max" -msgstr "" +msgstr "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/max/t01_scalar_real.f90)" #: ../../doc/src/progress.md:380 msgid "int" -msgstr "" +msgstr "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/int/t01_scalar_real.f90)" #: ../../doc/src/progress.md:389 msgid "real" -msgstr "" +msgstr "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/real/t01_scalar_real.f90)" #: ../../doc/src/progress.md:398 msgid "floor" -msgstr "" +msgstr "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/floor/t01_scalar_real.f90)" #: ../../doc/src/progress.md:407 msgid "nint" -msgstr "" +msgstr "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/nint/t01_scalar_real.f90)" From 9b91614780b89e584c2ae21f17658b8c9e1d89ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Fri, 26 Aug 2022 12:39:04 +0000 Subject: [PATCH 21/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 66.6% (558 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 56 +++++++++++++++------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index 159c1a2c26..7712cac923 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-26 12:30+0000\n" -"Last-Translator: Ys413 <2020172007@stu.mdjnu.edu.cn>\n" +"PO-Revision-Date: 2022-08-27 14:18+0000\n" +"Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -1662,7 +1662,7 @@ msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "乌班图(Ubuntu)" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." @@ -3355,7 +3355,7 @@ msgstr "支持的参数类型是实数和整数。" #: ../../doc/src/intrinsics/numeric/aimag.md:70 #: ../../doc/src/intrinsics/numeric/mod.md:97 msgid "[ceiling](ceiling.md), [floor](floor.md)." -msgstr "[ceiling](ceiling.md), [floor](floor.md)." +msgstr "[ceiling](ceiling.md),[floor](floor.md)。" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" @@ -3485,47 +3485,47 @@ msgstr "如果`x` 大于0,`anint(x)` 返回`aint(x + 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." -msgstr "" +msgstr "[aint](aint.md)。" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" -msgstr "" +msgstr "ceiling(x):进一取整" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" -msgstr "" +msgstr "进一取整函数" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." -msgstr "" +msgstr "输入值 `x` 可以是实数或整数类型。" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." -msgstr "" +msgstr "返回值是整数类型和最接近它的更大整数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." -msgstr "" +msgstr "**ceiling(x)** 返回大于或等于 `x` 的最小整数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." -msgstr "" +msgstr "支持的输入参数类型是整数和实数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." -msgstr "" +msgstr "[floor](floor.md),[mod](mod.md)。" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" -msgstr "" +msgstr "cmplx(x [, [, kind]]):转换为复数" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." -msgstr "" +msgstr "转换为复数类型。" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." -msgstr "" +msgstr "`cmplx(x, y)` 是 ASR 中的内置函数之一。" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" @@ -3535,49 +3535,53 @@ msgid "" "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" +"`x` 输入值必须是整数、实数或复数。 `y` 可选输入值必须是整数或实数类型。" +"它应该只在 `x` 不复杂的情况下出现。 `kind` " +"用于初始化的整数表达式类型的可选输入值,指示结果的种类参数。" #: ../../doc/src/intrinsics/numeric/cmplx.md:26 msgid "" "The return value is of complex type, with a kind defined by input `kind` " "type specified. If the `kind` is not specified, the return value is of " "default `kind` `complex` type." -msgstr "" +msgstr "返回值是复数类型,类型由指定的输入`kind`类型定义。如果未指定 `kind`," +"则返回值为默认 `kind` `complex` 类型。" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" -msgstr "" +msgstr "**cmplx(x, [, y [, kind]])** 将输入值转换为复数表示:" #: ../../doc/src/intrinsics/numeric/cmplx.md:34 msgid "" "`x` to real component of complex number. if `y` is present, it is " "converted to the imaginary component." -msgstr "" +msgstr "`x` 为复数的实部。如果 `y` 存在,则将其转换为虚部。" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." -msgstr "" +msgstr "如果 `y` 不存在,则虚部设置为 0.0。" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." -msgstr "" +msgstr "如果 `x` 是复数,则 `y` 不能出现。" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." -msgstr "" +msgstr "支持的参数类型是整数、实数或复数。" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" -msgstr "" +msgstr "conjg(x):复共轭" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." -msgstr "" +msgstr "复共轭函数。" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." -msgstr "" +msgstr "`x` 输入值必须是复数类型。" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." @@ -4043,7 +4047,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" From 4023253a1da90b9bc0e22b2879c0fd1c0a97c1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Sun, 28 Aug 2022 06:24:18 +0000 Subject: [PATCH 22/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 73.3% (614 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 118 ++++++++++++++------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index 7712cac923..8477c33c9b 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-27 14:18+0000\n" +"PO-Revision-Date: 2022-08-28 06:41+0000\n" "Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" @@ -3585,261 +3585,267 @@ msgstr "`x` 输入值必须是复数类型。" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." -msgstr "" +msgstr "返回值是复数类型。" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." -msgstr "" +msgstr "**conjg(x)** 将输入值 `x` 转换为其复数共轭。" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" -msgstr "" +msgstr "$x + iy$ 转换为 $x - iy$" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." -msgstr "" +msgstr "支持的参数类型是复数。" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" -msgstr "" +msgstr "digits(x):有效二进制数字" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." -msgstr "" +msgstr "有效的二进制数字。" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." -msgstr "" +msgstr "`x` 输入值必须是实数或整数类型。" #: ../../doc/src/intrinsics/numeric/digits.md:23 msgid "" "**digits(x)** returns the number of significant binary digits of the " "internal mopdel representation of `x`." -msgstr "" +msgstr "**digits(x)** 返回 `x` 的内部模型表示的有效二进制位数。" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" -msgstr "" +msgstr "dim(x, y):正差或 0" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." -msgstr "" +msgstr "正差或 0。" #: ../../doc/src/intrinsics/numeric/dim.md:15 msgid "" "`x` the input value must be of type real or integer. `y` the input value " "must of of the same type and kind as of `x`." -msgstr "" +msgstr "`x` 输入值必须是实数或整数类型。 `y` 输入值的类型和种类必须与 `x` 相同。" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." -msgstr "" +msgstr "返回值是整数或实数类型。" #: ../../doc/src/intrinsics/numeric/dim.md:24 msgid "" "**dim(x)** computes the difference $x - y$, if the result is positive, " "otherwise returns 0." -msgstr "" +msgstr "**dim(x)** 计算 $x - y$ 的差值,如果结果为正,否则返回 0。" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" -msgstr "" +msgstr "epsilon(x):ε 小量" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." -msgstr "" +msgstr "Epsilon 函数。" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." -msgstr "" +msgstr "返回值与输入参数的类型相同。" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" -msgstr "" +msgstr "**epsilon(x)** 计算与 `x` 相同类型的最小数 $\\epsilon$,如下所示:" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" -msgstr "" +msgstr "$1 + \\epsilon > 1$" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" -msgstr "" +msgstr "erf(x): 误差函数" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." -msgstr "" +msgstr "误差函数" #: ../../doc/src/intrinsics/numeric/erf.md:20 msgid "" "The return value is of type real and of the same kind as of the input " "parameter `x`." -msgstr "" +msgstr "返回值是 real 类型,与输入参数 `x` 的类型相同。" #: ../../doc/src/intrinsics/numeric/erf.md:25 #: ../../doc/src/intrinsics/numeric/erfc.md:25 msgid "" "**erf(x)** computes the error function of `x`. The result lies in the " "range:" -msgstr "" +msgstr "**erf(x)** 计算 `x` 的误差函数。结果位于以下范围内:" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" -msgstr "" +msgstr "$-1 \\leq erf (x) \\leq 1$" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." -msgstr "" +msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" -msgstr "" +msgstr "erfc(x):互补误差" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." -msgstr "" +msgstr "互补误差函数。" #: ../../doc/src/intrinsics/numeric/erfc.md:20 msgid "" "The return value is of type real and of the same kind as of the input " "parameter `x`. `erfc(x)` returns $1 - erf(x)$." -msgstr "" +msgstr "返回值是 real 类型,与输入参数 `x` 的类型相同。 `erfc(x)` 返回 $1 - erf(x)$。" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" -msgstr "" +msgstr "$0 \\leq erf (x) \\leq 2$" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erfc.md:33 msgid "" "It is used in instances when the large loss of relative accuracy occurs " "if `erf(x)` is called for large `x` and the result is subtracted from 1." -msgstr "" +msgstr "它用于在相对精度损失较大的情况下,如果为较大的 `x` 调用 `erf(x)` 并且从 1 " +"中减去结果。" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." -msgstr "" +msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" -msgstr "" +msgstr "exp(x):指数函数" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." -msgstr "" +msgstr "指数函数" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." -msgstr "" +msgstr "`x` 输入值必须是实数或复数类型。" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." -msgstr "" +msgstr "返回值与输入参数 `x` 的类型相同。" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." -msgstr "" +msgstr "**exp(x)** 计算 `x` 的基本 $e$ 指数,即 $e^x$。" #: ../../doc/src/intrinsics/numeric/exp.md:26 msgid "" "If `x` is of type complex, its imaginary part is considered as a value in" " radians." -msgstr "" +msgstr "如果 `x` 是复数类型,它的虚部被认为是弧度值。" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." -msgstr "" +msgstr "支持的参数类型是实数或复数。" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" -msgstr "" +msgstr "floor(x, kind):去一取整" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." -msgstr "" +msgstr "去一取整函数。" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." -msgstr "" +msgstr "`kind` 可选输入参数必须是一个标量整数常量表达式。" #: ../../doc/src/intrinsics/numeric/floor.md:22 msgid "" "The return value is of type integer(kind) if kind is passed as input " "parameter. If not, default kind integer is returned." -msgstr "" +msgstr "如果 kind 作为输入参数传递,则返回值是 integer(kind) " +"类型。如果不是,则返回默认类型整数。" #: ../../doc/src/intrinsics/numeric/floor.md:25 msgid "" "The return value is equal to or nearest greatest integer less than or " "equal to `x`." -msgstr "" +msgstr "返回值等于或最接近小于或等于 `x` 的最大整数。" #: ../../doc/src/intrinsics/numeric/floor.md:30 msgid "" "**floor(x)** returns the greatest integer less than or equal to x. It " "returns an integer value unless spefically specified using second " "optional paramter." -msgstr "" +msgstr "**floor(x)** 返回小于或等于 x " +"的最大整数。它返回一个整数值,除非使用第二个可选参数特别指定。" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" -msgstr "" +msgstr "gamma(x):伽马函数" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." -msgstr "" +msgstr "伽马函数。" #: ../../doc/src/intrinsics/numeric/gamma.md:16 msgid "" "`x` the input value must be of type real. It should not be zero or a " "negative integer." -msgstr "" +msgstr "`x` 输入值必须是实数类型。它不应为零或负整数。" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." -msgstr "" +msgstr "返回值与 `x` 的类型和种类相同。" #: ../../doc/src/intrinsics/numeric/gamma.md:25 msgid "" "**gamma(x)** computes $\\gamma(x)$. For positive, integer value of `x`, " "the Gamma function simplifies to factorial function:" -msgstr "" +msgstr "**gamma(x)** 计算 $\\gamma(x)$。对于 `x` 的正整数值,Gamma " +"函数简化为阶乘函数:" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" -msgstr "" +msgstr "$\\gamma(x) = (x-1)!$" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" -msgstr "" +msgstr "一般来说,如果 $x > 0$:" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" -msgstr "" +msgstr "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" -msgstr "" +msgstr "如果 $-n-1 < x < -n$ 其中 n 是整数 >= 0:" #: ../../doc/src/intrinsics/numeric/gamma.md:36 msgid "" "$\\gamma(x) = \\int_{0}^{\\infty}(e ^{-t} - \\sum\\limits_{k=0}^n " "\\frac{(-t)^k}{k!} dt)$" msgstr "" +"$\\gamma(x) = \\int_{0}^{\\infty}(e ^{-t} - \\sum\\limits_{k=0}^n \\frac" +"{(-t)^k}{k!} dt)$" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" -msgstr "" +msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" From 44c89aa8e4648db795cd02416726072b6f08b146 Mon Sep 17 00:00:00 2001 From: Asdrubal Lozada-Blanco Date: Mon, 29 Aug 2022 11:00:33 +0000 Subject: [PATCH 23/46] Translated using Weblate (Spanish) Currently translated at 43.2% (362 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/es/ --- doc/locale/es/LC_MESSAGES/docs.po | 35 ++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/doc/locale/es/LC_MESSAGES/docs.po b/doc/locale/es/LC_MESSAGES/docs.po index 9cd7898ef8..e016b69ccb 100644 --- a/doc/locale/es/LC_MESSAGES/docs.po +++ b/doc/locale/es/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-27 14:18+0000\n" +"PO-Revision-Date: 2022-08-29 23:56+0000\n" "Last-Translator: Asdrubal Lozada-Blanco \n" "Language-Team: Spanish \n" @@ -2831,7 +2831,7 @@ msgstr "Ajusta a izquierda una cadena." #: ../../doc/src/intrinsics/character/adjustl.md:16 #: ../../doc/src/intrinsics/character/adjustr.md:16 msgid "`string`: the input value must be of character type." -msgstr "" +msgstr "`string`: el valor de entrada debe ser de tipo carácter." #: ../../doc/src/intrinsics/character/adjustl.md:20 msgid "" @@ -2839,25 +2839,30 @@ msgid "" "value `string`, with leading spaces removed and same number of spaces " "appended." msgstr "" +"El valor devuelto es de tipo carácter y del mismo tipo que el valor de " +"entrada `string`, con los espacios iniciales eliminados y el mismo número de " +"espacios añadidos." #: ../../doc/src/intrinsics/character/adjustl.md:25 msgid "" "**adjustl(string)** adjusts input string by removing any leading spaces " "and appending same number of spaces." msgstr "" +"**adjustl(cadena)** ajusta la cadena de entrada eliminando cualquier espacio " +"inicial y agregando la misma cantidad de espacios." #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." -msgstr "" +msgstr "El tipo de argumento admitido es el carácter." #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" -msgstr "" +msgstr "adjustr(cadena): Cadena ajustada a la derecha" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." -msgstr "" +msgstr "Ajuste a la derecha una cadena." #: ../../doc/src/intrinsics/character/adjustr.md:20 msgid "" @@ -2865,44 +2870,54 @@ msgid "" "value `string`, with trailing spaces removed and same number of spaces " "added at the start." msgstr "" +"El valor devuelto es de tipo carácter y del mismo tipo que el valor de " +"entrada `string`, con los espacios finales eliminados y el mismo número de " +"espacios agregados al principio." #: ../../doc/src/intrinsics/character/adjustr.md:26 msgid "" "**adjustr(string)** adjusts input string by removing any trailing spaces " "and adding same number of spaces at the start of the input string." msgstr "" +"**adjustr(cadena)** ajusta la cadena de entrada eliminando los espacios " +"finales y agregando la misma cantidad de espacios al comienzo de la cadena " +"de entrada." #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" -msgstr "" +msgstr "char(x, [, kind]): Transforma entero en carácter" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." -msgstr "" +msgstr "Conversión de entero a carácter." #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." -msgstr "" +msgstr "`x`: el valor de entrada de tipo entero." #: ../../doc/src/intrinsics/character/char.md:18 msgid "" "`kind`: an optional input value of type integer constant expression for " "initialization. This indicates the kind parameter of the result." msgstr "" +"`kind`: un valor de entrada opcional de expresión constante de tipo entero " +"para la inicialización. Esto indica el tipo de parámetro del resultado." #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" +"**char(x)** devuelve el carácter representado por el conjunto de caracteres " +"ASCII en la posición `x`." #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" From d42912dc57fd727a27880ac67f4c3038f56a8154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Mon, 29 Aug 2022 02:27:41 +0000 Subject: [PATCH 24/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 77.2% (647 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 75 +++++++++++++++++----------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index 8477c33c9b..f35b5d00db 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-28 06:41+0000\n" +"PO-Revision-Date: 2022-08-29 23:56+0000\n" "Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" @@ -3849,63 +3849,63 @@ msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" -msgstr "" +msgstr "mod(x, y):模数" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." -msgstr "" +msgstr "模数或余数函数。" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." -msgstr "" +msgstr "`x` 输入值,可以是整数或实数。" #: ../../doc/src/intrinsics/numeric/mod.md:19 msgid "" "`y` second input parameter should be same type and kind as `x` and not " "equal to 0." -msgstr "" +msgstr "`y` 第二个输入参数的类型和种类应与 `x` 相同且不等于 0。" #: ../../doc/src/intrinsics/numeric/mod.md:24 msgid "" "The return value is of type and kind same as of `x`. The result is " "calculated using mathematical modulo or remainder as:" -msgstr "" +msgstr "返回值的类型和种类与 `x` 相同。结果使用数学模或余数计算为:" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." -msgstr "" +msgstr "`x - INT (x / y) * y`." #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." -msgstr "" +msgstr "如果 `y` 为 0,则结果未定义,如 `any integer value / 0`。" #: ../../doc/src/intrinsics/numeric/mod.md:33 msgid "" "**mod(x, y)** calculates and returns modulo or remainder when `x` is " "divided by `y`. The result is calculated using" -msgstr "" +msgstr "**mod(x, y)** 当 `x` 除以 `y` 时计算并返回模数或余数。结果计算使用" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" -msgstr "" +msgstr "`x - INT(x / y) * y`" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." -msgstr "" +msgstr "即,当第一个参数在数学上除以第二个参数时,结果是余数。" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." -msgstr "" +msgstr "返回值应该小于`y`。" #: ../../doc/src/language.md:1 msgid "Fortran Language" -msgstr "" +msgstr "Fortran 语言" #: ../../doc/src/language.md:3 msgid "Background and Motivation" -msgstr "" +msgstr "背景和动机" #: ../../doc/src/language.md:5 msgid "" @@ -3917,35 +3917,39 @@ msgid "" "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" +"Fortran 的设计从一开始就自然而简单地将数学转换为以最高速度编译和运行的代码。" +"并且专门针对此类基本计算任务,它在语言本身中包含广泛的关键功能,在所有平台上" +"都是标准的,不需要目前或未来可能会或可能不会得到很好优化或维护的外部库路。" #: ../../doc/src/language.md:12 msgid "Some highlights:" -msgstr "" +msgstr "一些亮点:" #: ../../doc/src/language.md:14 msgid "" "Multidimensional arrays which can be allocated and indexed as the " "math/science dictates (not restricted to start at 0 or 1) and can be " "sliced as desired (as, e.g., in MATLAB);" -msgstr "" +msgstr "多维数组,可以根据数学/科学的要求进行分配和索引(不限于从 0 或 1 " +"开始),并且可以根据需要进行切片(例如,在 MATLAB 中);" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" -msgstr "" +msgstr "像对标量一样自然地对上述数组/矩阵进行操作的运算符;" #: ../../doc/src/language.md:19 msgid "Complex numbers;" -msgstr "" +msgstr "复数;" #: ../../doc/src/language.md:20 msgid "Special functions;" -msgstr "" +msgstr "特殊函数;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." -msgstr "" +msgstr "用于更通用数据表示的结构和指针。" #: ../../doc/src/language.md:23 msgid "" @@ -3957,26 +3961,34 @@ msgid "" " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" +"因为基本内容包含在语言本身中,所以阅读和编写都很简单,无需从大量的外部类中进" +"行选择或破译来做同样的事情。由于这些要素是自包含的,编译器可以直接从自然、可" +"读的代码中提供详细的编译时(例如,参数不匹配)和运行时(例如,内存访问)检查" +",以及高度优化的可执行文件。开发人员的广泛优化英雄。" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" -msgstr "" +msgstr "有关更多信息,请参阅我们的博客文章:" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" +"[我们为什么创建 LFortran](https://lfortran.org/blog/2019/04/" +"why-we-created-lfortran/)" #: ../../doc/src/language.md:34 msgid "" "[Why to Use Fortran For New Projects](https://lfortran.org/blog/2019/05" "/why-to-use-fortran-for-new-projects/)" msgstr "" +"[为什么在新项目中使用 Fortran](https://lfortran.org/blog/2019/05/" +"why-to-use-fortran-for-new-projects/)" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" -msgstr "" +msgstr "如何学习 Fortran" #: ../../doc/src/language.md:38 msgid "" @@ -3987,6 +3999,10 @@ msgid "" "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" +"Fortran 学习起来相对较快,因为它比 C/C++ " +"简单得多,也更小(实际上,包括所有需要的库)。如果你有兴趣了解更多信息," +"请参阅我们的网页 [fortran90.org],其中包含编写代码的推荐做法、与 Python/" +"NumPy 的并排比较、其他在线 Fortran 资源和书籍的链接以及常见问题解答。" #: ../../doc/src/progress.md:3 msgid "" @@ -3994,32 +4010,35 @@ msgid "" "each feature we list a short description, the filename with the test and " "current status for each parts of the compiler:" msgstr "" +"此页面记录了 LFortran 支持的 Fortran 功能。对于每个特性,我们列出了一个简短的" +"描述,以及编译器每个部分的测试和当前状态的文件名:" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" -msgstr "" +msgstr "AST:代码可以解析为 AST (`lfortran --show-ast test.f90`)" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" -msgstr "" +msgstr "ASR:代码可以转换为 ASR (`lfortran --show-asr test.f90`)" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" -msgstr "" +msgstr "LLVM:LFortran 可以生成 LLVM IR (`lfortran --show-llvm test.f90`)" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" -msgstr "" +msgstr "BIN:LLVM IR 可以编译为二进制文件" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" -msgstr "" +msgstr "RUN:二进制运行没有错误" #: ../../doc/src/progress.md:13 msgid "" "If all are green it means the feature fully works and you can use it in " "your codes. Otherwise you can see what the status is of each feature." -msgstr "" +msgstr "如果全部为绿色,则表示该功能完全有效,你可以在代码中使用它。否则,你可以查看" +"每个功能的状态。" #: ../../doc/src/progress.md:16 msgid "" From ffff9551d6ecced2323d6672db2d092e4bd97429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Wed, 31 Aug 2022 12:02:36 +0000 Subject: [PATCH 25/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (837 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 326 +++++++++++++++++++-------- 1 file changed, 233 insertions(+), 93 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index f35b5d00db..aa5943e690 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-29 23:56+0000\n" +"PO-Revision-Date: 2022-09-01 06:50+0000\n" "Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" @@ -4049,26 +4049,30 @@ msgid "" "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" +"此页面是使用 [Compiler Tester](https://gitlab.com/lfortran/compiler_tester) " +"存储库自动生成的,该存储库包含所有 Fortran 测试和脚本,用于运行 LFortran " +"以生成下表。我们正在寻找贡献者来贡献更多的测试。我们的目标是拥有一个全面的 " +"Fortran 测试套件,可用于测试任何 Fortran 编译器。" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" -msgstr "" +msgstr "测试 LFortran 编译器版本:" #: ../../doc/src/progress.md:32 msgid "Topics" -msgstr "" +msgstr "话题" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" -msgstr "" +msgstr "计算有趣事物的完整程序" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" -msgstr "" +msgstr "基本数值" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" -msgstr "" +msgstr "路径:`tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" @@ -4076,123 +4080,139 @@ msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" -msgstr "" +msgstr "BIN" #: ../../doc/src/progress.md msgid "RUN" -msgstr "" +msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" -msgstr "" +msgstr "文件名" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" -msgstr "" +msgstr "`纯 Fortran sin(x) 实现`" #: ../../doc/src/progress.md msgid "✅" -msgstr "" +msgstr "✅" #: ../../doc/src/progress.md msgid "[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90)" msgstr "" +"[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/programs/numerics/t01_sin_implementation.f90)" #: ../../doc/src/progress.md:45 msgid "Modules" -msgstr "" +msgstr "模块" #: ../../doc/src/progress.md:47 msgid "Basic Usage" -msgstr "" +msgstr "基本用法" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" -msgstr "" +msgstr "路径:`tests/modules/basic`" #: ../../doc/src/progress.md msgid "`Basic modules`" -msgstr "" +msgstr "`基本模块`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/basic/t01.f90)" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" -msgstr "" +msgstr "模块函数和子程序" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" -msgstr "" +msgstr "路径:`tests/modules/procedures`" #: ../../doc/src/progress.md msgid "`Module functions`" -msgstr "" +msgstr "`模块函数`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t01.f90)" #: ../../doc/src/progress.md msgid "`Module subroutines`" -msgstr "" +msgstr "`模块子程序`" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t02.f90)" #: ../../doc/src/progress.md msgid "`Nested subroutines`" -msgstr "" +msgstr "`嵌套子程序`" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" +"[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t03.f90)" #: ../../doc/src/progress.md:67 msgid "Expressions" -msgstr "" +msgstr "表达式" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" -msgstr "" +msgstr "算术运算" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" -msgstr "" +msgstr "路径:`tests/expressions/arit`" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" -msgstr "" +msgstr "`+,-,*,/,**`" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" +"[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/arit/basic_operations.f90)" #: ../../doc/src/progress.md:78 msgid "Integers" -msgstr "" +msgstr "整型" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" -msgstr "" +msgstr "路径:`tests/expressions/integers`" #: ../../doc/src/progress.md msgid "`integers`" -msgstr "" +msgstr "`整型`" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" +"[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/integers/integer_kind.f90)" #: ../../doc/src/progress.md msgid "`relational operations`" -msgstr "" +msgstr "`关系运算`" #: ../../doc/src/progress.md msgid "[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90)" msgstr "" +"[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/integers/t01_rel_operations.f90)" #: ../../doc/src/progress.md msgid "`logical operations`" @@ -4212,11 +4232,13 @@ msgstr "" #: ../../doc/src/progress.md msgid "`single/double reals`" -msgstr "" +msgstr "`单/双精度实数`" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" +"[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/real_kind.f90)" #: ../../doc/src/progress.md msgid "`defined operator`" @@ -4224,7 +4246,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "❌" -msgstr "" +msgstr "❌" #: ../../doc/src/progress.md msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" @@ -4269,6 +4291,8 @@ msgstr "" #: ../../doc/src/progress.md msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" msgstr "" +"[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/character/t02_concat_operation.f90)" #: ../../doc/src/progress.md:118 msgid "Derived Types" @@ -4276,15 +4300,17 @@ msgstr "" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" -msgstr "" +msgstr "路径:`tests/expressions/derived_type`" #: ../../doc/src/progress.md msgid "`basic derived types`" -msgstr "" +msgstr "`基本派生类型`" #: ../../doc/src/progress.md msgid "[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90)" msgstr "" +"[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/derived_type/t01_derived_type.f90)" #: ../../doc/src/progress.md:127 msgid "Statements" @@ -4296,7 +4322,7 @@ msgstr "" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" -msgstr "" +msgstr "路径:`tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" @@ -4312,7 +4338,7 @@ msgstr "" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" -msgstr "" +msgstr "路径:`tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" @@ -4328,7 +4354,7 @@ msgstr "" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" -msgstr "" +msgstr "路径:`tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" @@ -4352,311 +4378,387 @@ msgstr "" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" -msgstr "" +msgstr "路径:`tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" -msgstr "" +msgstr "`Test .false.`" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" +"[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_01.f90)" #: ../../doc/src/progress.md msgid "`single line if statement`" -msgstr "" +msgstr "`单行 if 语句`" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" +"[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_02.f90)" #: ../../doc/src/progress.md msgid "`multi line if statement`" -msgstr "" +msgstr "`多行 if 语句`" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" +"[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_03.f90)" #: ../../doc/src/progress.md msgid "`nested if statements`" -msgstr "" +msgstr "`嵌套的 if 语句`" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" +"[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_04.f90)" #: ../../doc/src/progress.md:169 msgid "While Statement" -msgstr "" +msgstr "While 语句" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" -msgstr "" +msgstr "路径:`tests/statements/while`" #: ../../doc/src/progress.md msgid "`Simple while loops`" -msgstr "" +msgstr "`简单的 while 循环`" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" +"[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_01.f90)" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" -msgstr "" +msgstr "`从 while 循环退出/跳过`" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" +"[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_02.f90)" #: ../../doc/src/progress.md:179 msgid "Print Statement" -msgstr "" +msgstr "Print 声明" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" -msgstr "" +msgstr "路径:`tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" -msgstr "" +msgstr "`基本 Print`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/print/t01.f90)" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" -msgstr "" +msgstr "Open、Read、Write、Close语句" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" -msgstr "" +msgstr "路径:`tests/statements/file_io`" #: ../../doc/src/progress.md msgid "`open/read/write/close`" -msgstr "" +msgstr "`open/read/write/close`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/file_io/t01.f90)" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" -msgstr "" +msgstr "内置函数" #: ../../doc/src/progress.md:199 msgid "abs" -msgstr "" +msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" -msgstr "" +msgstr "路径:`tests/intrinsic/abs`" #: ../../doc/src/progress.md msgid "`scalar single/double real`" -msgstr "" +msgstr "`scalar single/double real`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" -msgstr "" +msgstr "`scalar single/double complex`" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" -msgstr "" +msgstr "`array 1D single/double real`" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t03_array1d_real.f90)" #: ../../doc/src/progress.md:210 msgid "exp" -msgstr "" +msgstr "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" -msgstr "" +msgstr "路径:`tests/intrinsic/exp`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t03_array1d_real.f90)" #: ../../doc/src/progress.md:221 msgid "log" -msgstr "" +msgstr "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" -msgstr "" +msgstr "路径:`tests/intrinsic/log`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t03_array1d_real.f90)" #: ../../doc/src/progress.md:232 msgid "sqrt" -msgstr "" +msgstr "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" -msgstr "" +msgstr "路径:`tests/intrinsic/sqrt`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t03_array1d_real.f90)" #: ../../doc/src/progress.md:243 msgid "sin" -msgstr "" +msgstr "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" -msgstr "" +msgstr "路径:`tests/intrinsic/sin`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:254 msgid "cos" -msgstr "" +msgstr "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" -msgstr "" +msgstr "路径:`tests/intrinsic/cos`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:265 msgid "tan" -msgstr "" +msgstr "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" -msgstr "" +msgstr "路径:`tests/intrinsic/tan`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:276 msgid "sinh" -msgstr "" +msgstr "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" -msgstr "" +msgstr "路径:`tests/intrinsic/sinh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:287 msgid "cosh" -msgstr "" +msgstr "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" -msgstr "" +msgstr "路径:`tests/intrinsic/cosh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:298 msgid "tanh" -msgstr "" +msgstr "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" -msgstr "" +msgstr "路径:`tests/intrinsic/tanh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:309 msgid "asin" @@ -4664,19 +4766,25 @@ msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" -msgstr "" +msgstr "路径:`tests/intrinsic/asin`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:320 msgid "acos" @@ -4684,139 +4792,171 @@ msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" -msgstr "" +msgstr "路径:`tests/intrinsic/acos`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:331 msgid "atan" -msgstr "" +msgstr "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" -msgstr "" +msgstr "路径:`tests/intrinsic/atan`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:342 msgid "modulo" -msgstr "" +msgstr "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" -msgstr "" +msgstr "路径:`tests/intrinsic/modulo`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t03_array1d_real.f90)" #: ../../doc/src/progress.md:352 msgid "mod" -msgstr "" +msgstr "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" -msgstr "" +msgstr "路径:`tests/intrinsic/mod`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t03_array1d_real.f90)" #: ../../doc/src/progress.md:362 msgid "min" -msgstr "" +msgstr "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" -msgstr "" +msgstr "路径:`tests/intrinsic/min`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/min/t01_scalar_real.f90)" #: ../../doc/src/progress.md:371 msgid "max" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/min/t01_scalar_real.f90)" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" -msgstr "" +msgstr "路径:`tests/intrinsic/max`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/max/t01_scalar_real.f90)" #: ../../doc/src/progress.md:380 msgid "int" -msgstr "" +msgstr "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" -msgstr "" +msgstr "路径:`tests/intrinsic/int`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/int/t01_scalar_real.f90)" #: ../../doc/src/progress.md:389 msgid "real" -msgstr "" +msgstr "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" -msgstr "" +msgstr "路径:`tests/intrinsic/real`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/real/t01_scalar_real.f90)" #: ../../doc/src/progress.md:398 msgid "floor" -msgstr "" +msgstr "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" -msgstr "" +msgstr "路径:`tests/intrinsic/floor`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/floor/t01_scalar_real.f90)" #: ../../doc/src/progress.md:407 msgid "nint" -msgstr "" +msgstr "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" -msgstr "" +msgstr "路径:`tests/intrinsic/nint`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" From 2e32a55a5826dd7c489d6c05bbdf9fc280989f69 Mon Sep 17 00:00:00 2001 From: Ys413 <2020172007@stu.mdjnu.edu.cn> Date: Wed, 31 Aug 2022 13:37:39 +0000 Subject: [PATCH 26/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (837 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 60 ++++++++++++++++++---------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index aa5943e690..53ed1fcd54 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" "PO-Revision-Date: 2022-09-01 06:50+0000\n" -"Last-Translator: 左志华 \n" +"Last-Translator: Ys413 <2020172007@stu.mdjnu.edu.cn>\n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -4216,19 +4216,21 @@ msgstr "" #: ../../doc/src/progress.md msgid "`logical operations`" -msgstr "" +msgstr "`逻辑运算`" #: ../../doc/src/progress.md msgid "[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90)" msgstr "" +"[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/integers/t02_logical_operations.f90)" #: ../../doc/src/progress.md:89 msgid "Real Numbers" -msgstr "" +msgstr "实数" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" -msgstr "" +msgstr "目录:`tests/expressions/reals`" #: ../../doc/src/progress.md msgid "`single/double reals`" @@ -4242,7 +4244,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`defined operator`" -msgstr "" +msgstr "`定义的运算符`" #: ../../doc/src/progress.md msgid "❌" @@ -4251,42 +4253,48 @@ msgstr "❌" #: ../../doc/src/progress.md msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" msgstr "" +"[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/t01_def_op.f90)" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" -msgstr "" +msgstr "复数" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" -msgstr "" +msgstr "目录:`tests/expressions/complex`" #: ../../doc/src/progress.md msgid "`single/double complex`" -msgstr "" +msgstr "`单/双复数`" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" +"[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/complex/complex_kind.f90)" #: ../../doc/src/progress.md:108 msgid "Strings" -msgstr "" +msgstr "字符串" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" -msgstr "" +msgstr "目录:`tests/expressions/character`" #: ../../doc/src/progress.md msgid "`character`" -msgstr "" +msgstr "`字符`" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" +"[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/character/t01_character.f90)" #: ../../doc/src/progress.md msgid "`string concatenation`" -msgstr "" +msgstr "`字符串连接`" #: ../../doc/src/progress.md msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" @@ -4296,7 +4304,7 @@ msgstr "" #: ../../doc/src/progress.md:118 msgid "Derived Types" -msgstr "" +msgstr "派生类型" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" @@ -4314,11 +4322,11 @@ msgstr "" #: ../../doc/src/progress.md:127 msgid "Statements" -msgstr "" +msgstr "声明" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" -msgstr "" +msgstr "分配语句" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" @@ -4326,15 +4334,17 @@ msgstr "路径:`tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" -msgstr "" +msgstr "`分配语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/allocate/t01.f90)" #: ../../doc/src/progress.md:138 msgid "Block Statement" -msgstr "" +msgstr "块语句" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" @@ -4342,15 +4352,17 @@ msgstr "路径:`tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" -msgstr "" +msgstr "`块语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/block/t01.f90)" #: ../../doc/src/progress.md:147 msgid "Goto Statement" -msgstr "" +msgstr "转到语句" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" @@ -4358,23 +4370,27 @@ msgstr "路径:`tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" -msgstr "" +msgstr "`计算的首选语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t01.f90)" #: ../../doc/src/progress.md msgid "`go-to statement`" -msgstr "" +msgstr "`首选声明`" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t02.f90)" #: ../../doc/src/progress.md:157 msgid "If Statement" -msgstr "" +msgstr "如果语句" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" From 97f031f07d99a8feba2caf1212cf28c09487a15d Mon Sep 17 00:00:00 2001 From: Asdrubal Lozada-Blanco Date: Wed, 31 Aug 2022 11:59:28 +0000 Subject: [PATCH 27/46] Translated using Weblate (Spanish) Currently translated at 44.2% (370 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/es/ --- doc/locale/es/LC_MESSAGES/docs.po | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/locale/es/LC_MESSAGES/docs.po b/doc/locale/es/LC_MESSAGES/docs.po index e016b69ccb..bd287ee7b3 100644 --- a/doc/locale/es/LC_MESSAGES/docs.po +++ b/doc/locale/es/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-29 23:56+0000\n" +"PO-Revision-Date: 2022-09-01 08:03+0000\n" "Last-Translator: Asdrubal Lozada-Blanco \n" "Language-Team: Spanish \n" @@ -2921,37 +2921,41 @@ msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" -msgstr "" +msgstr "len_trim(cadena): Longitud ignorando los espacios en blanco finales" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" +"Longitud de una cadena de caracteres que ignora los caracteres en blanco " +"finales." #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." -msgstr "" +msgstr "`string` el valor de entrada del tipo de carácter." #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." -msgstr "" +msgstr "El valor de retorno es de tipo entero sin signo." #: ../../doc/src/intrinsics/character/len_trim.md:24 msgid "" "**len_trim(string)** returns the length of the character argument without" " including trailing blank character(s)." msgstr "" +"**len_trim(cadena)** devuelve la longitud del argumento de carácter sin " +"incluir los caracteres en blanco finales." #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." -msgstr "" +msgstr "El tipo de argumento admitido es un carácter." #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" -msgstr "" +msgstr "lge(x, y): léxicamente mayor o igual" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." -msgstr "" +msgstr "Léxicamente mayor que o igual." #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." From 78ffd6f98b72adfd8a5e4374bd3f21e16c564931 Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Wed, 31 Aug 2022 00:33:52 +0000 Subject: [PATCH 28/46] Translated using Weblate (Portuguese) Currently translated at 20.6% (173 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/pt/ --- doc/locale/pt/LC_MESSAGES/docs.po | 37 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/doc/locale/pt/LC_MESSAGES/docs.po b/doc/locale/pt/LC_MESSAGES/docs.po index 9068b9bf60..24e4baa35c 100644 --- a/doc/locale/pt/LC_MESSAGES/docs.po +++ b/doc/locale/pt/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-27 14:18+0000\n" +"PO-Revision-Date: 2022-09-01 08:03+0000\n" "Last-Translator: Ian Giestas Pauli \n" "Language-Team: Portuguese \n" @@ -357,11 +357,11 @@ msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" -msgstr "" +msgstr "A seção é testada com `lfortran --show-asr examples/expr2.f90`" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" -msgstr "" +msgstr "Implemente o Novo Token no LLVM" #: ../../doc/src/contributing.md:186 msgid "" @@ -369,22 +369,27 @@ msgid "" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" +"Para implementá-lo no LLVM estendemos a tradução da BinOp (operação binária) " +"para o novo operador. Primeiro adicionamos os dois números e depois " +"dividimos por dois. :fontawesome-solid-code:*src/lfortran/codegen/asr_to_llvm" +".cpp*" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" -msgstr "" +msgstr "Esta seção é testada usando `lfortran --show-llvm examples/expr2.f90`" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" +"Agora que o LLVM funciona, podemos finalmente testar o executável usando:" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." -msgstr "" +msgstr "O que deve mostrar na tela 6." #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" -msgstr "" +msgstr "Também funciona interativamente:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" @@ -2261,7 +2266,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "Teste de bit." #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" @@ -3870,7 +3875,7 @@ msgstr "Tópicos" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" -msgstr "" +msgstr "Programas completos em que fazemos cálculo de algo interessante" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" @@ -3878,7 +3883,7 @@ msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" -msgstr "" +msgstr "Diretório: `tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" @@ -3900,7 +3905,7 @@ msgstr "Nome do arquivo" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" -msgstr "" +msgstr "`Implementação em Fortran puro de sin(x)`" #: ../../doc/src/progress.md #, fuzzy @@ -3920,11 +3925,11 @@ msgstr "Módulos" #: ../../doc/src/progress.md:47 msgid "Basic Usage" -msgstr "" +msgstr "Utilização básica" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" -msgstr "" +msgstr "Diretório: `tests/modules/basic`" #: ../../doc/src/progress.md msgid "`Basic modules`" @@ -3939,7 +3944,7 @@ msgstr "" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" -msgstr "" +msgstr "Sub-rotinas e Funções dos Módulos" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" @@ -4241,7 +4246,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`single line if statement`" -msgstr "" +msgstr "`comando if na mesma linha`" #: ../../doc/src/progress.md #, fuzzy @@ -4252,7 +4257,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`multi line if statement`" -msgstr "" +msgstr "`comando if ao longo de várias linhas`" #: ../../doc/src/progress.md #, fuzzy @@ -4293,7 +4298,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" -msgstr "" +msgstr "`exit / cycle em laços while`" #: ../../doc/src/progress.md #, fuzzy From 7045b078c2b50b3f7489ee39805777794866647f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=BF=97=E5=8D=8E?= Date: Thu, 1 Sep 2022 06:58:36 +0000 Subject: [PATCH 29/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (837 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/zh_Hans/ --- doc/locale/zh_CN/LC_MESSAGES/docs.po | 261 ++++++++++++++------------- 1 file changed, 132 insertions(+), 129 deletions(-) diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index 53ed1fcd54..6d15657141 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-09-01 06:50+0000\n" -"Last-Translator: Ys413 <2020172007@stu.mdjnu.edu.cn>\n" +"PO-Revision-Date: 2022-09-01 08:03+0000\n" +"Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -102,8 +102,8 @@ msgid "" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" -"我们欢迎任何人的贡献,即使您是开源新手。起初为编译器做贡献可能听起来令人生畏" -",但可以尝试去做,这并不复杂。我们将帮助您解决任何技术问题并帮助改进您的贡献" +"我们欢迎任何人的贡献,即使你是开源新手。起初为编译器做贡献可能听起来令人生畏" +",但可以尝试去做,这并不复杂。我们将帮助你解决任何技术问题并帮助改进你的贡献" ",以便将其合并。" #: ../../doc/src/contributing.md:8 @@ -112,11 +112,11 @@ msgstr "基本设置" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" -msgstr "要做出贡献,请确保您的设置:" +msgstr "要做出贡献,请确保你的设置:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" -msgstr "您的用户名 + 电子邮件" +msgstr "你的用户名 + 电子邮件" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" @@ -124,7 +124,7 @@ msgstr "你的 `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" -msgstr "您的 shell 提示显示当前分支名称" +msgstr "你的 shell 提示显示当前分支名称" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" @@ -141,14 +141,14 @@ msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" -"步骤 2. 使用 GitHub 设置您的 [SSH 密钥](https://docs.github.com/en/" +"步骤 2. 使用 GitHub 设置你的 [SSH 密钥](https://docs.github.com/en/" "authentication/connecting-to-github-with-ssh)" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" -msgstr "步骤 3. 从 GitHub 克隆项目存储库并设置您的远程存储库" +msgstr "步骤 3. 从 GitHub 克隆项目存储库并设置你的远程存储库" #: ../../doc/src/contributing.md:29 msgid "" @@ -162,14 +162,14 @@ msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" -":fontawesome-solid-edit: `YOUR_GITHUB_ID` 是您在 GitHub 上的用户 " -"ID,应该是您帐户路径的一部分。" +":fontawesome-solid-edit: `YOUR_GITHUB_ID` 是你在 GitHub 上的用户 " +"ID,应该是你帐户路径的一部分。" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." -msgstr "您可以使用 `git remote -v` 检查新远程地址是否设置正确。" +msgstr "你可以使用 `git remote -v` 检查新远程地址是否设置正确。" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" @@ -196,7 +196,7 @@ msgstr "[这里](https://chris.beams.io/posts/git-commit/) " #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" -msgstr "第 4 步:检查以确保您的更改看起来不错" +msgstr "第 4 步:检查以确保你的更改看起来不错" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" @@ -211,7 +211,7 @@ msgid "" " the \"Create\" button. Yay you are now all set." msgstr "" "该命令会将新分支 `fix1` 推送到您之前创建的远程存储库 `REMOTE_NAME` 中。此外," -"它还将显示一个链接,您可以单击该链接以打开新的合并请求。单击链接后,写下标题" +"它还将显示一个链接,你可以单击该链接以打开新的合并请求。单击链接后,写下标题" "和简明描述,然后单击 `创建` 按钮。是的,你现在一切就绪。" #: ../../doc/src/contributing.md:66 @@ -368,7 +368,7 @@ msgid "" "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" -"如果您有任何问题或需要帮助,请通过我们的 [mailinglist](https://groups.io/g/" +"如果你有任何问题或需要帮助,请通过我们的 [mailinglist](https://groups.io/g/" "lfortran) 或 [chat](https://lfortran.zulipchat.com/) 提问。" #: ../../doc/src/contributing.md:248 @@ -378,7 +378,7 @@ msgid "" "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" -"请注意,该项目的所有参与者都应遵守我们的行为准则。参与本项目即表示您同意遵守" +"请注意,该项目的所有参与者都应遵守我们的行为准则。参与本项目即表示你同意遵守" "其条款。请参阅 [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/" "blob/main/CODE_OF_CONDUCT.md)。" @@ -389,8 +389,8 @@ msgid "" "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" -"通过提交 PR,您同意根据 LFortran 的 BSD [许可](https://github.com/lfortran/" -"lfortran/blob/main/LICENSE) 许可您的贡献,除非另有明确说明。" +"通过提交 PR,你同意根据 LFortran 的 BSD [许可](https://github.com/lfortran/" +"lfortran/blob/main/LICENSE) 许可你的贡献,除非另有明确说明。" #: ../../doc/src/design.md:1 msgid "LFortran Design" @@ -628,7 +628,7 @@ msgstr "" "变量,如果这是一个接口,则需要指定在哪里可以找到实现,否则为body 提供了语句," "这些节点与 AST 中的几乎相同,除了每个变量只是对符号表中的符号的引用(因此通过" "构造一个不能有未定义的变量)。每个节点(例如 Function 或 " -"Module)的符号表也引用其父节点(例如,函数引用模块,模块引用全局范围)。" +"Module)的符号表也引用其父节点(例如,函数引用模块,模块引用全局作用域)。" #: ../../doc/src/design.md:102 msgid "" @@ -692,9 +692,9 @@ msgid "" "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" -"我们通过引入_全局范围_来扩展 Fortran 语言,它不仅是_程序单元_列表(如 F2008 " -"中),还可以包括语句、声明、使用语句和表达式。我们将_全局范围_定义为以下项目" -"的集合:" +"我们通过引入_全局作用域_来扩展 Fortran 语言,它不仅是_程序单元_列表(如 " +"F2008 中),还可以包括语句、声明、使用语句和表达式。我们将_全局作用域_定义为" +"以下项目的集合:" #: ../../doc/src/design.md:134 msgid "use statement" @@ -723,7 +723,7 @@ msgid "" msgstr "" "此外,如果变量没有在赋值语句中定义(例如`x = " "5+3`),则从右侧推断变量的类型(例如,`x` in `x = 5+3 ` 将是 `integer` 类型," -"而 `y = 5._dp` 中的 `y` 将是 `real(dp)` 类型)。此规则仅适用于 _全局范围_ " +"而 `y = 5._dp` 中的 `y` 将是 `real(dp)` 类型)。此规则仅适用于 _全局作用域_ " "的顶层。类型必须在主程序、模块、函数和子程序中完全指定,就像在 F2008 中一样。" #: ../../doc/src/design.md:146 @@ -733,14 +733,14 @@ msgid "" "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" -"_全局范围_ 有自己的符号表。主程序和模块/子模块看不到此符号表中的任何符号。但" -"是_全局范围_顶层的函数、子例程、语句和表达式使用和操作这个符号表。" +"_全局作用域_ 有自己的符号表。主程序和模块/子模块看不到此符号表中的任何符号。" +"但是_全局作用域_顶层的函数、子例程、语句和表达式使用和操作这个符号表。" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" -msgstr "_全局范围_ 在符号表中预定义了以下符号:" +msgstr "_全局作用域_ 在符号表中预定义了以下符号:" #: ../../doc/src/design.md:153 msgid "" @@ -918,7 +918,7 @@ msgstr "开发者指南" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "LFortran 内在函数" +msgstr "LFortran 内置函数" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" @@ -1204,7 +1204,7 @@ msgstr "安装" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." -msgstr "以下所有说明都适用于 Linux、macOS 和 Windows。" +msgstr "以下所有说明适用于 Linux、macOS 和 Windows。" #: ../../doc/src/installation.md:5 msgid "Binaries" @@ -1219,7 +1219,7 @@ msgid "" "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" -"安装 LFortran 的推荐方法是使用 Conda。例如,按照您的平台的说明安装 " +"安装 LFortran 的推荐方法是使用 Conda。例如,按照你的平台的说明安装 " "[Miniconda](https://conda.io/en/latest/miniconda.html),安装 " "Conda。然后创建一个新环境(你可以选择任何名称,这里我们选择了`lf`)并激活它:" @@ -1248,7 +1248,7 @@ msgstr "你可以通过执行以下命令来创建基于 Fortran 的 Jupyter 笔 #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "并选择`New->Fortran`。" +msgstr "并选择 `New->Fortran`。" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" @@ -1320,7 +1320,7 @@ msgstr "生成构建所需的文件(此步骤取决于 `re2c`、`bison` 和 `p msgid "" "Now the process is the same as installing from the source tarball. For " "example to build in Debug mode:" -msgstr "现在的过程与从源tarball安装相同。例如在Debug模式下构建:" +msgstr "现在的过程与从源 tarball 安装相同。例如在 Debug 模式下构建:" #: ../../doc/src/installation.md:92 msgid "Run tests:" @@ -1332,7 +1332,7 @@ msgstr "运行交互式提示符:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" -msgstr "在Windows上使用Visual Studio从Git构建" +msgstr "在 Windows 上使用 Visual Studio 从 Git 构建" #: ../../doc/src/installation.md:104 msgid "" @@ -1340,8 +1340,8 @@ msgid "" "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" -"安装Visual Studio (MSVC),例如2022版本,可以从: https://visualstudio." -"microsoft.com/downloads/ 免费下载社区版本。" +"安装 Visual Studio (MSVC),例如 2022 " +"版本,可以免费下载社区版本:https://visualstudio.microsoft.com/downloads/ 。" #: ../../doc/src/installation.md:107 msgid "" @@ -1357,11 +1357,11 @@ msgstr "从桌面上启动 Miniforge Prompt。" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" -msgstr "在shell中,用以下方法初始化MSVC编译器:" +msgstr "在 shell 中,用以下方法初始化 MSVC 编译器:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" -msgstr "你可以选择通过以下方式测试MSVC是否工作:" +msgstr "你可以选择通过以下方式测试 MSVC 是否工作:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." @@ -1369,11 +1369,11 @@ msgstr "这两个命令都必须打印帮助信息(若干页)。" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" -msgstr "现在你可以下载并建立LFortran:" +msgstr "现在你可以下载并建立 LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" -msgstr "如果一切都编译好了,那么你就可以使用LFortran,如下所示:" +msgstr "如果一切都编译好了,那么你就可以使用 LFortran,如下所示:" #: ../../doc/src/installation.md:140 msgid "And so on." @@ -1385,8 +1385,8 @@ msgid "" "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" -"注意:LFortran目前使用MSVC的链接器程序(`link`),只有在运行上面的MSVC " -"bat脚本时才能使用。如果你忘记激活它,LFortran的链接就会失败。" +"注意:LFortran 目前使用 MSVC 的链接器程序(`link`),只有在运行上面的 MSVC " +"bat 脚本时才能使用。如果你忘记激活它,LFortran 的链接就会失败。" #: ../../doc/src/installation.md:146 msgid "" @@ -1396,30 +1396,30 @@ msgid "" "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" -"注意:miniforge shell似乎在运行某个版本的`git-bash`(尽管它是`cmd.exe`),它" -"有一些类似unix的文件系统挂载在`/usr`,有几个命令可用,如`ls`、`which`、`git`" -"、`vim`。 由于这个原因,Conda构建的`environment_win." -"yml`包含了所有需要的东西,包括`git`。" +"注意:miniforge shell 似乎在运行某个版本的 `git-bash`(尽管它是`cmd.exe`)," +"它有一些类似 unix 的文件系统挂载在 " +"`/usr`,有几个命令可用,如`ls`、`which`、`git`、`vim`。 由于这个原因,Conda " +"构建的 `environment_win.yml` 包含了所有需要的东西,包括 `git`。" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" -msgstr "用WSL在Windows上从Git构建" +msgstr "用 WSL 在 Windows上 从 Git 构建" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." -msgstr "在windows中搜索 \"打开或关闭windows功能\"。" +msgstr "在 Windows 中搜索“打开或关闭 Windows 功能”。" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." -msgstr "标记Linux的Windows子系统。" +msgstr "标记适用于Linux 的 Windows 子系统。" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." -msgstr "按 \"确定 \"并重新启动计算机。" +msgstr "按“确定”并重新启动计算机。" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." -msgstr "到微软商店下载Ubuntu 20.04,并启动它。" +msgstr "到微软商店下载 Ubuntu 20.04,并启动它。" #: ../../doc/src/installation.md:157 msgid "Run the following commands." @@ -1435,11 +1435,11 @@ msgstr "然后转到文件底部,粘贴以下内容" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" -msgstr "然后按ctrl + O(保存),Enter(确认),ctrl + X(退出)" +msgstr "然后按 ctrl + O(保存),Enter(确认),ctrl + X(退出)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" -msgstr "之后,重新启动Ubuntu" +msgstr "之后,重新启动 Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" @@ -1447,13 +1447,14 @@ msgstr "运行以下内容" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "再次重启Ubuntu" +msgstr "再次重启 Ubuntu" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." -msgstr "你可以使用 `cd /mnt/[drive letter]/[windows location]`将目录改为Windows位置。" +msgstr "你可以使用 `cd /mnt/[drive letter]/[windows location]`将路径改为 Windows " +"位置。" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" @@ -1461,7 +1462,7 @@ msgstr "例如:`cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" -msgstr "现在克隆LFortran的git仓库" +msgstr "现在克隆 LFortran 的 git 仓库" #: ../../doc/src/installation.md:196 msgid "Run the following commands" @@ -1469,7 +1470,7 @@ msgstr "运行以下命令" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" -msgstr "如果一切都能编译,你可以使用LFortran,如下所示" +msgstr "如果一切都能编译,你可以使用 LFortran,如下所示" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" @@ -1481,35 +1482,36 @@ msgstr "运行测试" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" -msgstr "启用Jupyter内核" +msgstr "启用 Jupyter 内核" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" -msgstr "要安装Jupyter内核,还要安装以下Conda软件包:" +msgstr "要安装 Jupyter 内核,还要安装以下 Conda 软件包:" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" -msgstr "并通过`-DWITH_XEUS=yes`启用内核,然后安装到`$CONDA_PREFIX`。比如说:" +msgstr "并通过 `-DWITH_XEUS=yes` 启用内核,然后安装到 `$CONDA_PREFIX`。比如:" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" -msgstr "要使用它,请安装Jupyter(`conda install jupyter`)并测试是否找到LFortran内核:" +msgstr "要使用它,请安装 Jupyter(`conda install jupyter`)并测试是否找到 LFortran " +"内核:" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" -msgstr "然后启动Jupyter notebook,如下所示:" +msgstr "然后启动 Jupyter notebook,如下所示:" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" -msgstr "单击`新的- > Fortran`。启动jupyter LFortran终端控制台:" +msgstr "单击 `New - > Fortran`。启动 jupyter LFortran 终端控制台:" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" -msgstr "使用Nix从Git构建" +msgstr "使用 Nix 从 Git 构建" #: ../../doc/src/installation.md:256 msgid "" @@ -1518,8 +1520,9 @@ msgid "" "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" -"确保精确环境和依赖关系的方法之一是使用`nix`。这将确保系统的依赖性不会干扰到开" -"发环境。如果你愿意,你可以在`nix-shell`环境下报告bug,以方便别人复制。" +"确保精确环境和依赖关系的方法之一是使用 " +"`nix`。这将确保系统的依赖性不会干扰到开发环境。如果你愿意,你可以在 `nix-" +"shell` 环境下报告 bug,以方便别人复制。" #: ../../doc/src/installation.md:258 msgid "With Root" @@ -1530,8 +1533,8 @@ msgid "" "We start by getting `nix`. The following multi-user installation will " "work on any machine with a Linux distribution, MacOS or Windows (via " "WSL):" -msgstr "我们从获得`nix`开始。下面的多用户安装将在任何装有Linux发行版、MacOS或Windows" -"(通过WSL)的机器上工作:" +msgstr "我们从获得 `nix` 开始。下面的多用户安装将在任何装有 Linux 发行版、MacOS 或 " +"Windows(通过 WSL)的机器上工作:" #: ../../doc/src/installation.md:264 msgid "Without Root" @@ -1565,17 +1568,17 @@ msgstr "现在进入开发环境:" msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." -msgstr "`--pure`标志确保在环境中不使用系统依赖。" +msgstr "`--pure` 标志确保在环境中不使用系统依赖。" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" -msgstr "构建步骤与 `ci `相同:" +msgstr "构建步骤与 `ci ` 相同:" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" -msgstr "要把编译环境从`gcc`(默认)改为`clang`,我们可以使用`--argstr`:" +msgstr "要把编译环境从 `gcc`(默认)改为 `clang`,我们可以使用 `--argstr`:" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" @@ -1597,22 +1600,23 @@ msgid "" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" -"这个tarball是由我们的CI(持续集成)自动生成的,包含一些自动生成的文件:解析器" -"、AST和ASR节点,由ASDL翻译器生成(需要Python)。" +"这个 tarball 是由我们的 " +"CI(持续集成)自动生成的,包含一些自动生成的文件:解析器、AST 和 ASR 节点," +"由 ASDL 翻译器生成(需要 Python)。" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." -msgstr "在开发LFortran本身时要使用来自git的指令。" +msgstr "在开发 LFortran 本身时要使用来自 git 的指令。" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" -msgstr "不使用Conda的用户注意" +msgstr "不使用 Conda 的用户注意" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," -msgstr "以下是在开发模式下安装此版本库的必要依赖," +msgstr "以下是在开发模式下安装此版本库的必要依赖," #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" @@ -1638,8 +1642,8 @@ msgid "" "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" "[binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2." -"31.90.tar.xz) - 确保你应该启用与此依赖关系相关的必要选项来构建动态库(以`." -"so`结尾的库)。" +"31.90.tar.xz) —— 确保你应该启用与此依赖关系相关的必要选项来构建动态库(以 `." +"so` 结尾的库)。" #: ../../doc/src/installation.md:319 msgid "Stacktraces" @@ -1656,9 +1660,9 @@ msgid "" "instructions below." msgstr "" "LFortran 可以在出现未处理的异常时打印堆栈跟踪,也可以在任何编译器错误时使用 " -"`--show-stacktrace` 选项。这对开发编译器本身很有帮助,可以看到LFortran中的问" -"题所在。默认情况下,堆栈跟踪支持是关闭的,要启用它,需要在每个平台上按照下面" -"的说明安装先决条件后,用`-DWITH_STACKTRACE=yes` cmake选项编译LFortran。" +"`--show-stacktrace` 选项。这对开发编译器本身很有帮助,可以看到 LFortran 中的" +"问题所在。默认情况下,堆栈跟踪支持是关闭的,要启用它,需要在每个平台上按照下" +"面的说明安装先决条件后,用`-DWITH_STACKTRACE=yes` cmake 选项编译 LFortran。" #: ../../doc/src/installation.md:328 msgid "Ubuntu" @@ -1666,7 +1670,7 @@ msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." -msgstr "在Ubuntu系统, `apt install binutils-dev`." +msgstr "在 Ubuntu 系统,`apt install binutils-dev`。" #: ../../doc/src/installation.md:332 msgid "macOS" @@ -1680,23 +1684,24 @@ msgid "" "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" -"如果你在macOS上使用默认的Clang编译器,那么堆栈跟踪应该正好在基于Intel和M1的ma" -"cOS上工作(CMake构建系统自动调用`dsymtuil`工具和我们的Python脚本来存储调试信" -"息,更多细节见`src/bin/CMakeLists.txt`)。如果不能工作,请报告一个错误。" +"如果你在 macOS 上使用默认的 Clang 编译器,那么堆栈跟踪应该正好在基于 Intel " +"和 M1 的 macOS 上工作(CMake 构建系统自动调用 `dsymtuil` 工具和我们的 Python " +"脚本来存储调试信息,更多细节见 `src/bin/CMakeLists." +"txt`)。如果不能工作,请报告一个错误。" #: ../../doc/src/installation.md:340 msgid "" "If you do not like the default way, an alternative is to use bintutils. " "For that, first install [Spack](https://spack.io/), then:" -msgstr "如果你不喜欢默认的方式,另一个选择是使用bintutils。为此,首先安装[Spack](http" -"s://spack.io/),然后:" +msgstr "如果你不喜欢默认的方式,另一个选择是使用bintutils。为此,首先安装 " +"[Spack](https://spack.io/),然后:" #: ../../doc/src/installation.md:347 msgid "" "The last command will show a full path to the installed `binutils` " "package. Add this path to your shell config file, e.g.:" -msgstr "最后一条命令将显示已安装的`binutils`软件包的完整路径。把这个路径添加到你的she" -"ll配置文件中,例如:" +msgstr "最后一条命令将显示已安装的 `binutils` 软件包的完整路径。把这个路径添加到你的 " +"shell 配置文件中,例如:" #: ../../doc/src/installation.md:352 msgid "" @@ -1705,17 +1710,17 @@ msgid "" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" -"并使用`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cma" -"ke选项编译LFortran。`$CONDA_PREFIX`是在你使用Conda安装了一些其他的依赖项(如`" -"llvm`)的情况下出现的,否则你可以把它删除。" +"并使用 `-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` " +"cmake 选项编译 LFortran。`$CONDA_PREFIX` 是在你使用 Conda " +"安装了一些其他的依赖项(如 `llvm`)的情况下出现的,否则你可以把它删除。" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "数组内在函数" +msgstr "数组内置函数" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "已分配(x):状态检查" +msgstr "allocated(x):状态检查" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." @@ -1813,7 +1818,7 @@ msgstr "声明" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "句法" +msgstr "语法" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1862,7 +1867,7 @@ msgstr "句法" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "论据" +msgstr "参数" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." @@ -2145,7 +2150,7 @@ msgstr "也可以看看" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" -msgstr "cshift(A, shift [, dim]): 循环移位" +msgstr "cshift(A, shift [, dim]):循环移位" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." @@ -2203,7 +2208,7 @@ msgstr "支持的参数类型是 `A` 的数组和 `shift` 和 `dim` 的整数。 #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" -msgstr "size(x): 数组大小" +msgstr "size(x):数组大小" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." @@ -2399,7 +2404,7 @@ msgstr "`blt(x, y)` 计算一个整数输入值是否按位小于另一个。" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." +msgstr "[bge](bge.md), [ble](ble.md),[bgt](bgt.md)。" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" @@ -2438,7 +2443,7 @@ msgstr "如果 `pos` 小于 0 或大于 `bit_size()`,则 `btest(x, pos)` " #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" -msgstr "shiftl(x, shift): 左移" +msgstr "shiftl(x, shift):左移" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." @@ -2482,11 +2487,11 @@ msgstr "无符号整数值`x`和无符号整数值`shift`中支持的类型(7 #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." -msgstr "[shiftr](shiftr.md)." +msgstr "[shiftr](shiftr.md)。" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" -msgstr "shiftr(x, shift): 右移" +msgstr "shiftr(x, shift):右移" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." @@ -2505,11 +2510,11 @@ msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." -msgstr "[shiftl](shiftl.md)." +msgstr "[shiftl](shiftl.md)。" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "字符内在函数" +msgstr "字符内置函数" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." @@ -2629,7 +2634,7 @@ msgstr "**adjustr(string)** " #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." -msgstr "[adjustl](adjustl.md)." +msgstr "[adjustl](adjustl.md)。" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" @@ -2657,7 +2662,7 @@ msgstr "**char(x)** 返回由 ASCII 字符集在 `x` 位置表示的字符。" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" +msgstr "[achar](achar.md),[iachar](iachar.md),[ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" @@ -2736,7 +2741,7 @@ msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" -msgstr "种类类型内在函数" +msgstr "种类类型内置函数" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" @@ -2777,7 +2782,7 @@ msgstr "无。" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" -msgstr "数学内在函数" +msgstr "数学内置函数" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" @@ -2827,7 +2832,7 @@ msgstr "支持的参数类型 float、double、complex float、complex double。 #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." -msgstr "[asin](asin.md), [atan](atan.md)." +msgstr "[asin](asin.md),[atan](atan.md)。" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" @@ -2884,7 +2889,7 @@ msgstr "对于复数 $x = x + iy$,以及域 $-\\infty < z <= 1$ 中的实数 #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." -msgstr "[asinh](asinh.md), [atanh](atanh.md)." +msgstr "[asinh](asinh.md),[atanh](atanh.md)。" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" @@ -2963,7 +2968,7 @@ msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" -msgstr "atan2(y, x): 反正切" +msgstr "atan2(y, x):反正切" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." @@ -3044,7 +3049,7 @@ msgstr "如果 `y` 为负实零,则结果为 $\\frac{-\\pi}{2}$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." -msgstr "支持的参数类型是真实的。" +msgstr "支持的参数类型是实数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" @@ -3070,7 +3075,7 @@ msgstr "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" -msgstr "如果结果是真实的,它位于范围内" +msgstr "如果结果是实数,它位于范围内" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" @@ -3090,7 +3095,7 @@ msgstr "模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." -msgstr "`x` 输入值,必须是真实的。" +msgstr "`x` 输入值,必须是实数。" #: ../../doc/src/intrinsics/mathematical/fraction.md:19 msgid "" @@ -3116,7 +3121,7 @@ msgstr "$x * {radix(x)}^{(-exponent(x))}$" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" -msgstr "其他内在函数" +msgstr "其他内置函数" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" @@ -3178,7 +3183,7 @@ msgstr "`cpu_time(time)` 的绝对值是没有意义的,只有后续调用这 #: ../../doc/src/intrinsics/misc/cpu_time.md:35 #: ../../doc/src/intrinsics/misc/date_and_time.md:55 msgid "Supported input parameter types is real with `intent(out)`." -msgstr "支持的输入参数类型在 `intent(out)` 中是真实的。" +msgstr "支持的输入参数类型为 `intent(out)` 和实数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" @@ -3272,7 +3277,7 @@ msgstr "不可用或错误的日期和时间参数返回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." -msgstr "[cpu_time](cpu_time.md)." +msgstr "[cpu_time](cpu_time.md)。" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" @@ -3306,7 +3311,7 @@ msgstr "支持的输入参数类型是字符。" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" -msgstr "数值内在函数" +msgstr "数值内置函数" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" @@ -3359,7 +3364,7 @@ msgstr "[ceiling](ceiling.md),[floor](floor.md)。" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" -msgstr "目标: 第一部分" +msgstr "aimag(x):虚部" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." @@ -3440,7 +3445,7 @@ msgstr "**aint(x)** 返回大于或等于 `x` 且不超过输入值大小的最 #: ../../doc/src/intrinsics/numeric/aint.md:33 #: ../../doc/src/intrinsics/numeric/anint.md:36 msgid "The optional parameter `kind` specifies the kind of the result." -msgstr "可选参数`kind` ,指定结果的种类。" +msgstr "可选参数 `kind` ,指定结果的种类。" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 @@ -3450,7 +3455,7 @@ msgstr "可选参数`kind` ,指定结果的种类。" #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." -msgstr "支持的参数类型是真实的。" +msgstr "支持的参数类型是实数。" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 @@ -3536,7 +3541,7 @@ msgid "" "of the result." msgstr "" "`x` 输入值必须是整数、实数或复数。 `y` 可选输入值必须是整数或实数类型。" -"它应该只在 `x` 不复杂的情况下出现。 `kind` " +"它应该只在 `x` 不是复数的情况下出现。 `kind` " "用于初始化的整数表达式类型的可选输入值,指示结果的种类参数。" #: ../../doc/src/intrinsics/numeric/cmplx.md:26 @@ -3665,11 +3670,11 @@ msgstr "$1 + \\epsilon > 1$" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" -msgstr "erf(x): 误差函数" +msgstr "erf(x):误差函数" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." -msgstr "误差函数" +msgstr "误差函数。" #: ../../doc/src/intrinsics/numeric/erf.md:20 msgid "" @@ -3735,7 +3740,7 @@ msgstr "exp(x):指数函数" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." -msgstr "指数函数" +msgstr "指数函数。" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." @@ -4230,7 +4235,7 @@ msgstr "实数" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" -msgstr "目录:`tests/expressions/reals`" +msgstr "路径:`tests/expressions/reals`" #: ../../doc/src/progress.md msgid "`single/double reals`" @@ -4262,7 +4267,7 @@ msgstr "复数" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" -msgstr "目录:`tests/expressions/complex`" +msgstr "路径:`tests/expressions/complex`" #: ../../doc/src/progress.md msgid "`single/double complex`" @@ -4280,7 +4285,7 @@ msgstr "字符串" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" -msgstr "目录:`tests/expressions/character`" +msgstr "路径:`tests/expressions/character`" #: ../../doc/src/progress.md msgid "`character`" @@ -4910,9 +4915,7 @@ msgstr "" #: ../../doc/src/progress.md:371 msgid "max" -msgstr "" -"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" -"master/tests/intrinsic/min/t01_scalar_real.f90)" +msgstr "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" From f8bab9b433c9f927db9e97291729283aabae7d4d Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Fri, 2 Sep 2022 19:58:38 +0000 Subject: [PATCH 30/46] Translated using Weblate (Portuguese) Currently translated at 29.7% (249 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/pt/ --- doc/locale/pt/LC_MESSAGES/docs.po | 187 ++++++++++++++++++------------ 1 file changed, 112 insertions(+), 75 deletions(-) diff --git a/doc/locale/pt/LC_MESSAGES/docs.po b/doc/locale/pt/LC_MESSAGES/docs.po index 24e4baa35c..809bdd82c0 100644 --- a/doc/locale/pt/LC_MESSAGES/docs.po +++ b/doc/locale/pt/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-09-01 08:03+0000\n" +"PO-Revision-Date: 2022-09-03 06:16+0000\n" "Last-Translator: Ian Giestas Pauli \n" "Language-Team: Portuguese \n" @@ -527,56 +527,70 @@ msgid "" "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" +"O LFortran está estruturado em forma de uma biblioteca, podendo ser usado " +"para obter uma AST, ou usar o analisador semântico para obter uma ASR, " +"podendo usá-las em uma aplicação. Também é possível gerar uma ASR " +"diretamente (Ex: a partir do SymPy) e depois convertê-la a uma AST, para em " +"seguida montar um código em Fortran, ou usar o LFortran para compilá-la em " +"código de máquina diretamente. Em outras palavras, é fácil usar o LFortran " +"para converter facilmente entre às três representações equivalentes:" #: ../../doc/src/design.md:42 msgid "Fortran source code" -msgstr "" +msgstr "Código-fonte em Fortran" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" -msgstr "" +msgstr "Árvore de Sintaxe Abstrata (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" -msgstr "" +msgstr "Representação Semântica Abstrata (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" -msgstr "" +msgstr "São todos equivalentes, no seguinte sentido:" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" -msgstr "" +msgstr "Qualquer ASR pode ser convertida em uma AST equivalente" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" +"Qualquer AST pode sempre ser convertida em um código Fortran equivalente" #: ../../doc/src/design.md:50 msgid "" "Any Fortran source code can always be either converted to an equivalent " "AST or one gets a syntax error" msgstr "" +"Qualquer código-fonte em Fortran pode ser sempre convertido em uma AST " +"equivalente ou é emitido um erro de sintaxe" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" +"Qualquer AST pode ser sempre convertida em uma ASR equivalente ou é emitido " +"um erro de semântica" #: ../../doc/src/design.md:55 msgid "" "So when a conversion can be done, they are equivalent, and the conversion" " can always be done unless the code is invalid." msgstr "" +"Então, quando a conversão pode ser realizada, são equivalentes, e esta pode " +"sempre ser realizada, exceto no caso em que o código é invalido." #: ../../doc/src/design.md:58 msgid "ASR Design Details" -msgstr "" +msgstr "Detalhes do design da ASR" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" -msgstr "" +msgstr "A ASR foi imaginada para ter os seguintes recursos:" #: ../../doc/src/design.md:62 msgid "" @@ -584,12 +598,17 @@ msgid "" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" +"A ASR sempre é equivalente semanticamente ao código original Fortran (não " +"perde nenhuma informação). A ASR pode ser convertida em uma AST, e a AST em " +"código-fonte cuja funcionalidade é idêntica a original." #: ../../doc/src/design.md:66 msgid "" "ASR is as simple as possible: it does not contain any information that " "could not be inferred from ASR." msgstr "" +"A ASR é a mais simples possível: não contém nenhuma informação que não pode " +"ser inferida de uma ASR." #: ../../doc/src/design.md:69 msgid "" @@ -618,6 +637,9 @@ msgid "" "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" +"Informação perdida ao construir a ASR a partir do código-fonte: espaços em " +"branco, distinção entre os comandos if na mesma linha e if ao longo de " +"várias linhas, além das letras maiúsculas e minúsculas em palavras-chave." #: ../../doc/src/design.md:87 msgid "" @@ -628,6 +650,11 @@ msgid "" "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" +"Informação perdida quando transformando uma AST em ASR: sintaxe detalhada de " +"como as variáveis foram definidas e a ordem dos atributos de tipo (se a " +"dimensão de um array está usando o atributo `dimension` ou uma expressão " +"parentesada, ou ainda quantas variáveis existiam na linha, ou sua ordem), já " +"que a ASR apenas representa as informações de tipo em uma tabela de símbolos." #: ../../doc/src/design.md:90 msgid "" @@ -676,11 +703,11 @@ msgstr "Programa principal" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" -msgstr "" +msgstr "módulo ou submódulo" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" -msgstr "" +msgstr "função ou sub-rotina" #: ../../doc/src/design.md:120 msgid "" @@ -886,7 +913,7 @@ msgstr "Começando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" -msgstr "" +msgstr "Progresso no Desenvolvimento do LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" @@ -1155,7 +1182,7 @@ msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "" +msgstr "E selecionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" @@ -1274,7 +1301,7 @@ msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." -msgstr "" +msgstr "E assim por diante." #: ../../doc/src/installation.md:142 msgid "" @@ -1334,11 +1361,11 @@ msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" -msgstr "" +msgstr "Execute o seguinte" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "" +msgstr "Reinicie novamente o Ubuntu" #: ../../doc/src/installation.md:187 msgid "" @@ -1348,7 +1375,7 @@ msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" -msgstr "" +msgstr "Ex: `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" @@ -1464,7 +1491,7 @@ msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" -msgstr "" +msgstr "Nota Sobre Dependências" #: ../../doc/src/installation.md:299 msgid "" @@ -1495,18 +1522,23 @@ msgid "" msgstr "" #: ../../doc/src/installation.md:314 +#, fuzzy msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" -msgstr "" +msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 +#, fuzzy msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" msgstr "" +"[LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/" +"llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 +#, fuzzy msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" -msgstr "" +msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" @@ -1575,11 +1607,11 @@ msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas em Arrays" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "" +msgstr "allocated(x): Checagem de Condição" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." @@ -2099,7 +2131,7 @@ msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas de Bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" @@ -2176,8 +2208,9 @@ msgid "**Result:**" msgstr "**Resultado:**" #: ../../doc/src/intrinsics/bit/bge.md:70 +#, fuzzy msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" @@ -2185,7 +2218,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "Maior que bit-a-bit." #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" @@ -2194,12 +2227,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:68 +#, fuzzy msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): Tamanho em Bits" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." @@ -2239,8 +2273,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:70 +#, fuzzy msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" @@ -2248,7 +2283,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "Menor que bit-a-bit." #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" @@ -2257,8 +2292,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:68 +#, fuzzy msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" @@ -2359,7 +2395,7 @@ msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas para Caracteres" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." @@ -2503,8 +2539,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 +#, fuzzy msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" @@ -4094,7 +4131,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" -msgstr "" +msgstr "`número complexo de precisão simples/dupla`" #: ../../doc/src/progress.md #, fuzzy @@ -4109,7 +4146,7 @@ msgstr "Cadeia de Caracteres" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" -msgstr "" +msgstr "Diretório: `tests/expressions/character`" #: ../../doc/src/progress.md #, fuzzy @@ -4125,7 +4162,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`string concatenation`" -msgstr "" +msgstr "`concatenação de cadeias de caracteres`" #: ../../doc/src/progress.md #, fuzzy @@ -4140,7 +4177,7 @@ msgstr "Tipos Derivados" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" -msgstr "" +msgstr "Diretório: `tests/expressions/derived_type`" #: ../../doc/src/progress.md msgid "`basic derived types`" @@ -4159,15 +4196,15 @@ msgstr "Comandos" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" -msgstr "" +msgstr "Comando Allocate" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" -msgstr "" +msgstr "Diretório: `tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" -msgstr "" +msgstr "`comando allocate`" #: ../../doc/src/progress.md #, fuzzy @@ -4178,15 +4215,15 @@ msgstr "" #: ../../doc/src/progress.md:138 msgid "Block Statement" -msgstr "" +msgstr "Comando Block" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" -msgstr "" +msgstr "Diretório: `tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" -msgstr "" +msgstr "`comando block`" #: ../../doc/src/progress.md #, fuzzy @@ -4197,11 +4234,11 @@ msgstr "" #: ../../doc/src/progress.md:147 msgid "Goto Statement" -msgstr "" +msgstr "Comando Goto" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" -msgstr "" +msgstr "Diretório: `tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" @@ -4216,7 +4253,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "`go-to statement`" -msgstr "" +msgstr "`comando go-to`" #: ../../doc/src/progress.md #, fuzzy @@ -4227,15 +4264,15 @@ msgstr "" #: ../../doc/src/progress.md:157 msgid "If Statement" -msgstr "" +msgstr "Comando if" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" -msgstr "" +msgstr "Diretório: `tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" -msgstr "" +msgstr "`Teste .false.`" #: ../../doc/src/progress.md #, fuzzy @@ -4279,11 +4316,11 @@ msgstr "" #: ../../doc/src/progress.md:169 msgid "While Statement" -msgstr "" +msgstr "Comando While" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" -msgstr "" +msgstr "Diretório: `tests/statements/while`" #: ../../doc/src/progress.md msgid "`Simple while loops`" @@ -4309,15 +4346,15 @@ msgstr "" #: ../../doc/src/progress.md:179 msgid "Print Statement" -msgstr "" +msgstr "Comando Print" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" -msgstr "" +msgstr "Diretório: `tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" -msgstr "" +msgstr "`print básico`" #: ../../doc/src/progress.md #, fuzzy @@ -4332,7 +4369,7 @@ msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" -msgstr "" +msgstr "Diretório: `tests/statements/file_io`" #: ../../doc/src/progress.md #, fuzzy @@ -4348,7 +4385,7 @@ msgstr "" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas" #: ../../doc/src/progress.md:199 msgid "abs" @@ -4356,7 +4393,7 @@ msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/abs`" #: ../../doc/src/progress.md msgid "`scalar single/double real`" @@ -4397,7 +4434,7 @@ msgstr "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/exp`" #: ../../doc/src/progress.md #, fuzzy @@ -4426,7 +4463,7 @@ msgstr "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/log`" #: ../../doc/src/progress.md #, fuzzy @@ -4455,7 +4492,7 @@ msgstr "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sqrt`" #: ../../doc/src/progress.md #, fuzzy @@ -4484,7 +4521,7 @@ msgstr "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sin`" #: ../../doc/src/progress.md #, fuzzy @@ -4513,7 +4550,7 @@ msgstr "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/cos`" #: ../../doc/src/progress.md #, fuzzy @@ -4542,7 +4579,7 @@ msgstr "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/tan`" #: ../../doc/src/progress.md #, fuzzy @@ -4571,7 +4608,7 @@ msgstr "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sinh`" #: ../../doc/src/progress.md #, fuzzy @@ -4600,7 +4637,7 @@ msgstr "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/cosh`" #: ../../doc/src/progress.md #, fuzzy @@ -4629,7 +4666,7 @@ msgstr "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/tanh`" #: ../../doc/src/progress.md #, fuzzy @@ -4658,7 +4695,7 @@ msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/asin`" #: ../../doc/src/progress.md #, fuzzy @@ -4687,7 +4724,7 @@ msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/acos`" #: ../../doc/src/progress.md #, fuzzy @@ -4716,7 +4753,7 @@ msgstr "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/atan`" #: ../../doc/src/progress.md #, fuzzy @@ -4745,7 +4782,7 @@ msgstr "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/modulo`" #: ../../doc/src/progress.md #, fuzzy @@ -4767,7 +4804,7 @@ msgstr "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/mod`" #: ../../doc/src/progress.md #, fuzzy @@ -4789,7 +4826,7 @@ msgstr "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/min`" #: ../../doc/src/progress.md #, fuzzy @@ -4804,7 +4841,7 @@ msgstr "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/max`" #: ../../doc/src/progress.md #, fuzzy @@ -4819,7 +4856,7 @@ msgstr "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/int`" #: ../../doc/src/progress.md #, fuzzy @@ -4834,7 +4871,7 @@ msgstr "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/real`" #: ../../doc/src/progress.md #, fuzzy @@ -4849,7 +4886,7 @@ msgstr "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/floor`" #: ../../doc/src/progress.md #, fuzzy @@ -4864,7 +4901,7 @@ msgstr "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/nint`" #: ../../doc/src/progress.md #, fuzzy From 1ddb7475102677439720e8b4b7cf8789f3e9ac3f Mon Sep 17 00:00:00 2001 From: Smit-create Date: Sun, 4 Sep 2022 14:16:46 +0530 Subject: [PATCH 31/46] Add missing intrinsic functions in complite time eval --- src/lfortran/semantics/comptime_eval.h | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/lfortran/semantics/comptime_eval.h b/src/lfortran/semantics/comptime_eval.h index 68ff25ce28..6bde0ab935 100644 --- a/src/lfortran/semantics/comptime_eval.h +++ b/src/lfortran/semantics/comptime_eval.h @@ -107,6 +107,11 @@ struct IntrinsicProcedures { {"erfc", {m_math, &eval_erfc, true}}, {"abs", {m_math, &eval_abs, true}}, {"sqrt", {m_math, &eval_sqrt, true}}, + {"dsqrt", {m_math, &eval_dsqrt, true}}, + {"datan", {m_math, &eval_datan, true}}, + {"dabs", {m_math2, &eval_dabs, true}}, + {"dcos", {m_math, &eval_dcos, true}}, + {"dsin", {m_math, &eval_dsin, true}}, {"gamma", {m_math, &eval_gamma, true}}, {"log_gamma", {m_math, &eval_log_gamma, true}}, {"log10", {m_math, &eval_log10, true}}, @@ -525,6 +530,12 @@ TRIG2(log, slog) TRIG2(log, clog) TRIG2(log, zlog) +TRIG2(sin, dsin) +TRIG2(cos, dcos) +TRIG2(atan, datan) +TRIG2(sqrt, dsqrt) + + static ASR::expr_t *eval_erf(Allocator &al, const Location &loc, Vec &args) { return eval_trig(al, loc, args, &erf, nullptr); } @@ -670,6 +681,24 @@ TRIG2(log, zlog) } } + static ASR::expr_t *eval_dabs(Allocator &al, const Location &loc, + Vec &args + ) { + LFORTRAN_ASSERT(ASRUtils::all_args_evaluated(args)); + if (args.size() != 1) { + throw SemanticError("Intrinsic abs function accepts exactly 1 argument", loc); + } + ASR::expr_t* trig_arg = args[0]; + ASR::ttype_t* t = LFortran::ASRUtils::expr_type(args[0]); + if (LFortran::ASR::is_a(*t)) { + double rv = ASR::down_cast(trig_arg)->m_r; + double val = std::abs(rv); + return ASR::down_cast(ASR::make_RealConstant_t(al, loc, val, t)); + } else { + throw SemanticError("Argument of the dabs function must be Real", loc); + } + } + static ASR::expr_t *eval_range(Allocator &al, const Location &loc, Vec &args ) { From f86c93b1d6247abc3a2f995451813e5b6df88183 Mon Sep 17 00:00:00 2001 From: Smit-create Date: Sun, 4 Sep 2022 14:17:21 +0530 Subject: [PATCH 32/46] Add and update tests Co-Authored-By: Pranavchiku --- integration_tests/intrinsics_03.f90 | 9 ++- integration_tests/intrinsics_06.f90 | 3 + integration_tests/intrinsics_19.f90 | 2 +- integration_tests/sin_01.f90 | 6 +- .../reference/asr-intrinsics_03-ef06d46.json | 4 +- .../asr-intrinsics_03-ef06d46.stdout | 2 +- .../reference/asr-intrinsics_06-8523892.json | 4 +- .../asr-intrinsics_06-8523892.stdout | 2 +- .../reference/llvm-intrinsics_03-0771f1b.json | 4 +- .../llvm-intrinsics_03-0771f1b.stdout | 69 +++++++++++++++++++ .../reference/llvm-intrinsics_06-15c0eef.json | 4 +- .../llvm-intrinsics_06-15c0eef.stdout | 22 ++++++ 12 files changed, 116 insertions(+), 15 deletions(-) diff --git a/integration_tests/intrinsics_03.f90 b/integration_tests/intrinsics_03.f90 index 96d810b046..6ae48f7869 100644 --- a/integration_tests/intrinsics_03.f90 +++ b/integration_tests/intrinsics_03.f90 @@ -1,8 +1,11 @@ program intrinsics_03 +use iso_fortran_env, only: dp => real64 real :: x - +real(dp) :: a, r1, r2 x = cos(9.5) - print *, x - +a = 4.2_dp +r1 = dcos(a) +r2 = -0.4902608213406995_dp +if (dabs(r1-r2) > 1e-15_dp) error stop end diff --git a/integration_tests/intrinsics_06.f90 b/integration_tests/intrinsics_06.f90 index 7c7a07de46..ae1994bcfd 100644 --- a/integration_tests/intrinsics_06.f90 +++ b/integration_tests/intrinsics_06.f90 @@ -10,6 +10,9 @@ program intrinsics_06 x = atan(1.5574077) print *, x +x = datan(1.5574077) +print *, x + x = asinh(1.1752012) print *, x diff --git a/integration_tests/intrinsics_19.f90 b/integration_tests/intrinsics_19.f90 index ab61f0924b..41d68978bd 100644 --- a/integration_tests/intrinsics_19.f90 +++ b/integration_tests/intrinsics_19.f90 @@ -61,5 +61,5 @@ program intrinsics_19 print *, floor(3.6), floor(3.6_dp), s12, d12, floor(x2), floor(y2) print *, nint(-3.6), nint(-3.6_dp), s13, d13, nint(-x2), nint(-y2) print *, floor(-3.6), floor(-3.6_dp), s14, d14, floor(-x2), floor(-y2) - +if (abs(dsqrt(4.0_dp) - 2.0_dp) > 1e-15_dp) error stop end diff --git a/integration_tests/sin_01.f90 b/integration_tests/sin_01.f90 index ae39b7a958..a8044e209e 100644 --- a/integration_tests/sin_01.f90 +++ b/integration_tests/sin_01.f90 @@ -1,7 +1,11 @@ program sin_01 use iso_fortran_env, only: dp => real64 implicit none -real(dp) :: x +real(dp) :: x, y, r1, r2 x = sin(1.5_dp) if (abs(x - 0.997494996_dp) > 1e-5_dp) error stop +y = 10.5_dp +r1 = dsin(x) +r2 = -0.87969575997167_dp +if (dabs(r1-r2) > 1e15_dp) error stop end program diff --git a/tests/reference/asr-intrinsics_03-ef06d46.json b/tests/reference/asr-intrinsics_03-ef06d46.json index fbe4d3b6af..5c9de00752 100644 --- a/tests/reference/asr-intrinsics_03-ef06d46.json +++ b/tests/reference/asr-intrinsics_03-ef06d46.json @@ -2,11 +2,11 @@ "basename": "asr-intrinsics_03-ef06d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", - "infile_hash": "eda277452cad2d7bc3ef98963677fc276c09ce4d517756982a0d921d", + "infile_hash": "8e3eaf17fa2610e5ebdf1fd94dbf2be8ff26f85160239bcec926e16f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_03-ef06d46.stdout", - "stdout_hash": "738b7ae4d5cbd362628220adcf323642ec4d646d2e15ccfaea8d0cbf", + "stdout_hash": "71ab6b62dda9b0058790e4ad6536fb189f11469b745dd9139df19a35", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_03-ef06d46.stdout b/tests/reference/asr-intrinsics_03-ef06d46.stdout index 8b3f74f2f7..48265f578f 100644 --- a/tests/reference/asr-intrinsics_03-ef06d46.stdout +++ b/tests/reference/asr-intrinsics_03-ef06d46.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_03: (Program (SymbolTable 2 {cos: (ExternalSymbol 2 cos 4 cos lfortran_intrinsic_math [] cos Private), cos@scos: (ExternalSymbol 2 cos@scos 4 scos lfortran_intrinsic_math [] scos Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_03 [] [(= (Var 2 x) (FunctionCall 2 cos@scos 2 cos [((RealConstant 9.500000 (Real 4 [])))] (Real 4 []) (RealConstant -0.997172 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_03: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 8 []) Source Public Required .false.), cos: (ExternalSymbol 2 cos 6 cos lfortran_intrinsic_math [] cos Private), cos@scos: (ExternalSymbol 2 cos@scos 6 scos lfortran_intrinsic_math [] scos Private), dabs: (ExternalSymbol 2 dabs 226 dabs lfortran_intrinsic_math2 [] dabs Private), dcos: (ExternalSymbol 2 dcos 6 dcos lfortran_intrinsic_math [] dcos Private), dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public), r1: (Variable 2 r1 Local () () Default (Real 8 []) Source Public Required .false.), r2: (Variable 2 r2 Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_03 [iso_fortran_env] [(= (Var 2 x) (FunctionCall 2 cos@scos 2 cos [((RealConstant 9.500000 (Real 4 [])))] (Real 4 []) (RealConstant -0.997172 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 a) (RealConstant 4.200000 (Real 8 [])) ()) (= (Var 2 r1) (FunctionCall 2 dcos () [((Var 2 a))] (Real 8 []) () ()) ()) (= (Var 2 r2) (RealUnaryMinus (RealConstant 0.490261 (Real 8 [])) (Real 8 []) (RealConstant -0.490261 (Real 8 []))) ()) (If (RealCompare (FunctionCall 2 dabs () [((RealBinOp (Var 2 r1) Sub (Var 2 r2) (Real 8 []) ()))] (Real 8 []) () ()) Gt (RealConstant 0.000000 (Real 8 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-intrinsics_06-8523892.json b/tests/reference/asr-intrinsics_06-8523892.json index eb8644b476..8e31e93254 100644 --- a/tests/reference/asr-intrinsics_06-8523892.json +++ b/tests/reference/asr-intrinsics_06-8523892.json @@ -2,11 +2,11 @@ "basename": "asr-intrinsics_06-8523892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", - "infile_hash": "159c10373053040b4614f7468175543b4735da80807fbb7ef9bad071", + "infile_hash": "45568686a8770f0612e168afdd5bfba81ef25b7ad61daf3ef5960d15", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_06-8523892.stdout", - "stdout_hash": "32d977c48ba6e90e2526e80fd31b8b074dfa761bc919156b5d794df2", + "stdout_hash": "31dd3369dc7452212151bf8e1c539b8e2ae92eb006aded9a1abf6343", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_06-8523892.stdout b/tests/reference/asr-intrinsics_06-8523892.stdout index b359808fff..5922276b98 100644 --- a/tests/reference/asr-intrinsics_06-8523892.stdout +++ b/tests/reference/asr-intrinsics_06-8523892.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_06: (Program (SymbolTable 2 {acos: (ExternalSymbol 2 acos 4 acos lfortran_intrinsic_math [] acos Private), acos@sacos: (ExternalSymbol 2 acos@sacos 4 sacos lfortran_intrinsic_math [] sacos Private), acosh: (ExternalSymbol 2 acosh 4 acosh lfortran_intrinsic_math [] acosh Private), acosh@sacosh: (ExternalSymbol 2 acosh@sacosh 4 sacosh lfortran_intrinsic_math [] sacosh Private), asin: (ExternalSymbol 2 asin 4 asin lfortran_intrinsic_math [] asin Private), asin@sasin: (ExternalSymbol 2 asin@sasin 4 sasin lfortran_intrinsic_math [] sasin Private), asinh: (ExternalSymbol 2 asinh 4 asinh lfortran_intrinsic_math [] asinh Private), asinh@sasinh: (ExternalSymbol 2 asinh@sasinh 4 sasinh lfortran_intrinsic_math [] sasinh Private), atan: (ExternalSymbol 2 atan 4 atan lfortran_intrinsic_math [] atan Private), atan@satan: (ExternalSymbol 2 atan@satan 4 satan lfortran_intrinsic_math [] satan Private), atanh: (ExternalSymbol 2 atanh 4 atanh lfortran_intrinsic_math [] atanh Private), atanh@satanh: (ExternalSymbol 2 atanh@satanh 4 satanh lfortran_intrinsic_math [] satanh Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_06 [] [(= (Var 2 x) (FunctionCall 2 asin@sasin 2 asin [((RealConstant 0.841471 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acos@sacos 2 acos [((RealConstant 0.540302 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atan@satan 2 atan [((RealConstant 1.557408 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 asinh@sasinh 2 asinh [((RealConstant 1.175201 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acosh@sacosh 2 acosh [((RealConstant 1.543081 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atanh@satanh 2 atanh [((RealConstant 0.761594 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_06: (Program (SymbolTable 2 {acos: (ExternalSymbol 2 acos 4 acos lfortran_intrinsic_math [] acos Private), acos@sacos: (ExternalSymbol 2 acos@sacos 4 sacos lfortran_intrinsic_math [] sacos Private), acosh: (ExternalSymbol 2 acosh 4 acosh lfortran_intrinsic_math [] acosh Private), acosh@sacosh: (ExternalSymbol 2 acosh@sacosh 4 sacosh lfortran_intrinsic_math [] sacosh Private), asin: (ExternalSymbol 2 asin 4 asin lfortran_intrinsic_math [] asin Private), asin@sasin: (ExternalSymbol 2 asin@sasin 4 sasin lfortran_intrinsic_math [] sasin Private), asinh: (ExternalSymbol 2 asinh 4 asinh lfortran_intrinsic_math [] asinh Private), asinh@sasinh: (ExternalSymbol 2 asinh@sasinh 4 sasinh lfortran_intrinsic_math [] sasinh Private), atan: (ExternalSymbol 2 atan 4 atan lfortran_intrinsic_math [] atan Private), atan@satan: (ExternalSymbol 2 atan@satan 4 satan lfortran_intrinsic_math [] satan Private), atanh: (ExternalSymbol 2 atanh 4 atanh lfortran_intrinsic_math [] atanh Private), atanh@satanh: (ExternalSymbol 2 atanh@satanh 4 satanh lfortran_intrinsic_math [] satanh Private), datan: (ExternalSymbol 2 datan 4 datan lfortran_intrinsic_math [] datan Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_06 [] [(= (Var 2 x) (FunctionCall 2 asin@sasin 2 asin [((RealConstant 0.841471 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acos@sacos 2 acos [((RealConstant 0.540302 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atan@satan 2 atan [((RealConstant 1.557408 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (Cast (FunctionCall 2 datan () [((RealConstant 1.557408 (Real 4 [])))] (Real 8 []) (RealConstant 1.000000 (Real 4 [])) ()) RealToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 asinh@sasinh 2 asinh [((RealConstant 1.175201 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acosh@sacosh 2 acosh [((RealConstant 1.543081 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atanh@satanh 2 atanh [((RealConstant 0.761594 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/llvm-intrinsics_03-0771f1b.json b/tests/reference/llvm-intrinsics_03-0771f1b.json index 250c5ce7a9..bc783300e8 100644 --- a/tests/reference/llvm-intrinsics_03-0771f1b.json +++ b/tests/reference/llvm-intrinsics_03-0771f1b.json @@ -2,11 +2,11 @@ "basename": "llvm-intrinsics_03-0771f1b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", - "infile_hash": "eda277452cad2d7bc3ef98963677fc276c09ce4d517756982a0d921d", + "infile_hash": "8e3eaf17fa2610e5ebdf1fd94dbf2be8ff26f85160239bcec926e16f", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_03-0771f1b.stdout", - "stdout_hash": "f7dfdaf2d7428d3dcd95670bf5e124b654b1960268728a29b8ffc2a6", + "stdout_hash": "cac96dc91fc0d492d5f06133040f0bd9e967ac6a28876ae1d057b449", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-intrinsics_03-0771f1b.stdout b/tests/reference/llvm-intrinsics_03-0771f1b.stdout index 16c83e1bda..9603caa9fc 100644 --- a/tests/reference/llvm-intrinsics_03-0771f1b.stdout +++ b/tests/reference/llvm-intrinsics_03-0771f1b.stdout @@ -9,6 +9,7 @@ source_filename = "LFortran" @1 = private unnamed_addr constant [2 x i8] c" \00", align 1 @2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @3 = private unnamed_addr constant [5 x i8] c"%f%s\00", align 1 +@4 = private unnamed_addr constant [12 x i8] c"ERROR STOP\0A\00", align 1 declare i8* @__module_lfortran_intrinsic_builtin_char(i32*) @@ -27,6 +28,21 @@ return: ; preds = %.entry declare void @_lfortran_cpu_time(double*) +define double @__module_lfortran_intrinsic_math_dcos(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = call double @_lfortran_dcos(double %0) + store double %1, double* %r, align 8 + br label %return + +return: ; preds = %.entry + %2 = load double, double* %r, align 8 + ret double %2 +} + +declare double @_lfortran_dcos(double) + define void @__module_lfortran_intrinsic_math_dp_rand_num(double* %harvest) { .entry: call void @_lfortran_dp_rand_num(double* %harvest) @@ -86,14 +102,67 @@ return: ; preds = %.entry declare void @_lfortran_sp_rand_num(float*) +define double @__module_lfortran_intrinsic_math2_dabs(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = fcmp uge double %0, 0.000000e+00 + br i1 %1, label %then, label %else + +then: ; preds = %.entry + %2 = load double, double* %x, align 8 + store double %2, double* %r, align 8 + br label %ifcont + +else: ; preds = %.entry + %3 = load double, double* %x, align 8 + %4 = fsub double 0.000000e+00, %3 + store double %4, double* %r, align 8 + br label %ifcont + +ifcont: ; preds = %else, %then + br label %return + +return: ; preds = %ifcont + %5 = load double, double* %r, align 8 + ret double %5 +} + define i32 @main() { .entry: + %call_arg_value = alloca double, align 8 + %a = alloca double, align 8 + %r1 = alloca double, align 8 + %r2 = alloca double, align 8 %x = alloca float, align 4 store float 0xBFEFE8D5A0000000, float* %x, align 4 %0 = load float, float* %x, align 4 %1 = fpext float %0 to double call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), double %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) + store double 4.200000e+00, double* %a, align 8 + %2 = call double @__module_lfortran_intrinsic_math_dcos(double* %a) + store double %2, double* %r1, align 8 + store double 0xBFDF606EEC8AC71E, double* %r2, align 8 + %3 = load double, double* %r1, align 8 + %4 = load double, double* %r2, align 8 + %5 = fsub double %3, %4 + store double %5, double* %call_arg_value, align 8 + %6 = call double @__module_lfortran_intrinsic_math2_dabs(double* %call_arg_value) + %7 = fcmp ugt double %6, 1.000000e-15 + br i1 %7, label %then, label %else + +then: ; preds = %.entry + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @4, i32 0, i32 0)) + call void @exit(i32 1) + br label %ifcont + +else: ; preds = %.entry + br label %ifcont + +ifcont: ; preds = %else, %then ret i32 0 } declare void @_lfortran_printf(i8*, ...) + +declare void @exit(i32) diff --git a/tests/reference/llvm-intrinsics_06-15c0eef.json b/tests/reference/llvm-intrinsics_06-15c0eef.json index 65dd661750..cfd234be8a 100644 --- a/tests/reference/llvm-intrinsics_06-15c0eef.json +++ b/tests/reference/llvm-intrinsics_06-15c0eef.json @@ -2,11 +2,11 @@ "basename": "llvm-intrinsics_06-15c0eef", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", - "infile_hash": "159c10373053040b4614f7468175543b4735da80807fbb7ef9bad071", + "infile_hash": "45568686a8770f0612e168afdd5bfba81ef25b7ad61daf3ef5960d15", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_06-15c0eef.stdout", - "stdout_hash": "673deaec3d1d437eeea9ec24758dab95a4c17226a9f8aefe78c229c4", + "stdout_hash": "10a5b5aca78d25e7ba6479383b48a13c890bd5c5791a92ed7e3ff7e6", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-intrinsics_06-15c0eef.stdout b/tests/reference/llvm-intrinsics_06-15c0eef.stdout index c600c182c5..60f84a2238 100644 --- a/tests/reference/llvm-intrinsics_06-15c0eef.stdout +++ b/tests/reference/llvm-intrinsics_06-15c0eef.stdout @@ -24,6 +24,9 @@ source_filename = "LFortran" @16 = private unnamed_addr constant [2 x i8] c" \00", align 1 @17 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @18 = private unnamed_addr constant [5 x i8] c"%f%s\00", align 1 +@19 = private unnamed_addr constant [2 x i8] c" \00", align 1 +@20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 +@21 = private unnamed_addr constant [5 x i8] c"%f%s\00", align 1 declare i8* @__module_lfortran_intrinsic_builtin_char(i32*) @@ -42,6 +45,21 @@ return: ; preds = %.entry declare void @_lfortran_cpu_time(double*) +define double @__module_lfortran_intrinsic_math_datan(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = call double @_lfortran_datan(double %0) + store double %1, double* %r, align 8 + br label %return + +return: ; preds = %.entry + %2 = load double, double* %r, align 8 + ret double %2 +} + +declare double @_lfortran_datan(double) + define void @__module_lfortran_intrinsic_math_dp_rand_num(double* %harvest) { .entry: call void @_lfortran_dp_rand_num(double* %harvest) @@ -203,6 +221,10 @@ define i32 @main() { %10 = load float, float* %x, align 4 %11 = fpext float %10 to double call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0), double %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @17, i32 0, i32 0)) + store float 1.000000e+00, float* %x, align 4 + %12 = load float, float* %x, align 4 + %13 = fpext float %12 to double + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), double %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) ret i32 0 } From 411ab2771b4599fd8eb7ad0e569d3ec8d7d1ccef Mon Sep 17 00:00:00 2001 From: Vincent Magnin Date: Sun, 4 Sep 2022 10:52:56 +0000 Subject: [PATCH 33/46] Translated using Weblate (French) Currently translated at 0.4% (4 of 837 strings) Translation: Fortran programming language/LFortran documentation Translate-URL: https://hosted.weblate.org/projects/fortran-lang/lfortran-docs/fr/ --- doc/locale/fr/LC_MESSAGES/docs.po | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/doc/locale/fr/LC_MESSAGES/docs.po b/doc/locale/fr/LC_MESSAGES/docs.po index af5ab6f16a..0b88299e18 100644 --- a/doc/locale/fr/LC_MESSAGES/docs.po +++ b/doc/locale/fr/LC_MESSAGES/docs.po @@ -3,18 +3,21 @@ # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: LFortran \n" +"Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2022-09-05 11:19+0000\n" +"Last-Translator: Vincent Magnin \n" +"Language-Team: French \n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -31,7 +34,7 @@ msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" -msgstr "" +msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" @@ -43,7 +46,7 @@ msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" -msgstr "" +msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" @@ -1433,7 +1436,7 @@ msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." @@ -3760,7 +3763,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" @@ -4509,4 +4512,3 @@ msgstr "" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" - From c2dfc074d246025426a3439edbeb5c1c667e459d Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 09:49:47 +0530 Subject: [PATCH 34/46] Synced libasr with LPython --- src/libasr/ASR.asdl | 11 +- src/libasr/CMakeLists.txt | 1 + src/libasr/asdl_cpp.py | 165 +-- src/libasr/asr_utils.cpp | 5 + src/libasr/asr_utils.h | 144 ++- src/libasr/codegen/KaleidoscopeJIT.h | 2 +- src/libasr/codegen/asr_to_c.cpp | 1 + src/libasr/codegen/asr_to_c_cpp.h | 47 +- src/libasr/codegen/asr_to_llvm.cpp | 487 ++++++-- src/libasr/codegen/asr_to_wasm.cpp | 17 +- src/libasr/codegen/llvm_utils.cpp | 1312 ++++++++++++++++++++- src/libasr/codegen/llvm_utils.h | 229 +++- src/libasr/compiler_tester/tester.py | 26 +- src/libasr/modfile.cpp | 16 + src/libasr/modfile.h | 5 + src/libasr/pass/arr_dims_propagate.cpp | 66 ++ src/libasr/pass/arr_dims_propagate.h | 12 + src/libasr/pass/array_op.cpp | 26 +- src/libasr/pass/global_stmts.cpp | 4 +- src/libasr/pass/inline_function_calls.cpp | 11 +- src/libasr/pass/instantiate_template.cpp | 129 +- src/libasr/pass/instantiate_template.h | 2 +- src/libasr/pass/pass_array_by_data.cpp | 75 +- src/libasr/pass/pass_manager.h | 3 + src/libasr/pass/pass_utils.cpp | 2 +- src/libasr/pass/pass_utils.h | 6 + src/libasr/runtime/lfortran_intrinsics.c | 6 +- src/libasr/runtime/lfortran_intrinsics.h | 2 + src/libasr/serialization.cpp | 10 +- src/libasr/serialization.h | 2 + src/libasr/utils.h | 5 +- 31 files changed, 2416 insertions(+), 413 deletions(-) create mode 100644 src/libasr/pass/arr_dims_propagate.cpp create mode 100644 src/libasr/pass/arr_dims_propagate.h diff --git a/src/libasr/ASR.asdl b/src/libasr/ASR.asdl index 643d012d4e..aeee4588bf 100644 --- a/src/libasr/ASR.asdl +++ b/src/libasr/ASR.asdl @@ -87,7 +87,7 @@ symbol | Function(symbol_table symtab, identifier name, expr* args, ttype* type_params, stmt* body, expr? return_var, abi abi, access access, deftype deftype, string? bindc_name, bool elemental, - bool pure, bool module) + bool pure, bool module, bool inline) | GenericProcedure(symbol_table parent_symtab, identifier name, symbol* procs, access access) | CustomOperator(symbol_table parent_symtab, identifier name, @@ -206,6 +206,7 @@ stmt | SetRemove(expr a, expr ele) | ListInsert(expr a, expr pos, expr ele) | ListRemove(expr a, expr ele) + | ListClear(expr a) | DictInsert(expr a, expr key, expr value) @@ -328,7 +329,11 @@ ttype | Dict(ttype key_type, ttype value_type) | Pointer(ttype type) | CPtr() - | TypeParameter(identifier param, dimension* dims) + | TypeParameter(identifier param, dimension* dims, restriction* rt) + +restriction = Restriction(trait rt) + +trait = SupportsZero | SupportsPlus | Divisible | Any binop = Add | Sub | Mul | Div | Pow | BitAnd | BitOr | BitXor | BitLShift | BitRShift @@ -345,6 +350,7 @@ cast_kind | IntegerToReal | LogicalToReal | RealToReal + | TemplateToReal | IntegerToInteger | RealToComplex | IntegerToComplex @@ -352,6 +358,7 @@ cast_kind | RealToLogical | CharacterToLogical | CharacterToInteger + | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal diff --git a/src/libasr/CMakeLists.txt b/src/libasr/CMakeLists.txt index 4f51317c08..5b215742f2 100644 --- a/src/libasr/CMakeLists.txt +++ b/src/libasr/CMakeLists.txt @@ -33,6 +33,7 @@ set(SRC pass/implied_do_loops.cpp pass/array_op.cpp pass/class_constructor.cpp + pass/arr_dims_propagate.cpp pass/arr_slice.cpp pass/print_arr.cpp pass/pass_utils.cpp diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index 41fdb6f38b..9138aac193 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -501,6 +501,33 @@ def visitField(self, field): self.emit( "this->visit_symbol(*a.second);", 3) self.emit("}", 2) +class StatementsFirstWalkVisitorVisitor(ASTWalkVisitorVisitor, ASDLVisitor): + + def visitModule(self, mod): + self.emit("/" + "*"*78 + "/") + self.emit("// Statements First Visitor base class") + self.emit("") + self.emit("template ") + self.emit("class StatementsFirstBaseWalkVisitor : public BaseVisitor") + self.emit("{") + self.emit("private:") + self.emit(" Derived& self() { return static_cast(*this); }") + self.emit("public:") + super(ASTWalkVisitorVisitor, self).visitModule(mod) + self.emit("};") + + def make_visitor(self, name, fields): + self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) + self.used = False + have_body = False + for field in fields[::-1]: + self.visitField(field) + if not self.used: + # Note: a better solution would be to change `&x` to `& /* x */` + # above, but we would need to change emit to return a string. + self.emit("if ((bool&)x) { } // Suppress unused warning", 2) + self.emit("}", 1) + # This class generates a visitor that prints the tree structure of AST/ASR class TreeVisitorVisitor(ASDLVisitor): @@ -1190,10 +1217,12 @@ def visitModule(self, mod): self.emit("private:") self.emit( "Derived& self() { return static_cast(*this); }", 1) self.emit("public:") - self.emit( "std::string s, indtd = \"\";", 1) + self.emit( "std::string s, indtd;", 1) self.emit( "bool use_colors;", 1) - self.emit( "bool indent;", 1) - self.emit( "int indent_level = 0, indent_spaces = 4;", 1) + self.emit( "bool indent, start_line = true;", 1) + self.emit( "int indent_level = 0, indent_spaces = 3, lvl = 0;", 1) + self.emit( "int tmp = 0, tmp1 = 0, tmp2 = 2;", 1) + self.emit( "int curly[2000], round[2000];", 1) self.emit("public:") self.emit( "PickleBaseVisitor() : use_colors(false), indent(false) { s.reserve(100000); }", 1) self.emit( "void inc_indent() {", 1) @@ -1229,6 +1258,18 @@ def visitConstructor(self, cons, _): def make_visitor(self, name, fields, cons): self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) + self.emit( 'if(indent) {',2) + self.emit( 'tmp1++;',3) + self.emit( 'round[tmp1] = indent_level;',3) + self.emit( 'if(start_line) {',3) + self.emit( 'start_line = false;', 4) + self.emit( 's.append(indtd);', 4) + self.emit( 'inc_indent();',4) + self.emit( '} else {', 3) + self.emit( 's.append("\\n"+indtd);', 4) + self.emit( 'inc_indent();',4) + self.emit( '}', 3) + self.emit( '}', 2) self.emit( 's.append("(");', 2) subs = { "Assignment": "=", @@ -1236,17 +1277,6 @@ def make_visitor(self, name, fields, cons): } if name in subs: name = subs[name] - - # For ASR - symbol = [ - "Integer", - "Real", - "Complex", - "Character", - "Logical", - "Var", - ] - if cons: self.emit( 'if (use_colors) {', 2) self.emit( 's.append(color(style::bold));', 3) @@ -1259,23 +1289,16 @@ def make_visitor(self, name, fields, cons): self.emit( '}', 2) if len(fields) > 0: self.emit( 's.append(" ");', 2) - if name not in symbol: - self.emit( 'if(indent) {', 2) - self.emit( 'inc_indent();', 3) - self.emit( 's.append("\\n" + indtd);', 3) - self.emit( '}', 2) self.used = False for n, field in enumerate(fields): self.visitField(field, cons) if n < len(fields) - 1: self.emit( 's.append(" ");', 2) - if name not in symbol: - self.emit( 'if(indent) s.append("\\n" + indtd);', 2) - if name not in symbol and cons and len(fields) > 0: - self.emit( 'if(indent) {', 2) - self.emit( 'dec_indent();', 3) - self.emit( 's.append("\\n" + indtd);', 3) - self.emit( '}', 2) + self.emit( 'if(indent) {', 2) + self.emit( 'lvl = indent_level;', 3) + self.emit( 'for(int times = 0; times < (lvl - round[tmp1] ); times++)', 3) + self.emit( 'dec_indent();', 4) + self.emit( 'round[tmp1] = 0; if(tmp1 > 1) tmp1--;}', 3) self.emit( 's.append(")");', 2) if not self.used: # Note: a better solution would be to change `&x` to `& /* x */` @@ -1292,6 +1315,7 @@ def make_simple_sum_visitor(self, name, types): self.emit( 'switch (x) {', 2) for tp in types: self.emit( 'case (%s::%s) : {' % (name, tp.name), 3) + self.emit( 'if(indent) s.append("\\n"+indtd);',4) self.emit( 's.append("%s");' % (tp.name), 4) self.emit( ' break; }',3) self.emit( '}', 2) @@ -1320,10 +1344,7 @@ def visitField(self, field, cons): self.emit("self().visit_%s(*x.m_%s[i]);" % (field.type, field.name), level+1) else: self.emit("self().visit_%s(x.m_%s[i]);" % (field.type, field.name), level+1) - self.emit(' if (i < x.n_%s-1) {' % (field.name), level+1) - self.emit(' if (indent) s.append("\\n" + indtd);', level+2) - self.emit(' else s.append(" ");', level+2) - self.emit(' };', level+1) + self.emit( 'if (i < x.n_%s-1) s.append(" ");' % (field.name), level+1) self.emit("}", level) self.emit('s.append("]");', level) elif field.opt: @@ -1341,11 +1362,8 @@ def visitField(self, field, cons): level = 2 self.emit('s.append("[");', level) self.emit("for (size_t i=0; iget_counter());' % field.name, level) else: level = 2 + self.emit( 'if(indent) {',level) + self.emit( 's.append("\\n"+indtd);', level+1) + self.emit( 'round[++tmp1] = indent_level;',level+1) + self.emit( 'inc_indent();',level+1) + self.emit( '}', level) self.emit( 's.append("(");', level) self.emit('if (use_colors) {', level) self.emit( 's.append(color(fg::yellow));', level+1) @@ -1387,45 +1410,46 @@ def visitField(self, field, cons): self.emit('if (use_colors) {', level) self.emit( 's.append(color(fg::reset));', level+1) self.emit('}', level) - self.emit('if(indent) {', level) - self.emit( 'inc_indent();', level+1) - self.emit( 's.append("\\n" + indtd);', level+1) - self.emit('}', level) - self.emit('else s.append(" ");', level) - self.emit('s.append(x.m_%s->get_counter());' % field.name, level) - self.emit('if(indent) s.append("\\n" + indtd);', level) - self.emit('else s.append(" ");', level) + self.emit('s.append(" ");', level) + self.emit( 'if(indent) s.append("\\n"+indtd);', level) + self.emit( 's.append(x.m_%s->get_counter());' % field.name, level) + self.emit( 's.append(" ");', level) + self.emit( 'if(indent) {',level) + self.emit( 's.append("\\n"+indtd);', level+1) + self.emit( 'curly[++tmp] = indent_level;',level+1) + self.emit( 'tmp2 = 1;',level+1) + self.emit( 'inc_indent();',level+1) + self.emit( '}', level) self.emit( 's.append("{");', level) - self.emit('if(indent) {', level) - self.emit( 'inc_indent();', level+1) - self.emit( 's.append("\\n" + indtd);', level+1) - self.emit('}', level) self.emit('{', level) self.emit(' size_t i = 0;', level) self.emit(' for (auto &a : x.m_%s->get_scope()) {' % field.name, level) - self.emit(' s.append(a.first + ":");', level) - self.emit(' if(indent) {', level) - self.emit(' inc_indent();', level+1) - self.emit(' s.append("\\n" + indtd);', level+1) - self.emit(' }', level) - self.emit(' else s.append(" ");', level) + self.emit( 'if(indent) {',level) + self.emit( 's.append("\\n"+indtd);', level+1) + self.emit( 'inc_indent();',level+1) + self.emit( '}', level) + self.emit(' s.append(a.first + ": ");', level) self.emit(' this->visit_symbol(*a.second);', level) self.emit(' if (i < x.m_%s->get_scope().size()-1) { ' % field.name, level) self.emit(' s.append(", ");', level) - self.emit(' }', level) - self.emit(' if(indent) {', level) - self.emit(' dec_indent();', level+1) - self.emit(' s.append("\\n" + indtd);', level+1) + self.emit(' if(indent) {', level) + self.emit(' for(int times = 0; times < tmp2; times++)', level+1) + self.emit(' dec_indent();', level) + self.emit(' }', level) self.emit(' }', level) self.emit(' i++;', level) self.emit(' }', level) self.emit('}', level) - self.emit('if(indent) {', level) - self.emit( 'dec_indent();', level+1) - self.emit( 's.append("\\n" + indtd);', level+1) - self.emit('}', level) - self.emit('s.append("})");', level) - self.emit('if(indent) dec_indent();', level) + self.emit( 'if(indent) {',level) + self.emit( 'lvl = indent_level;', level+1) + self.emit( 'for(int times = 0; times < (lvl - curly[tmp] ); times++)', level+1) + self.emit( 'dec_indent();', level+2) + self.emit( 'curly[tmp] = 0; if(tmp > 1) tmp--;', level+1) + self.emit( 'tmp2++;', level+1) + self.emit( 's.append("\\n"+indtd);', level+1) + self.emit( '}', level) + self.emit( 's.append("})");', level) + self.emit( 'if(indent) dec_indent();', level) elif field.type == "string" and not field.seq: if field.opt: self.emit("if (x.m_%s) {" % field.name, 2) @@ -2194,8 +2218,9 @@ def add_masks(fields, node): visitors = [ASTNodeVisitor0, ASTNodeVisitor1, ASTNodeVisitor, ASTVisitorVisitor1, ASTVisitorVisitor1b, ASTVisitorVisitor2, - ASTWalkVisitorVisitor, PickleVisitorVisitor, - SerializationVisitorVisitor, DeserializationVisitorVisitor] + ASTWalkVisitorVisitor, TreeVisitorVisitor, PickleVisitorVisitor, + StatementsFirstWalkVisitorVisitor, SerializationVisitorVisitor, + DeserializationVisitorVisitor] def main(argv): diff --git a/src/libasr/asr_utils.cpp b/src/libasr/asr_utils.cpp index e6907ab710..b57f100ff9 100644 --- a/src/libasr/asr_utils.cpp +++ b/src/libasr/asr_utils.cpp @@ -659,6 +659,11 @@ bool types_equal(const ASR::ttype_t &a, const ASR::ttype_t &b) { } break; } + case (ASR::ttypeType::List) : { + ASR::List_t *a2 = ASR::down_cast(&a); + ASR::List_t *b2 = ASR::down_cast(&b); + return types_equal(*a2->m_type, *b2->m_type); + } case (ASR::ttypeType::Derived) : { ASR::Derived_t *a2 = ASR::down_cast(&a); ASR::Derived_t *b2 = ASR::down_cast(&b); diff --git a/src/libasr/asr_utils.h b/src/libasr/asr_utils.h index 12d353c537..48b65c3366 100644 --- a/src/libasr/asr_utils.h +++ b/src/libasr/asr_utils.h @@ -142,6 +142,10 @@ static inline std::string type_to_str(const ASR::ttype_t *t) return type_to_str(ASRUtils::type_get_past_pointer( const_cast(t))) + " pointer"; } + case ASR::ttypeType::TypeParameter: { + ASR::TypeParameter_t* tp = ASR::down_cast(t); + return tp->m_param; + } default : throw LCompilersException("Not implemented " + std::to_string(t->type) + "."); } } @@ -983,16 +987,12 @@ static inline bool is_logical(ASR::ttype_t &x) { } static inline bool is_generic(ASR::ttype_t &x) { - return ASR::is_a(*type_get_past_pointer(&x)); -} - -static inline std::string get_parameter_name(const ASR::ttype_t* t) { - switch (t->type) { - case ASR::ttypeType::TypeParameter: { - ASR::TypeParameter_t* tp = ASR::down_cast(t); - return tp->m_param; + switch (x.type) { + case ASR::ttypeType::List: { + ASR::List_t *list_type = ASR::down_cast(type_get_past_pointer(&x)); + return is_generic(*list_type->m_type); } - default: throw LCompilersException("Cannot obtain type parameter from this type"); + default : return ASR::is_a(*type_get_past_pointer(&x)); } } @@ -1072,6 +1072,16 @@ inline int extract_dimensions_from_ttype(ASR::ttype_t *x, m_dims = nullptr; break; } + case ASR::ttypeType::Tuple: { + n_dims = 0; + m_dims = nullptr; + break; + } + case ASR::ttypeType::Dict: { + n_dims = 0; + m_dims = nullptr; + break; + } case ASR::ttypeType::CPtr: { n_dims = 0; m_dims = nullptr; @@ -1089,69 +1099,6 @@ inline int extract_dimensions_from_ttype(ASR::ttype_t *x, return n_dims; } -// Sets the dimension member of `ttype_t`. Returns `true` if dimensions set. -// Returns `false` if the `ttype_t` does not have a dimension member. -inline bool ttype_set_dimensions(ASR::ttype_t *x, - ASR::dimension_t *m_dims, int64_t n_dims) { - switch (x->type) { - case ASR::ttypeType::Integer: { - ASR::Integer_t* Integer_type = ASR::down_cast(x); - Integer_type->n_dims = n_dims; - Integer_type->m_dims = m_dims; - return true; - } - case ASR::ttypeType::Real: { - ASR::Real_t* Real_type = ASR::down_cast(x); - Real_type->n_dims = n_dims; - Real_type->m_dims = m_dims; - return true; - } - case ASR::ttypeType::Complex: { - ASR::Complex_t* Complex_type = ASR::down_cast(x); - Complex_type->n_dims = n_dims; - Complex_type->m_dims = m_dims; - return true; - } - case ASR::ttypeType::Character: { - ASR::Character_t* Character_type = ASR::down_cast(x); - Character_type->n_dims = n_dims; - Character_type->m_dims = m_dims; - return true; - } - case ASR::ttypeType::Logical: { - ASR::Logical_t* Logical_type = ASR::down_cast(x); - n_dims = Logical_type->n_dims; - m_dims = Logical_type->m_dims; - return true; - } - case ASR::ttypeType::Derived: { - ASR::Derived_t* Derived_type = ASR::down_cast(x); - n_dims = Derived_type->n_dims; - m_dims = Derived_type->m_dims; - return true; - } - case ASR::ttypeType::Class: { - ASR::Class_t* Class_type = ASR::down_cast(x); - Class_type->n_dims = n_dims; - Class_type->m_dims = m_dims; - return true; - } - case ASR::ttypeType::TypeParameter: { - ASR::TypeParameter_t* tp = ASR::down_cast(x); - n_dims = tp->n_dims; - m_dims = tp->m_dims; - return true; - } - case ASR::ttypeType::Pointer: { - return ttype_set_dimensions( - ASR::down_cast(x)->m_type, m_dims, n_dims); - } - default: - return false; - } - return false; -} - inline bool is_array(ASR::ttype_t *x) { ASR::dimension_t* dims = nullptr; return extract_dimensions_from_ttype(x, dims) > 0; @@ -1214,7 +1161,34 @@ static inline ASR::ttype_t* duplicate_type(Allocator& al, const ASR::ttype_t* t, ASR::dimension_t* dimsp = dims ? dims->p : tp->m_dims; size_t dimsn = dims ? dims->n : tp->n_dims; return ASRUtils::TYPE(ASR::make_TypeParameter_t(al, t->base.loc, - tp->m_param, dimsp, dimsn)); + tp->m_param, dimsp, dimsn, tp->m_rt, tp->n_rt)); + } + default : throw LCompilersException("Not implemented " + std::to_string(t->type)); + } +} + +static inline ASR::ttype_t* duplicate_type_without_dims(Allocator& al, const ASR::ttype_t* t) { + switch (t->type) { + case ASR::ttypeType::Integer: { + ASR::Integer_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Integer_t(al, t->base.loc, + tnew->m_kind, nullptr, 0)); + } + case ASR::ttypeType::Real: { + ASR::Real_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Real_t(al, t->base.loc, + tnew->m_kind, nullptr, 0)); + } + case ASR::ttypeType::Character: { + ASR::Character_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Character_t(al, t->base.loc, + tnew->m_kind, tnew->m_len, tnew->m_len_expr, + nullptr, 0)); + } + case ASR::ttypeType::TypeParameter: { + ASR::TypeParameter_t* tp = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_TypeParameter_t(al, t->base.loc, + tp->m_param, nullptr, 0, tp->m_rt, tp->n_rt)); } default : throw LCompilersException("Not implemented " + std::to_string(t->type)); } @@ -1434,6 +1408,30 @@ static inline ASR::ttype_t* get_contained_type(ASR::ttype_t* asr_type) { } } +static inline ASR::ttype_t* get_type_parameter(ASR::ttype_t* t) { + switch (t->type) { + case ASR::ttypeType::TypeParameter: { + return t; + } + case ASR::ttypeType::List: { + ASR::List_t *tl = ASR::down_cast(t); + return get_type_parameter(tl->m_type); + } + default: throw LCompilersException("Cannot get type parameter from this type."); + } +} + +static inline bool has_trait(ASR::TypeParameter_t *tp, ASR::traitType rt) { + for (size_t i=0; in_rt; i++) { + ASR::Restriction_t *restriction = ASR::down_cast(tp->m_rt[i]); + if (restriction->m_rt == rt) { + return true; + } + } + return false; +} + + class ReplaceArgVisitor: public ASR::BaseExprReplacer { private: diff --git a/src/libasr/codegen/KaleidoscopeJIT.h b/src/libasr/codegen/KaleidoscopeJIT.h index c7022a4146..7e91ab2095 100644 --- a/src/libasr/codegen/KaleidoscopeJIT.h +++ b/src/libasr/codegen/KaleidoscopeJIT.h @@ -12,7 +12,7 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H #define LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H -#include + #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/iterator_range.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" diff --git a/src/libasr/codegen/asr_to_c.cpp b/src/libasr/codegen/asr_to_c.cpp index 66e14c0459..278ced37ef 100644 --- a/src/libasr/codegen/asr_to_c.cpp +++ b/src/libasr/codegen/asr_to_c.cpp @@ -655,6 +655,7 @@ Result asr_to_c(Allocator &al, ASR::TranslationUnit_t &asr, diag::Diagnostics &diagnostics, Platform &platform, int64_t default_lower_bound) { + LCompilers::PassOptions pass_options; pass_options.always_run = true; pass_unused_functions(al, asr, pass_options); diff --git a/src/libasr/codegen/asr_to_c_cpp.h b/src/libasr/codegen/asr_to_c_cpp.h index 5151018f12..5d55780dc8 100644 --- a/src/libasr/codegen/asr_to_c_cpp.h +++ b/src/libasr/codegen/asr_to_c_cpp.h @@ -225,11 +225,37 @@ R"(#include indentation_level -= 2; } + void visit_BlockCall(const ASR::BlockCall_t &x) { + LFORTRAN_ASSERT(ASR::is_a(*x.m_m)); + ASR::Block_t* block = ASR::down_cast(x.m_m); + std::string decl, body; + std::string indent(indentation_level*indentation_spaces, ' '); + std::string open_paranthesis = indent + "{\n"; + std::string close_paranthesis = indent + "}\n"; + indent += std::string(indentation_spaces, ' '); + indentation_level += 1; + for (auto &item : block->m_symtab->get_scope()) { + if (ASR::is_a(*item.second)) { + ASR::Variable_t *v = ASR::down_cast(item.second); + decl += indent + self().convert_variable_decl(*v) + ";\n"; + } + } + for (size_t i=0; in_body; i++) { + self().visit_stmt(*block->m_body[i]); + body += src; + } + src = open_paranthesis + decl + body + close_paranthesis; + indentation_level -= 1; + } + // Returns the declaration, no semi colon at the end std::string get_function_declaration(const ASR::Function_t &x) { template_for_Kokkos.clear(); template_number = 0; - std::string sub; + std::string sub, inl; + if (x.m_inline) { + inl = "inline __attribute__((always_inline)) "; + } if (x.m_return_var) { ASR::Variable_t *return_var = LFortran::ASRUtils::EXPR2VAR(x.m_return_var); if (ASRUtils::is_integer(*return_var->m_type)) { @@ -287,7 +313,7 @@ R"(#include if (sym_name == "exit") { sym_name = "_xx_lcompilers_changed_exit_xx"; } - std::string func = sub + sym_name + "("; + std::string func = inl + sub + sym_name + "("; for (size_t i=0; im_intent)); @@ -556,11 +582,17 @@ R"(#include self().visit_expr(*x.m_arg); switch (x.m_kind) { case (ASR::cast_kindType::IntegerToReal) : { - src = "(float)(" + src + ")"; + int dest_kind = ASRUtils::extract_kind_from_ttype_t(x.m_type); + switch (dest_kind) { + case 4: src = "(float)(" + src + ")"; break; + case 8: src = "(double)(" + src + ")"; break; + default: throw CodeGenError("Cast IntegerToReal: Unsupported Kind " + std::to_string(dest_kind)); + } break; } case (ASR::cast_kindType::RealToInteger) : { - src = "(int)(" + src + ")"; + int dest_kind = ASRUtils::extract_kind_from_ttype_t(x.m_type); + src = "(int" + std::to_string(dest_kind * 8) + "_t)(" + src + ")"; break; } case (ASR::cast_kindType::RealToReal) : { @@ -797,6 +829,11 @@ R"(#include case (ASR::binopType::Sub) : { last_expr_precedence = 6; break; } case (ASR::binopType::Mul) : { last_expr_precedence = 5; break; } case (ASR::binopType::Div) : { last_expr_precedence = 5; break; } + case (ASR::binopType::BitAnd) : { last_expr_precedence = 11; break; } + case (ASR::binopType::BitOr) : { last_expr_precedence = 13; break; } + case (ASR::binopType::BitXor) : { last_expr_precedence = 12; break; } + case (ASR::binopType::BitLShift) : { last_expr_precedence = 7; break; } + case (ASR::binopType::BitRShift) : { last_expr_precedence = 7; break; } case (ASR::binopType::Pow) : { src = "pow(" + left + ", " + right + ")"; if (is_c) { @@ -806,7 +843,7 @@ R"(#include } return; } - default: throw CodeGenError("BinOp: operator not implemented yet"); + default: throw CodeGenError("BinOp: " + std::to_string(x.m_op) + " operator not implemented yet"); } src = ""; if (left_precedence == 3) { diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index 097b92bfae..f8391fbed8 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -112,33 +112,6 @@ uint64_t static get_hash(ASR::asr_t *node) return (uint64_t)node; } -void printf(llvm::LLVMContext &context, llvm::Module &module, - llvm::IRBuilder<> &builder, const std::vector &args) -{ - llvm::Function *fn_printf = module.getFunction("_lfortran_printf"); - if (!fn_printf) { - llvm::FunctionType *function_type = llvm::FunctionType::get( - llvm::Type::getVoidTy(context), {llvm::Type::getInt8PtrTy(context)}, true); - fn_printf = llvm::Function::Create(function_type, - llvm::Function::ExternalLinkage, "_lfortran_printf", &module); - } - builder.CreateCall(fn_printf, args); -} - -void exit(llvm::LLVMContext &context, llvm::Module &module, - llvm::IRBuilder<> &builder, llvm::Value* exit_code) -{ - llvm::Function *fn_exit = module.getFunction("exit"); - if (!fn_exit) { - llvm::FunctionType *function_type = llvm::FunctionType::get( - llvm::Type::getVoidTy(context), {llvm::Type::getInt32Ty(context)}, - false); - fn_exit = llvm::Function::Create(function_type, - llvm::Function::ExternalLinkage, "exit", &module); - } - builder.CreateCall(fn_exit, {exit_code}); -} - void string_init(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* arg_size, llvm::Value* arg_string) { std::string func_name = "_lfortran_string_init"; @@ -248,6 +221,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor std::unique_ptr llvm_utils; std::unique_ptr list_api; std::unique_ptr tuple_api; + std::unique_ptr dict_api; std::unique_ptr arr_descr; uint64_t ptr_loads; @@ -264,6 +238,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm_utils(std::make_unique(context, builder.get())), list_api(std::make_unique(context, llvm_utils.get(), builder.get())), tuple_api(std::make_unique(context, llvm_utils.get(), builder.get())), + dict_api(std::make_unique(context, llvm_utils.get(), builder.get())), arr_descr(LLVMArrUtils::Descriptor::get_descriptor(context, builder.get(), llvm_utils.get(), @@ -271,6 +246,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor ptr_loads(2), is_assignment_target(false) { + llvm_utils->tuple_api = tuple_api.get(); + llvm_utils->list_api = list_api.get(); + llvm_utils->dict_api = dict_api.get(); } llvm::Value* CreateLoad(llvm::Value *x) { @@ -1035,7 +1013,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // Generate function prototypes for (auto &item : x.m_global_scope->get_scope()) { if (is_a(*item.second)) { - visit_Function(*ASR::down_cast(item.second)); + if (ASR::down_cast(item.second)->n_type_params == 0) { + visit_Function(*ASR::down_cast(item.second)); + } } } prototype_only = false; @@ -1055,7 +1035,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // Then do all the procedures for (auto &item : x.m_global_scope->get_scope()) { if (is_a(*item.second)) { - visit_symbol(*item.second); + if (ASR::down_cast(item.second)->n_type_params == 0) { + visit_symbol(*item.second); + } } } @@ -1156,10 +1138,19 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor void visit_ListConstant(const ASR::ListConstant_t& x) { ASR::List_t* list_type = ASR::down_cast(x.m_type); - llvm::Type* llvm_el_type = get_el_type(list_type->m_type); + bool is_array_type_local = false, is_malloc_array_type_local = false; + bool is_list_local = false; + ASR::dimension_t* m_dims_local = nullptr; + int n_dims_local = -1, a_kind_local = -1; + llvm::Type* llvm_el_type = get_type_from_ttype_t(list_type->m_type, + ASR::storage_typeType::Default, is_array_type_local, + is_malloc_array_type_local, is_list_local, m_dims_local, + n_dims_local, a_kind_local); std::string type_code = ASRUtils::get_type_code(list_type->m_type); int32_t type_size = -1; - if( ASR::is_a(*list_type->m_type) ) { + if( ASR::is_a(*list_type->m_type) || + LLVM::is_llvm_struct(list_type->m_type) || + ASR::is_a(*list_type->m_type) ) { llvm::DataLayout data_layout(module.get()); type_size = data_layout.getTypeAllocSize(llvm_el_type); } else { @@ -1174,12 +1165,36 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor this->visit_expr(*x.m_args[i]); llvm::Value* item = tmp; llvm::Value* pos = llvm::ConstantInt::get(context, llvm::APInt(32, i)); - list_api->write_item(const_list, pos, item); + list_api->write_item(const_list, pos, item, list_type->m_type, *module); } ptr_loads = ptr_loads_copy; tmp = const_list; } + void visit_DictConstant(const ASR::DictConstant_t& x) { + llvm::Type* const_dict_type = get_dict_type(x.m_type); + llvm::Value* const_dict = builder->CreateAlloca(const_dict_type, nullptr, "const_dict"); + ASR::Dict_t* x_dict = ASR::down_cast(x.m_type); + std::string key_type_code = ASRUtils::get_type_code(x_dict->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(x_dict->m_value_type); + dict_api->dict_init(key_type_code, value_type_code, const_dict, module.get(), x.n_keys); + uint64_t ptr_loads_key = LLVM::is_llvm_struct(x_dict->m_key_type) ? 0 : 2; + uint64_t ptr_loads_value = LLVM::is_llvm_struct(x_dict->m_value_type) ? 0 : 2; + uint64_t ptr_loads_copy = ptr_loads; + for( size_t i = 0; i < x.n_keys; i++ ) { + ptr_loads = ptr_loads_key; + visit_expr(*x.m_keys[i]); + llvm::Value* key = tmp; + ptr_loads = ptr_loads_value; + visit_expr(*x.m_values[i]); + llvm::Value* value = tmp; + dict_api->write_item(const_dict, key, value, module.get(), + x_dict->m_key_type, x_dict->m_value_type); + } + ptr_loads = ptr_loads_copy; + tmp = const_dict; + } + void visit_TupleConstant(const ASR::TupleConstant_t& x) { ASR::Tuple_t* tuple_type = ASR::down_cast(x.m_type); std::string type_code = ASRUtils::get_type_code(tuple_type->m_type, @@ -1198,10 +1213,13 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm::Type* const_tuple_type = tuple_api->get_tuple_type(type_code, llvm_el_types); llvm::Value* const_tuple = builder->CreateAlloca(const_tuple_type, nullptr, "const_tuple"); std::vector init_values; + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 2; for( size_t i = 0; i < x.n_elements; i++ ) { this->visit_expr(*x.m_elements[i]); init_values.push_back(tmp); } + ptr_loads = ptr_loads_copy; tuple_api->tuple_init(const_tuple, init_values); tmp = const_tuple; } @@ -1227,31 +1245,70 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_ListAppend(const ASR::ListAppend_t& x) { + ASR::List_t* asr_list = ASR::down_cast(ASRUtils::expr_type(x.m_a)); uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; this->visit_expr(*x.m_a); - ptr_loads = ptr_loads_copy; llvm::Value* plist = tmp; + ptr_loads = !LLVM::is_llvm_struct(asr_list->m_type); this->visit_expr_wrapper(x.m_ele, true); llvm::Value *item = tmp; + ptr_loads = ptr_loads_copy; - ASR::List_t* asr_list = ASR::down_cast(ASRUtils::expr_type(x.m_a)); - std::string type_code = ASRUtils::get_type_code(asr_list->m_type); - list_api->append(plist, item, *module, type_code); + list_api->append(plist, item, asr_list->m_type, *module); } void visit_ListItem(const ASR::ListItem_t& x) { + ASR::ttype_t* el_type = ASRUtils::get_contained_type( + ASRUtils::expr_type(x.m_a)); uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; this->visit_expr(*x.m_a); - ptr_loads = ptr_loads_copy; llvm::Value* plist = tmp; + ptr_loads = 1; this->visit_expr_wrapper(x.m_pos, true); + ptr_loads = ptr_loads_copy; llvm::Value *pos = tmp; - tmp = list_api->read_item(plist, pos); + tmp = list_api->read_item(plist, pos, + (LLVM::is_llvm_struct(el_type) || + ptr_loads == 0)); + } + + void visit_DictItem(const ASR::DictItem_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + ptr_loads = ptr_loads_copy; + llvm::Value *key = tmp; + + tmp = dict_api->read_item(pdict, key, *module, dict_type->m_key_type, + LLVM::is_llvm_struct(dict_type->m_value_type)); + } + + void visit_DictPop(const ASR::DictPop_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + ptr_loads = ptr_loads_copy; + llvm::Value *key = tmp; + + tmp = dict_api->pop_item(pdict, key, *module, dict_type, + LLVM::is_llvm_struct(dict_type->m_value_type)); } void visit_ListLen(const ASR::ListLen_t& x) { @@ -1267,6 +1324,85 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } } + void visit_DictLen(const ASR::DictLen_t& x) { + if (x.m_value) { + this->visit_expr(*x.m_value); + return ; + } + + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_arg); + ptr_loads = ptr_loads_copy; + llvm::Value* pdict = tmp; + tmp = dict_api->len(pdict); + } + + void visit_ListInsert(const ASR::ListInsert_t& x) { + ASR::List_t* asr_list = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + + ptr_loads = 1; + this->visit_expr_wrapper(x.m_pos, true); + llvm::Value *pos = tmp; + + ptr_loads = !LLVM::is_llvm_struct(asr_list->m_type); + this->visit_expr_wrapper(x.m_ele, true); + llvm::Value *item = tmp; + ptr_loads = ptr_loads_copy; + + list_api->insert_item(plist, pos, item, asr_list->m_type, *module); + } + + void visit_DictInsert(const ASR::DictInsert_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + llvm::Value *key = tmp; + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_value_type); + this->visit_expr_wrapper(x.m_value, true); + llvm::Value *value = tmp; + ptr_loads = ptr_loads_copy; + + dict_api->write_item(pdict, key, value, module.get(), + dict_type->m_key_type, + dict_type->m_value_type); + } + + void visit_ListRemove(const ASR::ListRemove_t& x) { + ASR::ttype_t* asr_el_type = ASRUtils::get_contained_type(ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + + ptr_loads = !LLVM::is_llvm_struct(asr_el_type); + this->visit_expr_wrapper(x.m_ele, true); + ptr_loads = ptr_loads_copy; + llvm::Value *item = tmp; + list_api->remove(plist, item, asr_el_type, *module); + } + + void visit_ListClear(const ASR::ListClear_t& x) { + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + ptr_loads = ptr_loads_copy; + + list_api->list_clear(plist); + } + void visit_TupleLen(const ASR::TupleLen_t& x) { LFORTRAN_ASSERT(x.m_value); this->visit_expr(*x.m_value); @@ -1282,7 +1418,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor this->visit_expr_wrapper(x.m_pos, true); llvm::Value *pos = tmp; - tmp = tuple_api->read_item(ptuple, pos); + tmp = tuple_api->read_item(ptuple, pos, LLVM::is_llvm_struct(x.m_type)); } void visit_ArrayItem(const ASR::ArrayItem_t& x) { @@ -1301,10 +1437,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor uint32_t v_h = get_hash((ASR::asr_t*)v); LFORTRAN_ASSERT(llvm_symtab.find(v_h) != llvm_symtab.end()); array = llvm_symtab[v_h]; - is_argument = (v->m_intent == ASRUtils::intent_in) - || (v->m_intent == ASRUtils::intent_out) - || (v->m_intent == ASRUtils::intent_inout) - || (v->m_intent == ASRUtils::intent_unspecified); + is_argument = v->m_intent == ASRUtils::intent_in || v->m_intent == ASRUtils::intent_out; } else { int64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; @@ -1647,6 +1780,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_Program(const ASR::Program_t &x) { + bool is_dict_present_copy = dict_api->is_dict_present; + dict_api->is_dict_present = false; llvm_goto_targets.clear(); // Generate code for nested subroutines and functions first: for (auto &item : x.m_symtab->get_scope()) { @@ -1675,6 +1810,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm::Value *ret_val2 = llvm::ConstantInt::get(context, llvm::APInt(32, 0)); builder->CreateRet(ret_val2); + dict_api->is_dict_present = is_dict_present_copy; } /* @@ -1695,6 +1831,41 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor return false; } + int32_t get_type_size(ASR::ttype_t* asr_type, llvm::Type* llvm_type, + int32_t a_kind) { + if( LLVM::is_llvm_struct(asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) ) { + llvm::DataLayout data_layout(module.get()); + return data_layout.getTypeAllocSize(llvm_type); + } + return a_kind; + } + + llvm::Type* get_dict_type(ASR::ttype_t* asr_type) { + ASR::Dict_t* asr_dict = ASR::down_cast(asr_type); + bool is_local_array_type = false, is_local_malloc_array_type = false; + bool is_local_list = false; + ASR::dimension_t* local_m_dims = nullptr; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm::Type* key_llvm_type = get_type_from_ttype_t(asr_dict->m_key_type, local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, + local_a_kind); + int32_t key_type_size = get_type_size(asr_dict->m_key_type, key_llvm_type, local_a_kind); + llvm::Type* value_llvm_type = get_type_from_ttype_t(asr_dict->m_value_type, local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, + local_a_kind); + int32_t value_type_size = get_type_size(asr_dict->m_value_type, value_llvm_type, local_a_kind); + std::string key_type_code = ASRUtils::get_type_code(asr_dict->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(asr_dict->m_value_type); + return dict_api->get_dict_type(key_type_code, value_type_code, key_type_size, + value_type_size, key_llvm_type, value_llvm_type); + } + llvm::Type* get_type_from_ttype_t(ASR::ttype_t* asr_type, ASR::storage_typeType m_storage, bool& is_array_type, bool& is_malloc_array_type, @@ -1832,7 +2003,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor a_kind); std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); int32_t type_size = -1; - if( ASR::is_a(*asr_list->m_type) ) { + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { llvm::DataLayout data_layout(module.get()); type_size = data_layout.getTypeAllocSize(el_llvm_type); } else { @@ -1841,6 +2014,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm_type = list_api->get_list_type(el_llvm_type, el_type_code, type_size); break; } + case (ASR::ttypeType::Dict): { + llvm_type = get_dict_type(asr_type); + break; + } case (ASR::ttypeType::Tuple) : { ASR::Tuple_t* asr_tuple = ASR::down_cast(asr_type); std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, @@ -1871,6 +2048,17 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor return llvm_type; } + inline llvm::Type* get_type_from_ttype_t_util(ASR::ttype_t* asr_type) { + ASR::storage_typeType m_storage_local = ASR::storage_typeType::Default; + bool is_array_type_local, is_malloc_array_type_local; + bool is_list_local; + ASR::dimension_t* m_dims_local; + int n_dims_local, a_kind_local; + return get_type_from_ttype_t(asr_type, m_storage_local, is_array_type_local, + is_malloc_array_type_local, is_list_local, + m_dims_local, n_dims_local, a_kind_local); + } + template void declare_vars(const T &x) { llvm::Value *target_var; @@ -2185,6 +2373,46 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor type = llvm::Type::getVoidTy(context)->getPointerTo(); break; } + case (ASR::ttypeType::Tuple) : { + ASR::Tuple_t* asr_tuple = ASR::down_cast(asr_type); + std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, + asr_tuple->n_type); + std::vector llvm_el_types; + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + bool is_local_array_type = false; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm_el_types.push_back(get_arg_type_from_ttype_t(asr_tuple->m_type[i], m_abi, + arg_m_abi, local_m_storage, arg_m_value_attr, local_n_dims, + local_a_kind, is_local_array_type, ASRUtils::intent_local)); + } + type = tuple_api->get_tuple_type(type_code, llvm_el_types)->getPointerTo(); + break; + } + case (ASR::ttypeType::List) : { + bool is_array_type = false, is_malloc_array_type = false; + bool is_list = true; + ASR::dimension_t *m_dims = nullptr; + ASR::List_t* asr_list = ASR::down_cast(asr_type); + llvm::Type* el_llvm_type = get_type_from_ttype_t(asr_list->m_type, m_storage, + is_array_type, + is_malloc_array_type, + is_list, m_dims, n_dims, + a_kind); + int32_t type_size = -1; + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { + llvm::DataLayout data_layout(module.get()); + type_size = data_layout.getTypeAllocSize(el_llvm_type); + } else { + type_size = a_kind; + } + std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); + type = list_api->get_list_type(el_llvm_type, el_type_code, type_size)->getPointerTo(); + break; + } default : LFORTRAN_ASSERT(false); } @@ -2396,6 +2624,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_Function(const ASR::Function_t &x) { + bool is_dict_present_copy = dict_api->is_dict_present; + dict_api->is_dict_present = false; llvm_goto_targets.clear(); instantiate_function(x); if (x.m_deftype == ASR::deftypeType::Interface) { @@ -2406,6 +2636,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor visit_procedures(x); generate_function(x); parent_function = nullptr; + dict_api->is_dict_present = is_dict_present_copy; } void instantiate_function(const ASR::Function_t &x){ @@ -2520,6 +2751,50 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor case (ASR::ttypeType::Derived) : throw CodeGenError("Derived return type not implemented yet"); break; + case (ASR::ttypeType::Tuple) : { + ASR::Tuple_t* asr_tuple = ASR::down_cast(return_var_type0); + std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, + asr_tuple->n_type); + std::vector llvm_el_types; + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + bool is_local_array_type = false, is_local_malloc_array_type = false; + bool is_local_list = false; + ASR::dimension_t* local_m_dims = nullptr; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm_el_types.push_back(get_type_from_ttype_t(asr_tuple->m_type[i], local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, local_a_kind)); + } + return_type = tuple_api->get_tuple_type(type_code, llvm_el_types); + break; + } + case (ASR::ttypeType::List) : { + bool is_array_type = false, is_malloc_array_type = false; + bool is_list = true; + ASR::dimension_t *m_dims = nullptr; + ASR::storage_typeType m_storage = ASR::storage_typeType::Default; + int n_dims = 0, a_kind = -1; + ASR::List_t* asr_list = ASR::down_cast(return_var_type0); + llvm::Type* el_llvm_type = get_type_from_ttype_t(asr_list->m_type, m_storage, + is_array_type, + is_malloc_array_type, + is_list, m_dims, n_dims, + a_kind); + int32_t type_size = -1; + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { + llvm::DataLayout data_layout(module.get()); + type_size = data_layout.getTypeAllocSize(el_llvm_type); + } else { + type_size = a_kind; + } + std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); + return_type = list_api->get_list_type(el_llvm_type, el_type_code, type_size); + break; + } default : LFORTRAN_ASSERT(false); throw CodeGenError("Type not implemented"); @@ -2876,6 +3151,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor bool is_value_list = ASR::is_a(*asr_value_type); bool is_target_tuple = ASR::is_a(*asr_target_type); bool is_value_tuple = ASR::is_a(*asr_value_type); + bool is_target_dict = ASR::is_a(*asr_target_type); + bool is_value_dict = ASR::is_a(*asr_value_type); if( is_target_list && is_value_list ) { uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; @@ -2887,44 +3164,75 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor ASR::List_t* value_asr_list = ASR::down_cast( ASRUtils::expr_type(x.m_value)); std::string value_type_code = ASRUtils::get_type_code(value_asr_list->m_type); - list_api->list_deepcopy(value_list, target_list, value_type_code, *module); + list_api->list_deepcopy(value_list, target_list, + value_asr_list, *module); return ; } else if( is_target_tuple && is_value_tuple ) { uint64_t ptr_loads_copy = ptr_loads; - ptr_loads = 0; - this->visit_expr(*x.m_value); - llvm::Value* value_tuple = tmp; - if( ASR::is_a(*x.m_target) ) { - ptr_loads = ptr_loads_copy; + if( ASR::is_a(*x.m_target) && + !ASR::is_a(*x.m_value) ) { + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_tuple = tmp; ASR::TupleConstant_t* const_tuple = ASR::down_cast(x.m_target); for( size_t i = 0; i < const_tuple->n_elements; i++ ) { - // TODO: Adjust for global variables as well - // See if-else check on llvm_symtab for the logic - ASR::Variable_t *target_var = EXPR2VAR(const_tuple->m_elements[i]); - uint32_t h = get_hash((ASR::asr_t*)target_var); - llvm::Value* target_ptr = nullptr; - if (llvm_symtab.find(h) != llvm_symtab.end()) { - target_ptr = llvm_symtab[h]; - if (ASR::is_a(*target_var->m_type)) { - target_ptr = CreateLoad(target_ptr); - } - } else { - throw CodeGenError("Support for unpacking tuple value to " - "a global variable is not available yet."); - } + ptr_loads = 0; + visit_expr(*const_tuple->m_elements[i]); + llvm::Value* target_ptr = tmp; llvm::Value* item = tuple_api->read_item(value_tuple, i, false); builder->CreateStore(item, target_ptr); } + ptr_loads = ptr_loads_copy; + } else if( ASR::is_a(*x.m_target) && + ASR::is_a(*x.m_value) ) { + ASR::TupleConstant_t* asr_value_tuple = ASR::down_cast(x.m_value); + Vec src_deepcopies; + src_deepcopies.reserve(al, asr_value_tuple->n_elements); + for( size_t i = 0; i < asr_value_tuple->n_elements; i++ ) { + ASR::ttype_t* asr_tuple_i_type = ASRUtils::expr_type(asr_value_tuple->m_elements[i]); + llvm::Type* llvm_tuple_i_type = get_type_from_ttype_t_util(asr_tuple_i_type); + llvm::Value* llvm_tuple_i = builder->CreateAlloca(llvm_tuple_i_type, nullptr); + ptr_loads = !LLVM::is_llvm_struct(asr_tuple_i_type); + visit_expr(*asr_value_tuple->m_elements[i]); + llvm_utils->deepcopy(tmp, llvm_tuple_i, asr_tuple_i_type, *module); + src_deepcopies.push_back(al, llvm_tuple_i); + } + ASR::TupleConstant_t* asr_target_tuple = ASR::down_cast(x.m_target); + for( size_t i = 0; i < asr_target_tuple->n_elements; i++ ) { + ptr_loads = 0; + visit_expr(*asr_target_tuple->m_elements[i]); + LLVM::CreateStore(*builder, + LLVM::CreateLoad(*builder, src_deepcopies[i]), + tmp + ); + } + ptr_loads = ptr_loads_copy; } else { + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_tuple = tmp; this->visit_expr(*x.m_target); llvm::Value* target_tuple = tmp; ptr_loads = ptr_loads_copy; ASR::Tuple_t* value_tuple_type = ASR::down_cast(asr_value_type); std::string type_code = ASRUtils::get_type_code(value_tuple_type->m_type, value_tuple_type->n_type); - tuple_api->tuple_deepcopy(value_tuple, target_tuple, type_code); + tuple_api->tuple_deepcopy(value_tuple, target_tuple, + value_tuple_type, *module); } return ; + } else if( is_target_dict && is_value_dict ) { + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_dict = tmp; + this->visit_expr(*x.m_target); + llvm::Value* target_dict = tmp; + ptr_loads = ptr_loads_copy; + ASR::Dict_t* value_dict_type = ASR::down_cast(asr_value_type); + dict_api->dict_deepcopy(value_dict, target_dict, + value_dict_type, module.get()); + return ; } if( ASR::is_a(*ASRUtils::expr_type(x.m_target)) && ASR::is_a(*x.m_value) ) { @@ -3327,6 +3635,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_WhileLoop(const ASR::WhileLoop_t &x) { + dict_api->set_iterators(); llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); @@ -3348,6 +3657,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // end start_new_block(loopend); + dict_api->reset_iterators(); } void visit_Exit(const ASR::Exit_t & /* x */) { @@ -4868,10 +5178,13 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } } } else { + ASR::ttype_t* arg_type = expr_type(x.m_args[i].m_value); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = !LLVM::is_llvm_struct(arg_type); this->visit_expr_wrapper(x.m_args[i].m_value); llvm::Value *value=tmp; + ptr_loads = ptr_loads_copy; llvm::Type *target_type; - ASR::ttype_t* arg_type = expr_type(x.m_args[i].m_value); bool character_bindc = false; switch (arg_type->type) { case (ASR::ttypeType::Integer) : { @@ -4912,6 +5225,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor case (ASR::ttypeType::CPtr) : target_type = llvm::Type::getVoidTy(context)->getPointerTo(); break; + case (ASR::ttypeType::List) : { + target_type = get_type_from_ttype_t_util(arg_type); + break ; + } default : throw CodeGenError("Type " + ASRUtils::type_to_str(arg_type) + " not implemented yet."); } @@ -4947,7 +5264,12 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor if( ASR::is_a(*x.m_args[i].m_value) ) { value = CreateLoad(value); } - builder->CreateStore(value, target); + if( ASR::is_a(*arg_type) || + ASR::is_a(*arg_type) ) { + llvm_utils->deepcopy(value, target, arg_type, *module); + } else { + builder->CreateStore(value, target); + } tmp = target; } } @@ -5113,6 +5435,33 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor tmp = builder->CreateOr(arg1, arg2); } + llvm::Value* CreatePointerToStructReturnValue(llvm::FunctionType* fnty, + llvm::Value* return_value, + ASR::ttype_t* asr_return_type) { + if( !LLVM::is_llvm_struct(asr_return_type) ) { + return return_value; + } + + // Call to LLVM APIs not needed to fetch the return type of the function. + // We can use asr_return_type as well but anyways for compactness I did it here. + llvm::Value* pointer_to_struct = builder->CreateAlloca(fnty->getReturnType(), nullptr); + LLVM::CreateStore(*builder, return_value, pointer_to_struct); + return pointer_to_struct; + } + + llvm::Value* CreateCallUtil(llvm::FunctionType* fnty, llvm::Function* fn, + std::vector& args, + ASR::ttype_t* asr_return_type) { + llvm::Value* return_value = builder->CreateCall(fn, args); + return CreatePointerToStructReturnValue(fnty, return_value, + asr_return_type); + } + + llvm::Value* CreateCallUtil(llvm::Function* fn, std::vector& args, + ASR::ttype_t* asr_return_type) { + return CreateCallUtil(fn->getFunctionType(), fn, args, asr_return_type); + } + void visit_FunctionCall(const ASR::FunctionCall_t &x) { if( ASRUtils::is_intrinsic_optimization(x.m_name) ) { ASR::Function_t* routine = ASR::down_cast( @@ -5206,8 +5555,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor std::string m_name = std::string(((ASR::Function_t*)(&(x.m_name->base)))->m_name); std::vector args2 = convert_call_args(x, m_name); args.insert(args.end(), args2.begin(), args2.end()); + ASR::ttype_t *return_var_type0 = EXPR2VAR(s->m_return_var)->m_type; if (s->m_abi == ASR::abiType::BindC) { - ASR::ttype_t *return_var_type0 = EXPR2VAR(s->m_return_var)->m_type; if (is_a(*return_var_type0)) { int a_kind = down_cast(return_var_type0)->m_kind; if (a_kind == 8) { @@ -5227,7 +5576,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor tmp = builder->CreateCall(fn, args); } } else { - tmp = builder->CreateCall(fn, args); + tmp = CreateCallUtil(fn, args, return_var_type0); } } if (s->m_abi == ASR::abiType::BindC) { diff --git a/src/libasr/codegen/asr_to_wasm.cpp b/src/libasr/codegen/asr_to_wasm.cpp index 950f8f7343..19af21f956 100644 --- a/src/libasr/codegen/asr_to_wasm.cpp +++ b/src/libasr/codegen/asr_to_wasm.cpp @@ -177,7 +177,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { m_al, global_scope_loc, global_scope, s2c(m_al, import_func.name), params.data(), params.size(), nullptr, 0, nullptr, 0, nullptr, ASR::abiType::Source, ASR::accessType::Public, - ASR::deftypeType::Implementation, nullptr, false, false, false); + ASR::deftypeType::Implementation, nullptr, false, false, false, false); m_import_func_asr_map[import_func.name] = func; wasm::emit_import_fn(m_import_section, m_al, "js", import_func.name, @@ -261,6 +261,9 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { } } + // Process procedures first: + declare_all_functions(*x.m_global_scope); + // then the main program: for (auto &item : x.m_global_scope->get_scope()) { if (ASR::is_a(*item.second)) { @@ -287,14 +290,8 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { } } - // // Process procedures first: - // for (auto &item : x.m_global_scope->get_scope()) { - // if (ASR::is_a(*item.second) - // || ASR::is_a(*item.second)) { - // visit_symbol(*item.second); - // // std::cout << "I am here -1: " << src << std::endl; - // } - // } + // Process procedures first: + declare_all_functions(*x.m_global_scope); // // Then do all the modules in the right order // std::vector build_order @@ -348,7 +345,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { m_al, x.base.base.loc, x.m_symtab, s2c(m_al, "_lcompilers_main"), nullptr, 0, nullptr, 0, x.m_body, x.n_body, nullptr, ASR::abiType::Source, ASR::accessType::Public, - ASR::deftypeType::Implementation, nullptr, false, false, false); + ASR::deftypeType::Implementation, nullptr, false, false, false, false); emit_function_prototype(*((ASR::Function_t *)main_func)); emit_function_body(*((ASR::Function_t *)main_func)); } diff --git a/src/libasr/codegen/llvm_utils.cpp b/src/libasr/codegen/llvm_utils.cpp index 64d76be72d..fe3593ad16 100644 --- a/src/libasr/codegen/llvm_utils.cpp +++ b/src/libasr/codegen/llvm_utils.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace LFortran { @@ -48,6 +49,23 @@ namespace LFortran { return builder.CreateCall(fn, args); } + llvm::Value* lfortran_calloc(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* count, llvm::Value* type_size) { + std::string func_name = "_lfortran_calloc"; + llvm::Function *fn = module.getFunction(func_name); + if (!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getInt8PtrTy(context), { + llvm::Type::getInt32Ty(context), + llvm::Type::getInt32Ty(context) + }, true); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, func_name, module); + } + std::vector args = {count, type_size}; + return builder.CreateCall(fn, args); + } + llvm::Value* lfortran_realloc(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* ptr, llvm::Value* arg_size) { std::string func_name = "_lfortran_realloc"; @@ -67,12 +85,32 @@ namespace LFortran { }; return builder.CreateCall(fn, args); } + + llvm::Value* lfortran_free(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* ptr) { + std::string func_name = "_lfortran_free"; + llvm::Function *fn = module.getFunction(func_name); + if (!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), { + llvm::Type::getInt8PtrTy(context) + }, true); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, func_name, module); + } + std::vector args = { + builder.CreateBitCast(ptr, llvm::Type::getInt8PtrTy(context)), + }; + return builder.CreateCall(fn, args); + } } // namespace LLVM LLVMUtils::LLVMUtils(llvm::LLVMContext& context, llvm::IRBuilder<>* _builder): context(context), - builder(std::move(_builder)) { + builder(std::move(_builder)), + str_cmp_itr(nullptr), + are_iterators_set(false) { } llvm::Value* LLVMUtils::create_gep(llvm::Value* ds, int idx) { @@ -155,6 +193,138 @@ namespace LFortran { builder->SetInsertPoint(bb); } + void LLVMUtils::set_iterators() { + if( are_iterators_set ) { + return ; + } + str_cmp_itr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "str_cmp_itr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), str_cmp_itr); + are_iterators_set = true; + } + + void LLVMUtils::reset_iterators() { + str_cmp_itr = nullptr; + are_iterators_set = false; + } + + llvm::Value* LLVMUtils::lfortran_str_cmp(llvm::Value* left_arg, llvm::Value* right_arg, + std::string runtime_func_name, llvm::Module& module) + { + llvm::Type* character_type = llvm::Type::getInt8PtrTy(context); + llvm::Function *fn = module.getFunction(runtime_func_name); + if(!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getInt1Ty(context), { + character_type->getPointerTo(), + character_type->getPointerTo() + }, false); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, runtime_func_name, module); + } + llvm::AllocaInst *pleft_arg = builder->CreateAlloca(character_type, nullptr); + LLVM::CreateStore(*builder, left_arg, pleft_arg); + llvm::AllocaInst *pright_arg = builder->CreateAlloca(character_type, nullptr); + LLVM::CreateStore(*builder, right_arg, pright_arg); + std::vector args = {pleft_arg, pright_arg}; + return builder->CreateCall(fn, args); + } + + llvm::Value* LLVMUtils::is_equal_by_value(llvm::Value* left, llvm::Value* right, + llvm::Module& module, ASR::ttype_t* asr_type) { + switch( asr_type->type ) { + case ASR::ttypeType::Integer: { + return builder->CreateICmpEQ(left, right); + }; + case ASR::ttypeType::Real: { + return builder->CreateFCmpOEQ(left, right); + } + case ASR::ttypeType::Character: { + if( !are_iterators_set ) { + str_cmp_itr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + llvm::Value* null_char = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), + llvm::APInt(8, '\0')); + llvm::Value* idx = str_cmp_itr; + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), llvm::APInt(32, 0)), + idx); + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + start_new_block(loophead); + { + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + llvm::Value* l = LLVM::CreateLoad(*builder, create_ptr_gep(left, i)); + llvm::Value* r = LLVM::CreateLoad(*builder, create_ptr_gep(right, i)); + llvm::Value *cond = builder->CreateAnd( + builder->CreateICmpNE(l, null_char), + builder->CreateICmpNE(r, null_char) + ); + cond = builder->CreateAnd(cond, builder->CreateICmpEQ(l, r)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + start_new_block(loopbody); + { + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + i = builder->CreateAdd(i, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, i, idx); + } + + builder->CreateBr(loophead); + + // end + start_new_block(loopend); + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + llvm::Value* l = LLVM::CreateLoad(*builder, create_ptr_gep(left, i)); + llvm::Value* r = LLVM::CreateLoad(*builder, create_ptr_gep(right, i)); + return builder->CreateICmpEQ(l, r); + } + case ASR::ttypeType::Tuple: { + ASR::Tuple_t* tuple_type = ASR::down_cast(asr_type); + return tuple_api->check_tuple_equality(left, right, tuple_type, context, + builder, module); + } + default: { + throw LCompilersException("LLVMUtils::is_equal_by_value isn't implemented for " + + ASRUtils::type_to_str_python(asr_type)); + } + } + } + + void LLVMUtils::deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* asr_type, llvm::Module& module) { + switch( asr_type->type ) { + case ASR::ttypeType::Integer: + case ASR::ttypeType::Real: + case ASR::ttypeType::Character: + case ASR::ttypeType::Logical: + case ASR::ttypeType::Complex: { + LLVM::CreateStore(*builder, src, dest); + break ; + }; + case ASR::ttypeType::Tuple: { + ASR::Tuple_t* tuple_type = ASR::down_cast(asr_type); + tuple_api->tuple_deepcopy(src, dest, tuple_type, module); + break ; + } + case ASR::ttypeType::List: { + ASR::List_t* list_type = ASR::down_cast(asr_type); + list_api->list_deepcopy(src, dest, list_type, module); + break ; + } + default: { + throw LCompilersException("LLVMUtils::deepcopy isn't implemented for " + + ASRUtils::type_to_str_python(asr_type)); + } + } + } + LLVMList::LLVMList(llvm::LLVMContext& context_, LLVMUtils* llvm_utils_, llvm::IRBuilder<>* builder_): @@ -162,6 +332,25 @@ namespace LFortran { llvm_utils(std::move(llvm_utils_)), builder(std::move(builder_)) {} + LLVMDict::LLVMDict(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils_, + llvm::IRBuilder<>* builder_): + context(context_), + llvm_utils(std::move(llvm_utils_)), + builder(std::move(builder_)), + pos_ptr(nullptr), is_key_matching_var(nullptr), + idx_ptr(nullptr), hash_iter(nullptr), + hash_value(nullptr), polynomial_powers(nullptr), + are_iterators_set(false), is_dict_present(false) { + } + + LLVMDictOptimizedLinearProbing::LLVMDictOptimizedLinearProbing( + llvm::LLVMContext& context_, + LLVMUtils* llvm_utils_, + llvm::IRBuilder<>* builder_): + LLVMDict(context_, llvm_utils_, builder_) { + } + llvm::Type* LLVMList::get_list_type(llvm::Type* el_type, std::string& type_code, int32_t type_size) { if( typecode2listtype.find(type_code) != typecode2listtype.end() ) { @@ -175,6 +364,29 @@ namespace LFortran { return list_desc; } + llvm::Type* LLVMDict::get_dict_type(std::string key_type_code, std::string value_type_code, + int32_t key_type_size, int32_t value_type_size, + llvm::Type* key_type, llvm::Type* value_type) { + is_dict_present = true; + std::pair llvm_key = std::make_pair(key_type_code, value_type_code); + if( typecode2dicttype.find(llvm_key) != typecode2dicttype.end() ) { + return std::get<0>(typecode2dicttype[llvm_key]); + } + + llvm::Type* key_list_type = llvm_utils->list_api->get_list_type(key_type, + key_type_code, key_type_size); + llvm::Type* value_list_type = llvm_utils->list_api->get_list_type(value_type, + value_type_code, value_type_size); + std::vector dict_type_vec = {llvm::Type::getInt32Ty(context), + key_list_type, value_list_type, + llvm::Type::getInt8PtrTy(context)}; + llvm::Type* dict_desc = llvm::StructType::create(context, dict_type_vec, "dict"); + typecode2dicttype[llvm_key] = std::make_tuple(dict_desc, + std::make_pair(key_type_size, value_type_size), + std::make_pair(key_type, value_type)); + return dict_desc; + } + llvm::Value* LLVMList::get_pointer_to_list_data(llvm::Value* list) { return llvm_utils->create_gep(list, 2); } @@ -190,7 +402,7 @@ namespace LFortran { void LLVMList::list_init(std::string& type_code, llvm::Value* list, llvm::Module& module, int32_t initial_capacity, int32_t n) { if( typecode2listtype.find(type_code) == typecode2listtype.end() ) { - LCompilersException("list for " + type_code + " not declared yet."); + throw LCompilersException("list for " + type_code + " not declared yet."); } int32_t type_size = std::get<1>(typecode2listtype[type_code]); llvm::Value* arg_size = llvm::ConstantInt::get(context, @@ -208,10 +420,73 @@ namespace LFortran { builder->CreateStore(current_capacity, get_pointer_to_current_capacity(list)); } + void LLVMList::list_init(std::string& type_code, llvm::Value* list, + llvm::Module& module, llvm::Value* initial_capacity, + llvm::Value* n) { + if( typecode2listtype.find(type_code) == typecode2listtype.end() ) { + throw LCompilersException("list for " + type_code + " not declared yet."); + } + int32_t type_size = std::get<1>(typecode2listtype[type_code]); + llvm::Value* llvm_type_size = llvm::ConstantInt::get(context, llvm::APInt(32, type_size)); + llvm::Value* arg_size = builder->CreateMul(llvm_type_size, initial_capacity); + llvm::Value* list_data = LLVM::lfortran_malloc(context, module, *builder, arg_size); + + llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); + list_data = builder->CreateBitCast(list_data, el_type->getPointerTo()); + llvm::Value* list_data_ptr = get_pointer_to_list_data(list); + builder->CreateStore(list_data, list_data_ptr); + builder->CreateStore(n, get_pointer_to_current_end_point(list)); + builder->CreateStore(initial_capacity, get_pointer_to_current_capacity(list)); + } + + llvm::Value* LLVMDict::get_key_list(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 1); + } + + llvm::Value* LLVMDict::get_value_list(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 2); + } + + llvm::Value* LLVMDict::get_pointer_to_occupancy(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 0); + } + + llvm::Value* LLVMDict::get_pointer_to_capacity(llvm::Value* dict) { + return llvm_utils->list_api->get_pointer_to_current_capacity( + get_value_list(dict)); + } + + void LLVMDict::dict_init(std::string key_type_code, std::string value_type_code, + llvm::Value* dict, llvm::Module* module, size_t initial_capacity) { + llvm::Value* n_ptr = get_pointer_to_occupancy(dict); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), n_ptr); + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm_utils->list_api->list_init(key_type_code, key_list, *module, + initial_capacity, initial_capacity); + llvm_utils->list_api->list_init(value_type_code, value_list, *module, + initial_capacity, initial_capacity); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_capacity = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, initial_capacity)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* key_mask = LLVM::lfortran_calloc(context, *module, *builder, llvm_capacity, + llvm_mask_size); + LLVM::CreateStore(*builder, key_mask, get_pointer_to_keymask(dict)); + } + + void LLVMList::list_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::List_t* list_type, llvm::Module& module) { + list_deepcopy(src, dest, list_type->m_type, module); + } + void LLVMList::list_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& src_type_code, - llvm::Module& module) { + ASR::ttype_t* element_type, llvm::Module& module) { LFORTRAN_ASSERT(src->getType() == dest->getType()); + std::string src_type_code = ASRUtils::get_type_code(element_type); llvm::Value* src_end_point = LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(src)); llvm::Value* src_capacity = LLVM::CreateLoad(*builder, get_pointer_to_current_capacity(src)); llvm::Value* dest_end_point_ptr = get_pointer_to_current_end_point(dest); @@ -226,18 +501,755 @@ namespace LFortran { arg_size); llvm::Type* el_type = std::get<2>(typecode2listtype[src_type_code]); copy_data = builder->CreateBitCast(copy_data, el_type->getPointerTo()); - builder->CreateMemCpy(copy_data, llvm::MaybeAlign(), src_data, - llvm::MaybeAlign(), arg_size); - builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + + // We consider the case when the element type of a list is defined by a struct + // which may also contain non-trivial structs (such as in case of list[list[f64]], + // list[tuple[f64]]). We need to make sure that all the data inside those structs + // is deepcopied and not just the address of the first element of those structs. + // Hence we dive deeper into the lowest level of nested types and deepcopy everything + // properly. If we don't consider this case then the data only from first level of nested types + // will be deep copied and rest will be shallow copied. The importance of this case + // can be figured out by goind through, integration_tests/test_list_06.py and + // integration_tests/test_list_07.py. + if( LLVM::is_llvm_struct(element_type) ) { + builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), + nullptr); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT( + src_end_point, + LLVM::CreateLoad(*builder, pos_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* srci = read_item(src, pos, true); + llvm::Value* desti = read_item(dest, pos, true); + llvm_utils->deepcopy(srci, desti, element_type, module); + llvm::Value* tmp = builder->CreateAdd( + pos, + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, pos_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + } else { + builder->CreateMemCpy(copy_data, llvm::MaybeAlign(), src_data, + llvm::MaybeAlign(), arg_size); + builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + } + } + + void LLVMDict::dict_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::Dict_t* dict_type, llvm::Module* module) { + LFORTRAN_ASSERT(src->getType() == dest->getType()); + llvm::Value* src_occupancy = LLVM::CreateLoad(*builder, get_pointer_to_occupancy(src)); + llvm::Value* dest_occupancy_ptr = get_pointer_to_occupancy(dest); + LLVM::CreateStore(*builder, src_occupancy, dest_occupancy_ptr); + + llvm::Value* src_key_list = get_key_list(src); + llvm::Value* dest_key_list = get_key_list(dest); + llvm_utils->list_api->list_deepcopy(src_key_list, dest_key_list, + dict_type->m_key_type, *module); + + llvm::Value* src_value_list = get_value_list(src); + llvm::Value* dest_value_list = get_value_list(dest); + llvm_utils->list_api->list_deepcopy(src_value_list, dest_value_list, + dict_type->m_value_type, *module); + + llvm::Value* src_key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(src)); + llvm::Value* dest_key_mask_ptr = get_pointer_to_keymask(dest); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* src_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(src)); + llvm::Value* dest_key_mask = LLVM::lfortran_calloc(context, *module, *builder, src_capacity, + llvm_mask_size); + builder->CreateMemCpy(dest_key_mask, llvm::MaybeAlign(), src_key_mask, + llvm::MaybeAlign(), builder->CreateMul(src_capacity, llvm_mask_size)); + LLVM::CreateStore(*builder, dest_key_mask, dest_key_mask_ptr); } - void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, llvm::Value* item) { + void LLVMList::check_index_within_bounds(llvm::Value* /*list*/, llvm::Value* /*pos*/) { + + } + + void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module, bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); - builder->CreateStore(item, element_ptr); + llvm_utils->deepcopy(item, element_ptr, asr_type, module); } - llvm::Value* LLVMList::read_item(llvm::Value* list, llvm::Value* pos, bool get_pointer) { + void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } + llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); + llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); + LLVM::CreateStore(*builder, item, element_ptr); + } + + llvm::Value* LLVMDict::get_pointer_to_keymask(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 3); + } + + void LLVMDict::set_iterators() { + if( are_iterators_set || !is_dict_present ) { + return ; + } + llvm_utils->set_iterators(); + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "pos_ptr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), pos_ptr); + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr, + "is_key_matching_var"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)), is_key_matching_var); + idx_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "idx_ptr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), idx_ptr); + hash_value = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_value"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 0)), hash_value); + hash_iter = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_iter"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 0)), hash_iter); + polynomial_powers = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "p_pow"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 1)), polynomial_powers); + are_iterators_set = true; + } + + void LLVMDict::reset_iterators() { + llvm_utils->reset_iterators(); + pos_ptr = nullptr; + is_key_matching_var = nullptr; + idx_ptr = nullptr; + hash_iter = nullptr; + hash_value = nullptr; + polynomial_powers = nullptr; + are_iterators_set = false; + } + + void LLVMDict::resolve_collision( + llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read) { + if( !are_iterators_set ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr); + } + LLVM::CreateStore(*builder, key_hash, pos_ptr); + + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_key_skip = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3))); + llvm::Value* is_key_set = builder->CreateICmpNE(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* is_key_matching = llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* compare_keys = builder->CreateAnd(is_key_set, + builder->CreateNot(is_key_skip)); + builder->CreateCondBr(compare_keys, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* original_key = llvm_utils->list_api->read_item(key_list, pos, + LLVM::is_llvm_struct(key_asr_type), false); + is_key_matching = llvm_utils->is_equal_by_value(key, original_key, module, + key_asr_type); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + } + builder->CreateBr(mergeBB); + + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + // TODO: Allow safe exit if pos becomes key_hash again. + // Ideally should not happen as dict will be resized once + // load factor touches a threshold (which will always be less than 1) + // so there will be some key which will not be set. However for safety + // we can add an exit from the loop with a error message. + llvm::Value *cond = nullptr; + if( for_read ) { + cond = builder->CreateAnd(is_key_set, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + cond = builder->CreateOr(is_key_skip, cond); + } else { + cond = builder->CreateAnd(is_key_set, builder->CreateNot(is_key_skip)); + cond = builder->CreateAnd(cond, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + } + builder->CreateCondBr(cond, loopbody, loopend); + } + + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + pos = builder->CreateAdd(pos, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + pos = builder->CreateSRem(pos, capacity); + LLVM::CreateStore(*builder, pos, pos_ptr); + } + + + builder->CreateBr(loophead); + + + // end + llvm_utils->start_new_block(loopend); + } + + void LLVMDictOptimizedLinearProbing::resolve_collision( + llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read) { + if( !are_iterators_set ) { + if( !for_read ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr); + } + + LLVM::CreateStore(*builder, key_hash, pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_key_skip = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3))); + llvm::Value* is_key_set = builder->CreateICmpNE(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* is_key_matching = llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* compare_keys = builder->CreateAnd(is_key_set, + builder->CreateNot(is_key_skip)); + builder->CreateCondBr(compare_keys, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* original_key = llvm_utils->list_api->read_item(key_list, pos, + LLVM::is_llvm_struct(key_asr_type), false); + is_key_matching = llvm_utils->is_equal_by_value(key, original_key, module, + key_asr_type); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + // TODO: Allow safe exit if pos becomes key_hash again. + // Ideally should not happen as dict will be resized once + // load factor touches a threshold (which will always be less than 1) + // so there will be some key which will not be set. However for safety + // we can add an exit from the loop with a error message. + llvm::Value *cond = nullptr; + if( for_read ) { + cond = builder->CreateAnd(is_key_set, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + cond = builder->CreateOr(is_key_skip, cond); + } else { + cond = builder->CreateAnd(is_key_set, builder->CreateNot(is_key_skip)); + cond = builder->CreateAnd(cond, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + } + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + pos = builder->CreateAdd(pos, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + pos = builder->CreateSRem(pos, capacity); + LLVM::CreateStore(*builder, pos, pos_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + } + + void LLVMDict::resolve_collision_for_write( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm_utils->list_api->write_item(key_list, pos, key, + key_asr_type, module, false); + llvm_utils->list_api->write_item(value_list, pos, value, + value_asr_type, module, false); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_slot_empty = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + is_slot_empty = builder->CreateZExt(is_slot_empty, llvm::Type::getInt32Ty(context)); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + LLVM::CreateStore(*builder, builder->CreateAdd(occupancy, is_slot_empty), + occupancy_ptr); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1)), + llvm_utils->create_ptr_gep(key_mask, pos)); + } + + void LLVMDictOptimizedLinearProbing::resolve_collision_for_write( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm_utils->list_api->write_item(key_list, pos, key, + key_asr_type, module, false); + llvm_utils->list_api->write_item(value_list, pos, value, + value_asr_type, module, false); + + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_slot_empty = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + is_slot_empty = builder->CreateZExt(is_slot_empty, llvm::Type::getInt32Ty(context)); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + LLVM::CreateStore(*builder, builder->CreateAdd(occupancy, is_slot_empty), + occupancy_ptr); + + llvm::Value* linear_prob_happened = builder->CreateICmpNE(key_hash, pos); + linear_prob_happened = builder->CreateOr(linear_prob_happened, + builder->CreateICmpEQ( + LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key_mask, key_hash)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2) + )) + ); + llvm::Value* set_max_2 = builder->CreateSelect(linear_prob_happened, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(key_mask, key_hash)); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(key_mask, pos)); + } + + llvm::Value* LLVMDict::resolve_collision_for_read( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type, true); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* item = llvm_utils->list_api->read_item(value_list, pos, true, false); + return item; + } + + llvm::Value* LLVMDictOptimizedLinearProbing::resolve_collision_for_read( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + if( !are_iterators_set ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, key_hash)); + llvm::Value* is_prob_not_neeeded = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + builder->CreateCondBr(is_prob_not_neeeded, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + LLVM::CreateStore(*builder, key_hash, pos_ptr); + } + builder->CreateBr(mergeBB); + llvm_utils->start_new_block(elseBB); + { + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, + module, key_asr_type, true); + } + llvm_utils->start_new_block(mergeBB); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* item = llvm_utils->list_api->read_item(value_list, pos, true, false); + return item; + } + + llvm::Value* LLVMDict::get_key_hash(llvm::Value* capacity, llvm::Value* key, + ASR::ttype_t* key_asr_type, llvm::Module& module) { + // Write specialised hash functions for intrinsic types + // This is to avoid unnecessary calls to C-runtime and do + // as much as possible in LLVM directly. + switch( key_asr_type->type ) { + case ASR::ttypeType::Integer: { + // Simple modulo with the capacity of the dict. + // We can update it later to do a better hash function + // which produces lesser collisions. + + llvm::Value* int_hash = builder->CreateZExtOrTrunc( + builder->CreateSRem(key, + builder->CreateZExtOrTrunc(capacity, key->getType())), + capacity->getType() + ); + return int_hash; + } + case ASR::ttypeType::Character: { + // Polynomial rolling hash function for strings + llvm::Value* null_char = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), + llvm::APInt(8, '\0')); + llvm::Value* p = llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 31)); + llvm::Value* m = llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 100000009)); + if( !are_iterators_set ) { + hash_value = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_value"); + hash_iter = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_iter"); + polynomial_powers = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "p_pow"); + } + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 0)), + hash_value); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1)), + polynomial_powers); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 0)), + hash_iter); + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* i = LLVM::CreateLoad(*builder, hash_iter); + llvm::Value* c = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key, i)); + llvm::Value *cond = builder->CreateICmpNE(c, null_char); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + // for c in key: + // hash_value = (hash_value + (ord(c) + 1) * p_pow) % m + // p_pow = (p_pow * p) % m + llvm::Value* i = LLVM::CreateLoad(*builder, hash_iter); + llvm::Value* c = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key, i)); + llvm::Value* p_pow = LLVM::CreateLoad(*builder, polynomial_powers); + llvm::Value* hash = LLVM::CreateLoad(*builder, hash_value); + c = builder->CreateZExt(c, llvm::Type::getInt64Ty(context)); + c = builder->CreateAdd(c, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1))); + c = builder->CreateMul(c, p_pow); + c = builder->CreateSRem(c, m); + hash = builder->CreateAdd(hash, c); + hash = builder->CreateSRem(hash, m); + LLVM::CreateStore(*builder, hash, hash_value); + p_pow = builder->CreateMul(p_pow, p); + p_pow = builder->CreateSRem(p_pow, m); + LLVM::CreateStore(*builder, p_pow, polynomial_powers); + i = builder->CreateAdd(i, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1))); + LLVM::CreateStore(*builder, i, hash_iter); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + llvm::Value* hash = LLVM::CreateLoad(*builder, hash_value); + hash = builder->CreateTrunc(hash, llvm::Type::getInt32Ty(context)); + return builder->CreateSRem(hash, capacity); + } + case ASR::ttypeType::Tuple: { + llvm::Value* tuple_hash = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), llvm::APInt(32, 0)); + ASR::Tuple_t* asr_tuple = ASR::down_cast(key_asr_type); + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + llvm::Value* llvm_tuple_i = llvm_utils->tuple_api->read_item(key, i, + LLVM::is_llvm_struct(asr_tuple->m_type[i])); + tuple_hash = builder->CreateAdd(tuple_hash, get_key_hash(capacity, llvm_tuple_i, + asr_tuple->m_type[i], module)); + tuple_hash = builder->CreateSRem(tuple_hash, capacity); + } + return tuple_hash; + } + default: { + throw LCompilersException("Hashing " + ASRUtils::type_to_str_python(key_asr_type) + + " isn't implemented yet."); + } + } + } + + void LLVMDict::rehash(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* capacity_ptr = get_pointer_to_capacity(dict); + llvm::Value* old_capacity = LLVM::CreateLoad(*builder, capacity_ptr); + llvm::Value* capacity = builder->CreateMul(old_capacity, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 2))); + capacity = builder->CreateAdd(capacity, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, capacity, capacity_ptr); + + std::string key_type_code = ASRUtils::get_type_code(key_asr_type); + std::string value_type_code = ASRUtils::get_type_code(value_asr_type); + std::pair dict_type_key = std::make_pair(key_type_code, value_type_code); + llvm::Type* key_llvm_type = std::get<2>(typecode2dicttype[dict_type_key]).first; + llvm::Type* value_llvm_type = std::get<2>(typecode2dicttype[dict_type_key]).second; + int32_t key_type_size = std::get<1>(typecode2dicttype[dict_type_key]).first; + int32_t value_type_size = std::get<1>(typecode2dicttype[dict_type_key]).second; + + llvm::Value* key_list = get_key_list(dict); + llvm::Value* new_key_list = builder->CreateAlloca(llvm_utils->list_api->get_list_type(key_llvm_type, + key_type_code, key_type_size), nullptr); + llvm_utils->list_api->list_init(key_type_code, new_key_list, *module, capacity, capacity); + + llvm::Value* value_list = get_value_list(dict); + llvm::Value* new_value_list = builder->CreateAlloca(llvm_utils->list_api->get_list_type(value_llvm_type, + value_type_code, value_type_size), nullptr); + llvm_utils->list_api->list_init(value_type_code, new_value_list, *module, capacity, capacity); + + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* new_key_mask = LLVM::lfortran_calloc(context, *module, *builder, capacity, + llvm_mask_size); + + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + if( !are_iterators_set ) { + idx_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), idx_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT(old_capacity, LLVM::CreateLoad(*builder, idx_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* idx = LLVM::CreateLoad(*builder, idx_ptr); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* is_key_set = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key_mask, idx)); + is_key_set = builder->CreateICmpNE(is_key_set, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + builder->CreateCondBr(is_key_set, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* key = llvm_utils->list_api->read_item(key_list, idx, + LLVM::is_llvm_struct(key_asr_type), false); + llvm::Value* value = llvm_utils->list_api->read_item(value_list, idx, + LLVM::is_llvm_struct(value_asr_type), false); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, *module); + this->resolve_collision(current_capacity, key_hash, key, new_key_list, + new_key_mask, *module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_dest = llvm_utils->list_api->read_item(new_key_list, pos, + true, false); + llvm_utils->deepcopy(key, key_dest, key_asr_type, *module); + llvm::Value* value_dest = llvm_utils->list_api->read_item(new_value_list, pos, + true, false); + llvm_utils->deepcopy(value, value_dest, value_asr_type, *module); + + llvm::Value* linear_prob_happened = builder->CreateICmpNE(key_hash, pos); + llvm::Value* set_max_2 = builder->CreateSelect(linear_prob_happened, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(new_key_mask, key_hash)); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(new_key_mask, pos)); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + idx = builder->CreateAdd(idx, llvm::ConstantInt::get( + llvm::Type::getInt32Ty(context), llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, idx, idx_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + // TODO: Free key_list, value_list and key_mask + llvm_utils->list_api->free_data(key_list, *module); + llvm_utils->list_api->free_data(value_list, *module); + LLVM::lfortran_free(context, *module, *builder, key_mask); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, new_key_list), key_list); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, new_value_list), value_list); + LLVM::CreateStore(*builder, new_key_mask, get_pointer_to_keymask(dict)); + } + + void LLVMDict::rehash_all_at_once_if_needed(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type) { + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + + llvm::Value* occupancy = LLVM::CreateLoad(*builder, get_pointer_to_occupancy(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + occupancy = builder->CreateAdd(occupancy, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + occupancy = builder->CreateSIToFP(occupancy, llvm::Type::getFloatTy(context)); + capacity = builder->CreateSIToFP(capacity, llvm::Type::getFloatTy(context)); + llvm::Value* load_factor = builder->CreateFDiv(occupancy, capacity); + // Threshold hash is chosen from https://en.wikipedia.org/wiki/Hash_table#Load_factor + llvm::Value* load_factor_threshold = llvm::ConstantFP::get(llvm::Type::getFloatTy(context), + llvm::APFloat((float) 0.6)); + builder->CreateCondBr(builder->CreateFCmpOGE(load_factor, load_factor_threshold), thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + rehash(dict, module, key_asr_type, value_asr_type); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + } + + void LLVMDict::write_item(llvm::Value* dict, llvm::Value* key, + llvm::Value* value, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type) { + rehash_all_at_once_if_needed(dict, module, key_asr_type, value_asr_type); + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, *module); + this->resolve_collision_for_write(dict, key_hash, key, value, *module, + key_asr_type, value_asr_type); + } + + llvm::Value* LLVMDict::read_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::ttype_t* key_asr_type, + bool get_pointer) { + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, module); + llvm::Value* value_ptr = this->resolve_collision_for_read(dict, key_hash, key, module, + key_asr_type); + if( get_pointer ) { + return value_ptr; + } + return LLVM::CreateLoad(*builder, value_ptr); + } + + llvm::Value* LLVMDict::pop_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::Dict_t* dict_type, + bool get_pointer) { + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, dict_type->m_key_type, module); + llvm::Value* value_ptr = this->resolve_collision_for_read(dict, key_hash, key, module, + dict_type->m_key_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* key_mask_i = llvm_utils->create_ptr_gep(key_mask, pos); + llvm::Value* tombstone_marker = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3)); + LLVM::CreateStore(*builder, tombstone_marker, key_mask_i); + + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + occupancy = builder->CreateSub(occupancy, llvm::ConstantInt::get( + llvm::Type::getInt32Ty(context), llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, occupancy, occupancy_ptr); + + if( get_pointer ) { + std::string key_type_code = ASRUtils::get_type_code(dict_type->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(dict_type->m_value_type); + llvm::Type* llvm_value_type = std::get<2>(typecode2dicttype[std::make_pair( + key_type_code, value_type_code)]).second; + llvm::Value* return_ptr = builder->CreateAlloca(llvm_value_type, nullptr); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, value_ptr), return_ptr); + return return_ptr; + } + + return LLVM::CreateLoad(*builder, value_ptr); + } + + llvm::Value* LLVMList::read_item(llvm::Value* list, llvm::Value* pos, bool get_pointer, + bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); if( get_pointer ) { @@ -250,6 +1262,16 @@ namespace LFortran { return LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(list)); } + llvm::Value* LLVMDict::len(llvm::Value* dict) { + return LLVM::CreateLoad(*builder, get_pointer_to_occupancy(dict)); + } + + LLVMDict::~LLVMDict() { + typecode2dicttype.clear(); + } + + LLVMDictOptimizedLinearProbing::~LLVMDictOptimizedLinearProbing() {} + void LLVMList::resize_if_needed(llvm::Value* list, llvm::Value* n, llvm::Value* capacity, int32_t type_size, llvm::Type* el_type, llvm::Module& module) { @@ -287,18 +1309,255 @@ namespace LFortran { } void LLVMList::append(llvm::Value* list, llvm::Value* item, - llvm::Module& module, - std::string& type_code) { + ASR::ttype_t* asr_type, llvm::Module& module) { llvm::Value* current_end_point = LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(list)); llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_current_capacity(list)); + std::string type_code = ASRUtils::get_type_code(asr_type); int type_size = std::get<1>(typecode2listtype[type_code]); llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); resize_if_needed(list, current_end_point, current_capacity, type_size, el_type, module); - write_item(list, current_end_point, item); + write_item(list, current_end_point, item, asr_type, module); shift_end_point_by_one(list); } + void LLVMList::insert_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module) { + std::string type_code = ASRUtils::get_type_code(asr_type); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, + get_pointer_to_current_capacity(list)); + int type_size = std::get<1>(typecode2listtype[type_code]); + llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); + resize_if_needed(list, current_end_point, current_capacity, + type_size, el_type, module); + + /* While loop equivalent in C++: + * end_point // nth index of list + * pos // ith index to insert the element + * pos_ptr = pos; + * tmp_ptr = list[pos]; + * tmp = 0; + * + * while(end_point > pos_ptr) { + * tmp = list[pos + 1]; + * list[pos + 1] = tmp_ptr; + * tmp_ptr = tmp; + * pos_ptr++; + * } + * + * list[pos] = item; + */ + + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *tmp_ptr = builder->CreateAlloca(el_type, nullptr); + LLVM::CreateStore(*builder, read_item(list, pos, false), tmp_ptr); + llvm::Value* tmp = nullptr; + + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *pos_ptr = builder->CreateAlloca( + llvm::Type::getInt32Ty(context), nullptr); + LLVM::CreateStore(*builder, pos, pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT( + current_end_point, + LLVM::CreateLoad(*builder, pos_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* next_index = builder->CreateAdd( + LLVM::CreateLoad(*builder, pos_ptr), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + tmp = read_item(list, next_index, false); + write_item(list, next_index, LLVM::CreateLoad(*builder, tmp_ptr)); + LLVM::CreateStore(*builder, tmp, tmp_ptr); + + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, pos_ptr), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, pos_ptr); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + write_item(list, pos, item, asr_type, module); + shift_end_point_by_one(list); + } + + llvm::Value* LLVMList::find_item_position(llvm::Value* list, + llvm::Value* item, ASR::ttype_t* item_type, llvm::Module& module) { + llvm::Type* pos_type = llvm::Type::getInt32Ty(context); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *i = builder->CreateAlloca(pos_type, nullptr); + LLVM::CreateStore(*builder, llvm::ConstantInt::get( + context, llvm::APInt(32, 0)), i); + llvm::Value* tmp = nullptr; + + /* Equivalent in C++: + * int i = 0; + * while(list[i] != item && end_point > i) { + * i++; + * } + * + * if (i == end_point) { + * std::cout << "The list does not contain the element"; + * } + */ + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* left_arg = read_item(list, LLVM::CreateLoad(*builder, i), + LLVM::is_llvm_struct(item_type)); + llvm::Value* is_item_not_equal = builder->CreateNot( + llvm_utils->is_equal_by_value( + left_arg, item, + module, item_type) + ); + llvm::Value *cond = builder->CreateAnd(is_item_not_equal, + builder->CreateICmpSGT(current_end_point, + LLVM::CreateLoad(*builder, i))); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, i), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, i); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + + llvm::Value* cond = builder->CreateICmpEQ( + LLVM::CreateLoad(*builder, i), current_end_point); + builder->CreateCondBr(cond, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + // TODO: Allow runtime information like the exact element which is + // not found. + std::string message = "The list does not contain the element"; + llvm::Value *fmt_ptr = builder->CreateGlobalStringPtr("ValueError: %s\n"); + llvm::Value *fmt_ptr2 = builder->CreateGlobalStringPtr(message); + printf(context, module, *builder, {fmt_ptr, fmt_ptr2}); + int exit_code_int = 1; + llvm::Value *exit_code = llvm::ConstantInt::get(context, + llvm::APInt(32, exit_code_int)); + exit(context, module, *builder, exit_code); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + + return LLVM::CreateLoad(*builder, i); + } + + void LLVMList::remove(llvm::Value* list, llvm::Value* item, + ASR::ttype_t* item_type, llvm::Module& module) { + llvm::Type* pos_type = llvm::Type::getInt32Ty(context); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *item_pos = builder->CreateAlloca(pos_type, nullptr); + llvm::Value* tmp = LLVMList::find_item_position(list, item, item_type, module); + LLVM::CreateStore(*builder, tmp, item_pos); + + /* While loop equivalent in C++: + * item_pos = find_item_position(); + * while(end_point > item_pos) { + * tmp = item_pos + 1; + * list[item_pos] = list[tmp]; + * item_pos = tmp; + * } + */ + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT(current_end_point, + LLVM::CreateLoad(*builder, item_pos)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, item_pos), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + write_item(list, LLVM::CreateLoad(*builder, item_pos), + read_item(list, tmp, false)); + LLVM::CreateStore(*builder, tmp, item_pos); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + // Decrement end point by one + llvm::Value* end_point_ptr = get_pointer_to_current_end_point(list); + llvm::Value* end_point = LLVM::CreateLoad(*builder, end_point_ptr); + end_point = builder->CreateSub(end_point, llvm::ConstantInt::get( + context, llvm::APInt(32, 1))); + builder->CreateStore(end_point, end_point_ptr); + } + + void LLVMList::list_clear(llvm::Value* list) { + llvm::Value* end_point_ptr = get_pointer_to_current_end_point(list); + llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)); + LLVM::CreateStore(*builder, zero, end_point_ptr); + } + + void LLVMList::free_data(llvm::Value* list, llvm::Module& module) { + llvm::Value* data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); + LLVM::lfortran_free(context, module, *builder, data); + } + + LLVMTuple::LLVMTuple(llvm::LLVMContext& context_, LLVMUtils* llvm_utils_, llvm::IRBuilder<>* builder_) : @@ -339,14 +1598,31 @@ namespace LFortran { } void LLVMTuple::tuple_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& type_code) { + ASR::Tuple_t* tuple_type, llvm::Module& module) { LFORTRAN_ASSERT(src->getType() == dest->getType()); - size_t n_elements = typecode2tupletype[type_code].second; - for( size_t i = 0; i < n_elements; i++ ) { - llvm::Value* src_item = read_item(src, i, false); + for( size_t i = 0; i < tuple_type->n_type; i++ ) { + llvm::Value* src_item = read_item(src, i, LLVM::is_llvm_struct( + tuple_type->m_type[i])); llvm::Value* dest_item_ptr = read_item(dest, i, true); - builder->CreateStore(src_item, dest_item_ptr); + llvm_utils->deepcopy(src_item, dest_item_ptr, + tuple_type->m_type[i], module); + } + } + + llvm::Value* LLVMTuple::check_tuple_equality(llvm::Value* t1, llvm::Value* t2, + ASR::Tuple_t* tuple_type, + llvm::LLVMContext& context, + llvm::IRBuilder<>* builder, + llvm::Module& module) { + llvm::Value* is_equal = llvm::ConstantInt::get(context, llvm::APInt(1, 1)); + for( size_t i = 0; i < tuple_type->n_type; i++ ) { + llvm::Value* t1i = llvm_utils->tuple_api->read_item(t1, i); + llvm::Value* t2i = llvm_utils->tuple_api->read_item(t2, i); + llvm::Value* is_t1_eq_t2 = llvm_utils->is_equal_by_value(t1i, t2i, module, + tuple_type->m_type[i]); + is_equal = builder->CreateAnd(is_equal, is_t1_eq_t2); } + return is_equal; } } // namespace LFortran diff --git a/src/libasr/codegen/llvm_utils.h b/src/libasr/codegen/llvm_utils.h index bb5b72813f..5eaa428bfd 100644 --- a/src/libasr/codegen/llvm_utils.h +++ b/src/libasr/codegen/llvm_utils.h @@ -5,12 +5,40 @@ #include #include +#include #include #include namespace LFortran { + static inline void printf(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, const std::vector &args) + { + llvm::Function *fn_printf = module.getFunction("_lfortran_printf"); + if (!fn_printf) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), {llvm::Type::getInt8PtrTy(context)}, true); + fn_printf = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, "_lfortran_printf", &module); + } + builder.CreateCall(fn_printf, args); + } + + static inline void exit(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* exit_code) + { + llvm::Function *fn_exit = module.getFunction("exit"); + if (!fn_exit) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), {llvm::Type::getInt32Ty(context)}, + false); + fn_exit = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, "exit", &module); + } + builder.CreateCall(fn_exit, {exit_code}); + } + namespace LLVM { llvm::Value* CreateLoad(llvm::IRBuilder<> &builder, llvm::Value *x); @@ -21,17 +49,38 @@ namespace LFortran { llvm::IRBuilder<> &builder, llvm::Value* arg_size); llvm::Value* lfortran_realloc(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* ptr, llvm::Value* arg_size); + llvm::Value* lfortran_calloc(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* count, llvm::Value* type_size); + llvm::Value* lfortran_free(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* ptr); + static inline bool is_llvm_struct(ASR::ttype_t* asr_type) { + return ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type); + } } + class LLVMList; + class LLVMTuple; + class LLVMDict; + class LLVMUtils { private: llvm::LLVMContext& context; llvm::IRBuilder<>* builder; + llvm::AllocaInst *str_cmp_itr; + + bool are_iterators_set; public: + LLVMTuple* tuple_api; + LLVMList* list_api; + LLVMDict* dict_api; + LLVMUtils(llvm::LLVMContext& context, llvm::IRBuilder<>* _builder); @@ -47,6 +96,19 @@ namespace LFortran { void start_new_block(llvm::BasicBlock *bb); + llvm::Value* lfortran_str_cmp(llvm::Value* left_arg, llvm::Value* right_arg, + std::string runtime_func_name, llvm::Module& module); + + llvm::Value* is_equal_by_value(llvm::Value* left, llvm::Value* right, + llvm::Module& module, ASR::ttype_t* asr_type); + + void set_iterators(); + + void reset_iterators(); + + void deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* asr_type, llvm::Module& module); + }; // LLVMUtils class LLVMList { @@ -67,11 +129,15 @@ namespace LFortran { public: LLVMList(llvm::LLVMContext& context_, LLVMUtils* llvm_utils, - llvm::IRBuilder<>* builder); + llvm::IRBuilder<>* builder); llvm::Type* get_list_type(llvm::Type* el_type, std::string& type_code, int32_t type_size); + void list_init(std::string& type_code, llvm::Value* list, + llvm::Module& module, llvm::Value* initial_capacity, + llvm::Value* n); + void list_init(std::string& type_code, llvm::Value* list, llvm::Module& module, int32_t initial_capacity=1, int32_t n=0); @@ -83,19 +149,44 @@ namespace LFortran { llvm::Value* get_pointer_to_current_capacity(llvm::Value* list); void list_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& src_type_code, + ASR::List_t* list_type, + llvm::Module& module); + + void list_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* element_type, llvm::Module& module); llvm::Value* read_item(llvm::Value* list, llvm::Value* pos, - bool get_pointer=false); + bool get_pointer=false, bool check_index_bound=true); llvm::Value* len(llvm::Value* list); + void check_index_within_bounds(llvm::Value* list, llvm::Value* pos); + + void write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module, bool check_index_bound=true); + void write_item(llvm::Value* list, llvm::Value* pos, - llvm::Value* item); + llvm::Value* item, bool check_index_bound=true); void append(llvm::Value* list, llvm::Value* item, - llvm::Module& module, std::string& type_code); + ASR::ttype_t* asr_type, llvm::Module& module); + + void insert_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module); + + void remove(llvm::Value* list, llvm::Value* item, + ASR::ttype_t* item_type, llvm::Module& module); + + void list_clear(llvm::Value* list); + + llvm::Value* find_item_position(llvm::Value* list, + llvm::Value* item, ASR::ttype_t* item_type, + llvm::Module& module); + + void free_data(llvm::Value* list, llvm::Module& module); }; class LLVMTuple { @@ -125,7 +216,133 @@ namespace LFortran { bool get_pointer=false); void tuple_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& type_code); + ASR::Tuple_t* type_code, llvm::Module& module); + + llvm::Value* check_tuple_equality(llvm::Value* t1, llvm::Value* t2, + ASR::Tuple_t* tuple_type, llvm::LLVMContext& context, + llvm::IRBuilder<>* builder, llvm::Module& module); + }; + + class LLVMDict { + protected: + + llvm::LLVMContext& context; + LLVMUtils* llvm_utils; + llvm::IRBuilder<>* builder; + llvm::AllocaInst *pos_ptr, *is_key_matching_var; + llvm::AllocaInst *idx_ptr, *hash_iter, *hash_value; + llvm::AllocaInst *polynomial_powers; + bool are_iterators_set; + + std::map, + std::tuple, + std::pair>> typecode2dicttype; + + public: + + bool is_dict_present; + + LLVMDict(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils, + llvm::IRBuilder<>* builder); + + llvm::Type* get_dict_type(std::string key_type_code, std::string value_type_code, + int32_t key_type_size, int32_t value_type_size, + llvm::Type* key_type, llvm::Type* value_type); + + void dict_init(std::string key_type_code, std::string value_type_code, + llvm::Value* dict, llvm::Module* module, size_t initial_capacity); + + llvm::Value* get_key_list(llvm::Value* dict); + + llvm::Value* get_value_list(llvm::Value* dict); + + llvm::Value* get_pointer_to_occupancy(llvm::Value* dict); + + llvm::Value* get_pointer_to_capacity(llvm::Value* dict); + + llvm::Value* get_key_hash(llvm::Value* capacity, llvm::Value* key, + ASR::ttype_t* key_asr_type, llvm::Module& module); + + virtual + void resolve_collision(llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read=false); + + virtual + void resolve_collision_for_write(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + virtual + llvm::Value* resolve_collision_for_read(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type); + + void rehash(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + void rehash_all_at_once_if_needed(llvm::Value* dict, + llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + void write_item(llvm::Value* dict, llvm::Value* key, + llvm::Value* value, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type); + + llvm::Value* read_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::ttype_t* key_asr_type, + bool get_pointer=false); + + llvm::Value* pop_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::Dict_t* dict_type, + bool get_pointer=false); + + llvm::Value* get_pointer_to_keymask(llvm::Value* dict); + + void set_iterators(); + + void reset_iterators(); + + void dict_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::Dict_t* dict_type, llvm::Module* module); + + llvm::Value* len(llvm::Value* dict); + + virtual ~LLVMDict(); + }; + + class LLVMDictOptimizedLinearProbing: public LLVMDict { + + public: + + LLVMDictOptimizedLinearProbing(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils, + llvm::IRBuilder<>* builder); + + virtual + void resolve_collision(llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read=false); + + virtual + void resolve_collision_for_write(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + virtual + llvm::Value* resolve_collision_for_read(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type); + + virtual ~LLVMDictOptimizedLinearProbing(); + }; } // LFortran diff --git a/src/libasr/compiler_tester/tester.py b/src/libasr/compiler_tester/tester.py index b4e4760c1b..d0b49a04b2 100644 --- a/src/libasr/compiler_tester/tester.py +++ b/src/libasr/compiler_tester/tester.py @@ -27,6 +27,7 @@ SRC_DIR = os.path.dirname(LIBASR_DIR) ROOT_DIR = os.path.dirname(SRC_DIR) + class RunException(Exception): pass @@ -126,8 +127,6 @@ def fixdir(s: bytes) -> bytes: local_dir = os.getcwd() return s.replace(local_dir.encode(), "$DIR".encode()) -def unl_loop_del(b): - return b.replace(bytes('\r\n', encoding='utf-8'), bytes('\n', encoding='utf-8')) def run(basename: str, cmd: Union[pathlib.Path, str], out_dir: Union[pathlib.Path, str], infile=None, extra_args=None): @@ -162,9 +161,6 @@ def run(basename: str, cmd: Union[pathlib.Path, str], if infile and not os.path.exists(infile): raise RunException("The input file does not exist") outfile = os.path.join(out_dir, basename + "." + "out") - - infile=infile.replace("\\\\","\\").replace("\\","/") - cmd2 = cmd.format(infile=infile, outfile=outfile) if extra_args: cmd2 += " " + extra_args @@ -183,26 +179,25 @@ def run(basename: str, cmd: Union[pathlib.Path, str], open(stderr_file, "wb").write(fixdir(r.stderr)) else: stderr_file = None + if infile: - temp=unl_loop_del(open(infile, "rb").read()) - infile_hash = hashlib.sha224(temp).hexdigest() + infile_hash = hashlib.sha224(open(infile, "rb").read()).hexdigest() else: infile_hash = None if outfile: - temp=unl_loop_del(open(outfile, "rb").read()) - outfile_hash = hashlib.sha224(temp).hexdigest() + outfile_hash = hashlib.sha224(open(outfile, "rb").read()).hexdigest() outfile = os.path.basename(outfile) else: outfile_hash = None if stdout_file: - temp=unl_loop_del(open(stdout_file, "rb").read()) - stdout_hash = hashlib.sha224(temp).hexdigest() + stdout_hash = hashlib.sha224( + open(stdout_file, "rb").read()).hexdigest() stdout_file = os.path.basename(stdout_file) else: stdout_hash = None if stderr_file: - temp=unl_loop_del(open(stderr_file, "rb").read()) - stderr_hash = hashlib.sha224(temp).hexdigest() + stderr_hash = hashlib.sha224( + open(stderr_file, "rb").read()).hexdigest() stderr_file = os.path.basename(stderr_file) else: stderr_hash = None @@ -278,10 +273,8 @@ def run_test(testname, basename, cmd, infile, update_reference=False, s = f"{testname} * {basename}" basename = bname(basename, cmd, infile) infile = os.path.join("tests", infile) - jo = run(basename, cmd, os.path.join("tests", "output"), infile=infile, extra_args=extra_args) - jr = os.path.join("tests", "reference", os.path.basename(jo)) if not os.path.exists(jo): raise FileNotFoundError( @@ -324,7 +317,6 @@ def run_test(testname, basename, cmd, infile, update_reference=False, raise RunException( "Testing with reference output failed." + full_err_str) - log.debug(s + " " + check()) def tester_main(compiler, single_test): @@ -348,7 +340,7 @@ def tester_main(compiler, single_test): verbose = args.verbose no_llvm = args.no_llvm - # So that the tests find the `lfortran` executable + # So that the tests find the `lpython` executable os.environ["PATH"] = os.path.join(SRC_DIR, "bin") \ + os.pathsep + os.environ["PATH"] test_data = toml.load(open(os.path.join(ROOT_DIR, "tests", "tests.toml"))) diff --git a/src/libasr/modfile.cpp b/src/libasr/modfile.cpp index ea5e3c159e..d8a6338919 100644 --- a/src/libasr/modfile.cpp +++ b/src/libasr/modfile.cpp @@ -64,6 +64,12 @@ std::string save_modfile(const ASR::TranslationUnit_t &m) { return asr_string; } +std::string save_pycfile(const ASR::TranslationUnit_t &m) { + std::string asr_string; + save_asr(m, asr_string); + return asr_string; +} + inline void load_serialised_asr(const std::string &s, std::string& asr_binary) { #ifdef WITH_LFORTRAN_BINARY_MODFILES BinaryReader b(s); @@ -91,4 +97,14 @@ ASR::TranslationUnit_t* load_modfile(Allocator &al, const std::string &s, return tu; } +ASR::TranslationUnit_t* load_pycfile(Allocator &al, const std::string &s, + bool load_symtab_id) { + std::string asr_binary; + load_serialised_asr(s, asr_binary); + ASR::asr_t *asr = deserialize_asr(al, asr_binary, load_symtab_id); + + ASR::TranslationUnit_t *tu = ASR::down_cast2(asr); + return tu; +} + } // namespace LFortran diff --git a/src/libasr/modfile.h b/src/libasr/modfile.h index deec7c9e2a..07aced4d69 100644 --- a/src/libasr/modfile.h +++ b/src/libasr/modfile.h @@ -8,10 +8,15 @@ namespace LFortran { // Save a module to a modfile std::string save_modfile(const ASR::TranslationUnit_t &m); + std::string save_pycfile(const ASR::TranslationUnit_t &m); + // Load a module from a modfile ASR::TranslationUnit_t* load_modfile(Allocator &al, const std::string &s, bool load_symtab_id, SymbolTable &symtab); + ASR::TranslationUnit_t* load_pycfile(Allocator &al, const std::string &s, + bool load_symtab_id); + } #endif // LFORTRAN_MODFILE_H diff --git a/src/libasr/pass/arr_dims_propagate.cpp b/src/libasr/pass/arr_dims_propagate.cpp new file mode 100644 index 0000000000..1abaf6993b --- /dev/null +++ b/src/libasr/pass/arr_dims_propagate.cpp @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include +#include +#include + +namespace LFortran { + +/* + * This ASR pass replaces ttype for all arrays passed. + * + * Converts: + * integer :: a(:, :) + * + * to: + * integer :: a(2, 3) + */ + +class ArrDimsPropagate : public ASR::StatementsFirstBaseWalkVisitor +{ +private: +// Allocator &m_al; +public: + ArrDimsPropagate(Allocator &/*al*/) /*: m_al(al)*/ { } + + void visit_FunctionCall(const ASR::FunctionCall_t &x) { + ASR::Function_t *fn = ASR::down_cast(ASRUtils::symbol_get_past_external(x.m_name)); + + for (size_t i = 0; i < x.n_args; i++) { + if (ASR::is_a(*x.m_args[i].m_value) && ASRUtils::is_array(ASRUtils::expr_type(x.m_args[i].m_value))) { + ASR::Variable_t* v = ASRUtils::EXPR2VAR(x.m_args[i].m_value); + ASR::Variable_t *fn_param = ASRUtils::EXPR2VAR(fn->m_args[i]); + ASR::dimension_t* m_dims; + int n_dims = ASRUtils::extract_dimensions_from_ttype(fn_param->m_type, m_dims); + if (n_dims > 0 && !m_dims[0].m_length && ASRUtils::check_equal_type(v->m_type, fn_param->m_type)) { + fn_param->m_type = v->m_type; + } + } + } + } + + void visit_SubroutineCall(const ASR::SubroutineCall_t &x) { + ASR::Function_t *sb = ASR::down_cast(ASRUtils::symbol_get_past_external(x.m_name)); + for (size_t i = 0; i < x.n_args; i++) { + if (ASR::is_a(*x.m_args[i].m_value) && ASRUtils::is_array(ASRUtils::expr_type(x.m_args[i].m_value))) { + ASR::Variable_t* v = ASRUtils::EXPR2VAR(x.m_args[i].m_value); + ASR::Variable_t *sb_param = ASRUtils::EXPR2VAR(sb->m_args[i]); + ASR::dimension_t* m_dims; + int n_dims = ASRUtils::extract_dimensions_from_ttype(sb_param->m_type, m_dims); + if (n_dims > 0 && !m_dims[0].m_length && ASRUtils::check_equal_type(v->m_type, sb_param->m_type)) { + sb_param->m_type = v->m_type; + } + } + } + } +}; + +void pass_propagate_arr_dims(Allocator &al, ASR::TranslationUnit_t &unit) { + ArrDimsPropagate v(al); + v.visit_TranslationUnit(unit); + LFORTRAN_ASSERT(asr_verify(unit)); +} + +} // namespace LFortran diff --git a/src/libasr/pass/arr_dims_propagate.h b/src/libasr/pass/arr_dims_propagate.h new file mode 100644 index 0000000000..2eb38748d1 --- /dev/null +++ b/src/libasr/pass/arr_dims_propagate.h @@ -0,0 +1,12 @@ +#ifndef LFORTRAN_PASS_ARR_DIMS_PROPAGATE +#define LFORTRAN_PASS_ARR_DIMS_PROPAGATE + +#include + +namespace LFortran { + + void pass_propagate_arr_dims(Allocator &al, ASR::TranslationUnit_t &unit); + +} // namespace LFortran + +#endif // LFORTRAN_PASS_ARR_DIMS_PROPAGATE diff --git a/src/libasr/pass/array_op.cpp b/src/libasr/pass/array_op.cpp index a2c273a8c1..48f443d275 100644 --- a/src/libasr/pass/array_op.cpp +++ b/src/libasr/pass/array_op.cpp @@ -132,7 +132,7 @@ class ArrayOpVisitor : public PassUtils::PassVisitor s->m_name, a_args.p, a_args.size(), nullptr, 0, s->m_body, s->n_body, nullptr, s->m_abi, s->m_access, s->m_deftype, nullptr, false, false, - false); + false, s->m_inline); ASR::symbol_t* s_sub = ASR::down_cast(s_sub_asr); return s_sub; } @@ -705,47 +705,55 @@ class ArrayOpVisitor : public PassUtils::PassVisitor if( doloop == nullptr ) { ASR::expr_t* ref = PassUtils::create_array_ref(arr_expr, idx_vars_value, al); ASR::expr_t* res = PassUtils::create_array_ref(result_var, idx_vars, al); + ASR::expr_t *lexpr = nullptr, *rexpr = nullptr; + if( rank_left > 0 ) { + lexpr = ref; + rexpr = other_expr; + } else { + rexpr = ref; + lexpr = other_expr; + } ASR::expr_t* op_el_wise = nullptr; switch( x.class_type ) { case ASR::exprType::IntegerBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_IntegerBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::RealBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_RealBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::ComplexBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_ComplexBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::LogicalBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_LogicalBinOp_t( al, x.base.base.loc, - ref, (ASR::logicalbinopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::logicalbinopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::IntegerCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_IntegerCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::RealCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_RealCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::ComplexCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_ComplexCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::LogicalCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_LogicalCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; default: throw LCompilersException("The desired operation is not supported yet for arrays."); diff --git a/src/libasr/pass/global_stmts.cpp b/src/libasr/pass/global_stmts.cpp index 09c863612c..e0568fe9e0 100644 --- a/src/libasr/pass/global_stmts.cpp +++ b/src/libasr/pass/global_stmts.cpp @@ -121,7 +121,7 @@ void pass_wrap_global_stmts_into_function(Allocator &al, ASR::abiType::BindC, ASR::Public, ASR::Implementation, nullptr, - false, false, false); + false, false, false, false); std::string sym_name = fn_name; if (unit.m_global_scope->get_symbol(sym_name) != nullptr) { throw LCompilersException("Function already defined"); @@ -142,7 +142,7 @@ void pass_wrap_global_stmts_into_function(Allocator &al, nullptr, ASR::abiType::Source, ASR::Public, ASR::Implementation, nullptr, - false, false, false); + false, false, false, false); std::string sym_name = fn_name; if (unit.m_global_scope->get_symbol(sym_name) != nullptr) { throw LCompilersException("Function already defined"); diff --git a/src/libasr/pass/inline_function_calls.cpp b/src/libasr/pass/inline_function_calls.cpp index 491ca0b1f1..e5e24ed4b5 100644 --- a/src/libasr/pass/inline_function_calls.cpp +++ b/src/libasr/pass/inline_function_calls.cpp @@ -45,6 +45,7 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitorm_inline ) { + return ; + } + current_routine_scope = func->m_symtab; ASR::expr_t* return_var = nullptr; @@ -448,7 +455,7 @@ void pass_inline_function_calls(Allocator &al, ASR::TranslationUnit_t &unit, const LCompilers::PassOptions& pass_options) { std::string rl_path = pass_options.runtime_library_dir; bool inline_external_symbol_calls = pass_options.inline_external_symbol_calls; - InlineFunctionCallVisitor v(al, rl_path, inline_external_symbol_calls); + InlineFunctionCallVisitor v(al, rl_path, inline_external_symbol_calls, pass_options.fast); v.configure_node_duplicator(false); v.visit_TranslationUnit(unit); v.configure_node_duplicator(true); diff --git a/src/libasr/pass/instantiate_template.cpp b/src/libasr/pass/instantiate_template.cpp index ec9f98b4bb..028a43b286 100644 --- a/src/libasr/pass/instantiate_template.cpp +++ b/src/libasr/pass/instantiate_template.cpp @@ -8,25 +8,23 @@ namespace LFortran { class FunctionInstantiator : public ASR::BaseExprStmtDuplicator { -public: +public: SymbolTable *current_scope; std::map subs; - std::string new_function_name; + std::string new_func_name; - FunctionInstantiator(Allocator &al, std::map subs, - SymbolTable *current_scope, std::string new_function_name): + FunctionInstantiator(Allocator &al, std::map subs, + SymbolTable *current_scope, std::string new_func_name): BaseExprStmtDuplicator(al), current_scope{current_scope}, subs{subs}, - new_function_name{new_function_name} + new_func_name{new_func_name} {} ASR::asr_t* instantiate_Function(ASR::Function_t &x) { SymbolTable *parent_scope = current_scope; current_scope = al.make_new(parent_scope); - std::string func_name = new_function_name; - Vec args; args.reserve(al, x.n_args); for (size_t i=0; i( - (ASR::down_cast(x.m_return_var))->m_v); - std::string return_var_name = return_var->m_name; - ASR::ttype_t *return_param_type = ASRUtils::expr_type(x.m_return_var); - ASR::ttype_t *return_type = ASR::is_a(*return_param_type) ? - subs[ASR::down_cast(return_param_type)->m_param] : return_param_type; - ASR::asr_t *new_return_var = ASR::make_Variable_t(al, return_var->base.base.loc, - current_scope, s2c(al, return_var_name), return_var->m_intent, nullptr, nullptr, - return_var->m_storage, return_type, return_var->m_abi, return_var->m_access, - return_var->m_presence, return_var->m_value_attr); - current_scope->add_symbol(return_var_name, ASR::down_cast(new_return_var)); - ASR::asr_t *new_return_var_ref = ASR::make_Var_t(al, x.base.base.loc, - current_scope->get_symbol(return_var_name)); + ASR::expr_t *new_return_var_ref = nullptr; + if (x.m_return_var != nullptr) { + ASR::Variable_t *return_var = ASR::down_cast( + (ASR::down_cast(x.m_return_var))->m_v); + std::string return_var_name = return_var->m_name; + ASR::ttype_t *return_param_type = ASRUtils::expr_type(x.m_return_var); + ASR::ttype_t *return_type = substitute_type(return_param_type); + ASR::asr_t *new_return_var = ASR::make_Variable_t(al, return_var->base.base.loc, + current_scope, s2c(al, return_var_name), return_var->m_intent, nullptr, nullptr, + return_var->m_storage, return_type, return_var->m_abi, return_var->m_access, + return_var->m_presence, return_var->m_value_attr); + current_scope->add_symbol(return_var_name, ASR::down_cast(new_return_var)); + new_return_var_ref = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + current_scope->get_symbol(return_var_name))); + } // Rebuild the symbol table for (auto const &sym_pair: x.m_symtab->get_scope()) { if (current_scope->resolve_symbol(sym_pair.first) == nullptr) { ASR::symbol_t *sym = sym_pair.second; - ASR::ttype_t *new_sym_type = substitute_type(ASRUtils::symbol_type(sym)); if (ASR::is_a(*sym)) { + ASR::ttype_t *new_sym_type = substitute_type(ASRUtils::symbol_type(sym)); ASR::Variable_t *var_sym = ASR::down_cast(sym); std::string var_sym_name = var_sym->m_name; ASR::asr_t *new_var = ASR::make_Variable_t(al, var_sym->base.base.loc, @@ -103,21 +103,23 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(result); - parent_scope->add_symbol(func_name, t); + parent_scope->add_symbol(new_func_name, t); current_scope = parent_scope; return result; } + + ASR::asr_t* duplicate_Var(ASR::Var_t *x) { std::string sym_name = ASRUtils::symbol_name(x->m_v); ASR::symbol_t *sym = current_scope->get_symbol(sym_name); @@ -127,7 +129,7 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorm_v); ASR::expr_t *m_value = duplicate_expr(x->m_value); - + Vec args; args.reserve(al, x->n_args); for (size_t i=0; in_args; i++) { @@ -139,6 +141,16 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorbase.base.loc, m_v, args.p, x->n_args, type, m_value); } + ASR::asr_t* duplicate_ListItem(ASR::ListItem_t *x) { + ASR::expr_t *m_a = duplicate_expr(x->m_a); + ASR::expr_t *m_pos = duplicate_expr(x->m_pos); + ASR::ttype_t *type = substitute_type(x->m_type); + ASR::expr_t *m_value = duplicate_expr(x->m_value); + + return ASR::make_ListItem_t(al, x->base.base.loc, + m_a, m_pos, type, m_value); + } + ASR::array_index_t duplicate_array_index(ASR::array_index_t x) { ASR::expr_t *left = duplicate_expr(x.m_left); ASR::expr_t *right = duplicate_expr(x.m_right); @@ -150,11 +162,26 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorm_target); + ASR::ttype_t *target_type = substitute_type(ASRUtils::expr_type(x->m_target)); + ASR::expr_t *value = duplicate_expr(x->m_value); + if (ASRUtils::is_real(*target_type) && ASR::is_a(*x->m_value)) { + ASR::IntegerConstant_t *int_value = ASR::down_cast(x->m_value); + if (int_value->m_n == 0) { + value = ASRUtils::EXPR(ASR::make_RealConstant_t(al, value->base.loc, 0, + ASRUtils::duplicate_type(al, target_type))); + } + } + ASR::stmt_t *overloaded = duplicate_stmt(x->m_overloaded); + return ASR::make_Assignment_t(al, x->base.base.loc, target, value, overloaded); + } + ASR::asr_t* duplicate_TemplateBinOp(ASR::TemplateBinOp_t *x) { ASR::expr_t *left = duplicate_expr(x->m_left); ASR::expr_t *right = duplicate_expr(x->m_right); - return make_BinOp_helper(left, right, x->m_op, x->base.base.loc); + return make_BinOp_helper(left, right, x->m_op, x->base.base.loc); } ASR::asr_t* duplicate_DoLoop(ASR::DoLoop_t *x) { @@ -172,11 +199,20 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorbase.base.loc, head, m_body.p, x->n_body); } + ASR::asr_t* duplicate_Cast(ASR::Cast_t *x) { + ASR::expr_t *arg = duplicate_expr(x->m_arg); + ASR::ttype_t *type = substitute_type(ASRUtils::expr_type(x->m_arg)); + if (ASRUtils::is_real(*type)) { + return (ASR::asr_t*) arg; + } + return ASRUtils::make_Cast_t_value(al, x->base.base.loc, arg, ASR::cast_kindType::IntegerToReal, x->m_type); + } + ASR::ttype_t* substitute_type(ASR::ttype_t *param_type) { if (ASR::is_a(*param_type)) { - ASR::List_t *list_type = ASR::down_cast(param_type); - ASR::ttype_t *elem_type = substitute_type(list_type->m_type); - return ASRUtils::TYPE(ASR::make_List_t(al, param_type->base.loc, elem_type)); + ASR::List_t *tlist = ASR::down_cast(param_type); + return ASRUtils::TYPE(ASR::make_List_t(al, param_type->base.loc, + substitute_type(tlist->m_type))); } if (ASR::is_a(*param_type)) { ASR::TypeParameter_t *param = ASR::down_cast(param_type); @@ -191,28 +227,26 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(t); return ASRUtils::TYPE(ASR::make_Real_t(al, t->base.loc, tnew->m_kind, param->m_dims, param->n_dims)); - } + } case ASR::ttypeType::Character: { ASR::Character_t* tnew = ASR::down_cast(t); return ASRUtils::TYPE(ASR::make_Character_t(al, t->base.loc, tnew->m_kind, tnew->m_len, tnew->m_len_expr, param->m_dims, param->n_dims)); - } - default: return subs[param->m_param]; + } + default: return subs[param->m_param]; } } return param_type; - } - + } + + // Commented out part is not yet considered for generic functions ASR::asr_t* make_BinOp_helper(ASR::expr_t *left, ASR::expr_t *right, ASR::binopType op, const Location &loc) { ASR::ttype_t *left_type = ASRUtils::expr_type(left); ASR::ttype_t *right_type = ASRUtils::expr_type(right); ASR::ttype_t *dest_type = nullptr; ASR::expr_t *value = nullptr; - - // bool right_is_int = ASRUtils::is_character(*left_type) && ASRUtils::is_integer(*right_type); - // bool left_is_int = ASRUtils::is_integer(*left_type) && ASRUtils::is_character(*right_type); if ((ASRUtils::is_integer(*left_type) || ASRUtils::is_real(*left_type) || ASRUtils::is_complex(*left_type) || ASRUtils::is_logical(*left_type)) && @@ -223,7 +257,6 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(left_type); ASR::Character_t *right_type2 = ASR::down_cast(right_type); LFORTRAN_ASSERT(left_type2->n_dims == 0); @@ -250,9 +283,10 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator> right_value; break; } + */ default: { LFORTRAN_ASSERT(false); } // should never happen } value = ASR::down_cast(ASR::make_IntegerConstant_t(al, loc, result, dest_type)); } return ASR::make_IntegerBinOp_t(al, loc, left, op, right, dest_type, value); } else if (ASRUtils::is_real(*dest_type)) { + /* if (op == ASR::binopType::BitAnd || op == ASR::binopType::BitOr || op == ASR::binopType::BitXor || op == ASR::binopType::BitLShift || op == ASR::binopType::BitRShift) { throw LCompilersException("ICE: failure in instantiation: Unsupported binary operation on floats: '" + ASRUtils::binop_to_str_python(op) + "'"); } + */ right = cast_helper(left_type, right); dest_type = ASRUtils::expr_type(right); if (ASRUtils::expr_value(left) != nullptr && ASRUtils::expr_value(right) != nullptr) { @@ -299,9 +336,9 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(ASR::make_RealConstant_t(al, loc, result, dest_type)); } return ASR::make_RealBinOp_t(al, loc, left, op, right, dest_type, value); - } + } - return nullptr; + return nullptr; } ASR::expr_t *cast_helper(ASR::ttype_t *left_type, ASR::expr_t *right, @@ -317,12 +354,12 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator subs, - SymbolTable *current_scope, std::string new_function_name, ASR::Function_t &func) { - FunctionInstantiator tf(al, subs, current_scope, new_function_name); + SymbolTable *current_scope, std::string new_func_name, ASR::Function_t &func) { + FunctionInstantiator tf(al, subs, current_scope, new_func_name); ASR::asr_t *new_function = tf.instantiate_Function(func); return ASR::down_cast(new_function); } diff --git a/src/libasr/pass/instantiate_template.h b/src/libasr/pass/instantiate_template.h index 28f0906da1..f6752da200 100644 --- a/src/libasr/pass/instantiate_template.h +++ b/src/libasr/pass/instantiate_template.h @@ -6,7 +6,7 @@ namespace LFortran { ASR::symbol_t* pass_instantiate_generic_function(Allocator &al, std::map subs, - SymbolTable *current_scope, std::string new_function_name, ASR::Function_t &func); + SymbolTable *current_scope, std::string new_func_name, ASR::Function_t &func); } #endif // LFORTRAN_PASS_TEMPLATE_VISITOR_H \ No newline at end of file diff --git a/src/libasr/pass/pass_array_by_data.cpp b/src/libasr/pass/pass_array_by_data.cpp index 53bd24a14c..0af9e5df0e 100644 --- a/src/libasr/pass/pass_array_by_data.cpp +++ b/src/libasr/pass/pass_array_by_data.cpp @@ -12,26 +12,6 @@ namespace LFortran { -/* - -The following visitor converts function/subroutines (a.k.a procedures) -with array arguments having empty dimensions to arrays having dimensional -information available from function arguments. See example below, - -subroutine f(array1, array2) - integer, intent(in) :: array1(:) - integer, intent(out) :: array2(:) -end subroutine - -gets converted to, - -subroutine f_array1_array2(array1, m1, n1, array2, m2, n2) - integer, intent(in) :: m1, m2, n1, n2 - integer, intent(in) :: array1(m1:n1) - integer, intent(out) :: array2(m2:n2) -end subroutine - -*/ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -155,7 +135,7 @@ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitorm_abi, x->m_access, x->m_deftype, s2c(al, new_bindc_name), x->m_elemental, - x->m_pure, x->m_module); + x->m_pure, x->m_module, x->m_inline); new_symbol = ASR::down_cast(new_subrout); } current_scope->add_symbol(new_name, new_symbol); @@ -226,21 +206,6 @@ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -289,19 +254,6 @@ class ReplaceSubroutineCallsVisitor : public PassUtils::PassVisitor { private: @@ -351,13 +303,6 @@ class ReplaceFunctionCalls: public ASR::BaseExprReplacer { }; -/* - -The following visitor calls the above replacer i.e., ReplaceFunctionCalls -on expressions present in ASR so that FunctionCall get replaced everywhere -and we don't end up with false positives. - -*/ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor { private: @@ -376,16 +321,6 @@ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor }; -/* - -Since the above visitors have replaced procedure and calls to those procedures -with arrays as arguments, we don't need the original ones anymore. So we remove -them from the ASR. The reason to do this is that some backends like WASM don't -have support for accepting and returning arrays via array descriptors. Therefore, -they cannot generate code for such functions. To avoid backends like WASM from failing -we remove those functions by implementing and calling the following visitor. - -*/ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor { private: @@ -400,18 +335,12 @@ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor(x); current_scope = xx.m_symtab; - std::vector to_be_erased; for( auto& item: current_scope->get_scope() ) { if( v.proc2newproc.find(item.second) != v.proc2newproc.end() ) { - LFORTRAN_ASSERT(item.first == ASRUtils::symbol_name(item.second)) - to_be_erased.push_back(item.first); + current_scope->erase_symbol(ASRUtils::symbol_name(item.second)); } } - - for (auto &item: to_be_erased) { - current_scope->erase_symbol(item); - } } }; diff --git a/src/libasr/pass/pass_manager.h b/src/libasr/pass/pass_manager.h index 5aa72d0c8f..b18ea5b474 100644 --- a/src/libasr/pass/pass_manager.h +++ b/src/libasr/pass/pass_manager.h @@ -101,6 +101,7 @@ namespace LCompilers { "do_loops", "forall", "select_case", + "inline_function_calls", "unused_functions" }; @@ -161,8 +162,10 @@ namespace LCompilers { void apply_passes(Allocator& al, LFortran::ASR::TranslationUnit_t* asr, PassOptions& pass_options) { if( !_user_defined_passes.empty() ) { + pass_options.fast = true; _apply_passes(al, asr, _user_defined_passes, pass_options); } else if( apply_default_passes ) { + pass_options.fast = is_fast; if( is_fast ) { _apply_passes(al, asr, _with_optimization_passes, pass_options); } else { diff --git a/src/libasr/pass/pass_utils.cpp b/src/libasr/pass/pass_utils.cpp index 0a92ca2d4e..ff9dffcf09 100644 --- a/src/libasr/pass/pass_utils.cpp +++ b/src/libasr/pass/pass_utils.cpp @@ -540,7 +540,7 @@ namespace LFortran { nullptr, 0, body.p, body.size(), nullptr, ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Implementation, - nullptr, false, false, false); + nullptr, false, false, false, false); global_scope->add_symbol(vector_copy_name, ASR::down_cast(vector_copy_asr)); return ASR::down_cast(vector_copy_asr); } diff --git a/src/libasr/pass/pass_utils.h b/src/libasr/pass/pass_utils.h index 8f13a48731..14df3c02e9 100644 --- a/src/libasr/pass/pass_utils.h +++ b/src/libasr/pass/pass_utils.h @@ -159,6 +159,12 @@ namespace LFortran { transform_stmts(xx.m_body, xx.n_body); } + void visit_Block(const ASR::Block_t& x) { + ASR::Block_t &xx = const_cast(x); + current_scope = xx.m_symtab; + transform_stmts(xx.m_body, xx.n_body); + } + }; template diff --git a/src/libasr/runtime/lfortran_intrinsics.c b/src/libasr/runtime/lfortran_intrinsics.c index 17399c7844..38b5dadbe8 100644 --- a/src/libasr/runtime/lfortran_intrinsics.c +++ b/src/libasr/runtime/lfortran_intrinsics.c @@ -732,7 +732,7 @@ LFORTRAN_API int32_t _lpython_bit_length4(int32_t num) LFORTRAN_API int32_t _lpython_bit_length8(int64_t num) { int32_t res = 0; - num = abs(num); + num = llabs(num); for(; num; num >>= 1, res++); return res; } @@ -860,6 +860,10 @@ LFORTRAN_API int8_t* _lfortran_realloc(int8_t* ptr, int32_t size) { return (int8_t*) realloc(ptr, size); } +LFORTRAN_API int8_t* _lfortran_calloc(int32_t count, int32_t size) { + return (int8_t*) calloc(count, size); +} + LFORTRAN_API void _lfortran_free(char* ptr) { free((void*)ptr); } diff --git a/src/libasr/runtime/lfortran_intrinsics.h b/src/libasr/runtime/lfortran_intrinsics.h index baccb85bff..e1785a2b85 100644 --- a/src/libasr/runtime/lfortran_intrinsics.h +++ b/src/libasr/runtime/lfortran_intrinsics.h @@ -160,6 +160,8 @@ LFORTRAN_API int _lfortran_str_ord(char** s); LFORTRAN_API char* _lfortran_str_chr(int c); LFORTRAN_API int _lfortran_str_to_int(char** s); LFORTRAN_API char* _lfortran_malloc(int size); +LFORTRAN_API int8_t* _lfortran_realloc(int8_t* ptr, int32_t size); +LFORTRAN_API int8_t* _lfortran_calloc(int32_t count, int32_t size); LFORTRAN_API void _lfortran_free(char* ptr); LFORTRAN_API void _lfortran_string_init(int size_plus_one, char *s); LFORTRAN_API int32_t _lfortran_iand32(int32_t x, int32_t y); diff --git a/src/libasr/serialization.cpp b/src/libasr/serialization.cpp index 569b4829e7..84c9630153 100644 --- a/src/libasr/serialization.cpp +++ b/src/libasr/serialization.cpp @@ -307,7 +307,12 @@ void fix_external_symbols(ASR::TranslationUnit_t &unit, } ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, - bool load_symtab_id, SymbolTable &external_symtab) { + bool load_symtab_id, SymbolTable & /*external_symtab*/) { + return deserialize_asr(al, s, load_symtab_id); +} + +ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, + bool load_symtab_id) { ASRDeserializationVisitor v(al, s, load_symtab_id); ASR::asr_t *node = v.deserialize_node(); ASR::TranslationUnit_t *tu = ASR::down_cast2(node); @@ -319,9 +324,6 @@ ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, LFORTRAN_ASSERT(asr_verify(*tu, false)); - // Suppress a warning for now - if ((bool&)external_symtab) {} - return node; } diff --git a/src/libasr/serialization.h b/src/libasr/serialization.h index 7b054ed2d7..3e04b0f98e 100644 --- a/src/libasr/serialization.h +++ b/src/libasr/serialization.h @@ -9,6 +9,8 @@ namespace LFortran { std::string serialize(const ASR::TranslationUnit_t &unit); ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, bool load_symtab_id, SymbolTable &symtab); + ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, + bool load_symtab_id); void fix_external_symbols(ASR::TranslationUnit_t &unit, SymbolTable &external_symtab); diff --git a/src/libasr/utils.h b/src/libasr/utils.h index 92c4263424..a901c03974 100644 --- a/src/libasr/utils.h +++ b/src/libasr/utils.h @@ -35,8 +35,6 @@ struct CompilerOptions { std::string error_format = "human"; bool new_parser = false; bool implicit_typing = false; - bool implicit_interface = false; - std::string target = ""; Platform platform; @@ -57,9 +55,10 @@ namespace LCompilers { bool always_run; // for unused_functions pass bool inline_external_symbol_calls; // for inline_function_calls pass int64_t unroll_factor; // for loop_unroll pass + bool fast; // is fast flag enabled. PassOptions(): always_run(false), inline_external_symbol_calls(true), - unroll_factor(32) + unroll_factor(32), fast(false) {} }; From fd5024af8ff05a12e7c88969f603f914332d1eef Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 09:53:11 +0530 Subject: [PATCH 35/46] Restored ASRUtils::ttype_set_dimensions --- src/libasr/asr_utils.h | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/libasr/asr_utils.h b/src/libasr/asr_utils.h index 48b65c3366..ac81681dcf 100644 --- a/src/libasr/asr_utils.h +++ b/src/libasr/asr_utils.h @@ -1099,6 +1099,69 @@ inline int extract_dimensions_from_ttype(ASR::ttype_t *x, return n_dims; } +// Sets the dimension member of `ttype_t`. Returns `true` if dimensions set. +// Returns `false` if the `ttype_t` does not have a dimension member. +inline bool ttype_set_dimensions(ASR::ttype_t *x, + ASR::dimension_t *m_dims, int64_t n_dims) { + switch (x->type) { + case ASR::ttypeType::Integer: { + ASR::Integer_t* Integer_type = ASR::down_cast(x); + Integer_type->n_dims = n_dims; + Integer_type->m_dims = m_dims; + return true; + } + case ASR::ttypeType::Real: { + ASR::Real_t* Real_type = ASR::down_cast(x); + Real_type->n_dims = n_dims; + Real_type->m_dims = m_dims; + return true; + } + case ASR::ttypeType::Complex: { + ASR::Complex_t* Complex_type = ASR::down_cast(x); + Complex_type->n_dims = n_dims; + Complex_type->m_dims = m_dims; + return true; + } + case ASR::ttypeType::Character: { + ASR::Character_t* Character_type = ASR::down_cast(x); + Character_type->n_dims = n_dims; + Character_type->m_dims = m_dims; + return true; + } + case ASR::ttypeType::Logical: { + ASR::Logical_t* Logical_type = ASR::down_cast(x); + n_dims = Logical_type->n_dims; + m_dims = Logical_type->m_dims; + return true; + } + case ASR::ttypeType::Derived: { + ASR::Derived_t* Derived_type = ASR::down_cast(x); + n_dims = Derived_type->n_dims; + m_dims = Derived_type->m_dims; + return true; + } + case ASR::ttypeType::Class: { + ASR::Class_t* Class_type = ASR::down_cast(x); + Class_type->n_dims = n_dims; + Class_type->m_dims = m_dims; + return true; + } + case ASR::ttypeType::TypeParameter: { + ASR::TypeParameter_t* tp = ASR::down_cast(x); + n_dims = tp->n_dims; + m_dims = tp->m_dims; + return true; + } + case ASR::ttypeType::Pointer: { + return ttype_set_dimensions( + ASR::down_cast(x)->m_type, m_dims, n_dims); + } + default: + return false; + } + return false; +} + inline bool is_array(ASR::ttype_t *x) { ASR::dimension_t* dims = nullptr; return extract_dimensions_from_ttype(x, dims) > 0; From 9f3b04ff3332f500332767bd88ac7f7574f3aba3 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:02:49 +0530 Subject: [PATCH 36/46] Update libasr API usage in LFortran --- src/lfortran/mod_to_asr.cpp | 8 ++++---- src/lfortran/semantics/ast_common_visitor.h | 5 +++-- src/lfortran/semantics/ast_symboltable_visitor.cpp | 8 ++++---- src/libasr/utils.h | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lfortran/mod_to_asr.cpp b/src/lfortran/mod_to_asr.cpp index 956d3e54a5..3de1ebbb30 100644 --- a/src/lfortran/mod_to_asr.cpp +++ b/src/lfortran/mod_to_asr.cpp @@ -55,14 +55,14 @@ int uncompress_gzip( } std::string extract_gzip( -#ifdef HAVE_ZLIB +#ifdef HAVE_ZLIB std::vector& buffer -#else +#else std::vector& /*buffer*/ #endif ) { -#ifdef HAVE_ZLIB +#ifdef HAVE_ZLIB std::vector data(1024*1024); uint64_t data_size = data.size(); int res = uncompress_gzip(&data[0], &data_size, &buffer[0], buffer.size()); @@ -292,7 +292,7 @@ ASR::TranslationUnit_t* parse_gfortran_mod_file(Allocator &al, const std::string nullptr, 0, nullptr, // return var ASR::abiType::GFortranModule, ASR::Public, - ASR::Interface, nullptr, false, false, false); + ASR::Interface, nullptr, false, false, false, false); s.p.proc = down_cast(asr); std::string sym_name = s.name; if (parent_scope->get_symbol(sym_name) != nullptr) { diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index 05090df938..5855d5a6a2 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -1335,7 +1335,8 @@ class CommonVisitor : public AST::BaseVisitor { is_current_procedure_templated = true; type_param = true; type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, loc, - s2c(al, derived_type_name), nullptr, 0)); + s2c(al, derived_type_name), nullptr, 0, + nullptr, 0)); } } } @@ -2561,7 +2562,7 @@ class CommonVisitor : public AST::BaseVisitor { /* n_body */ 0, /* a_return_var */ to_return, ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Interface, - nullptr, false, false, false); + nullptr, false, false, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); current_scope = parent_scope; } diff --git a/src/lfortran/semantics/ast_symboltable_visitor.cpp b/src/lfortran/semantics/ast_symboltable_visitor.cpp index 1aae50ad16..a7ef8bd895 100644 --- a/src/lfortran/semantics/ast_symboltable_visitor.cpp +++ b/src/lfortran/semantics/ast_symboltable_visitor.cpp @@ -347,7 +347,7 @@ class SymbolTableVisitor : public CommonVisitor { nullptr, current_procedure_abi_type, s_access, deftype, bindc_name, - is_pure, is_module, false); + is_pure, is_module, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); current_scope = parent_scope; /* FIXME: This can become incorrect/get cleared prematurely, perhaps @@ -513,7 +513,7 @@ class SymbolTableVisitor : public CommonVisitor { } } } - if(type_param) type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, x.base.base.loc, nullptr, nullptr, 0)); + if(type_param) type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, x.base.base.loc, nullptr, nullptr, 0, nullptr, 0)); else type = LFortran::ASRUtils::TYPE(ASR::make_Derived_t(al, x.base.base.loc, v, nullptr, 0)); break; @@ -599,7 +599,7 @@ class SymbolTableVisitor : public CommonVisitor { /* n_body */ 0, /* a_return_var */ LFortran::ASRUtils::EXPR(return_var_ref), current_procedure_abi_type, s_access, deftype, - bindc_name, is_elemental, false, false); + bindc_name, is_elemental, false, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); current_scope = parent_scope; current_procedure_args.clear(); @@ -657,7 +657,7 @@ class SymbolTableVisitor : public CommonVisitor { parent_sym = parent_scope->get_symbol(parent_sym_name); } if(is_template && data_member_names.size() == 0){ - current_template_type_parameters.push_back(ASR::make_TypeParameter_t(al, x.base.base.loc, s2c(al, to_lower(x.m_name)), nullptr, 0)); + current_template_type_parameters.push_back(ASR::make_TypeParameter_t(al, x.base.base.loc, s2c(al, to_lower(x.m_name)), nullptr, 0, nullptr, 0)); } tmp = ASR::make_DerivedType_t(al, x.base.base.loc, current_scope, s2c(al, to_lower(x.m_name)), data_member_names.p, data_member_names.size(), diff --git a/src/libasr/utils.h b/src/libasr/utils.h index a901c03974..b7bccc8b42 100644 --- a/src/libasr/utils.h +++ b/src/libasr/utils.h @@ -35,6 +35,7 @@ struct CompilerOptions { std::string error_format = "human"; bool new_parser = false; bool implicit_typing = false; + bool implicit_interface = false; std::string target = ""; Platform platform; From b6c8484cf8a94d131ba2779cf431083070f01086 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:06:08 +0530 Subject: [PATCH 37/46] Restored fix for arrays_16_func.f90 --- src/libasr/codegen/asr_to_llvm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index f8391fbed8..a07f823d1e 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -1437,7 +1437,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor uint32_t v_h = get_hash((ASR::asr_t*)v); LFORTRAN_ASSERT(llvm_symtab.find(v_h) != llvm_symtab.end()); array = llvm_symtab[v_h]; - is_argument = v->m_intent == ASRUtils::intent_in || v->m_intent == ASRUtils::intent_out; + is_argument = (v->m_intent == ASRUtils::intent_in) + || (v->m_intent == ASRUtils::intent_out) + || (v->m_intent == ASRUtils::intent_inout) + || (v->m_intent == ASRUtils::intent_unspecified); } else { int64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; From a6535f77f33e23ca9b1446ff1aae3de6ccf91191 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:16:52 +0530 Subject: [PATCH 38/46] Resotre changes in asdl_cpp.py Co-authored-by: Thirumalai Shaktivel <74826228+Thirumalai-Shaktivel@users.noreply.github.com> --- src/libasr/asdl_cpp.py | 160 ++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 65 deletions(-) diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index 9138aac193..88d157a599 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -528,6 +528,33 @@ def make_visitor(self, name, fields): self.emit("if ((bool&)x) { } // Suppress unused warning", 2) self.emit("}", 1) +class StatementsFirstWalkVisitorVisitor(ASTWalkVisitorVisitor, ASDLVisitor): + + def visitModule(self, mod): + self.emit("/" + "*"*78 + "/") + self.emit("// Statements First Visitor base class") + self.emit("") + self.emit("template ") + self.emit("class StatementsFirstBaseWalkVisitor : public BaseVisitor") + self.emit("{") + self.emit("private:") + self.emit(" Derived& self() { return static_cast(*this); }") + self.emit("public:") + super(ASTWalkVisitorVisitor, self).visitModule(mod) + self.emit("};") + + def make_visitor(self, name, fields): + self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) + self.used = False + have_body = False + for field in fields[::-1]: + self.visitField(field) + if not self.used: + # Note: a better solution would be to change `&x` to `& /* x */` + # above, but we would need to change emit to return a string. + self.emit("if ((bool&)x) { } // Suppress unused warning", 2) + self.emit("}", 1) + # This class generates a visitor that prints the tree structure of AST/ASR class TreeVisitorVisitor(ASDLVisitor): @@ -1217,12 +1244,10 @@ def visitModule(self, mod): self.emit("private:") self.emit( "Derived& self() { return static_cast(*this); }", 1) self.emit("public:") - self.emit( "std::string s, indtd;", 1) + self.emit( "std::string s, indtd = \"\";", 1) self.emit( "bool use_colors;", 1) - self.emit( "bool indent, start_line = true;", 1) - self.emit( "int indent_level = 0, indent_spaces = 3, lvl = 0;", 1) - self.emit( "int tmp = 0, tmp1 = 0, tmp2 = 2;", 1) - self.emit( "int curly[2000], round[2000];", 1) + self.emit( "bool indent;", 1) + self.emit( "int indent_level = 0, indent_spaces = 4;", 1) self.emit("public:") self.emit( "PickleBaseVisitor() : use_colors(false), indent(false) { s.reserve(100000); }", 1) self.emit( "void inc_indent() {", 1) @@ -1258,18 +1283,6 @@ def visitConstructor(self, cons, _): def make_visitor(self, name, fields, cons): self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) - self.emit( 'if(indent) {',2) - self.emit( 'tmp1++;',3) - self.emit( 'round[tmp1] = indent_level;',3) - self.emit( 'if(start_line) {',3) - self.emit( 'start_line = false;', 4) - self.emit( 's.append(indtd);', 4) - self.emit( 'inc_indent();',4) - self.emit( '} else {', 3) - self.emit( 's.append("\\n"+indtd);', 4) - self.emit( 'inc_indent();',4) - self.emit( '}', 3) - self.emit( '}', 2) self.emit( 's.append("(");', 2) subs = { "Assignment": "=", @@ -1277,6 +1290,17 @@ def make_visitor(self, name, fields, cons): } if name in subs: name = subs[name] + + # For ASR + symbol = [ + "Integer", + "Real", + "Complex", + "Character", + "Logical", + "Var", + ] + if cons: self.emit( 'if (use_colors) {', 2) self.emit( 's.append(color(style::bold));', 3) @@ -1289,16 +1313,23 @@ def make_visitor(self, name, fields, cons): self.emit( '}', 2) if len(fields) > 0: self.emit( 's.append(" ");', 2) + if name not in symbol: + self.emit( 'if(indent) {', 2) + self.emit( 'inc_indent();', 3) + self.emit( 's.append("\\n" + indtd);', 3) + self.emit( '}', 2) self.used = False for n, field in enumerate(fields): self.visitField(field, cons) if n < len(fields) - 1: self.emit( 's.append(" ");', 2) - self.emit( 'if(indent) {', 2) - self.emit( 'lvl = indent_level;', 3) - self.emit( 'for(int times = 0; times < (lvl - round[tmp1] ); times++)', 3) - self.emit( 'dec_indent();', 4) - self.emit( 'round[tmp1] = 0; if(tmp1 > 1) tmp1--;}', 3) + if name not in symbol: + self.emit( 'if(indent) s.append("\\n" + indtd);', 2) + if name not in symbol and cons and len(fields) > 0: + self.emit( 'if(indent) {', 2) + self.emit( 'dec_indent();', 3) + self.emit( 's.append("\\n" + indtd);', 3) + self.emit( '}', 2) self.emit( 's.append(")");', 2) if not self.used: # Note: a better solution would be to change `&x` to `& /* x */` @@ -1315,7 +1346,6 @@ def make_simple_sum_visitor(self, name, types): self.emit( 'switch (x) {', 2) for tp in types: self.emit( 'case (%s::%s) : {' % (name, tp.name), 3) - self.emit( 'if(indent) s.append("\\n"+indtd);',4) self.emit( 's.append("%s");' % (tp.name), 4) self.emit( ' break; }',3) self.emit( '}', 2) @@ -1344,7 +1374,10 @@ def visitField(self, field, cons): self.emit("self().visit_%s(*x.m_%s[i]);" % (field.type, field.name), level+1) else: self.emit("self().visit_%s(x.m_%s[i]);" % (field.type, field.name), level+1) - self.emit( 'if (i < x.n_%s-1) s.append(" ");' % (field.name), level+1) + self.emit(' if (i < x.n_%s-1) {' % (field.name), level+1) + self.emit(' if (indent) s.append("\\n" + indtd);', level+2) + self.emit(' else s.append(" ");', level+2) + self.emit(' };', level+1) self.emit("}", level) self.emit('s.append("]");', level) elif field.opt: @@ -1362,8 +1395,11 @@ def visitField(self, field, cons): level = 2 self.emit('s.append("[");', level) self.emit("for (size_t i=0; iget_counter());' % field.name, level) else: level = 2 - self.emit( 'if(indent) {',level) - self.emit( 's.append("\\n"+indtd);', level+1) - self.emit( 'round[++tmp1] = indent_level;',level+1) - self.emit( 'inc_indent();',level+1) - self.emit( '}', level) self.emit( 's.append("(");', level) self.emit('if (use_colors) {', level) self.emit( 's.append(color(fg::yellow));', level+1) @@ -1410,46 +1441,45 @@ def visitField(self, field, cons): self.emit('if (use_colors) {', level) self.emit( 's.append(color(fg::reset));', level+1) self.emit('}', level) - self.emit('s.append(" ");', level) - self.emit( 'if(indent) s.append("\\n"+indtd);', level) - self.emit( 's.append(x.m_%s->get_counter());' % field.name, level) - self.emit( 's.append(" ");', level) - self.emit( 'if(indent) {',level) - self.emit( 's.append("\\n"+indtd);', level+1) - self.emit( 'curly[++tmp] = indent_level;',level+1) - self.emit( 'tmp2 = 1;',level+1) - self.emit( 'inc_indent();',level+1) - self.emit( '}', level) + self.emit('if(indent) {', level) + self.emit( 'inc_indent();', level+1) + self.emit( 's.append("\\n" + indtd);', level+1) + self.emit('}', level) + self.emit('else s.append(" ");', level) + self.emit('s.append(x.m_%s->get_counter());' % field.name, level) + self.emit('if(indent) s.append("\\n" + indtd);', level) + self.emit('else s.append(" ");', level) self.emit( 's.append("{");', level) + self.emit('if(indent) {', level) + self.emit( 'inc_indent();', level+1) + self.emit( 's.append("\\n" + indtd);', level+1) + self.emit('}', level) self.emit('{', level) self.emit(' size_t i = 0;', level) self.emit(' for (auto &a : x.m_%s->get_scope()) {' % field.name, level) - self.emit( 'if(indent) {',level) - self.emit( 's.append("\\n"+indtd);', level+1) - self.emit( 'inc_indent();',level+1) - self.emit( '}', level) - self.emit(' s.append(a.first + ": ");', level) + self.emit(' s.append(a.first + ":");', level) + self.emit(' if(indent) {', level) + self.emit(' inc_indent();', level+1) + self.emit(' s.append("\\n" + indtd);', level+1) + self.emit(' }', level) + self.emit(' else s.append(" ");', level) self.emit(' this->visit_symbol(*a.second);', level) self.emit(' if (i < x.m_%s->get_scope().size()-1) { ' % field.name, level) self.emit(' s.append(", ");', level) - self.emit(' if(indent) {', level) - self.emit(' for(int times = 0; times < tmp2; times++)', level+1) - self.emit(' dec_indent();', level) - self.emit(' }', level) + self.emit(' }', level) + self.emit(' if(indent) {', level) + self.emit(' dec_indent();', level+1) + self.emit(' s.append("\\n" + indtd);', level+1) self.emit(' }', level) self.emit(' i++;', level) self.emit(' }', level) self.emit('}', level) - self.emit( 'if(indent) {',level) - self.emit( 'lvl = indent_level;', level+1) - self.emit( 'for(int times = 0; times < (lvl - curly[tmp] ); times++)', level+1) - self.emit( 'dec_indent();', level+2) - self.emit( 'curly[tmp] = 0; if(tmp > 1) tmp--;', level+1) - self.emit( 'tmp2++;', level+1) - self.emit( 's.append("\\n"+indtd);', level+1) - self.emit( '}', level) - self.emit( 's.append("})");', level) - self.emit( 'if(indent) dec_indent();', level) + self.emit('if(indent) {', level) + self.emit( 'dec_indent();', level+1) + self.emit( 's.append("\\n" + indtd);', level+1) + self.emit('}', level) + self.emit('s.append("})");', level) + self.emit('if(indent) dec_indent();', level) elif field.type == "string" and not field.seq: if field.opt: self.emit("if (x.m_%s) {" % field.name, 2) From 211133aa29e29adbb8045eebe1e2472e676ad0da Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:18:23 +0530 Subject: [PATCH 39/46] Update function nodes in test_llvm.cpp --- src/lfortran/tests/test_llvm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lfortran/tests/test_llvm.cpp b/src/lfortran/tests/test_llvm.cpp index e53157cd85..b775e1ab48 100644 --- a/src/lfortran/tests/test_llvm.cpp +++ b/src/lfortran/tests/test_llvm.cpp @@ -368,7 +368,7 @@ end function)"; LFortran::SymbolTable::reset_global_counter(); LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics, nullptr, false, compiler_options)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false. .false.)}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; @@ -406,7 +406,7 @@ end function)"; // AST -> ASR LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics, nullptr, false, compiler_options)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 4 f) (IntegerConstant 4 (Integer 4 [])) ())] (Var 4 f) Source Public Implementation () .false. .false. .false.)}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 4 f) (IntegerConstant 4 (Integer 4 [])) ())] (Var 4 f) Source Public Implementation () .false. .false. .false. .false.)}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; LCompilers::PassManager lpm; From 453f9db0bab9d409efde6a30120a23670aabcd6d Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:35:50 +0530 Subject: [PATCH 40/46] Restore changes for LFortran --- src/libasr/asdl_cpp.py | 27 ----------- src/libasr/codegen/KaleidoscopeJIT.h | 2 +- src/libasr/compiler_tester/tester.py | 21 +++++--- src/libasr/pass/pass_array_by_data.cpp | 67 +++++++++++++++++++++++++- 4 files changed, 81 insertions(+), 36 deletions(-) diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index 88d157a599..df1168e456 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -501,33 +501,6 @@ def visitField(self, field): self.emit( "this->visit_symbol(*a.second);", 3) self.emit("}", 2) -class StatementsFirstWalkVisitorVisitor(ASTWalkVisitorVisitor, ASDLVisitor): - - def visitModule(self, mod): - self.emit("/" + "*"*78 + "/") - self.emit("// Statements First Visitor base class") - self.emit("") - self.emit("template ") - self.emit("class StatementsFirstBaseWalkVisitor : public BaseVisitor") - self.emit("{") - self.emit("private:") - self.emit(" Derived& self() { return static_cast(*this); }") - self.emit("public:") - super(ASTWalkVisitorVisitor, self).visitModule(mod) - self.emit("};") - - def make_visitor(self, name, fields): - self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) - self.used = False - have_body = False - for field in fields[::-1]: - self.visitField(field) - if not self.used: - # Note: a better solution would be to change `&x` to `& /* x */` - # above, but we would need to change emit to return a string. - self.emit("if ((bool&)x) { } // Suppress unused warning", 2) - self.emit("}", 1) - class StatementsFirstWalkVisitorVisitor(ASTWalkVisitorVisitor, ASDLVisitor): def visitModule(self, mod): diff --git a/src/libasr/codegen/KaleidoscopeJIT.h b/src/libasr/codegen/KaleidoscopeJIT.h index 7e91ab2095..c7022a4146 100644 --- a/src/libasr/codegen/KaleidoscopeJIT.h +++ b/src/libasr/codegen/KaleidoscopeJIT.h @@ -12,7 +12,7 @@ #ifndef LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H #define LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H - +#include #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/iterator_range.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" diff --git a/src/libasr/compiler_tester/tester.py b/src/libasr/compiler_tester/tester.py index d0b49a04b2..04e3186c0a 100644 --- a/src/libasr/compiler_tester/tester.py +++ b/src/libasr/compiler_tester/tester.py @@ -127,6 +127,8 @@ def fixdir(s: bytes) -> bytes: local_dir = os.getcwd() return s.replace(local_dir.encode(), "$DIR".encode()) +def unl_loop_del(b): + return b.replace(bytes('\r\n', encoding='utf-8'), bytes('\n', encoding='utf-8')) def run(basename: str, cmd: Union[pathlib.Path, str], out_dir: Union[pathlib.Path, str], infile=None, extra_args=None): @@ -161,6 +163,9 @@ def run(basename: str, cmd: Union[pathlib.Path, str], if infile and not os.path.exists(infile): raise RunException("The input file does not exist") outfile = os.path.join(out_dir, basename + "." + "out") + + infile=infile.replace("\\\\","\\").replace("\\","/") + cmd2 = cmd.format(infile=infile, outfile=outfile) if extra_args: cmd2 += " " + extra_args @@ -181,23 +186,25 @@ def run(basename: str, cmd: Union[pathlib.Path, str], stderr_file = None if infile: - infile_hash = hashlib.sha224(open(infile, "rb").read()).hexdigest() + temp=unl_loop_del(open(infile, "rb").read()) + infile_hash = hashlib.sha224(temp).hexdigest() else: infile_hash = None if outfile: - outfile_hash = hashlib.sha224(open(outfile, "rb").read()).hexdigest() + temp=unl_loop_del(open(outfile, "rb").read()) + outfile_hash = hashlib.sha224(temp).hexdigest() outfile = os.path.basename(outfile) else: outfile_hash = None if stdout_file: - stdout_hash = hashlib.sha224( - open(stdout_file, "rb").read()).hexdigest() + temp = unl_loop_del(open(stdout_file, "rb").read()) + stdout_hash = hashlib.sha224(temp).hexdigest() stdout_file = os.path.basename(stdout_file) else: stdout_hash = None if stderr_file: - stderr_hash = hashlib.sha224( - open(stderr_file, "rb").read()).hexdigest() + temp=unl_loop_del(open(stderr_file, "rb").read()) + stderr_hash = hashlib.sha224(temp).hexdigest() stderr_file = os.path.basename(stderr_file) else: stderr_hash = None @@ -340,7 +347,7 @@ def tester_main(compiler, single_test): verbose = args.verbose no_llvm = args.no_llvm - # So that the tests find the `lpython` executable + # So that the tests find the `lcompiler` executable os.environ["PATH"] = os.path.join(SRC_DIR, "bin") \ + os.pathsep + os.environ["PATH"] test_data = toml.load(open(os.path.join(ROOT_DIR, "tests", "tests.toml"))) diff --git a/src/libasr/pass/pass_array_by_data.cpp b/src/libasr/pass/pass_array_by_data.cpp index 0af9e5df0e..cdffdd6e30 100644 --- a/src/libasr/pass/pass_array_by_data.cpp +++ b/src/libasr/pass/pass_array_by_data.cpp @@ -12,6 +12,24 @@ namespace LFortran { +/* +The following visitor converts function/subroutines (a.k.a procedures) +with array arguments having empty dimensions to arrays having dimensional +information available from function arguments. See example below, + + subroutine f(array1, array2) + integer, intent(in) :: array1(:) + integer, intent(out) :: array2(:) + end subroutine + +gets converted to, + + subroutine f_array1_array2(array1, m1, n1, array2, m2, n2) + integer, intent(in) :: m1, m2, n1, n2 + integer, intent(in) :: array1(m1:n1) + integer, intent(out) :: array2(m2:n2) + end subroutine + */ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -206,6 +224,19 @@ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -254,6 +285,20 @@ class ReplaceSubroutineCallsVisitor : public PassUtils::PassVisitor { private: @@ -303,6 +348,11 @@ class ReplaceFunctionCalls: public ASR::BaseExprReplacer { }; +/* +The following visitor calls the above replacer i.e., ReplaceFunctionCalls +on expressions present in ASR so that FunctionCall get replaced everywhere +and we don't end up with false positives. +*/ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor { private: @@ -321,6 +371,14 @@ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor }; +/* +Since the above visitors have replaced procedure and calls to those procedures +with arrays as arguments, we don't need the original ones anymore. So we remove +them from the ASR. The reason to do this is that some backends like WASM don't +have support for accepting and returning arrays via array descriptors. Therefore, +they cannot generate code for such functions. To avoid backends like WASM from failing +we remove those functions by implementing and calling the following visitor. +*/ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor { private: @@ -336,11 +394,18 @@ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor(x); current_scope = xx.m_symtab; + std::vector to_be_erased; + for( auto& item: current_scope->get_scope() ) { if( v.proc2newproc.find(item.second) != v.proc2newproc.end() ) { - current_scope->erase_symbol(ASRUtils::symbol_name(item.second)); + LFORTRAN_ASSERT(item.first == ASRUtils::symbol_name(item.second)) + to_be_erased.push_back(item.first); } } + + for (auto &item: to_be_erased) { + current_scope->erase_symbol(item); + } } }; From fc6507557221d05c7047b1748ccf5635a6d07e04 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Tue, 6 Sep 2022 10:42:51 +0530 Subject: [PATCH 41/46] Updated reference tests --- tests/reference/asr-allocate_01-f3446f6.json | 2 +- .../reference/asr-allocate_01-f3446f6.stdout | 2 +- tests/reference/asr-allocate_02-3c0d7c8.json | 2 +- .../reference/asr-allocate_02-3c0d7c8.stdout | 2 +- tests/reference/asr-allocate_03-8219a72.json | 2 +- .../reference/asr-allocate_03-8219a72.stdout | 2 +- .../asr-allow_implicit_interface-dfa7a9a.json | 2 +- ...sr-allow_implicit_interface-dfa7a9a.stdout | 2 +- .../reference/asr-arrays_03_func-7c8d572.json | 2 +- .../asr-arrays_03_func-7c8d572.stdout | 2 +- .../reference/asr-arrays_04_func-9f59ad6.json | 2 +- .../asr-arrays_04_func-9f59ad6.stdout | 2 +- .../reference/asr-arrays_08_func-2759ced.json | 2 +- .../asr-arrays_08_func-2759ced.stdout | 2 +- .../asr-arrays_elemental_15-c7c15ca.json | 2 +- .../asr-arrays_elemental_15-c7c15ca.stdout | 2 +- tests/reference/asr-arrays_op_4-ca3318f.json | 2 +- .../reference/asr-arrays_op_4-ca3318f.stdout | 2 +- tests/reference/asr-arrays_op_5-9ff5901.json | 2 +- .../reference/asr-arrays_op_5-9ff5901.stdout | 2 +- tests/reference/asr-arrays_op_6-030b24e.json | 2 +- .../reference/asr-arrays_op_6-030b24e.stdout | 2 +- tests/reference/asr-arrays_op_7-52a6b5a.json | 2 +- .../reference/asr-arrays_op_7-52a6b5a.stdout | 2 +- .../asr-arrays_reshape_14-913f34e.json | 2 +- .../asr-arrays_reshape_14-913f34e.stdout | 2 +- tests/reference/asr-block_03-6c8fdd8.json | 2 +- tests/reference/asr-block_03-6c8fdd8.stdout | 2 +- tests/reference/asr-callback_01-21b53de.json | 2 +- .../reference/asr-callback_01-21b53de.stdout | 2 +- tests/reference/asr-callback_02-aec5457.json | 2 +- .../reference/asr-callback_02-aec5457.stdout | 2 +- tests/reference/asr-class_01-704dee8.json | 2 +- tests/reference/asr-class_01-704dee8.stdout | 2 +- tests/reference/asr-class_02-b56b852.json | 2 +- tests/reference/asr-class_02-b56b852.stdout | 2 +- .../asr-derived_types_01-960dafe.json | 2 +- .../asr-derived_types_01-960dafe.stdout | 2 +- .../asr-derived_types_03-b1d32aa.json | 2 +- .../asr-derived_types_03-b1d32aa.stdout | 2 +- .../asr-derived_types_04-b960162.json | 2 +- .../asr-derived_types_04-b960162.stdout | 2 +- .../asr-derived_types_05-35150cd.json | 2 +- .../asr-derived_types_05-35150cd.stdout | 2 +- .../asr-derived_types_06-5ae916e.json | 2 +- .../asr-derived_types_06-5ae916e.stdout | 2 +- .../asr-derived_types_07-ccfd81f.json | 2 +- .../asr-derived_types_07-ccfd81f.stdout | 2 +- .../asr-derived_types_08-3680946.json | 2 +- .../asr-derived_types_08-3680946.stdout | 2 +- .../reference/asr-dimension_attr-1c00ad6.json | 2 +- .../asr-dimension_attr-1c00ad6.stdout | 2 +- .../asr-dimension_attr2-8fda690.json | 2 +- .../asr-dimension_attr2-8fda690.stdout | 2 +- .../asr-fixed_form_if_variations-b4dcd1e.json | 2 +- ...sr-fixed_form_if_variations-b4dcd1e.stdout | 2 +- tests/reference/asr-fn2-b585098.json | 2 +- tests/reference/asr-fn2-b585098.stdout | 2 +- tests/reference/asr-functions_04-ea50b75.json | 2 +- .../reference/asr-functions_04-ea50b75.stdout | 2 +- tests/reference/asr-functions_05-adf0d8b.json | 2 +- .../reference/asr-functions_05-adf0d8b.stdout | 2 +- tests/reference/asr-functions_06-83a7aca.json | 2 +- .../reference/asr-functions_06-83a7aca.stdout | 2 +- tests/reference/asr-functions_07-2d29eab.json | 2 +- .../reference/asr-functions_07-2d29eab.stdout | 2 +- tests/reference/asr-functions_08-23f422a.json | 2 +- .../reference/asr-functions_08-23f422a.stdout | 2 +- tests/reference/asr-functions_09-1e51ac7.json | 2 +- .../reference/asr-functions_09-1e51ac7.stdout | 2 +- tests/reference/asr-functions_10-0449324.json | 2 +- .../reference/asr-functions_10-0449324.stdout | 2 +- .../asr-generic_name_01-9f2fd25.json | 2 +- .../asr-generic_name_01-9f2fd25.stdout | 2 +- .../asr-implicit_typing2-d87e21a.json | 2 +- .../asr-implicit_typing2-d87e21a.stdout | 2 +- tests/reference/asr-intent_01-c1f267a.json | 2 +- tests/reference/asr-intent_01-c1f267a.stdout | 2 +- tests/reference/asr-interface_01-9dc98da.json | 2 +- .../reference/asr-interface_01-9dc98da.stdout | 2 +- tests/reference/asr-interface_04-9570e2b.json | 2 +- .../reference/asr-interface_04-9570e2b.stdout | 2 +- tests/reference/asr-interface_05-5639d22.json | 2 +- .../reference/asr-interface_05-5639d22.stdout | 2 +- tests/reference/asr-interface_08-1848d3c.json | 2 +- .../reference/asr-interface_08-1848d3c.stdout | 2 +- tests/reference/asr-interface_10-e9eb6ea.json | 2 +- .../reference/asr-interface_10-e9eb6ea.stdout | 2 +- .../reference/asr-intrinsics_26-f10d0e6.json | 2 +- .../asr-intrinsics_26-f10d0e6.stdout | 2 +- .../reference/asr-intrinsics_35-10733ec.json | 2 +- .../asr-intrinsics_35-10733ec.stdout | 2 +- tests/reference/asr-issue532-4bdd3b3.json | 2 +- tests/reference/asr-issue532-4bdd3b3.stdout | 2 +- .../asr-kokkos_program2-8391215.json | 2 +- .../asr-kokkos_program2-8391215.stdout | 2 +- tests/reference/asr-kwargs_02-1588831.json | 2 +- tests/reference/asr-kwargs_02-1588831.stdout | 2 +- tests/reference/asr-loop_test2-82d82ea.json | 2 +- tests/reference/asr-loop_test2-82d82ea.stdout | 2 +- .../asr-loop_unroll_small-13135c0.json | 2 +- .../asr-loop_unroll_small-13135c0.stdout | 2 +- tests/reference/asr-modules_01-3535389.json | 2 +- tests/reference/asr-modules_01-3535389.stdout | 2 +- tests/reference/asr-modules_02-74be421.json | 2 +- tests/reference/asr-modules_02-74be421.stdout | 2 +- tests/reference/asr-modules_03-54c2520.json | 2 +- tests/reference/asr-modules_03-54c2520.stdout | 2 +- tests/reference/asr-modules_04-0d478be.json | 2 +- tests/reference/asr-modules_04-0d478be.stdout | 2 +- tests/reference/asr-modules_05-f939cc6.json | 2 +- tests/reference/asr-modules_05-f939cc6.stdout | 2 +- tests/reference/asr-modules_06-609dd30.json | 2 +- tests/reference/asr-modules_06-609dd30.stdout | 2 +- tests/reference/asr-modules_06-821cc56.json | 2 +- tests/reference/asr-modules_06-821cc56.stdout | 2 +- tests/reference/asr-modules_11-dd72b29.json | 2 +- tests/reference/asr-modules_11-dd72b29.stdout | 2 +- tests/reference/asr-modules_15b-09f8335.json | 2 +- .../reference/asr-modules_15b-09f8335.stdout | 2 +- tests/reference/asr-nested_01-290187e.json | 2 +- tests/reference/asr-nested_01-290187e.stdout | 2 +- tests/reference/asr-nested_02-8302041.json | 2 +- tests/reference/asr-nested_02-8302041.stdout | 2 +- tests/reference/asr-nested_03-57ffed2.json | 2 +- tests/reference/asr-nested_03-57ffed2.stdout | 2 +- tests/reference/asr-nested_04-8423f42.json | 2 +- tests/reference/asr-nested_04-8423f42.stdout | 2 +- tests/reference/asr-nested_05-00beea9.json | 2 +- tests/reference/asr-nested_05-00beea9.stdout | 2 +- tests/reference/asr-nested_06-1d576ad.json | 2 +- tests/reference/asr-nested_06-1d576ad.stdout | 2 +- .../asr-operator_overloading_01-9ec8e71.json | 2 +- ...asr-operator_overloading_01-9ec8e71.stdout | 2 +- .../asr-operator_overloading_02-6076a0f.json | 2 +- ...asr-operator_overloading_02-6076a0f.stdout | 2 +- .../asr-operator_overloading_03-f7a6efe.json | 2 +- ...asr-operator_overloading_03-f7a6efe.stdout | 2 +- .../asr-operator_overloading_04-e28fb55.json | 2 +- ...asr-operator_overloading_04-e28fb55.stdout | 2 +- tests/reference/asr-optional1-c14719e.json | 2 +- tests/reference/asr-optional1-c14719e.stdout | 2 +- tests/reference/asr-parameter1-1a7ed3b.json | 2 +- tests/reference/asr-parameter1-1a7ed3b.stdout | 2 +- tests/reference/asr-program3-557dbe8.json | 2 +- tests/reference/asr-program3-557dbe8.stdout | 2 +- tests/reference/asr-program4-ba26fd1.json | 2 +- tests/reference/asr-program4-ba26fd1.stdout | 2 +- tests/reference/asr-program_03-fbe20e8.json | 2 +- tests/reference/asr-program_03-fbe20e8.stdout | 2 +- tests/reference/asr-recursion_02-20a7daf.json | 2 +- .../reference/asr-recursion_02-20a7daf.stdout | 2 +- tests/reference/asr-recursion_03-8300fac.json | 2 +- .../reference/asr-recursion_03-8300fac.stdout | 2 +- tests/reference/asr-scopes1-502009a.json | 2 +- tests/reference/asr-scopes1-502009a.stdout | 2 +- tests/reference/asr-string_14-861794e.json | 2 +- tests/reference/asr-string_14-861794e.stdout | 2 +- tests/reference/asr-string_17-29e01e3.json | 2 +- tests/reference/asr-string_17-29e01e3.stdout | 2 +- tests/reference/asr-string_19-d880475.json | 2 +- tests/reference/asr-string_19-d880475.stdout | 2 +- tests/reference/asr-submodule_02-9152b7b.json | 2 +- .../reference/asr-submodule_02-9152b7b.stdout | 2 +- tests/reference/asr-subroutine3-8086030.json | 2 +- .../reference/asr-subroutine3-8086030.stdout | 2 +- tests/reference/asr-subroutine3b-4883d18.json | 2 +- .../reference/asr-subroutine3b-4883d18.stdout | 2 +- tests/reference/asr-subroutine4-a425266.json | 2 +- .../reference/asr-subroutine4-a425266.stdout | 2 +- tests/reference/asr-subroutine5-e248afc.json | 2 +- .../reference/asr-subroutine5-e248afc.stdout | 2 +- tests/reference/asr-subroutine7-58db221.json | 2 +- .../reference/asr-subroutine7-58db221.stdout | 2 +- .../reference/asr-subroutines_01-d48abaa.json | 2 +- .../asr-subroutines_01-d48abaa.stdout | 2 +- .../reference/asr-subroutines_02-597f5e1.json | 2 +- .../asr-subroutines_02-597f5e1.stdout | 2 +- .../reference/asr-subroutines_04-a817e0c.json | 2 +- .../asr-subroutines_04-a817e0c.stdout | 2 +- .../reference/asr-subroutines_05-1398db3.json | 2 +- .../asr-subroutines_05-1398db3.stdout | 2 +- .../reference/asr-subroutines_06-1ab6665.json | 2 +- .../asr-subroutines_06-1ab6665.stdout | 2 +- .../reference/asr-subroutines_07-4a9f44e.json | 2 +- .../asr-subroutines_07-4a9f44e.stdout | 2 +- tests/reference/asr-template_add-177bf3c.json | 2 +- .../reference/asr-template_add-177bf3c.stdout | 2 +- tests/reference/asr-uppercase1-b7c06b1.json | 2 +- tests/reference/asr-uppercase1-b7c06b1.stdout | 2 +- .../asr_indent-subroutine1-5dfc71f.json | 2 +- .../asr_indent-subroutine1-5dfc71f.stdout | 2 + ...asr_preprocess-preprocessor12-94ccea0.json | 2 +- ...r_preprocess-preprocessor12-94ccea0.stdout | 2 +- tests/reference/cpp-types_01-dfa3d3c.json | 2 +- tests/reference/cpp-types_01-dfa3d3c.stdout | 4 +- tests/reference/cpp-types_03-dc774f0.json | 2 +- tests/reference/cpp-types_03-dc774f0.stdout | 2 +- tests/reference/cpp-types_05-06dea62.json | 2 +- tests/reference/cpp-types_05-06dea62.stdout | 12 +- tests/reference/llvm-allocate_02-7f23768.json | 2 +- .../reference/llvm-allocate_02-7f23768.stdout | 8 +- tests/reference/llvm-arrays_op_5-8426b5a.json | 2 +- .../reference/llvm-arrays_op_5-8426b5a.stdout | 160 +++++++++--------- .../reference/mod_to_asr-mod1-14-4253040.json | 2 +- .../mod_to_asr-mod1-14-4253040.stdout | 2 +- .../pass_global_stmts-expr1-213371d.json | 2 +- .../pass_global_stmts-expr1-213371d.stdout | 2 +- .../pass_global_stmts-expr2-22f4149.json | 2 +- .../pass_global_stmts-expr2-22f4149.stdout | 2 +- .../pass_global_stmts-expr3-c9c0bd7.json | 2 +- .../pass_global_stmts-expr3-c9c0bd7.stdout | 2 +- .../pass_global_stmts-expr4-eea496b.json | 2 +- .../pass_global_stmts-expr4-eea496b.stdout | 2 +- .../pass_global_stmts-expr6-a926072.json | 2 +- .../pass_global_stmts-expr6-a926072.stdout | 2 +- ...ss_global_stmts-global_scope2-64078e2.json | 2 +- ..._global_stmts-global_scope2-64078e2.stdout | 2 +- ...ss_global_stmts-global_scope3-a36d20b.json | 2 +- ..._global_stmts-global_scope3-a36d20b.stdout | 2 +- ...ss_global_stmts-global_scope4-2d4061d.json | 2 +- ..._global_stmts-global_scope4-2d4061d.stdout | 2 +- ...ss_global_stmts-global_scope5-fb3716b.json | 2 +- ..._global_stmts-global_scope5-fb3716b.stdout | 2 +- ...ss_global_stmts-global_scope6-278bd63.json | 2 +- ..._global_stmts-global_scope6-278bd63.stdout | 2 +- ...ss_global_stmts-global_scope7-d6ec187.json | 2 +- ..._global_stmts-global_scope7-d6ec187.stdout | 2 +- ...ss_global_stmts-global_scope8-95c3673.json | 2 +- ..._global_stmts-global_scope8-95c3673.stdout | 2 +- ...ss_global_stmts-global_scope9-4cbbc3e.json | 2 +- ..._global_stmts-global_scope9-4cbbc3e.stdout | 2 +- ...e_function_calls-functions_05-73805d1.json | 2 +- ...function_calls-functions_05-73805d1.stdout | 2 +- ...e_function_calls-functions_07-cc20830.json | 2 +- ...function_calls-functions_07-cc20830.stdout | 2 +- ...e_function_calls-functions_08-515120b.json | 2 +- ...function_calls-functions_08-515120b.stdout | 2 +- ...loop_unroll-loop_unroll_small-462d647.json | 2 +- ...op_unroll-loop_unroll_small-462d647.stdout | 2 +- 240 files changed, 329 insertions(+), 327 deletions(-) diff --git a/tests/reference/asr-allocate_01-f3446f6.json b/tests/reference/asr-allocate_01-f3446f6.json index a44d0d6163..8d5a3462a3 100644 --- a/tests/reference/asr-allocate_01-f3446f6.json +++ b/tests/reference/asr-allocate_01-f3446f6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_01-f3446f6.stdout", - "stdout_hash": "fced1a1ffe97552fc3d6e6e2886ba48964557815900516ec1115ca73", + "stdout_hash": "c5831d361c04d023226b86f85ad720fb533fe24e15c0e5b1ef25aea7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_01-f3446f6.stdout b/tests/reference/asr-allocate_01-f3446f6.stdout index 97cf257011..cbc6296e42 100644 --- a/tests/reference/asr-allocate_01-f3446f6.stdout +++ b/tests/reference/asr-allocate_01-f3446f6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (ImplicitDeallocate [2 c]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) IntegerToComplex (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (If (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4 [])) (RealConstant 0.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 114345.000000 0.000000 (Complex 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (ImplicitDeallocate [2 c]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) IntegerToComplex (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (If (ComplexCompare (Var 2 r) NotEq (ComplexConstructor (RealConstant 114345.000000 (Real 4 [])) (RealConstant 0.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 114345.000000 0.000000 (Complex 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_02-3c0d7c8.json b/tests/reference/asr-allocate_02-3c0d7c8.json index 1ef486ea8d..8103437268 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.json +++ b/tests/reference/asr-allocate_02-3c0d7c8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_02-3c0d7c8.stdout", - "stdout_hash": "44e573887cff00033271c0288438d6018607ba1a91f4159800b7ae5b", + "stdout_hash": "511c6596dbebbeb8b4f005c0a2ed4389bc2e8682c669bd8ee64c4ca4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_02-3c0d7c8.stdout b/tests/reference/asr-allocate_02-3c0d7c8.stdout index e1a99eacf5..08c0b6ff6e 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.stdout +++ b/tests/reference/asr-allocate_02-3c0d7c8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), isource: (Variable 2 isource Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), whole_square: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), a_2: (Variable 3 a_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ab: (Variable 3 ab Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), abc: (Variable 3 abc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b_2: (Variable 3 b_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), bc: (Variable 3 bc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c_2: (Variable 3 c_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ca: (Variable 3 ca Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), status: (Variable 3 status ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) whole_square [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (Allocate [(3 a_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 b_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 c_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (Allocate [(3 ab [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 bc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 ca [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 abc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (= (Var 3 status) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Integer 4 [(() ())]) ()) ()) (= (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 [(() ())]) ()) ()) (= (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Integer 4 [(() ())]) ()) ()) (= (Var 3 ab) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) ()) (= (Var 3 bc) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 ca) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 c) (Integer 4 []) ()) Mul (Var 3 a) (Integer 4 []) ()) ()) (= (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 status) (IntegerConstant 1 (Integer 4 [])) ()) (ImplicitDeallocate [3 a_2 3 ab 3 abc 3 b_2 3 bc 3 c_2 3 ca])] (Var 3 status) Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))])] (Var 2 ierr) () (Var 2 isource)) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 c) (IntegerConstant 3 (Integer 4 [])) ()) (Print () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) () ())] () ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), isource: (Variable 2 isource Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), whole_square: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), a_2: (Variable 3 a_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ab: (Variable 3 ab Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), abc: (Variable 3 abc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b_2: (Variable 3 b_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), bc: (Variable 3 bc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c_2: (Variable 3 c_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ca: (Variable 3 ca Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), status: (Variable 3 status ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) whole_square [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (Allocate [(3 a_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 b_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 c_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (Allocate [(3 ab [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 bc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 ca [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 abc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (= (Var 3 status) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Integer 4 [(() ())]) ()) ()) (= (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 [(() ())]) ()) ()) (= (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Integer 4 [(() ())]) ()) ()) (= (Var 3 ab) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) ()) (= (Var 3 bc) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 ca) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 c) (Integer 4 []) ()) Mul (Var 3 a) (Integer 4 []) ()) ()) (= (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 status) (IntegerConstant 1 (Integer 4 [])) ()) (ImplicitDeallocate [3 a_2 3 ab 3 abc 3 b_2 3 bc 3 c_2 3 ca])] (Var 3 status) Source Public Implementation () .false. .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))])] (Var 2 ierr) () (Var 2 isource)) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 c) (IntegerConstant 3 (Integer 4 [])) ()) (Print () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) () ())] () ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_03-8219a72.json b/tests/reference/asr-allocate_03-8219a72.json index be5c519e9e..7080edc854 100644 --- a/tests/reference/asr-allocate_03-8219a72.json +++ b/tests/reference/asr-allocate_03-8219a72.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_03-8219a72.stdout", - "stdout_hash": "19900d88f80e0e5e756f7d8eafd392863b0d349c6749de42ef78fb79", + "stdout_hash": "58daca116baf023b8cdfd06994ce4241aac28d27c6825c27b3f6b0f8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_03-8219a72.stdout b/tests/reference/asr-allocate_03-8219a72.stdout index 9dd5fcc505..01407563b2 100644 --- a/tests/reference/asr-allocate_03-8219a72.stdout +++ b/tests/reference/asr-allocate_03-8219a72.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [4 x]) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [5 c]) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (ImplicitDeallocate [2 c]) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [4 x]) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [5 c]) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (ImplicitDeallocate [2 c]) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json index af62070fe3..619233b9e0 100644 --- a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allow_implicit_interface-dfa7a9a.stdout", - "stdout_hash": "093a1a9707aba10495acc3707b9366b452c59bfde17c243b81538bd3", + "stdout_hash": "c78304a86d10f4c75cfc40b69d14a55328d9282c1a9449b3e1e17a86", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout index b92c75353f..c3c9510145 100644 --- a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), prho: (Function (SymbolTable 2 {alnorm: (Function (SymbolTable 225 {alnorm_arg_0: (Variable 225 alnorm_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), alnorm_arg_1: (Variable 225 alnorm_arg_1 Unspecified () () Default (Logical 4 []) Source Public Required .false.), alnorm_return_var_name: (Variable 225 alnorm_return_var_name ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) alnorm [(Var 225 alnorm_arg_0) (Var 225 alnorm_arg_1)] [] [] (Var 225 alnorm_return_var_name) Source Public Interface () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 8 []) Source Public Required .false.), dgetrf: (Function (SymbolTable 226 {dgetrf_arg_0: (Variable 226 dgetrf_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_1: (Variable 226 dgetrf_arg_1 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_2: (Variable 226 dgetrf_arg_2 Unspecified () () Default (Real 8 []) Source Public Required .false.)}) dgetrf [(Var 226 dgetrf_arg_0) (Var 226 dgetrf_arg_1) (Var 226 dgetrf_arg_2)] [] [] () Source Public Interface () .false. .false. .false.), exp: (ExternalSymbol 2 exp 4 exp lfortran_intrinsic_math [] exp Private), exp@dexp: (ExternalSymbol 2 exp@dexp 4 dexp lfortran_intrinsic_math [] dexp Private), one: (Variable 2 one Local () (RealConstant 1.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), prho: (Variable 2 prho ReturnVar () () Default (Real 8 []) Source Public Required .false.), six: (Variable 2 six Local () (RealConstant 6.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () (RealConstant 2.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () (RealConstant 0.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) prho [] [] [(= (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (FunctionCall 2 exp@dexp 2 exp [((RealBinOp (Var 2 y) Div (Var 2 two) (Real 8 []) ()))] (Real 8 []) () ()) (Real 8 []) ()) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4 [])))] (Real 8 []) () ()) (Real 8 []) ()) ()) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] ()) (If (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 zero) ())] []) (If (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 one) ())] []) (Return)] (Var 2 prho) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), prho: (Function (SymbolTable 2 {alnorm: (Function (SymbolTable 225 {alnorm_arg_0: (Variable 225 alnorm_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), alnorm_arg_1: (Variable 225 alnorm_arg_1 Unspecified () () Default (Logical 4 []) Source Public Required .false.), alnorm_return_var_name: (Variable 225 alnorm_return_var_name ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) alnorm [(Var 225 alnorm_arg_0) (Var 225 alnorm_arg_1)] [] [] (Var 225 alnorm_return_var_name) Source Public Interface () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 8 []) Source Public Required .false.), dgetrf: (Function (SymbolTable 226 {dgetrf_arg_0: (Variable 226 dgetrf_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_1: (Variable 226 dgetrf_arg_1 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_2: (Variable 226 dgetrf_arg_2 Unspecified () () Default (Real 8 []) Source Public Required .false.)}) dgetrf [(Var 226 dgetrf_arg_0) (Var 226 dgetrf_arg_1) (Var 226 dgetrf_arg_2)] [] [] () Source Public Interface () .false. .false. .false. .false.), exp: (ExternalSymbol 2 exp 4 exp lfortran_intrinsic_math [] exp Private), exp@dexp: (ExternalSymbol 2 exp@dexp 4 dexp lfortran_intrinsic_math [] dexp Private), one: (Variable 2 one Local () (RealConstant 1.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), prho: (Variable 2 prho ReturnVar () () Default (Real 8 []) Source Public Required .false.), six: (Variable 2 six Local () (RealConstant 6.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () (RealConstant 2.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () (RealConstant 0.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) prho [] [] [(= (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (FunctionCall 2 exp@dexp 2 exp [((RealBinOp (Var 2 y) Div (Var 2 two) (Real 8 []) ()))] (Real 8 []) () ()) (Real 8 []) ()) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4 [])))] (Real 8 []) () ()) (Real 8 []) ()) ()) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] ()) (If (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 zero) ())] []) (If (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 one) ())] []) (Return)] (Var 2 prho) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-arrays_03_func-7c8d572.json b/tests/reference/asr-arrays_03_func-7c8d572.json index 4ba8ef320f..44fd636517 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.json +++ b/tests/reference/asr-arrays_03_func-7c8d572.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_03_func-7c8d572.stdout", - "stdout_hash": "392235bdb644223c34c0c4e780c3be78c415f48328980a0e1c458b9e", + "stdout_hash": "52712b4a0722f0b4881b9cecaa0654c89e73836a0d0669dde27f6107", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_03_func-7c8d572.stdout b/tests/reference/asr-arrays_03_func-7c8d572.stdout index 3c09c5a0af..a1837d3cf9 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.stdout +++ b/tests/reference/asr-arrays_03_func-7c8d572.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_03_func: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), mysum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mysum [(Var 3 a)] [] [(= (Var 3 r) (IntegerConstant 0 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) (Integer 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_03_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 s) (FunctionCall 2 mysum () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 s)] () ()) (If (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_03_func: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), mysum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mysum [(Var 3 a)] [] [(= (Var 3 r) (IntegerConstant 0 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) (Integer 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_03_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 s) (FunctionCall 2 mysum () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 s)] () ()) (If (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.json b/tests/reference/asr-arrays_04_func-9f59ad6.json index 9002a6514b..21ac5e7cb4 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.json +++ b/tests/reference/asr-arrays_04_func-9f59ad6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_04_func-9f59ad6.stdout", - "stdout_hash": "2e8194a7e05c954985951b0d7e2abbb49ab3e386490403e2b082c098", + "stdout_hash": "0826ce9a245416260bf810b8c986c70849bc9d7a5b0f873bf7b1ce79", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.stdout b/tests/reference/asr-arrays_04_func-9f59ad6.stdout index 8b7b102961..13a48604df 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.stdout +++ b/tests/reference/asr-arrays_04_func-9f59ad6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_04_func: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), abs: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) abs [(Var 4 a)] [] [(Print () [(StringConstant "abs" (Character 1 3 () []))] () ()) (If (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) (Logical 4 []) ()) [(= (Var 4 r) (Var 4 a) ())] [(= (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) sum [(Var 3 a)] [] [(Print () [(StringConstant "sum" (Character 1 3 () []))] () ()) (= (Var 3 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) arrays_04_func [] [(= (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (= (Var 2 b) (FunctionCall 2 sum () [((Var 2 a))] (Real 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_04_func: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), abs: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) abs [(Var 4 a)] [] [(Print () [(StringConstant "abs" (Character 1 3 () []))] () ()) (If (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) (Logical 4 []) ()) [(= (Var 4 r) (Var 4 a) ())] [(= (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) sum [(Var 3 a)] [] [(Print () [(StringConstant "sum" (Character 1 3 () []))] () ()) (= (Var 3 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) arrays_04_func [] [(= (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (= (Var 2 b) (FunctionCall 2 sum () [((Var 2 a))] (Real 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_08_func-2759ced.json b/tests/reference/asr-arrays_08_func-2759ced.json index dcb23f27f3..1c392a14c6 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.json +++ b/tests/reference/asr-arrays_08_func-2759ced.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_08_func-2759ced.stdout", - "stdout_hash": "d7ea665bf0a31ee67d11cd05584d8b2901d626dc04bb891d230b7413", + "stdout_hash": "2d5aeaa77043edea9166e2c5b2e4cc787db66b4678c54665a16844ce", "stderr": "asr-arrays_08_func-2759ced.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 diff --git a/tests/reference/asr-arrays_08_func-2759ced.stdout b/tests/reference/asr-arrays_08_func-2759ced.stdout index 804edd2eab..9b1204b73f 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.stdout +++ b/tests/reference/asr-arrays_08_func-2759ced.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_08_func: (Program (SymbolTable 2 {copy_from_to: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Out () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) copy_from_to [(Var 3 a) (Var 3 b)] [] [(DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4 []) ()) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Logical 4 []) Source Public Required .false.), verify: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 a) (Var 4 b)] [] [(= (Var 4 r) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 4 a) () (Integer 4 []) ()) ()) [(= (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4 []) ()) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_08_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (SubroutineCall 2 copy_from_to () [((Var 2 x)) ((Var 2 y))] ()) (= (Var 2 r) (FunctionCall 2 verify () [((Var 2 x)) ((Var 2 y))] (Logical 4 []) () ()) ()) (Print () [(Var 2 r)] () ()) (If (LogicalNot (Var 2 r) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_08_func: (Program (SymbolTable 2 {copy_from_to: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Out () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) copy_from_to [(Var 3 a) (Var 3 b)] [] [(DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4 []) ()) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Logical 4 []) Source Public Required .false.), verify: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 a) (Var 4 b)] [] [(= (Var 4 r) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 4 a) () (Integer 4 []) ()) ()) [(= (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4 []) ()) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_08_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (SubroutineCall 2 copy_from_to () [((Var 2 x)) ((Var 2 y))] ()) (= (Var 2 r) (FunctionCall 2 verify () [((Var 2 x)) ((Var 2 y))] (Logical 4 []) () ()) ()) (Print () [(Var 2 r)] () ()) (If (LogicalNot (Var 2 r) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_elemental_15-c7c15ca.json b/tests/reference/asr-arrays_elemental_15-c7c15ca.json index 3e8a345a43..f9e88d2fa9 100644 --- a/tests/reference/asr-arrays_elemental_15-c7c15ca.json +++ b/tests/reference/asr-arrays_elemental_15-c7c15ca.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_elemental_15-c7c15ca.stdout", - "stdout_hash": "692236d55bddf7d9865128ac96a29e9fb9a93723a81f5428260d4f2e", + "stdout_hash": "d3eba375be8ef8dabb8022e0763d7128f5589a95f6c0e1d2875d9814", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout b/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout index 7d069b81fa..031d211e7c 100644 --- a/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout +++ b/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_elemental_15: (Program (SymbolTable 2 {elemental_cos: (Function (SymbolTable 7 {array2d: (Variable 7 array2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 7 cos 10 cos lfortran_intrinsic_math [] cos Private), cos2d: (Variable 7 cos2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos@dcos: (ExternalSymbol 7 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 7 j Local () () Default (Integer 4 []) Source Public Required .false.)}) elemental_cos [] [] [(DoLoop ((Var 7 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 7 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(= (ArrayItem (Var 7 array2d) [(() (Var 7 i) ()) (() (Var 7 j) ())] (Real 8 []) ()) (Cast (IntegerBinOp (Var 7 i) Add (Var 7 j) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])]) (= (Var 7 cos2d) (RealBinOp (FunctionCall 7 cos@dcos 7 cos [((Var 7 array2d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verify2d () [((Var 7 array2d)) ((Var 7 cos2d)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false.), elemental_sin: (Function (SymbolTable 6 {array1d: (Variable 6 array1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), arraynd: (Variable 6 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 6 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 6 k Local () () Default (Integer 4 []) Source Public Required .false.), sin: (ExternalSymbol 6 sin 10 sin lfortran_intrinsic_math [] sin Private), sin1d: (Variable 6 sin1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), sin@dsin: (ExternalSymbol 6 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), sinnd: (Variable 6 sinnd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.)}) elemental_sin [] [] [(DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 array1d) [(() (Var 6 i) ())] (Real 8 []) ()) (Cast (Var 6 i) IntegerToReal (Real 8 []) ()) ())]) (= (Var 6 sin1d) (FunctionCall 6 sin@dsin 6 sin [((FunctionCall 6 sin@dsin 6 sin [((Var 6 array1d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 verify1d () [((Var 6 array1d)) ((Var 6 sin1d)) ((IntegerConstant 256 (Integer 4 [])))] ()) (DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 6 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 6 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 arraynd) [(() (Var 6 i) ()) (() (Var 6 j) ()) (() (Var 6 k) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (Var 6 i) Add (Var 6 j) (Integer 4 []) ()) Add (Var 6 k) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])]) (= (Var 6 sinnd) (RealBinOp (FunctionCall 6 sin@dsin 6 sin [((Var 6 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verifynd () [((Var 6 arraynd)) ((Var 6 sinnd)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 16 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false.), elemental_trig_identity: (Function (SymbolTable 8 {abs: (ExternalSymbol 8 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 8 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), arraynd: (Variable 8 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 8 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 8 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 8 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 8 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 8 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 8 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 8 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 8 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), observed: (Variable 8 observed Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), observed1d: (Variable 8 observed1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])))]) Source Public Required .false.), sin: (ExternalSymbol 8 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 8 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private)}) elemental_trig_identity [] [] [(= (Var 8 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 8 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 [])) ()) [(DoLoop ((Var 8 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) ()) [(DoLoop ((Var 8 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 8 arraynd) [(() (Var 8 i) ()) (() (Var 8 j) ()) (() (Var 8 k) ()) (() (Var 8 l) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 8 i) Add (Var 8 j) (Integer 4 []) ()) Add (Var 8 k) (Integer 4 []) ()) Add (Var 8 l) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])])]) (= (Var 8 observed) (RealBinOp (RealBinOp (FunctionCall 8 sin@dsin 8 sin [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) Add (RealBinOp (FunctionCall 8 cos@dcos 8 cos [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) ()) (= (ArrayItem (Var 8 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 65536 (Integer 4 [])) ()) (= (Var 8 observed1d) (ArrayReshape (Var 8 observed) (Var 8 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 8 abs@dabs 8 abs [((RealBinOp (ArrayItem (Var 8 observed1d) [(() (Var 8 i) ())] (Real 8 []) ()) Sub (Cast (RealConstant 1.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 1.000000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 8 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), verify1d: (Function (SymbolTable 3 {abs: (ExternalSymbol 3 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 3 array In () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result In () () Default (Real 8 [(() ())]) Source Public Required .false.), sin: (ExternalSymbol 3 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 3 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size: (Variable 3 size In () () Default (Integer 4 []) Source Public Required .false.)}) verify1d [(Var 3 array) (Var 3 result) (Var 3 size)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 size) ()) [(If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (FunctionCall 3 sin@dsin 3 sin [((FunctionCall 3 sin@dsin 3 sin [((ArrayItem (Var 3 array) [(() (Var 3 i) ())] (Real 8 []) ()))] (Real 8 []) () ()))] (Real 8 []) () ()) Sub (ArrayItem (Var 3 result) [(() (Var 3 i) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), verify2d: (Function (SymbolTable 5 {abs: (ExternalSymbol 5 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 5 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 5 array In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), cos: (ExternalSymbol 5 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 5 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 5 eps Local () () Default (Real 8 []) 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.), result: (Variable 5 result In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), size1: (Variable 5 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 5 size2 In () () Default (Integer 4 []) Source Public Required .false.)}) verify2d [(Var 5 array) (Var 5 result) (Var 5 size1) (Var 5 size2)] [] [(= (Var 5 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (Var 5 size1) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (Var 5 size2) ()) [(If (RealCompare (FunctionCall 5 abs@dabs 5 abs [((RealBinOp (RealBinOp (FunctionCall 5 cos@dcos 5 cos [((ArrayItem (Var 5 array) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 5 result) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 5 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])] () Source Public Implementation () .false. .false. .false.), verifynd: (Function (SymbolTable 4 {abs: (ExternalSymbol 4 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 4 array In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 4 result In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), sin: (ExternalSymbol 4 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 4 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size1: (Variable 4 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 4 size2 In () () Default (Integer 4 []) Source Public Required .false.), size3: (Variable 4 size3 In () () Default (Integer 4 []) Source Public Required .false.)}) verifynd [(Var 4 array) (Var 4 result) (Var 4 size1) (Var 4 size2) (Var 4 size3)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (Var 4 size1) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (Var 4 size2) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (Var 4 size3) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (FunctionCall 4 sin@dsin 4 sin [((ArrayItem (Var 4 array) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 4 result) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.)}) arrays_elemental_15 [] [(SubroutineCall 2 elemental_sin () [] ()) (SubroutineCall 2 elemental_cos () [] ()) (SubroutineCall 2 elemental_trig_identity () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {arrays_elemental_15: (Program (SymbolTable 2 {elemental_cos: (Function (SymbolTable 7 {array2d: (Variable 7 array2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 7 cos 10 cos lfortran_intrinsic_math [] cos Private), cos2d: (Variable 7 cos2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos@dcos: (ExternalSymbol 7 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 7 j Local () () Default (Integer 4 []) Source Public Required .false.)}) elemental_cos [] [] [(DoLoop ((Var 7 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 7 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(= (ArrayItem (Var 7 array2d) [(() (Var 7 i) ()) (() (Var 7 j) ())] (Real 8 []) ()) (Cast (IntegerBinOp (Var 7 i) Add (Var 7 j) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])]) (= (Var 7 cos2d) (RealBinOp (FunctionCall 7 cos@dcos 7 cos [((Var 7 array2d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verify2d () [((Var 7 array2d)) ((Var 7 cos2d)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false. .false.), elemental_sin: (Function (SymbolTable 6 {array1d: (Variable 6 array1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), arraynd: (Variable 6 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 6 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 6 k Local () () Default (Integer 4 []) Source Public Required .false.), sin: (ExternalSymbol 6 sin 10 sin lfortran_intrinsic_math [] sin Private), sin1d: (Variable 6 sin1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), sin@dsin: (ExternalSymbol 6 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), sinnd: (Variable 6 sinnd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.)}) elemental_sin [] [] [(DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 array1d) [(() (Var 6 i) ())] (Real 8 []) ()) (Cast (Var 6 i) IntegerToReal (Real 8 []) ()) ())]) (= (Var 6 sin1d) (FunctionCall 6 sin@dsin 6 sin [((FunctionCall 6 sin@dsin 6 sin [((Var 6 array1d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 verify1d () [((Var 6 array1d)) ((Var 6 sin1d)) ((IntegerConstant 256 (Integer 4 [])))] ()) (DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 6 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 6 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 arraynd) [(() (Var 6 i) ()) (() (Var 6 j) ()) (() (Var 6 k) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (Var 6 i) Add (Var 6 j) (Integer 4 []) ()) Add (Var 6 k) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])]) (= (Var 6 sinnd) (RealBinOp (FunctionCall 6 sin@dsin 6 sin [((Var 6 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verifynd () [((Var 6 arraynd)) ((Var 6 sinnd)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 16 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false. .false.), elemental_trig_identity: (Function (SymbolTable 8 {abs: (ExternalSymbol 8 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 8 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), arraynd: (Variable 8 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 8 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 8 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 8 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 8 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 8 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 8 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 8 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 8 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), observed: (Variable 8 observed Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), observed1d: (Variable 8 observed1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])))]) Source Public Required .false.), sin: (ExternalSymbol 8 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 8 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private)}) elemental_trig_identity [] [] [(= (Var 8 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 8 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 [])) ()) [(DoLoop ((Var 8 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) ()) [(DoLoop ((Var 8 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 8 arraynd) [(() (Var 8 i) ()) (() (Var 8 j) ()) (() (Var 8 k) ()) (() (Var 8 l) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 8 i) Add (Var 8 j) (Integer 4 []) ()) Add (Var 8 k) (Integer 4 []) ()) Add (Var 8 l) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])])]) (= (Var 8 observed) (RealBinOp (RealBinOp (FunctionCall 8 sin@dsin 8 sin [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) Add (RealBinOp (FunctionCall 8 cos@dcos 8 cos [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) ()) (= (ArrayItem (Var 8 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 65536 (Integer 4 [])) ()) (= (Var 8 observed1d) (ArrayReshape (Var 8 observed) (Var 8 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 8 abs@dabs 8 abs [((RealBinOp (ArrayItem (Var 8 observed1d) [(() (Var 8 i) ())] (Real 8 []) ()) Sub (Cast (RealConstant 1.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 1.000000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 8 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), verify1d: (Function (SymbolTable 3 {abs: (ExternalSymbol 3 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 3 array In () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result In () () Default (Real 8 [(() ())]) Source Public Required .false.), sin: (ExternalSymbol 3 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 3 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size: (Variable 3 size In () () Default (Integer 4 []) Source Public Required .false.)}) verify1d [(Var 3 array) (Var 3 result) (Var 3 size)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 size) ()) [(If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (FunctionCall 3 sin@dsin 3 sin [((FunctionCall 3 sin@dsin 3 sin [((ArrayItem (Var 3 array) [(() (Var 3 i) ())] (Real 8 []) ()))] (Real 8 []) () ()))] (Real 8 []) () ()) Sub (ArrayItem (Var 3 result) [(() (Var 3 i) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), verify2d: (Function (SymbolTable 5 {abs: (ExternalSymbol 5 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 5 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 5 array In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), cos: (ExternalSymbol 5 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 5 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 5 eps Local () () Default (Real 8 []) 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.), result: (Variable 5 result In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), size1: (Variable 5 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 5 size2 In () () Default (Integer 4 []) Source Public Required .false.)}) verify2d [(Var 5 array) (Var 5 result) (Var 5 size1) (Var 5 size2)] [] [(= (Var 5 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (Var 5 size1) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (Var 5 size2) ()) [(If (RealCompare (FunctionCall 5 abs@dabs 5 abs [((RealBinOp (RealBinOp (FunctionCall 5 cos@dcos 5 cos [((ArrayItem (Var 5 array) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 5 result) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 5 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])] () Source Public Implementation () .false. .false. .false. .false.), verifynd: (Function (SymbolTable 4 {abs: (ExternalSymbol 4 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 4 array In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 4 result In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), sin: (ExternalSymbol 4 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 4 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size1: (Variable 4 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 4 size2 In () () Default (Integer 4 []) Source Public Required .false.), size3: (Variable 4 size3 In () () Default (Integer 4 []) Source Public Required .false.)}) verifynd [(Var 4 array) (Var 4 result) (Var 4 size1) (Var 4 size2) (Var 4 size3)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (Var 4 size1) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (Var 4 size2) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (Var 4 size3) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (FunctionCall 4 sin@dsin 4 sin [((ArrayItem (Var 4 array) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 4 result) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.)}) arrays_elemental_15 [] [(SubroutineCall 2 elemental_sin () [] ()) (SubroutineCall 2 elemental_cos () [] ()) (SubroutineCall 2 elemental_trig_identity () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/asr-arrays_op_4-ca3318f.json b/tests/reference/asr-arrays_op_4-ca3318f.json index 173467b7ab..1cd0bc299e 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.json +++ b/tests/reference/asr-arrays_op_4-ca3318f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_4-ca3318f.stdout", - "stdout_hash": "082370c90dfe0b3abde5a219798bd2156881a3d4cd6d3617198b8d99", + "stdout_hash": "e70a60c89ace8402ea7095499e77b8f438050ff69003ffd2e0ec2761", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_4-ca3318f.stdout b/tests/reference/asr-arrays_op_4-ca3318f.stdout index e77a5d6c9e..51de9bc0dd 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.stdout +++ b/tests/reference/asr-arrays_op_4-ca3318f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_3: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), dim1: (Variable 2 dim1 Local (IntegerConstant 10 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim2: (Variable 2 dim2 Local (IntegerConstant 100 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim3: (Variable 2 dim3 Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), modulo2: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) modulo2 [(Var 3 x)] [] [(= (Var 3 r) (IntegerCompare (IntegerBinOp (Var 3 x) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (Var 3 x) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.), verify: (Function (SymbolTable 4 {c: (Variable 4 c In () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), op_code: (Variable 4 op_code In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Local () () Default (Logical 4 []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 c) (Var 4 op_code)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 x) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (Var 4 y) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Mul (Var 4 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 j) Mul (Var 4 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 k) Mul (Var 4 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (Select (Var 4 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) And (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Or (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Eqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 3 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) NEqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false.)}) array_op_3 [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))])] () () ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim1) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim2) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim3) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ())])])]) (= (Var 2 c) (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Eqv (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 2 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 3 (Integer 4 [])))] ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {array_op_3: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), dim1: (Variable 2 dim1 Local (IntegerConstant 10 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim2: (Variable 2 dim2 Local (IntegerConstant 100 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim3: (Variable 2 dim3 Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), modulo2: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) modulo2 [(Var 3 x)] [] [(= (Var 3 r) (IntegerCompare (IntegerBinOp (Var 3 x) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (Var 3 x) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), verify: (Function (SymbolTable 4 {c: (Variable 4 c In () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), op_code: (Variable 4 op_code In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Local () () Default (Logical 4 []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 c) (Var 4 op_code)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 x) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (Var 4 y) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Mul (Var 4 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 j) Mul (Var 4 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 k) Mul (Var 4 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (Select (Var 4 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) And (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Or (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Eqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 3 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) NEqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false. .false.)}) array_op_3 [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))])] () () ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim1) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim2) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim3) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ())])])]) (= (Var 2 c) (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Eqv (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 2 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 3 (Integer 4 [])))] ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-arrays_op_5-9ff5901.json b/tests/reference/asr-arrays_op_5-9ff5901.json index 4cc69a9816..d6253c2b86 100644 --- a/tests/reference/asr-arrays_op_5-9ff5901.json +++ b/tests/reference/asr-arrays_op_5-9ff5901.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_5-9ff5901.stdout", - "stdout_hash": "5f65ef45e0ec8a2183d301b728ccfd006e5736ffe30cd7c6d253df3d", + "stdout_hash": "4cd084f87018bba33cada1f48ac732e4cc26874e22613176fc08165f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_5-9ff5901.stdout b/tests/reference/asr-arrays_op_5-9ff5901.stdout index 1683c285af..f2ba9b8e73 100644 --- a/tests/reference/asr-arrays_op_5-9ff5901.stdout +++ b/tests/reference/asr-arrays_op_5-9ff5901.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 3 {c: (Variable 3 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), left: (Variable 3 left Local () () Default (Real 4 []) Source Public Required .false.), op_code: (Variable 3 op_code In () () Default (Integer 4 []) Source Public Required .false.), right: (Variable 3 right Local () () Default (Real 4 []) Source Public Required .false.)}) check [(Var 3 c) (Var 3 op_code)] [] [(DoLoop ((Var 3 i) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(Select (Var 3 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (Var 3 left) RealToComplex (Complex 4 []) ()) Add (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (RealUnaryMinus (Var 3 left) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) Sub (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Mul (Var 2 k) (Integer 4 []) ()) ())])])]) (= (Var 2 c) (ComplexBinOp (Cast (Var 2 a) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (Var 2 b) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (ComplexBinOp (Cast (IntegerUnaryMinus (Var 2 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (IntegerUnaryMinus (Var 2 b) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 3 {c: (Variable 3 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), left: (Variable 3 left Local () () Default (Real 4 []) Source Public Required .false.), op_code: (Variable 3 op_code In () () Default (Integer 4 []) Source Public Required .false.), right: (Variable 3 right Local () () Default (Real 4 []) Source Public Required .false.)}) check [(Var 3 c) (Var 3 op_code)] [] [(DoLoop ((Var 3 i) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(Select (Var 3 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (Var 3 left) RealToComplex (Complex 4 []) ()) Add (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (RealUnaryMinus (Var 3 left) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) Sub (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Mul (Var 2 k) (Integer 4 []) ()) ())])])]) (= (Var 2 c) (ComplexBinOp (Cast (Var 2 a) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (Var 2 b) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (ComplexBinOp (Cast (IntegerUnaryMinus (Var 2 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (IntegerUnaryMinus (Var 2 b) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ())])}) []) diff --git a/tests/reference/asr-arrays_op_6-030b24e.json b/tests/reference/asr-arrays_op_6-030b24e.json index 2d71cfdcbd..078c75792d 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.json +++ b/tests/reference/asr-arrays_op_6-030b24e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_6-030b24e.stdout", - "stdout_hash": "81225797b0a03a3f8fee30722b5e78cdbff5a1b2bd53e87cd2ced35e", + "stdout_hash": "81e724c10b082d72549e13d1c450b2b9df4816f80fdc35307ea98f90", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_6-030b24e.stdout b/tests/reference/asr-arrays_op_6-030b24e.stdout index 7b4f1f82a1..3c8860d70a 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.stdout +++ b/tests/reference/asr-arrays_op_6-030b24e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), asquare: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), d: (Variable 3 d ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.)}) asquare [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 [(() ()) (() ()) (() ())]) ()) Add (Var 3 c) (Real 4 [(() ()) (() ()) (() ())]) ()) ())] (Var 3 d) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.)}) check [(Var 4 c)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()) Pow (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.), d: (Variable 2 d Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 i) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ())])])]) (= (Var 2 d) (FunctionCall 2 asquare () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 check () [((Var 2 d))] ())])}) []) +(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), asquare: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), d: (Variable 3 d ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.)}) asquare [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 [(() ()) (() ()) (() ())]) ()) Add (Var 3 c) (Real 4 [(() ()) (() ()) (() ())]) ()) ())] (Var 3 d) Source Public Implementation () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.)}) check [(Var 4 c)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4 []) ()) NotEq (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()) Pow (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), d: (Variable 2 d Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 i) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 k) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 j) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 2 i) Mul (Var 2 k) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ())])])]) (= (Var 2 d) (FunctionCall 2 asquare () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 check () [((Var 2 d))] ())])}) []) diff --git a/tests/reference/asr-arrays_op_7-52a6b5a.json b/tests/reference/asr-arrays_op_7-52a6b5a.json index 34b7075f7c..f26952d607 100644 --- a/tests/reference/asr-arrays_op_7-52a6b5a.json +++ b/tests/reference/asr-arrays_op_7-52a6b5a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_7-52a6b5a.stdout", - "stdout_hash": "367247a16279398a496bb3c5ad501db97bcb94259f6b98143de48377", + "stdout_hash": "3db9b199e9d3c2957c11ceda5a5c3bdd70b789cfb015e985ece03d73", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_7-52a6b5a.stdout b/tests/reference/asr-arrays_op_7-52a6b5a.stdout index 7975dcb414..d7e5ac3a71 100644 --- a/tests/reference/asr-arrays_op_7-52a6b5a.stdout +++ b/tests/reference/asr-arrays_op_7-52a6b5a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_op_7: (Program (SymbolTable 2 {f: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 [(() ())]) Source Public Required .false.), y: (Variable 3 y Out () () Default (Integer 4 [(() ())]) Source Public Required .false.)}) f [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) arrays_op_7 [] [(= (Var 2 x) (IntegerConstant 3 (Integer 4 [])) ()) (SubroutineCall 2 f () [((Var 2 x)) ((Var 2 y))] ()) (Print () [(Var 2 y)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {arrays_op_7: (Program (SymbolTable 2 {f: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 [(() ())]) Source Public Required .false.), y: (Variable 3 y Out () () Default (Integer 4 [(() ())]) Source Public Required .false.)}) f [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) arrays_op_7 [] [(= (Var 2 x) (IntegerConstant 3 (Integer 4 [])) ()) (SubroutineCall 2 f () [((Var 2 x)) ((Var 2 y))] ()) (Print () [(Var 2 y)] () ())])}) []) diff --git a/tests/reference/asr-arrays_reshape_14-913f34e.json b/tests/reference/asr-arrays_reshape_14-913f34e.json index b3a7ee59b2..f8d909748e 100644 --- a/tests/reference/asr-arrays_reshape_14-913f34e.json +++ b/tests/reference/asr-arrays_reshape_14-913f34e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_reshape_14-913f34e.stdout", - "stdout_hash": "9f1385e5c401fbc4429fccc32b8262b2fdb375cdf0cc1b51989ad542", + "stdout_hash": "9592df6a957ba3efc8785e0dd6a2012f08386c3c5e388a2535ce75a9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_reshape_14-913f34e.stdout b/tests/reference/asr-arrays_reshape_14-913f34e.stdout index 7119235d98..7e0f46b5de 100644 --- a/tests/reference/asr-arrays_reshape_14-913f34e.stdout +++ b/tests/reference/asr-arrays_reshape_14-913f34e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_reshape_14: (Program (SymbolTable 2 {test_1d_to_nd: (Function (SymbolTable 4 {a: (Variable 4 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), abs: (ExternalSymbol 4 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 4 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 4 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 4 d Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 4 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 4 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 4 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) test_1d_to_nd [(Var 4 d)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())]) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 a) (ArrayReshape (Var 4 b) (Var 4 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 c) (ArrayReshape (Var 4 d) (Var 4 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.), test_nd_to_1d: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), abs: (ExternalSymbol 3 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 3 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 3 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 3 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 3 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.)}) test_nd_to_1d [(Var 3 a)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (= (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 256 (Integer 4 [])) ()) (= (Var 3 b) (ArrayReshape (Var 3 a) (Var 3 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8 []) ()) Sub (Cast (Var 3 i) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 j) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])])]) (= (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 4096 (Integer 4 [])) ()) (= (Var 3 d) (ArrayReshape (Var 3 c) (Var 3 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8 []) ()) Sub (Cast (Var 3 i) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 j) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 k) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), test_reshape_with_argument: (Function (SymbolTable 5 {a: (Variable 5 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 5 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (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.), k: (Variable 5 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 5 l Local () () Default (Integer 4 []) Source Public Required .false.)}) test_reshape_with_argument [] [] [(DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])]) (SubroutineCall 2 test_nd_to_1d () [((Var 5 a))] ()) (DoLoop ((Var 5 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4 []) ()) Add (Var 5 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())]) (SubroutineCall 2 test_1d_to_nd () [((Var 5 d))] ())] () Source Public Implementation () .false. .false. .false.)}) array_reshape_14 [] [(SubroutineCall 2 test_reshape_with_argument () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {array_reshape_14: (Program (SymbolTable 2 {test_1d_to_nd: (Function (SymbolTable 4 {a: (Variable 4 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), abs: (ExternalSymbol 4 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 4 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 4 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 4 d Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 4 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 4 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 4 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) test_1d_to_nd [(Var 4 d)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())]) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 a) (ArrayReshape (Var 4 b) (Var 4 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 c) (ArrayReshape (Var 4 d) (Var 4 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), test_nd_to_1d: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), abs: (ExternalSymbol 3 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 3 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 3 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 3 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 3 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.)}) test_nd_to_1d [(Var 3 a)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (= (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 256 (Integer 4 [])) ()) (= (Var 3 b) (ArrayReshape (Var 3 a) (Var 3 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8 []) ()) Sub (Cast (Var 3 i) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 j) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])])]) (= (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 4096 (Integer 4 [])) ()) (= (Var 3 d) (ArrayReshape (Var 3 c) (Var 3 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8 []) ()) Sub (Cast (Var 3 i) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 j) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (Var 3 k) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), test_reshape_with_argument: (Function (SymbolTable 5 {a: (Variable 5 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 5 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (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.), k: (Variable 5 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 5 l Local () () Default (Integer 4 []) Source Public Required .false.)}) test_reshape_with_argument [] [] [(DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])]) (SubroutineCall 2 test_nd_to_1d () [((Var 5 a))] ()) (DoLoop ((Var 5 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Add (Var 5 j) (Integer 4 []) ()) Add (Var 5 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())]) (SubroutineCall 2 test_1d_to_nd () [((Var 5 d))] ())] () Source Public Implementation () .false. .false. .false. .false.)}) array_reshape_14 [] [(SubroutineCall 2 test_reshape_with_argument () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/asr-block_03-6c8fdd8.json b/tests/reference/asr-block_03-6c8fdd8.json index 3087eeda78..c74e75e04a 100644 --- a/tests/reference/asr-block_03-6c8fdd8.json +++ b/tests/reference/asr-block_03-6c8fdd8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-block_03-6c8fdd8.stdout", - "stdout_hash": "1ba5a1c71ce15e35bbb75e719051f3e91f4a02e166709da032ec8af4", + "stdout_hash": "8c848afecdd11c0da4af74caa61b6e44d74269c6cac4f1c6ea4ecf88", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-block_03-6c8fdd8.stdout b/tests/reference/asr-block_03-6c8fdd8.stdout index c81dac7291..9edb81ee93 100644 --- a/tests/reference/asr-block_03-6c8fdd8.stdout +++ b/tests/reference/asr-block_03-6c8fdd8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {block_02: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), block: (Block (SymbolTable 4 {b: (Variable 4 b Local () () Default (Integer 4 []) Source Public Required .false.)}) block [(= (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4 [])) (Logical 4 []) ()) [(GoTo 1)] []) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ()) (SubroutineCall 1 square () [((Var 4 b))] ())])}) block_02 [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) ()) (GoToTarget 1) (BlockCall -1 2 block)]), square: (Function (SymbolTable 3 {b: (Variable 3 b Unspecified () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false.)}) square [(Var 3 b)] [] [(= (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 []) ()) ()) (If (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 3 result)] () ())] () Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {block_02: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), block: (Block (SymbolTable 4 {b: (Variable 4 b Local () () Default (Integer 4 []) Source Public Required .false.)}) block [(= (Var 2 a) (IntegerBinOp (Var 2 a) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 a) Eq (IntegerConstant 15 (Integer 4 [])) (Logical 4 []) ()) [(GoTo 1)] []) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ()) (SubroutineCall 1 square () [((Var 4 b))] ())])}) block_02 [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) ()) (GoToTarget 1) (BlockCall -1 2 block)]), square: (Function (SymbolTable 3 {b: (Variable 3 b Unspecified () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result Local () () Default (Integer 4 []) Source Public Required .false.)}) square [(Var 3 b)] [] [(= (Var 3 result) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 []) ()) ()) (If (IntegerCompare (Var 3 result) NotEq (IntegerConstant 100 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 3 result)] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-callback_01-21b53de.json b/tests/reference/asr-callback_01-21b53de.json index bfdc215425..e8a0888bad 100644 --- a/tests/reference/asr-callback_01-21b53de.json +++ b/tests/reference/asr-callback_01-21b53de.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_01-21b53de.stdout", - "stdout_hash": "b3c5de75d0cb36f4008a078733458828102d57cf9a4aabaeb89eb37e", + "stdout_hash": "ba5634cbfe06e5efaf1d4997490be7eb24823b9b2eb6a9bdea73d451", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_01-21b53de.stdout b/tests/reference/asr-callback_01-21b53de.stdout index 98e1c5d691..5ec5c05ac5 100644 --- a/tests/reference/asr-callback_01-21b53de.stdout +++ b/tests/reference/asr-callback_01-21b53de.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {callback_01: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), cb: (Variable 3 cb ReturnVar () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [] (Var 4 f) Source Public Interface () .false. .false. .false.)}) cb [(Var 3 f) (Var 3 a) (Var 3 b)] [] [(= (Var 3 cb) (RealBinOp (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 a))] (Real 4 []) () ()) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 b))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 3 cb) Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x)] [] [(= (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] (Var 6 f) Source Public Implementation () .false. .false. .false.)}) foo [(Var 5 c) (Var 5 d)] [] [(Print () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) callback_01 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_01 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_01 [] foo Public)}) main [callback_01] [(SubroutineCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {callback_01: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), cb: (Variable 3 cb ReturnVar () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [] (Var 4 f) Source Public Interface () .false. .false. .false. .false.)}) cb [(Var 3 f) (Var 3 a) (Var 3 b)] [] [(= (Var 3 cb) (RealBinOp (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 a))] (Real 4 []) () ()) (Real 4 []) ()) Add (FunctionCall 3 f () [((Var 3 b))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 3 cb) Source Public Implementation () .false. .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x)] [] [(= (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] (Var 6 f) Source Public Implementation () .false. .false. .false. .false.)}) foo [(Var 5 c) (Var 5 d)] [] [(Print () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) callback_01 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_01 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_01 [] foo Public)}) main [callback_01] [(SubroutineCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) diff --git a/tests/reference/asr-callback_02-aec5457.json b/tests/reference/asr-callback_02-aec5457.json index 5931a25ee2..62ce949d05 100644 --- a/tests/reference/asr-callback_02-aec5457.json +++ b/tests/reference/asr-callback_02-aec5457.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_02-aec5457.stdout", - "stdout_hash": "728d29084c9338b0f927f92c075bbf9cd0e687446cedb3a01f9affa0", + "stdout_hash": "79725a4823382938793d6e38f2951aef83681cef0665fd10b04901be", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_02-aec5457.stdout b/tests/reference/asr-callback_02-aec5457.stdout index 6fbb959833..41d64b19c4 100644 --- a/tests/reference/asr-callback_02-aec5457.stdout +++ b/tests/reference/asr-callback_02-aec5457.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {callback_02: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {res: (Variable 4 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x) (Var 4 res)] [] [] () Source Public Interface () .false. .false. .false.), res: (Variable 3 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) cb [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (= (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Mul (Var 3 res) (Real 4 []) ()) ()) (Print () [(Var 3 res)] () ())] () Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {res: (Variable 6 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x) (Var 6 res)] [] [(= (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), foo: (Variable 5 foo ReturnVar () () Default (Real 4 []) Source Public Required .false.), res: (Variable 5 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 5 c) (Var 5 d) (Var 5 res)] [] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] ()) (= (Var 5 foo) (Var 5 res) ())] (Var 5 foo) Source Public Implementation () .false. .false. .false.)}) callback_02 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_02 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_02 [] foo Public), res: (Variable 7 res Local (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) main [callback_02] [(= (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 []))) ((Var 7 res))] (Real 4 []) () ()) ())])}) []) +(TranslationUnit (SymbolTable 1 {callback_02: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {res: (Variable 4 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x) (Var 4 res)] [] [] () Source Public Interface () .false. .false. .false. .false.), res: (Variable 3 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) cb [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (= (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Mul (Var 3 res) (Real 4 []) ()) ()) (Print () [(Var 3 res)] () ())] () Source Public Implementation () .false. .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {res: (Variable 6 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x) (Var 6 res)] [] [(= (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), foo: (Variable 5 foo ReturnVar () () Default (Real 4 []) Source Public Required .false.), res: (Variable 5 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 5 c) (Var 5 d) (Var 5 res)] [] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] ()) (= (Var 5 foo) (Var 5 res) ())] (Var 5 foo) Source Public Implementation () .false. .false. .false. .false.)}) callback_02 [] .false. .false.), main: (Program (SymbolTable 7 {cb: (ExternalSymbol 7 cb 2 cb callback_02 [] cb Public), foo: (ExternalSymbol 7 foo 2 foo callback_02 [] foo Public), res: (Variable 7 res Local (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) main [callback_02] [(= (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 []))) ((Var 7 res))] (Real 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-class_01-704dee8.json b/tests/reference/asr-class_01-704dee8.json index 3ecdfab9d9..20b95b5c2e 100644 --- a/tests/reference/asr-class_01-704dee8.json +++ b/tests/reference/asr-class_01-704dee8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_01-704dee8.stdout", - "stdout_hash": "82023f8a7f1ca448f27dc3d94db41107cb5c80b55e2106f354b96d48", + "stdout_hash": "1460112d2e6e699fa0e94e8a44d2d90a2e8042d226fddce0f151ce8f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_01-704dee8.stdout b/tests/reference/asr-class_01-704dee8.stdout index 2246bf1fb3..81d7bca418 100644 --- a/tests/reference/asr-class_01-704dee8.stdout +++ b/tests/reference/asr-class_01-704dee8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 6 circle []) Source Private Required .false.), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Private)}) circle_test [class_circle1] [(= (Var 6 c) (DerivedTypeConstructor 6 circle [(RealConstant 1.500000 (Real 4 []))] (Derived 6 circle []) ()) ()) (SubroutineCall 3 print () [] (Var 6 c)) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (SubroutineCall 3 print () [] (Var 6 c))]), class_circle1: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {area: (ClassProcedure 3 area circle_area 2 circle_area Source), print: (ClassProcedure 3 print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {area: (Variable 4 area ReturnVar () () Default (Real 4 []) Source Private Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle1 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 6 circle []) Source Private Required .false.), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Private)}) circle_test [class_circle1] [(= (Var 6 c) (DerivedTypeConstructor 6 circle [(RealConstant 1.500000 (Real 4 []))] (Derived 6 circle []) ()) ()) (SubroutineCall 3 print () [] (Var 6 c)) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (SubroutineCall 3 print () [] (Var 6 c))]), class_circle1: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {area: (ClassProcedure 3 area circle_area 2 circle_area Source), print: (ClassProcedure 3 print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {area: (Variable 4 area ReturnVar () () Default (Real 4 []) Source Private Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 area) Source Private Implementation () .false. .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle1 [] .false. .false.)}) []) diff --git a/tests/reference/asr-class_02-b56b852.json b/tests/reference/asr-class_02-b56b852.json index d1b08583ca..6b9bb21743 100644 --- a/tests/reference/asr-class_02-b56b852.json +++ b/tests/reference/asr-class_02-b56b852.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_02-b56b852.stdout", - "stdout_hash": "200e34ddceeb095c18df762b8821004b24578f8f20da5a5d25192bf3", + "stdout_hash": "97d7dd93c002a92a08ce207357892f8ee839accc806cbcd52c7651fb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_02-b56b852.stdout b/tests/reference/asr-class_02-b56b852.stdout index 15960012c5..7614960435 100644 --- a/tests/reference/asr-class_02-b56b852.stdout +++ b/tests/reference/asr-class_02-b56b852.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 7 {main: (ExternalSymbol 7 main 2 main class_circle2 [] main Private)}) circle_test [class_circle2] [(SubroutineCall 7 main () [] ())]), class_circle2: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {circle_area: (ClassProcedure 3 circle_area circle_area 2 circle_area Source), circle_print: (ClassProcedure 3 circle_print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {circle_area: (Variable 4 circle_area ReturnVar () () Default (Real 4 []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 circle_area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 circle_area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), main: (Function (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 2 circle []) Source Private Required .false.)}) main [] [] [(= (Var 6 c) (DerivedTypeConstructor 2 circle [(RealConstant 1.000000 (Real 4 []))] (Derived 2 circle []) ()) ()) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ()) (SubroutineCall 3 circle_print () [] (Var 6 c))] () Source Public Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle2 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 7 {main: (ExternalSymbol 7 main 2 main class_circle2 [] main Private)}) circle_test [class_circle2] [(SubroutineCall 7 main () [] ())]), class_circle2: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {circle_area: (ClassProcedure 3 circle_area circle_area 2 circle_area Source), circle_print: (ClassProcedure 3 circle_print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {circle_area: (Variable 4 circle_area ReturnVar () () Default (Real 4 []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 circle_area) Source Private Implementation () .false. .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 circle_area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false. .false.), main: (Function (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 2 circle []) Source Private Required .false.)}) main [] [] [(= (Var 6 c) (DerivedTypeConstructor 2 circle [(RealConstant 1.000000 (Real 4 []))] (Derived 2 circle []) ()) ()) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ()) (SubroutineCall 3 circle_print () [] (Var 6 c))] () Source Public Implementation () .false. .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle2 [] .false. .false.)}) []) diff --git a/tests/reference/asr-derived_types_01-960dafe.json b/tests/reference/asr-derived_types_01-960dafe.json index f173740106..0f24b91dbb 100644 --- a/tests/reference/asr-derived_types_01-960dafe.json +++ b/tests/reference/asr-derived_types_01-960dafe.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_01-960dafe.stdout", - "stdout_hash": "397d51b937f61079c60c15f93eeb84ad5f55170634cb2c58702bb6c1", + "stdout_hash": "eaf99be33634014cb35324e7122e21f3bfd23cd01a765664426a470d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_01-960dafe.stdout b/tests/reference/asr-derived_types_01-960dafe.stdout index 13e7622c03..05fd080c23 100644 --- a/tests/reference/asr-derived_types_01-960dafe.stdout +++ b/tests/reference/asr-derived_types_01-960dafe.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {set: (Function (SymbolTable 5 {a: (Variable 5 a Out () () Default (Derived 2 x []) Source Public Required .false.)}) set [(Var 5 a)] [] [(= (DerivedRef (Var 5 a) 3 i (Integer 4 []) ()) (IntegerConstant 1 (Integer 4 [])) ()) (= (DerivedRef (Var 5 a) 3 r (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.)}) x [r i] Source Public ()), y: (DerivedType (SymbolTable 4 {c: (Variable 4 c Local () () Default (Complex 4 []) Source Public Required .false.), d: (Variable 4 d Local () () Default (Derived 2 x []) Source Public Required .false.)}) y [c d] Source Public ())}) a_01 [] .false. .false.), a_02: (Module (SymbolTable 6 {y: (ExternalSymbol 6 y 2 y a_01 [] y Public), z: (DerivedType (SymbolTable 7 {k: (Variable 7 k Local () () Default (Complex 4 []) Source Public Required .false.), l: (Variable 7 l Local () () Default (Derived 6 y []) Source Public Required .false.)}) z [k l] Source Public ())}) a_02 [a_01] .false. .false.), derived_types_01: (Program (SymbolTable 8 {1_a_01_y: (ExternalSymbol 8 1_a_01_y 2 y a_01 [] y Public), b: (Variable 8 b Local () () Default (Derived 8 x []) Source Public Required .false.), c: (Variable 8 c Local () () Default (Derived 8 z []) Source Public Required .false.), set: (ExternalSymbol 8 set 2 set a_01 [] set Public), x: (ExternalSymbol 8 x 2 x a_01 [] x Public), z: (ExternalSymbol 8 z 6 z a_02 [] z Public)}) derived_types_01 [a_02 a_01] [(= (DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (IntegerConstant 5 (Integer 4 [])) ()) (= (DerivedRef (Var 8 b) 3 r (Real 4 []) ()) (RealConstant 3.500000 (Real 4 [])) ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (SubroutineCall 8 set () [((Var 8 b))] ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (= (DerivedRef (Var 8 c) 7 k (Complex 4 []) ()) (ComplexConstructor (RealConstant 2.000000 (Real 4 [])) (RealConstant 2.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 2.000000 2.000000 (Complex 4 []))) ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ()) (SubroutineCall 8 set () [((DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()))] ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {set: (Function (SymbolTable 5 {a: (Variable 5 a Out () () Default (Derived 2 x []) Source Public Required .false.)}) set [(Var 5 a)] [] [(= (DerivedRef (Var 5 a) 3 i (Integer 4 []) ()) (IntegerConstant 1 (Integer 4 [])) ()) (= (DerivedRef (Var 5 a) 3 r (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.)}) x [r i] Source Public ()), y: (DerivedType (SymbolTable 4 {c: (Variable 4 c Local () () Default (Complex 4 []) Source Public Required .false.), d: (Variable 4 d Local () () Default (Derived 2 x []) Source Public Required .false.)}) y [c d] Source Public ())}) a_01 [] .false. .false.), a_02: (Module (SymbolTable 6 {y: (ExternalSymbol 6 y 2 y a_01 [] y Public), z: (DerivedType (SymbolTable 7 {k: (Variable 7 k Local () () Default (Complex 4 []) Source Public Required .false.), l: (Variable 7 l Local () () Default (Derived 6 y []) Source Public Required .false.)}) z [k l] Source Public ())}) a_02 [a_01] .false. .false.), derived_types_01: (Program (SymbolTable 8 {1_a_01_y: (ExternalSymbol 8 1_a_01_y 2 y a_01 [] y Public), b: (Variable 8 b Local () () Default (Derived 8 x []) Source Public Required .false.), c: (Variable 8 c Local () () Default (Derived 8 z []) Source Public Required .false.), set: (ExternalSymbol 8 set 2 set a_01 [] set Public), x: (ExternalSymbol 8 x 2 x a_01 [] x Public), z: (ExternalSymbol 8 z 6 z a_02 [] z Public)}) derived_types_01 [a_02 a_01] [(= (DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (IntegerConstant 5 (Integer 4 [])) ()) (= (DerivedRef (Var 8 b) 3 r (Real 4 []) ()) (RealConstant 3.500000 (Real 4 [])) ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (SubroutineCall 8 set () [((Var 8 b))] ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (= (DerivedRef (Var 8 c) 7 k (Complex 4 []) ()) (ComplexConstructor (RealConstant 2.000000 (Real 4 [])) (RealConstant 2.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 2.000000 2.000000 (Complex 4 []))) ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ()) (SubroutineCall 8 set () [((DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()))] ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ())])}) []) diff --git a/tests/reference/asr-derived_types_03-b1d32aa.json b/tests/reference/asr-derived_types_03-b1d32aa.json index bf69385af6..9aa43fc81e 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.json +++ b/tests/reference/asr-derived_types_03-b1d32aa.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_03-b1d32aa.stdout", - "stdout_hash": "0539d13f3206905780ee4674b9e39ac590dc1045dd5c2a59a5ff7dd4", + "stdout_hash": "c2730fe9bb5c1ca46a61a1b706d94f7c557709d7495129096a2cd80e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_03-b1d32aa.stdout b/tests/reference/asr-derived_types_03-b1d32aa.stdout index e47c030f0b..86415dfdd3 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.stdout +++ b/tests/reference/asr-derived_types_03-b1d32aa.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_03: (Program (SymbolTable 2 {b: (Variable 2 b Local () () Default (Derived 2 x []) Source Public Required .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) x [i] Source Public ()), y: (Function (SymbolTable 4 {a: (DerivedType (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 4 b Local () () Default (Derived 4 a []) Source Public Required .false.)}) y [] [] [] () Source Public Implementation () .false. .false. .false.), z: (Function (SymbolTable 6 {a: (DerivedType (SymbolTable 7 {i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 6 b Local () () Default (Derived 6 a []) Source Public Required .false.), z: (Variable 6 z ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) z [] [] [(= (Var 6 z) (IntegerConstant 5 (Integer 4 [])) ())] (Var 6 z) Source Public Implementation () .false. .false. .false.)}) derived_types_03 [] [])}) []) +(TranslationUnit (SymbolTable 1 {derived_types_03: (Program (SymbolTable 2 {b: (Variable 2 b Local () () Default (Derived 2 x []) Source Public Required .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) x [i] Source Public ()), y: (Function (SymbolTable 4 {a: (DerivedType (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 4 b Local () () Default (Derived 4 a []) Source Public Required .false.)}) y [] [] [] () Source Public Implementation () .false. .false. .false. .false.), z: (Function (SymbolTable 6 {a: (DerivedType (SymbolTable 7 {i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 6 b Local () () Default (Derived 6 a []) Source Public Required .false.), z: (Variable 6 z ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) z [] [] [(= (Var 6 z) (IntegerConstant 5 (Integer 4 [])) ())] (Var 6 z) Source Public Implementation () .false. .false. .false. .false.)}) derived_types_03 [] [])}) []) diff --git a/tests/reference/asr-derived_types_04-b960162.json b/tests/reference/asr-derived_types_04-b960162.json index 81fa75fa57..39afa16a57 100644 --- a/tests/reference/asr-derived_types_04-b960162.json +++ b/tests/reference/asr-derived_types_04-b960162.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-b960162.stdout", - "stdout_hash": "690a36743a9126245f30898fa95e688ab958fc30a89bc429108e63a1", + "stdout_hash": "dbc148810a39130916bafc22cbe8d2d2285557e3fe6eef119e84beae", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_04-b960162.stdout b/tests/reference/asr-derived_types_04-b960162.stdout index a308e6c90a..484ee861f5 100644 --- a/tests/reference/asr-derived_types_04-b960162.stdout +++ b/tests/reference/asr-derived_types_04-b960162.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {bitset: (Module (SymbolTable 2 {all_abstract: (Function (SymbolTable 4 {all: (Variable 4 all ReturnVar () () Default (Logical 4 []) Source Private Required .false.), self: (Variable 4 self In () () Default (Class 2 bitset_type []) Source Private Required .false.)}) all_abstract [(Var 4 self)] [] [] (Var 4 all) Source Private Interface () .true. .false. .false.), bitset_type: (DerivedType (SymbolTable 3 {all: (ClassProcedure 3 all all_abstract 2 all_abstract Source), num_bits: (Variable 3 num_bits Local () () Default (Integer 8 []) Source Private Required .false.)}) bitset_type [num_bits] Source Private ())}) bitset [] .false. .false.), debug: (Program (SymbolTable 5 {}) debug [] [])}) []) +(TranslationUnit (SymbolTable 1 {bitset: (Module (SymbolTable 2 {all_abstract: (Function (SymbolTable 4 {all: (Variable 4 all ReturnVar () () Default (Logical 4 []) Source Private Required .false.), self: (Variable 4 self In () () Default (Class 2 bitset_type []) Source Private Required .false.)}) all_abstract [(Var 4 self)] [] [] (Var 4 all) Source Private Interface () .true. .false. .false. .false.), bitset_type: (DerivedType (SymbolTable 3 {all: (ClassProcedure 3 all all_abstract 2 all_abstract Source), num_bits: (Variable 3 num_bits Local () () Default (Integer 8 []) Source Private Required .false.)}) bitset_type [num_bits] Source Private ())}) bitset [] .false. .false.), debug: (Program (SymbolTable 5 {}) debug [] [])}) []) diff --git a/tests/reference/asr-derived_types_05-35150cd.json b/tests/reference/asr-derived_types_05-35150cd.json index 0be393ca72..4eb600337f 100644 --- a/tests/reference/asr-derived_types_05-35150cd.json +++ b/tests/reference/asr-derived_types_05-35150cd.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_05-35150cd.stdout", - "stdout_hash": "28d73162cdc59fdefe0c196172ae9ba8afe49e61b3b44a43b3bdc8b2", + "stdout_hash": "e600bc816870d49211803526d1d807d3a8317b7605b91c68268f2595", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_05-35150cd.stdout b/tests/reference/asr-derived_types_05-35150cd.stdout index 31e7d41920..6a8ce18d60 100644 --- a/tests/reference/asr-derived_types_05-35150cd.stdout +++ b/tests/reference/asr-derived_types_05-35150cd.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_type_05: (Program (SymbolTable 13 {}) derived_type_05 [] []), stdlib_string_type: (Module (SymbolTable 2 {new_string: (Function (SymbolTable 4 {new: (Variable 4 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), string: (Variable 4 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 4 string)] [] [] (Var 4 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 5 {new: (Variable 5 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 5 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 5 val)] [] [] (Var 5 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 6 {new: (Variable 6 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 6 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 6 val)] [] [] (Var 6 new) Source Public Interface () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 7 {new: (Variable 7 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 7 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 7 val)] [] [] (Var 7 new) Source Public Interface () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ()), ~string_type: (GenericProcedure 2 ~string_type [2 new_string 2 new_string_from_integer_int32 2 new_string_from_integer_int64 2 new_string_from_logical_lk] Public)}) stdlib_string_type [] .false. .false.), stdlib_string_type_constructor: (Module (SymbolTable 8 {new_string: (Function (SymbolTable 9 {new: (Variable 9 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), string: (Variable 9 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 9 string)] [] [] (Var 9 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 10 {new: (Variable 10 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 10 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 10 val)] [] [] (Var 10 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 11 {new: (Variable 11 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 11 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 11 val)] [] [] (Var 11 new) Source Public Implementation () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 12 {new: (Variable 12 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 12 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 12 val)] [] [] (Var 12 new) Source Public Implementation () .true. .false. .false.), string_type: (ExternalSymbol 8 string_type 2 string_type stdlib_string_type [] string_type Public), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type stdlib_string_type [] ~string_type Public)}) stdlib_string_type_constructor [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_type_05: (Program (SymbolTable 13 {}) derived_type_05 [] []), stdlib_string_type: (Module (SymbolTable 2 {new_string: (Function (SymbolTable 4 {new: (Variable 4 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), string: (Variable 4 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 4 string)] [] [] (Var 4 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 5 {new: (Variable 5 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 5 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 5 val)] [] [] (Var 5 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 6 {new: (Variable 6 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 6 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 6 val)] [] [] (Var 6 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 7 {new: (Variable 7 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 7 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 7 val)] [] [] (Var 7 new) Source Public Interface () .true. .false. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ()), ~string_type: (GenericProcedure 2 ~string_type [2 new_string 2 new_string_from_integer_int32 2 new_string_from_integer_int64 2 new_string_from_logical_lk] Public)}) stdlib_string_type [] .false. .false.), stdlib_string_type_constructor: (Module (SymbolTable 8 {new_string: (Function (SymbolTable 9 {new: (Variable 9 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), string: (Variable 9 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 9 string)] [] [] (Var 9 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 10 {new: (Variable 10 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 10 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 10 val)] [] [] (Var 10 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 11 {new: (Variable 11 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 11 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 11 val)] [] [] (Var 11 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 12 {new: (Variable 12 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 12 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 12 val)] [] [] (Var 12 new) Source Public Implementation () .true. .false. .false. .false.), string_type: (ExternalSymbol 8 string_type 2 string_type stdlib_string_type [] string_type Public), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type stdlib_string_type [] ~string_type Public)}) stdlib_string_type_constructor [] .false. .false.)}) []) diff --git a/tests/reference/asr-derived_types_06-5ae916e.json b/tests/reference/asr-derived_types_06-5ae916e.json index 652b0146b0..1a435e58b9 100644 --- a/tests/reference/asr-derived_types_06-5ae916e.json +++ b/tests/reference/asr-derived_types_06-5ae916e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-5ae916e.stdout", - "stdout_hash": "4b9ddf936efa861e04c62a88ed2f8f7103ad6e49d54a18ac79f72552", + "stdout_hash": "b1b52f8c531cf735c99f304e2e70ce155654f2cf2f1ed1d64d78b09e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_06-5ae916e.stdout b/tests/reference/asr-derived_types_06-5ae916e.stdout index 63b7ed39ad..000d2c2b19 100644 --- a/tests/reference/asr-derived_types_06-5ae916e.stdout +++ b/tests/reference/asr-derived_types_06-5ae916e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {abstract_type: (Module (SymbolTable 2 {subrout: (Function (SymbolTable 3 {a: (Variable 3 a Out () () Default (Class 3 ~abstract_type []) Source Public Required .false.), ~abstract_type: (DerivedType (SymbolTable 4 {}) ~abstract_type [] Source Public ())}) subrout [(Var 3 a)] [] [] () Source Public Implementation () .false. .false. .false.)}) abstract_type [] .false. .false.), derived_types_01: (Program (SymbolTable 5 {}) derived_types_01 [] [])}) []) +(TranslationUnit (SymbolTable 1 {abstract_type: (Module (SymbolTable 2 {subrout: (Function (SymbolTable 3 {a: (Variable 3 a Out () () Default (Class 3 ~abstract_type []) Source Public Required .false.), ~abstract_type: (DerivedType (SymbolTable 4 {}) ~abstract_type [] Source Public ())}) subrout [(Var 3 a)] [] [] () Source Public Implementation () .false. .false. .false. .false.)}) abstract_type [] .false. .false.), derived_types_01: (Program (SymbolTable 5 {}) derived_types_01 [] [])}) []) diff --git a/tests/reference/asr-derived_types_07-ccfd81f.json b/tests/reference/asr-derived_types_07-ccfd81f.json index 85f5510cd2..d493cd4a5b 100644 --- a/tests/reference/asr-derived_types_07-ccfd81f.json +++ b/tests/reference/asr-derived_types_07-ccfd81f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-ccfd81f.stdout", - "stdout_hash": "47b7eec8d31d3b8a3177340ec5c98216d9ce0ce85c83922afe7571e9", + "stdout_hash": "882bb1df8a76c40ad766c84cbc150c3657cd04964c2891c140b45b46", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_07-ccfd81f.stdout b/tests/reference/asr-derived_types_07-ccfd81f.stdout index 8ce3c1156f..72e4039874 100644 --- a/tests/reference/asr-derived_types_07-ccfd81f.stdout +++ b/tests/reference/asr-derived_types_07-ccfd81f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_05: (Program (SymbolTable 5 {}) derived_types_05 [] []), stdlib_logger: (Module (SymbolTable 2 {final_logger: (Function (SymbolTable 4 {iostat: (Variable 4 iostat Local () () Default (Integer 4 []) Source Private Required .false.), message: (Variable 4 message Local () () Default (Character 1 256 () []) Source Private Required .false.), self: (Variable 4 self In () () Default (Derived 2 logger_type []) Source Private Required .false.), unit: (Variable 4 unit Local () () Default (Integer 4 []) Source Private Required .false.)}) final_logger [(Var 4 self)] [] [] () Source Private Implementation () .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_blank_line: (Variable 3 add_blank_line Local (LogicalConstant .false. (Logical 4 [])) () Save (Logical 4 []) Source Private Required .false.), log_units: (Variable 3 log_units Local () () Allocatable (Integer 4 [(() ())]) Source Private Required .false.), max_width: (Variable 3 max_width Local (IntegerConstant 0 (Integer 4 [])) () Save (Integer 4 []) Source Private Required .false.)}) logger_type [add_blank_line log_units max_width] Source Private ())}) stdlib_logger [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_types_05: (Program (SymbolTable 5 {}) derived_types_05 [] []), stdlib_logger: (Module (SymbolTable 2 {final_logger: (Function (SymbolTable 4 {iostat: (Variable 4 iostat Local () () Default (Integer 4 []) Source Private Required .false.), message: (Variable 4 message Local () () Default (Character 1 256 () []) Source Private Required .false.), self: (Variable 4 self In () () Default (Derived 2 logger_type []) Source Private Required .false.), unit: (Variable 4 unit Local () () Default (Integer 4 []) Source Private Required .false.)}) final_logger [(Var 4 self)] [] [] () Source Private Implementation () .false. .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_blank_line: (Variable 3 add_blank_line Local (LogicalConstant .false. (Logical 4 [])) () Save (Logical 4 []) Source Private Required .false.), log_units: (Variable 3 log_units Local () () Allocatable (Integer 4 [(() ())]) Source Private Required .false.), max_width: (Variable 3 max_width Local (IntegerConstant 0 (Integer 4 [])) () Save (Integer 4 []) Source Private Required .false.)}) logger_type [add_blank_line log_units max_width] Source Private ())}) stdlib_logger [] .false. .false.)}) []) diff --git a/tests/reference/asr-derived_types_08-3680946.json b/tests/reference/asr-derived_types_08-3680946.json index 8a71caa357..7254cee32f 100644 --- a/tests/reference/asr-derived_types_08-3680946.json +++ b/tests/reference/asr-derived_types_08-3680946.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_08-3680946.stdout", - "stdout_hash": "5ae69284d033be31927ae5b09271806741b3885b26b0304de1e945b7", + "stdout_hash": "681f3bdc5201ab3df3d6fa4ca4dbc4201ae0dc5fa9cb5cd239fa6602", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_08-3680946.stdout b/tests/reference/asr-derived_types_08-3680946.stdout index a24195e82d..9060daec27 100644 --- a/tests/reference/asr-derived_types_08-3680946.stdout +++ b/tests/reference/asr-derived_types_08-3680946.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_08: (Program (SymbolTable 6 {initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public), rect: (Variable 6 rect Local () () Default (Derived 6 rectangle []) Source Public Required .false.), rectangle: (ExternalSymbol 6 rectangle 2 rectangle shape_mod [] rectangle Public), shape: (ExternalSymbol 6 shape 2 shape shape_mod [] shape Public), shp: (Variable 6 shp Local () () Default (Derived 6 shape []) Source Public Required .false.)}) derived_types_08 [shape_mod] [(SubroutineCall 3 initialize () [((IntegerConstant 1 (Integer 4 []))) ((LogicalConstant .true. (Logical 4 []))) ((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 20 (Integer 4 [])))] (Var 6 shp)) (SubroutineCall 3 initialize () [((IntegerConstant 2 (Integer 4 []))) ((LogicalConstant .false. (Logical 4 []))) ((IntegerConstant 100 (Integer 4 []))) ((IntegerConstant 200 (Integer 4 [])))] (Var 6 rect)) (Print () [(DerivedRef (Var 6 shp) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 shp) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 y (Integer 4 []) ())] () ()) (Print () [(DerivedRef (Var 6 rect) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 rect) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 y (Integer 4 []) ())] () ()) (= (DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (IntegerConstant 100 (Integer 4 [])) ()) (= (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ()) (IntegerConstant 200 (Integer 4 [])) ()) (Print () [(DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ())] () ())]), shape_mod: (Module (SymbolTable 2 {initialize_subrout: (Function (SymbolTable 5 {color: (Variable 5 color Unspecified () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 5 filled Unspecified () () Default (Logical 4 []) Source Public Required .false.), sh: (Variable 5 sh Unspecified () () Default (Class 2 shape []) Source Public Required .false.), x: (Variable 5 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) initialize_subrout [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [] [(= (DerivedRef (Var 5 sh) 3 color (Integer 4 []) ()) (Var 5 color) ()) (= (DerivedRef (Var 5 sh) 3 filled (Logical 4 []) ()) (Var 5 filled) ()) (= (DerivedRef (Var 5 sh) 3 x (Integer 4 []) ()) (Var 5 x) ()) (= (DerivedRef (Var 5 sh) 3 y (Integer 4 []) ()) (Var 5 y) ())] () Source Public Implementation () .false. .false. .false.), rectangle: (DerivedType (SymbolTable 4 {length: (Variable 4 length Local () () Default (Integer 4 []) Source Public Required .false.), width: (Variable 4 width Local () () Default (Integer 4 []) Source Public Required .false.)}) rectangle [length width] Source Public 2 shape), shape: (DerivedType (SymbolTable 3 {color: (Variable 3 color Local () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 3 filled Local () () Default (Logical 4 []) Source Public Required .false.), initialize: (ClassProcedure 3 initialize initialize_subrout 2 initialize_subrout Source), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.)}) shape [color filled x y] Source Public ())}) shape_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_types_08: (Program (SymbolTable 6 {initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public), rect: (Variable 6 rect Local () () Default (Derived 6 rectangle []) Source Public Required .false.), rectangle: (ExternalSymbol 6 rectangle 2 rectangle shape_mod [] rectangle Public), shape: (ExternalSymbol 6 shape 2 shape shape_mod [] shape Public), shp: (Variable 6 shp Local () () Default (Derived 6 shape []) Source Public Required .false.)}) derived_types_08 [shape_mod] [(SubroutineCall 3 initialize () [((IntegerConstant 1 (Integer 4 []))) ((LogicalConstant .true. (Logical 4 []))) ((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 20 (Integer 4 [])))] (Var 6 shp)) (SubroutineCall 3 initialize () [((IntegerConstant 2 (Integer 4 []))) ((LogicalConstant .false. (Logical 4 []))) ((IntegerConstant 100 (Integer 4 []))) ((IntegerConstant 200 (Integer 4 [])))] (Var 6 rect)) (Print () [(DerivedRef (Var 6 shp) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 shp) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 y (Integer 4 []) ())] () ()) (Print () [(DerivedRef (Var 6 rect) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 rect) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 y (Integer 4 []) ())] () ()) (= (DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (IntegerConstant 100 (Integer 4 [])) ()) (= (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ()) (IntegerConstant 200 (Integer 4 [])) ()) (Print () [(DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ())] () ())]), shape_mod: (Module (SymbolTable 2 {initialize_subrout: (Function (SymbolTable 5 {color: (Variable 5 color Unspecified () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 5 filled Unspecified () () Default (Logical 4 []) Source Public Required .false.), sh: (Variable 5 sh Unspecified () () Default (Class 2 shape []) Source Public Required .false.), x: (Variable 5 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) initialize_subrout [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [] [(= (DerivedRef (Var 5 sh) 3 color (Integer 4 []) ()) (Var 5 color) ()) (= (DerivedRef (Var 5 sh) 3 filled (Logical 4 []) ()) (Var 5 filled) ()) (= (DerivedRef (Var 5 sh) 3 x (Integer 4 []) ()) (Var 5 x) ()) (= (DerivedRef (Var 5 sh) 3 y (Integer 4 []) ()) (Var 5 y) ())] () Source Public Implementation () .false. .false. .false. .false.), rectangle: (DerivedType (SymbolTable 4 {length: (Variable 4 length Local () () Default (Integer 4 []) Source Public Required .false.), width: (Variable 4 width Local () () Default (Integer 4 []) Source Public Required .false.)}) rectangle [length width] Source Public 2 shape), shape: (DerivedType (SymbolTable 3 {color: (Variable 3 color Local () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 3 filled Local () () Default (Logical 4 []) Source Public Required .false.), initialize: (ClassProcedure 3 initialize initialize_subrout 2 initialize_subrout Source), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.)}) shape [color filled x y] Source Public ())}) shape_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-dimension_attr-1c00ad6.json b/tests/reference/asr-dimension_attr-1c00ad6.json index cc7935acfd..437228a641 100644 --- a/tests/reference/asr-dimension_attr-1c00ad6.json +++ b/tests/reference/asr-dimension_attr-1c00ad6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr-1c00ad6.stdout", - "stdout_hash": "bd84cd967c0f69b657681d2a9d982842818baa1fc6804f7e4e85330e", + "stdout_hash": "1252d65c80103e28b5b973039a8068927051a89ae662087b52653ca3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dimension_attr-1c00ad6.stdout b/tests/reference/asr-dimension_attr-1c00ad6.stdout index 2147b95134..3da1e390db 100644 --- a/tests/reference/asr-dimension_attr-1c00ad6.stdout +++ b/tests/reference/asr-dimension_attr-1c00ad6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false.), main: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), z: (Variable 3 z Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false. .false.), main: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), z: (Variable 3 z Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ())])}) []) diff --git a/tests/reference/asr-dimension_attr2-8fda690.json b/tests/reference/asr-dimension_attr2-8fda690.json index d382b23094..57bc6ae7ae 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.json +++ b/tests/reference/asr-dimension_attr2-8fda690.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr2-8fda690.stdout", - "stdout_hash": "8cca1169a698173c242b06842c26ea09b65e763bca03e808dc98aba8", + "stdout_hash": "e127ec5a1a1f826fb9afa137687dbc891da41beeeb5348e8dd0282e9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dimension_attr2-8fda690.stdout b/tests/reference/asr-dimension_attr2-8fda690.stdout index 5f99b65495..0f0a827dac 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.stdout +++ b/tests/reference/asr-dimension_attr2-8fda690.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) f [(Var 2 x)] [] [] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) f [(Var 2 x)] [] [] (Var 2 f) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json index 062f5b962f..14ee77f867 100644 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json +++ b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_if_variations-b4dcd1e.stdout", - "stdout_hash": "3da1975a13d60a80bbc681a903f5672d9cbdbc9ac7918398a1780839", + "stdout_hash": "ee343915bbe4e3b3173e69070036bd38d49e1f8f71e11a187fca752f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout index a52a8acaeb..5940982e46 100644 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout +++ b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false.), main: (Program (SymbolTable 3 {}) main [] [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Print () [(StringConstant "first branch" (Character 1 12 () []))] () ())] [(Print () [(StringConstant "second branch" (Character 1 13 () []))] () ())]) (GoToTarget 50) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ()) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Return)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(GoTo 50)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4 [])))] ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false. .false.), main: (Program (SymbolTable 3 {}) main [] [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Print () [(StringConstant "first branch" (Character 1 12 () []))] () ())] [(Print () [(StringConstant "second branch" (Character 1 13 () []))] () ())]) (GoToTarget 50) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ()) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Return)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(GoTo 50)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4 [])))] ())] [])])}) []) diff --git a/tests/reference/asr-fn2-b585098.json b/tests/reference/asr-fn2-b585098.json index f69c47977a..00ede28d56 100644 --- a/tests/reference/asr-fn2-b585098.json +++ b/tests/reference/asr-fn2-b585098.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-fn2-b585098.stdout", - "stdout_hash": "cc309eec2ffc958db5b49b556533ca7a25731586a5ce184a575334a6", + "stdout_hash": "22aa601e32656d600144ff097803f2414577cb0e4e60463d36d187ff", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-fn2-b585098.stdout b/tests/reference/asr-fn2-b585098.stdout index 3d4ef3a5c0..45b77c4432 100644 --- a/tests/reference/asr-fn2-b585098.stdout +++ b/tests/reference/asr-fn2-b585098.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Function (SymbolTable 2 {a: (Variable 2 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [] (Var 2 a) Source Public Implementation () .false. .false. .false.), b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) b [] [] [] (Var 3 b) Source Public Implementation () .false. .false. .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) c [] [] [] (Var 4 c) Source Public Implementation () .false. .false. .false.), d: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.), e: (Function (SymbolTable 6 {r: (Variable 6 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) e [] [] [] (Var 6 r) Source Public Implementation () .false. .false. .false.), f: (Function (SymbolTable 7 {r: (Variable 7 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) f [] [] [] (Var 7 r) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {a: (Function (SymbolTable 2 {a: (Variable 2 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [] (Var 2 a) Source Public Implementation () .false. .false. .false. .false.), b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) b [] [] [] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) c [] [] [] (Var 4 c) Source Public Implementation () .false. .false. .false. .false.), d: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.), e: (Function (SymbolTable 6 {r: (Variable 6 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) e [] [] [] (Var 6 r) Source Public Implementation () .false. .false. .false. .false.), f: (Function (SymbolTable 7 {r: (Variable 7 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) f [] [] [] (Var 7 r) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-functions_04-ea50b75.json b/tests/reference/asr-functions_04-ea50b75.json index 2decd4fcd1..0cf0cfd607 100644 --- a/tests/reference/asr-functions_04-ea50b75.json +++ b/tests/reference/asr-functions_04-ea50b75.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_04-ea50b75.stdout", - "stdout_hash": "b8fe67bccdad1ff38b81c7d36289fcc08057de1b0a14e12710df32d3", + "stdout_hash": "f100d700771bc083234b3292019048ac2780aac1f9d8a24da7ad0c14", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_04-ea50b75.stdout b/tests/reference/asr-functions_04-ea50b75.stdout index 184e398d21..bad2b24114 100644 --- a/tests/reference/asr-functions_04-ea50b75.stdout +++ b/tests/reference/asr-functions_04-ea50b75.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {functions_04: (Program (SymbolTable 4 {int: (Variable 4 int Local (IntegerConstant 4 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), to_negative: (ExternalSymbol 4 to_negative 2 to_negative stdlib_int [] to_negative Public), to_negative@to_negative~genericprocedure: (ExternalSymbol 4 to_negative@to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Private), to_negative~genericprocedure: (ExternalSymbol 4 to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Public)}) functions_04 [stdlib_int] [(If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] [])]), stdlib_int: (Module (SymbolTable 2 {to_negative: (GenericProcedure 2 to_negative [2 to_negative~genericprocedure] Public), to_negative~genericprocedure: (Function (SymbolTable 3 {int: (Variable 3 int In () () Default (Integer 4 []) Source Public Required .false.), neg_int: (Variable 3 neg_int ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) to_negative~genericprocedure [(Var 3 int)] [] [(If (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4 []) ()) ())] [(= (Var 3 neg_int) (Var 3 int) ())])] (Var 3 neg_int) Source Public Implementation () .false. .false. .false.)}) stdlib_int [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {functions_04: (Program (SymbolTable 4 {int: (Variable 4 int Local (IntegerConstant 4 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), to_negative: (ExternalSymbol 4 to_negative 2 to_negative stdlib_int [] to_negative Public), to_negative@to_negative~genericprocedure: (ExternalSymbol 4 to_negative@to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Private), to_negative~genericprocedure: (ExternalSymbol 4 to_negative~genericprocedure 2 to_negative~genericprocedure stdlib_int [] to_negative~genericprocedure Public)}) functions_04 [stdlib_int] [(If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] [])]), stdlib_int: (Module (SymbolTable 2 {to_negative: (GenericProcedure 2 to_negative [2 to_negative~genericprocedure] Public), to_negative~genericprocedure: (Function (SymbolTable 3 {int: (Variable 3 int In () () Default (Integer 4 []) Source Public Required .false.), neg_int: (Variable 3 neg_int ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) to_negative~genericprocedure [(Var 3 int)] [] [(If (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4 []) ()) ())] [(= (Var 3 neg_int) (Var 3 int) ())])] (Var 3 neg_int) Source Public Implementation () .false. .false. .false. .false.)}) stdlib_int [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_05-adf0d8b.json b/tests/reference/asr-functions_05-adf0d8b.json index e5a25055b8..0bca599589 100644 --- a/tests/reference/asr-functions_05-adf0d8b.json +++ b/tests/reference/asr-functions_05-adf0d8b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_05-adf0d8b.stdout", - "stdout_hash": "3ddb916043c2b899eb631cf86281af02c7d4a5587d1069e854abb830", + "stdout_hash": "893960ba8e820ca7531f3dfae8a44ee9ec90b5f149a8f55d5e37f6bb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_05-adf0d8b.stdout b/tests/reference/asr-functions_05-adf0d8b.stdout index 8995349665..2acf6d5882 100644 --- a/tests/reference/asr-functions_05-adf0d8b.stdout +++ b/tests/reference/asr-functions_05-adf0d8b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4 []))) ((Var 4 a))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4 []) () ()) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4 []) () ()) ()) (Print () [(Var 2 c)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4 []))) ((Var 4 a))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 5 x) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 5 x) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 5 y) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4 []) () ()) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4 []) () ()) ()) (Print () [(Var 2 c)] () ())])}) []) diff --git a/tests/reference/asr-functions_06-83a7aca.json b/tests/reference/asr-functions_06-83a7aca.json index 442dc8e982..4e0f3ecf8c 100644 --- a/tests/reference/asr-functions_06-83a7aca.json +++ b/tests/reference/asr-functions_06-83a7aca.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_06-83a7aca.stdout", - "stdout_hash": "c9ca90b74522400b4f3d1bc0b01036cbc8e847353a8f6f06e6054125", + "stdout_hash": "004327c42d05d9d3e3e56b907c9470264549db762fa4f49ccd5000d9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_06-83a7aca.stdout b/tests/reference/asr-functions_06-83a7aca.stdout index 19f5824bac..b1848fcd2f 100644 --- a/tests/reference/asr-functions_06-83a7aca.stdout +++ b/tests/reference/asr-functions_06-83a7aca.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {int_return: (Function (SymbolTable 4 {i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 4 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 4 r ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 4 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) int_return [(Var 4 s)] [] [(DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), real_return: (Function (SymbolTable 29 {i: (Variable 29 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 29 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 29 r ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 29 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) real_return [(Var 29 s)] [] [(DoLoop ((Var 29 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 29 r) [(() (Var 29 i) ())] (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ())])] (Var 29 r) Source Public Implementation () .false. .false. .false.), trim_wrapper: (Function (SymbolTable 3 {len: (ExternalSymbol 3 len 6 len lfortran_intrinsic_builtin [] len Private), len_trim: (ExternalSymbol 3 len_trim 32 len_trim lfortran_intrinsic_string [] len_trim Private), r: (Variable 3 r ReturnVar () () Default (Character 1 -3 (FunctionCall 3 len () [((Var 3 s))] (Integer 4 []) () ()) []) Source Public Required .false.), s: (Variable 3 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.), trim: (ExternalSymbol 3 trim 32 trim lfortran_intrinsic_string [] trim Private)}) trim_wrapper [(Var 3 s)] [] [(= (Var 3 r) (FunctionCall 3 trim () [((Var 3 s))] (Character 1 -3 (FunctionCall 3 len_trim () [((Var 3 s))] (Integer 4 []) () ()) []) () ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a [lfortran_intrinsic_builtin lfortran_intrinsic_string] .false. .false.), functions_06: (Program (SymbolTable 30 {int_return: (ExternalSymbol 30 int_return 2 int_return a [] int_return Public), len: (ExternalSymbol 30 len 6 len lfortran_intrinsic_builtin [] len Private), real_return: (ExternalSymbol 30 real_return 2 real_return a [] real_return Public), string: (Variable 30 string Local (StringConstant " abc" (Character 1 5 () [])) () Save (Character 1 5 () []) Source Public Required .false.), trim_wrapper: (ExternalSymbol 30 trim_wrapper 2 trim_wrapper a [] trim_wrapper Public)}) functions_06 [a] [(Print () [(FunctionCall 30 trim_wrapper () [((Var 30 string))] (Character 1 -3 (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()) []) () ())] () ()) (Print () [(FunctionCall 30 int_return () [((Var 30 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ()) (Print () [(FunctionCall 30 real_return () [((Var 30 string))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_string: (IntrinsicModule lfortran_intrinsic_string)}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {int_return: (Function (SymbolTable 4 {i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 4 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 4 r ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 4 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) int_return [(Var 4 s)] [] [(DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), real_return: (Function (SymbolTable 29 {i: (Variable 29 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 29 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 29 r ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 29 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) real_return [(Var 29 s)] [] [(DoLoop ((Var 29 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 29 r) [(() (Var 29 i) ())] (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ())])] (Var 29 r) Source Public Implementation () .false. .false. .false. .false.), trim_wrapper: (Function (SymbolTable 3 {len: (ExternalSymbol 3 len 6 len lfortran_intrinsic_builtin [] len Private), len_trim: (ExternalSymbol 3 len_trim 32 len_trim lfortran_intrinsic_string [] len_trim Private), r: (Variable 3 r ReturnVar () () Default (Character 1 -3 (FunctionCall 3 len () [((Var 3 s))] (Integer 4 []) () ()) []) Source Public Required .false.), s: (Variable 3 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.), trim: (ExternalSymbol 3 trim 32 trim lfortran_intrinsic_string [] trim Private)}) trim_wrapper [(Var 3 s)] [] [(= (Var 3 r) (FunctionCall 3 trim () [((Var 3 s))] (Character 1 -3 (FunctionCall 3 len_trim () [((Var 3 s))] (Integer 4 []) () ()) []) () ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) a [lfortran_intrinsic_builtin lfortran_intrinsic_string] .false. .false.), functions_06: (Program (SymbolTable 30 {int_return: (ExternalSymbol 30 int_return 2 int_return a [] int_return Public), len: (ExternalSymbol 30 len 6 len lfortran_intrinsic_builtin [] len Private), real_return: (ExternalSymbol 30 real_return 2 real_return a [] real_return Public), string: (Variable 30 string Local (StringConstant " abc" (Character 1 5 () [])) () Save (Character 1 5 () []) Source Public Required .false.), trim_wrapper: (ExternalSymbol 30 trim_wrapper 2 trim_wrapper a [] trim_wrapper Public)}) functions_06 [a] [(Print () [(FunctionCall 30 trim_wrapper () [((Var 30 string))] (Character 1 -3 (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()) []) () ())] () ()) (Print () [(FunctionCall 30 int_return () [((Var 30 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ()) (Print () [(FunctionCall 30 real_return () [((Var 30 string))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_string: (IntrinsicModule lfortran_intrinsic_string)}) []) diff --git a/tests/reference/asr-functions_07-2d29eab.json b/tests/reference/asr-functions_07-2d29eab.json index 02ffc1fb9d..0defea10c0 100644 --- a/tests/reference/asr-functions_07-2d29eab.json +++ b/tests/reference/asr-functions_07-2d29eab.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_07-2d29eab.stdout", - "stdout_hash": "bd9acf83184e47ab00702394f439081484be561e267efe4fb1c0903f", + "stdout_hash": "fa8f4c3b5fd5a43a3d8c5a9b0fd2735a3d8f130dd5a2cca93702d7d4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_07-2d29eab.stdout b/tests/reference/asr-functions_07-2d29eab.stdout index 10d3b9b5b3..f2283e49eb 100644 --- a/tests/reference/asr-functions_07-2d29eab.stdout +++ b/tests/reference/asr-functions_07-2d29eab.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4 []) () ()) ()) (Print () [(Var 8 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4 []) () ()) ()) (Print () [(Var 8 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_08-23f422a.json b/tests/reference/asr-functions_08-23f422a.json index 29d8431730..d52dcec67f 100644 --- a/tests/reference/asr-functions_08-23f422a.json +++ b/tests/reference/asr-functions_08-23f422a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_08-23f422a.stdout", - "stdout_hash": "48e839556de6ef4c72da2a42898721ef2ce826113c85ea2279a34601", + "stdout_hash": "24f5f1e263a00d2addd2b5e9919002d2eb65dc437178b4e995ecb723", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_08-23f422a.stdout b/tests/reference/asr-functions_08-23f422a.stdout index a71a9bc380..c0cd33ec2c 100644 --- a/tests/reference/asr-functions_08-23f422a.stdout +++ b/tests/reference/asr-functions_08-23f422a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4 []) () ()) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4 []) () ()) ()) (Print () [(Var 3 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4 []) () ()) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4 []) () ()) ()) (Print () [(Var 3 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_09-1e51ac7.json b/tests/reference/asr-functions_09-1e51ac7.json index 58388734c4..36106431db 100644 --- a/tests/reference/asr-functions_09-1e51ac7.json +++ b/tests/reference/asr-functions_09-1e51ac7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_09-1e51ac7.stdout", - "stdout_hash": "bbfb28028a05fa8a3491f00a4f3168ae0fec7ad5d6fc93450864d304", + "stdout_hash": "5f626190932b955b9f6909faac52a5a957cf7c270703d73c32e39b17", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_09-1e51ac7.stdout b/tests/reference/asr-functions_09-1e51ac7.stdout index fa186a914f..3268420d4f 100644 --- a/tests/reference/asr-functions_09-1e51ac7.stdout +++ b/tests/reference/asr-functions_09-1e51ac7.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {stdlib_quadrature: (Program (SymbolTable 5 {simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public), x1: (Variable 5 x1 Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) stdlib_quadrature [stdlib_quadrature_simps] [(Print () [(FunctionCall 5 simps38_weights_dp () [((Var 5 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())]), stdlib_quadrature_simps: (Module (SymbolTable 2 {simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public), simps38_weights_dp: (Function (SymbolTable 3 {w: (Variable 3 w ReturnVar () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp [(Var 3 x)] [] [] (Var 3 w) Source Public Implementation () .false. .false. .false.), simps38_weights_dp_use: (Function (SymbolTable 4 {x1: (Variable 4 x1 In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp_use [(Var 4 x1)] [] [(Print () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) stdlib_quadrature_simps [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {stdlib_quadrature: (Program (SymbolTable 5 {simps38_weights_dp: (ExternalSymbol 5 simps38_weights_dp 2 simps38_weights_dp stdlib_quadrature_simps [] simps38_weights_dp Public), x1: (Variable 5 x1 Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) stdlib_quadrature [stdlib_quadrature_simps] [(Print () [(FunctionCall 5 simps38_weights_dp () [((Var 5 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())]), stdlib_quadrature_simps: (Module (SymbolTable 2 {simps38_weights: (GenericProcedure 2 simps38_weights [2 simps38_weights_dp] Public), simps38_weights_dp: (Function (SymbolTable 3 {w: (Variable 3 w ReturnVar () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp [(Var 3 x)] [] [] (Var 3 w) Source Public Implementation () .false. .false. .false. .false.), simps38_weights_dp_use: (Function (SymbolTable 4 {x1: (Variable 4 x1 In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.)}) simps38_weights_dp_use [(Var 4 x1)] [] [(Print () [(FunctionCall 2 simps38_weights_dp 2 simps38_weights [((Var 4 x1))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ())] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) stdlib_quadrature_simps [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_10-0449324.json b/tests/reference/asr-functions_10-0449324.json index ca6fd1c598..1cb48a3d84 100644 --- a/tests/reference/asr-functions_10-0449324.json +++ b/tests/reference/asr-functions_10-0449324.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_10-0449324.stdout", - "stdout_hash": "a99c792a0624f651d853558e66244e20adff2711cddf7a1f87a2b55b", + "stdout_hash": "4a00b765a201a54b0f37bcd79f3e08c1eda9cf569e51795f07303c6c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_10-0449324.stdout b/tests/reference/asr-functions_10-0449324.stdout index 2dd7c08f74..1766c17e0c 100644 --- a/tests/reference/asr-functions_10-0449324.stdout +++ b/tests/reference/asr-functions_10-0449324.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {kwarg_gp: (Module (SymbolTable 2 {mergegp: (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public), mergei32: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), m: (Variable 3 m Unspecified () () Default (Integer 4 [(() ())]) Source Public Optional .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mergei32 [(Var 3 a) (Var 3 b) (Var 3 m)] [] [] (Var 3 r) Source Public Implementation () .false. .false. .false.), merger32: (Function (SymbolTable 4 {a: (Variable 4 a Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), m: (Variable 4 m Unspecified () () Default (Real 4 [(() ())]) Source Public Optional .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) merger32 [(Var 4 a) (Var 4 b) (Var 4 m)] [] [] (Var 4 r) Source Public Implementation () .false. .false. .false.), merger64: (Function (SymbolTable 5 {a: (Variable 5 a Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), b: (Variable 5 b Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), m: (Variable 5 m Unspecified () () Default (Real 8 [(() ())]) Source Public Optional .false.), r: (Variable 5 r ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) merger64 [(Var 5 a) (Var 5 b) (Var 5 m)] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.)}) kwarg_gp [] .false. .false.), kwarg_use: (Program (SymbolTable 6 {a1: (Variable 6 a1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), a2: (Variable 6 a2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), b1: (Variable 6 b1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), b2: (Variable 6 b2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), m1: (Variable 6 m1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), m2: (Variable 6 m2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), mergegp: (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public), mergegp@mergei32: (ExternalSymbol 6 mergegp@mergei32 2 mergei32 kwarg_gp [] mergei32 Private), mergegp@merger32: (ExternalSymbol 6 mergegp@merger32 2 merger32 kwarg_gp [] merger32 Private), mergei32: (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public), merger32: (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public), merger64: (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public)}) kwarg_use [kwarg_gp] [(Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ())])}) []) +(TranslationUnit (SymbolTable 1 {kwarg_gp: (Module (SymbolTable 2 {mergegp: (GenericProcedure 2 mergegp [2 mergei32 2 merger32 2 merger64] Public), mergei32: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), m: (Variable 3 m Unspecified () () Default (Integer 4 [(() ())]) Source Public Optional .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mergei32 [(Var 3 a) (Var 3 b) (Var 3 m)] [] [] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), merger32: (Function (SymbolTable 4 {a: (Variable 4 a Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), m: (Variable 4 m Unspecified () () Default (Real 4 [(() ())]) Source Public Optional .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) merger32 [(Var 4 a) (Var 4 b) (Var 4 m)] [] [] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), merger64: (Function (SymbolTable 5 {a: (Variable 5 a Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), b: (Variable 5 b Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), m: (Variable 5 m Unspecified () () Default (Real 8 [(() ())]) Source Public Optional .false.), r: (Variable 5 r ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) merger64 [(Var 5 a) (Var 5 b) (Var 5 m)] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.)}) kwarg_gp [] .false. .false.), kwarg_use: (Program (SymbolTable 6 {a1: (Variable 6 a1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), a2: (Variable 6 a2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), b1: (Variable 6 b1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), b2: (Variable 6 b2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), m1: (Variable 6 m1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), m2: (Variable 6 m2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), mergegp: (ExternalSymbol 6 mergegp 2 mergegp kwarg_gp [] mergegp Public), mergegp@mergei32: (ExternalSymbol 6 mergegp@mergei32 2 mergei32 kwarg_gp [] mergei32 Private), mergegp@merger32: (ExternalSymbol 6 mergegp@merger32 2 merger32 kwarg_gp [] merger32 Private), mergei32: (ExternalSymbol 6 mergei32 2 mergei32 kwarg_gp [] mergei32 Public), merger32: (ExternalSymbol 6 merger32 2 merger32 kwarg_gp [] merger32 Public), merger64: (ExternalSymbol 6 merger64 2 merger64 kwarg_gp [] merger64 Public)}) kwarg_use [kwarg_gp] [(Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ())])}) []) diff --git a/tests/reference/asr-generic_name_01-9f2fd25.json b/tests/reference/asr-generic_name_01-9f2fd25.json index 5568b2cce2..aaa0b3e258 100644 --- a/tests/reference/asr-generic_name_01-9f2fd25.json +++ b/tests/reference/asr-generic_name_01-9f2fd25.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-generic_name_01-9f2fd25.stdout", - "stdout_hash": "3430eaff93ab487e7390ab3963c9b7ad9ada717a6b038750b16c1b6a", + "stdout_hash": "ed8e533e0197cea39ce59a435b2796853adf35ce381ca7df93aa7eb5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-generic_name_01-9f2fd25.stdout b/tests/reference/asr-generic_name_01-9f2fd25.stdout index 19047c4796..6bf6f94559 100644 --- a/tests/reference/asr-generic_name_01-9f2fd25.stdout +++ b/tests/reference/asr-generic_name_01-9f2fd25.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {complex_module: (Module (SymbolTable 2 {complextype: (DerivedType (SymbolTable 3 {add: (GenericProcedure 3 add [3 integer_add_subrout 3 real_add_subrout] Public), i: (Variable 3 i Local () () Default (Real 4 []) Source Public Required .false.), integer_add_subrout: (ClassProcedure 3 integer_add_subrout integer_add_subrout 2 integer_add_subrout Source), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.), real_add_subrout: (ClassProcedure 3 real_add_subrout real_add_subrout 2 real_add_subrout Source)}) complextype [r i] Source Public ()), integer_add_subrout: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r In () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 4 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) integer_add_subrout [(Var 4 this) (Var 4 r) (Var 4 i) (Var 4 sum)] [] [(Print () [(StringConstant "Calling integer_add_subrout" (Character 1 27 () []))] () ()) (= (DerivedRef (Var 4 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 r (Real 4 []) ()) Add (Cast (Var 4 r) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ()) (= (DerivedRef (Var 4 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 i (Real 4 []) ()) Add (Cast (Var 4 i) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), real_add_subrout: (Function (SymbolTable 5 {i: (Variable 5 i In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 5 r In () () Default (Real 4 []) Source Public Required .false.), sum: (Variable 5 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 5 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) real_add_subrout [(Var 5 this) (Var 5 r) (Var 5 i) (Var 5 sum)] [] [(Print () [(StringConstant "Calling real_add_subrout" (Character 1 24 () []))] () ()) (= (DerivedRef (Var 5 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 r (Real 4 []) ()) Add (Var 5 r) (Real 4 []) ()) ()) (= (DerivedRef (Var 5 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 i (Real 4 []) ()) Add (Var 5 i) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) complex_module [] .false. .false.), generic_name_01: (Program (SymbolTable 6 {a: (Variable 6 a Local () () Default (Derived 6 complextype []) Source Public Required .false.), c: (Variable 6 c Local () () Default (Derived 6 complextype []) Source Public Required .false.), complextype: (ExternalSymbol 6 complextype 2 complextype complex_module [] complextype Public), fpone: (Variable 6 fpone Local () () Default (Real 4 []) Source Public Required .false.), fptwo: (Variable 6 fptwo Local () () Default (Real 4 []) Source Public Required .false.), fpzero: (Variable 6 fpzero Local () () Default (Real 4 []) Source Public Required .false.), ione: (Variable 6 ione Local () () Default (Integer 4 []) Source Public Required .false.), izero: (Variable 6 izero Local () () Default (Integer 4 []) Source Public Required .false.), negfpone: (Variable 6 negfpone Local () () Default (Real 4 []) Source Public Required .false.)}) generic_name_01 [complex_module] [(= (Var 6 fpone) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 6 fptwo) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 6 fpzero) (RealConstant 0.000000 (Real 4 [])) ()) (= (Var 6 ione) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 6 izero) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 6 negfpone) (RealUnaryMinus (RealConstant 1.000000 (Real 4 [])) (Real 4 []) (RealConstant -1.000000 (Real 4 []))) ()) (= (Var 6 c) (DerivedTypeConstructor 6 complextype [(Var 6 fpone) (Var 6 fptwo)] (Derived 6 complextype []) ()) ()) (SubroutineCall 3 integer_add_subrout 3 add [((Var 6 ione)) ((Var 6 izero)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ()) (SubroutineCall 3 real_add_subrout 3 add [((Var 6 fpzero)) ((Var 6 negfpone)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ())])}) []) +(TranslationUnit (SymbolTable 1 {complex_module: (Module (SymbolTable 2 {complextype: (DerivedType (SymbolTable 3 {add: (GenericProcedure 3 add [3 integer_add_subrout 3 real_add_subrout] Public), i: (Variable 3 i Local () () Default (Real 4 []) Source Public Required .false.), integer_add_subrout: (ClassProcedure 3 integer_add_subrout integer_add_subrout 2 integer_add_subrout Source), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.), real_add_subrout: (ClassProcedure 3 real_add_subrout real_add_subrout 2 real_add_subrout Source)}) complextype [r i] Source Public ()), integer_add_subrout: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r In () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 4 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) integer_add_subrout [(Var 4 this) (Var 4 r) (Var 4 i) (Var 4 sum)] [] [(Print () [(StringConstant "Calling integer_add_subrout" (Character 1 27 () []))] () ()) (= (DerivedRef (Var 4 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 r (Real 4 []) ()) Add (Cast (Var 4 r) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ()) (= (DerivedRef (Var 4 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 i (Real 4 []) ()) Add (Cast (Var 4 i) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), real_add_subrout: (Function (SymbolTable 5 {i: (Variable 5 i In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 5 r In () () Default (Real 4 []) Source Public Required .false.), sum: (Variable 5 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 5 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) real_add_subrout [(Var 5 this) (Var 5 r) (Var 5 i) (Var 5 sum)] [] [(Print () [(StringConstant "Calling real_add_subrout" (Character 1 24 () []))] () ()) (= (DerivedRef (Var 5 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 r (Real 4 []) ()) Add (Var 5 r) (Real 4 []) ()) ()) (= (DerivedRef (Var 5 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 i (Real 4 []) ()) Add (Var 5 i) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) complex_module [] .false. .false.), generic_name_01: (Program (SymbolTable 6 {a: (Variable 6 a Local () () Default (Derived 6 complextype []) Source Public Required .false.), c: (Variable 6 c Local () () Default (Derived 6 complextype []) Source Public Required .false.), complextype: (ExternalSymbol 6 complextype 2 complextype complex_module [] complextype Public), fpone: (Variable 6 fpone Local () () Default (Real 4 []) Source Public Required .false.), fptwo: (Variable 6 fptwo Local () () Default (Real 4 []) Source Public Required .false.), fpzero: (Variable 6 fpzero Local () () Default (Real 4 []) Source Public Required .false.), ione: (Variable 6 ione Local () () Default (Integer 4 []) Source Public Required .false.), izero: (Variable 6 izero Local () () Default (Integer 4 []) Source Public Required .false.), negfpone: (Variable 6 negfpone Local () () Default (Real 4 []) Source Public Required .false.)}) generic_name_01 [complex_module] [(= (Var 6 fpone) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 6 fptwo) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 6 fpzero) (RealConstant 0.000000 (Real 4 [])) ()) (= (Var 6 ione) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 6 izero) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 6 negfpone) (RealUnaryMinus (RealConstant 1.000000 (Real 4 [])) (Real 4 []) (RealConstant -1.000000 (Real 4 []))) ()) (= (Var 6 c) (DerivedTypeConstructor 6 complextype [(Var 6 fpone) (Var 6 fptwo)] (Derived 6 complextype []) ()) ()) (SubroutineCall 3 integer_add_subrout 3 add [((Var 6 ione)) ((Var 6 izero)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ()) (SubroutineCall 3 real_add_subrout 3 add [((Var 6 fpzero)) ((Var 6 negfpone)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ())])}) []) diff --git a/tests/reference/asr-implicit_typing2-d87e21a.json b/tests/reference/asr-implicit_typing2-d87e21a.json index 13f9de6b0a..8620fab1c7 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.json +++ b/tests/reference/asr-implicit_typing2-d87e21a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing2-d87e21a.stdout", - "stdout_hash": "63de72db75aa1d64d6c308a037142ada39423fd1f08ac2a17fdf5120", + "stdout_hash": "ef997564215a91543f43260d70ac539281538f9ec91f721a348ebaf9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-implicit_typing2-d87e21a.stdout b/tests/reference/asr-implicit_typing2-d87e21a.stdout index 08dcfc311d..5e4910d836 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.stdout +++ b/tests/reference/asr-implicit_typing2-d87e21a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), b: (Variable 2 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), ifault: (Variable 2 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [] [(= (Var 2 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.), ifault: (Variable 3 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) g [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [] [(= (Var 3 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] (Var 3 g) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), b: (Variable 2 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), ifault: (Variable 2 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [] [(= (Var 2 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] () Source Public Implementation () .false. .false. .false. .false.), g: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.), ifault: (Variable 3 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) g [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [] [(= (Var 3 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] (Var 3 g) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-intent_01-c1f267a.json b/tests/reference/asr-intent_01-c1f267a.json index b837d17656..7af10c19b1 100644 --- a/tests/reference/asr-intent_01-c1f267a.json +++ b/tests/reference/asr-intent_01-c1f267a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intent_01-c1f267a.stdout", - "stdout_hash": "5e2ab6b5bbad4d986518726933b02a4274def281bb6020a5741cc11a", + "stdout_hash": "92041bbe019d317634c17fb74288f6e183b74f6e86eaed0a4ad65f18", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intent_01-c1f267a.stdout b/tests/reference/asr-intent_01-c1f267a.stdout index 6553707a41..00c73f2bce 100644 --- a/tests/reference/asr-intent_01-c1f267a.stdout +++ b/tests/reference/asr-intent_01-c1f267a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {dflt_intent: (Module (SymbolTable 2 {foo: (Function (SymbolTable 3 {c: (Variable 3 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 3 d Unspecified () () Default (Real 4 []) Source Public Required .false.), e: (Variable 3 e Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [(= (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 4 x) (Real 4 []) ()) ()) (Print () [(Var 4 f)] () ())] (Var 4 f) Source Public Implementation () .false. .false. .false.), g: (Variable 3 g Local () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 3 c) (Var 3 d)] [] [(= (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4 []) () ()) ()) (= (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .false. .false.)}) dflt_intent [] .false. .false.), main: (Program (SymbolTable 5 {foo: (ExternalSymbol 5 foo 2 foo dflt_intent [] foo Public)}) main [dflt_intent] [(SubroutineCall 5 foo () [((RealConstant 0.000000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {dflt_intent: (Module (SymbolTable 2 {foo: (Function (SymbolTable 3 {c: (Variable 3 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 3 d Unspecified () () Default (Real 4 []) Source Public Required .false.), e: (Variable 3 e Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [(= (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 4 x) (Real 4 []) ()) ()) (Print () [(Var 4 f)] () ())] (Var 4 f) Source Public Implementation () .false. .false. .false. .false.), g: (Variable 3 g Local () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 3 c) (Var 3 d)] [] [(= (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4 []) () ()) ()) (= (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) dflt_intent [] .false. .false.), main: (Program (SymbolTable 5 {foo: (ExternalSymbol 5 foo 2 foo dflt_intent [] foo Public)}) main [dflt_intent] [(SubroutineCall 5 foo () [((RealConstant 0.000000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 [])))] ())])}) []) diff --git a/tests/reference/asr-interface_01-9dc98da.json b/tests/reference/asr-interface_01-9dc98da.json index a0c6df9b64..3db4e8fcf6 100644 --- a/tests/reference/asr-interface_01-9dc98da.json +++ b/tests/reference/asr-interface_01-9dc98da.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_01-9dc98da.stdout", - "stdout_hash": "72fd2c0a5ebf18ec2174706b9045f4927fcafc475ef1f2ce858cc8e3", + "stdout_hash": "619078441113540c8babb470045d2faac577a798a6887fdda226aeb5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_01-9dc98da.stdout b/tests/reference/asr-interface_01-9dc98da.stdout index 6950862493..39ed51f886 100644 --- a/tests/reference/asr-interface_01-9dc98da.stdout +++ b/tests/reference/asr-interface_01-9dc98da.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_01: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_01_mod [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_01_mod [] a1 Private), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_01_mod [] a2 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_01 [interface_01_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_01_mod: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1 2 a2] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a InOut () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a InOut () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) interface_01_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_01: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_01_mod [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_01_mod [] a1 Private), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_01_mod [] a2 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_01 [interface_01_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_01_mod: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1 2 a2] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a InOut () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a InOut () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_01_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_04-9570e2b.json b/tests/reference/asr-interface_04-9570e2b.json index 7f7d03343c..be75e4f7d1 100644 --- a/tests/reference/asr-interface_04-9570e2b.json +++ b/tests/reference/asr-interface_04-9570e2b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_04-9570e2b.stdout", - "stdout_hash": "446bf22af048ad81694ad8219d74f1217f71bba4307b3e0f6d87a73e", + "stdout_hash": "f57053e4e1868980ad6dc9065945616b962a4ca5068a7cebe6f5282c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_04-9570e2b.stdout b/tests/reference/asr-interface_04-9570e2b.stdout index 8fd3b53408..0690249ef9 100644 --- a/tests/reference/asr-interface_04-9570e2b.stdout +++ b/tests/reference/asr-interface_04-9570e2b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_04: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_04_mod1 [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_04_mod1 [] a1 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) interface_04 [interface_04_mod2] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_04_mod1: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a InOut () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) interface_04_mod1 [] .false. .false.), interface_04_mod2: (Module (SymbolTable 4 {a: (ExternalSymbol 4 a 2 a interface_04_mod1 [] a Public), a1: (ExternalSymbol 4 a1 2 a1 interface_04_mod1 [] a1 Public)}) interface_04_mod2 [interface_04_mod1] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_04: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_04_mod1 [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_04_mod1 [] a1 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) interface_04 [interface_04_mod2] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_04_mod1: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a InOut () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_04_mod1 [] .false. .false.), interface_04_mod2: (Module (SymbolTable 4 {a: (ExternalSymbol 4 a 2 a interface_04_mod1 [] a Public), a1: (ExternalSymbol 4 a1 2 a1 interface_04_mod1 [] a1 Public)}) interface_04_mod2 [interface_04_mod1] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_05-5639d22.json b/tests/reference/asr-interface_05-5639d22.json index e6b34dd7ee..eb7d14e336 100644 --- a/tests/reference/asr-interface_05-5639d22.json +++ b/tests/reference/asr-interface_05-5639d22.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_05-5639d22.stdout", - "stdout_hash": "2d438ea507da62ef6ef7433bd7ee135b115fabb5de48302f2ad6ef8f", + "stdout_hash": "831dd9995d5336bf15a97d0ac628ab2b90265c75f95fb36b1441b088", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_05-5639d22.stdout b/tests/reference/asr-interface_05-5639d22.stdout index 5bb4e3cdb8..a4f0d14fef 100644 --- a/tests/reference/asr-interface_05-5639d22.stdout +++ b/tests/reference/asr-interface_05-5639d22.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_05: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_05_mod [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_05_mod [] a1 Private), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_05_mod [] a2 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_05 [interface_05_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (= (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4 []) () ()) ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_05_mod: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1 2 a2] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), a1: (Variable 3 a1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 3 a1) Source Public Implementation () .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a2: (Variable 4 a2 ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] (Var 4 a2) Source Public Implementation () .false. .false. .false.)}) interface_05_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_05: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_05_mod [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_05_mod [] a1 Private), a@a2: (ExternalSymbol 5 a@a2 2 a2 interface_05_mod [] a2 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_05 [interface_05_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (= (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4 []) () ()) ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), interface_05_mod: (Module (SymbolTable 2 {a: (GenericProcedure 2 a [2 a1 2 a2] Public), a1: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), a1: (Variable 3 a1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 3 a1) Source Public Implementation () .false. .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a2: (Variable 4 a2 ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] (Var 4 a2) Source Public Implementation () .false. .false. .false. .false.)}) interface_05_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_08-1848d3c.json b/tests/reference/asr-interface_08-1848d3c.json index 76cf213939..a4a253d816 100644 --- a/tests/reference/asr-interface_08-1848d3c.json +++ b/tests/reference/asr-interface_08-1848d3c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_08-1848d3c.stdout", - "stdout_hash": "c849b40b33445f14229c09e8d7d0767748cfb7985af34ac3fe44b725", + "stdout_hash": "9ab2eb72764b583fbd6710a91effdeb88db57f4eefb9e6954dcbfb89", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_08-1848d3c.stdout b/tests/reference/asr-interface_08-1848d3c.stdout index 4ba7e15868..e723bc27b8 100644 --- a/tests/reference/asr-interface_08-1848d3c.stdout +++ b/tests/reference/asr-interface_08-1848d3c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_08: (Module (SymbolTable 2 {sub: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub [(Var 3 x) (Var 3 y)] [] [] () Source Public Interface () .false. .false. .false.)}) interface_08 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_08: (Module (SymbolTable 2 {sub: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub [(Var 3 x) (Var 3 y)] [] [] () Source Public Interface () .false. .false. .false. .false.)}) interface_08 [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_10-e9eb6ea.json b/tests/reference/asr-interface_10-e9eb6ea.json index f0807f38cf..6669328a7b 100644 --- a/tests/reference/asr-interface_10-e9eb6ea.json +++ b/tests/reference/asr-interface_10-e9eb6ea.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_10-e9eb6ea.stdout", - "stdout_hash": "225678542d53830aa099cea44d843fdb4f02c6d3148eb22122c9a7eb", + "stdout_hash": "d0f6164c81578cfc0ec54f8bf173add9f5b1dbfb7bdb7527534a6040", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_10-e9eb6ea.stdout b/tests/reference/asr-interface_10-e9eb6ea.stdout index d6901e19fa..809d24ef38 100644 --- a/tests/reference/asr-interface_10-e9eb6ea.stdout +++ b/tests/reference/asr-interface_10-e9eb6ea.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_10: (Program (SymbolTable 4 {chars: (ExternalSymbol 4 chars 2 chars interface_10_m [] chars Public), chars@identity: (ExternalSymbol 4 chars@identity 2 identity interface_10_m [] identity Private), identity: (ExternalSymbol 4 identity 2 identity interface_10_m [] identity Public), x: (Variable 4 x Local () () Default (Character 1 1 () []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Character 1 1 () []) Source Public Required .false.)}) interface_10 [interface_10_m] [(= (Var 4 x) (StringConstant "A" (Character 1 1 () [])) ()) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] ()) (Print () [(Var 4 x)] () ())]), interface_10_m: (Module (SymbolTable 2 {chars: (GenericProcedure 2 chars [2 identity] Public), identity: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Character 1 1 () []) Source Public Required .false.), y: (Variable 3 y Out () () Default (Character 1 1 () []) Source Public Required .false.)}) identity [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false.)}) interface_10_m [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_10: (Program (SymbolTable 4 {chars: (ExternalSymbol 4 chars 2 chars interface_10_m [] chars Public), chars@identity: (ExternalSymbol 4 chars@identity 2 identity interface_10_m [] identity Private), identity: (ExternalSymbol 4 identity 2 identity interface_10_m [] identity Public), x: (Variable 4 x Local () () Default (Character 1 1 () []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Character 1 1 () []) Source Public Required .false.)}) interface_10 [interface_10_m] [(= (Var 4 x) (StringConstant "A" (Character 1 1 () [])) ()) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] ()) (Print () [(Var 4 x)] () ())]), interface_10_m: (Module (SymbolTable 2 {chars: (GenericProcedure 2 chars [2 identity] Public), identity: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Character 1 1 () []) Source Public Required .false.), y: (Variable 3 y Out () () Default (Character 1 1 () []) Source Public Required .false.)}) identity [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_10_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.json b/tests/reference/asr-intrinsics_26-f10d0e6.json index 991dbc0231..6b15f1bb97 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.json +++ b/tests/reference/asr-intrinsics_26-f10d0e6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_26-f10d0e6.stdout", - "stdout_hash": "c2a21033a22e37877043ea9f509553066021a6ed1aeb3033beca0c3e", + "stdout_hash": "ef1728df2b0b3abe7858b3871cfe4fc80350926d731dee3c774dd56c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.stdout b/tests/reference/asr-intrinsics_26-f10d0e6.stdout index ee0c9b9860..3d3595463b 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.stdout +++ b/tests/reference/asr-intrinsics_26-f10d0e6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_26: (Program (SymbolTable 4 {all_set: (ExternalSymbol 4 all_set 2 all_set stdlib_bitsets_64 [] all_set Public), i: (Variable 4 i Local (IntegerConstant 31 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) intrinsics_26 [stdlib_bitsets_64] [(Print () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), stdlib_bitsets_64: (Module (SymbolTable 2 {all_set: (Function (SymbolTable 3 {btest: (ExternalSymbol 3 btest 6 btest lfortran_intrinsic_bit [] btest Private), btest@btest32: (ExternalSymbol 3 btest@btest32 6 btest32 lfortran_intrinsic_bit [] btest32 Private), num_bits: (Variable 3 num_bits In () () Default (Integer 4 []) Source Public Required .false.), pos: (Variable 3 pos Local () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 3 res ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) all_set [(Var 3 x) (Var 3 num_bits)] [] [(= (Var 3 res) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 3 pos) (IntegerConstant 0 (Integer 4 [])) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) [(If (LogicalNot (FunctionCall 3 btest@btest32 3 btest [((Var 3 x)) ((Var 3 pos))] (Logical 4 []) () ()) (Logical 4 []) ()) [(= (Var 3 res) (LogicalConstant .false. (Logical 4 [])) ())] [])])] (Var 3 res) Source Public Implementation () .false. .false. .false.)}) stdlib_bitsets_64 [lfortran_intrinsic_bit] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_26: (Program (SymbolTable 4 {all_set: (ExternalSymbol 4 all_set 2 all_set stdlib_bitsets_64 [] all_set Public), i: (Variable 4 i Local (IntegerConstant 31 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) intrinsics_26 [stdlib_bitsets_64] [(Print () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), stdlib_bitsets_64: (Module (SymbolTable 2 {all_set: (Function (SymbolTable 3 {btest: (ExternalSymbol 3 btest 6 btest lfortran_intrinsic_bit [] btest Private), btest@btest32: (ExternalSymbol 3 btest@btest32 6 btest32 lfortran_intrinsic_bit [] btest32 Private), num_bits: (Variable 3 num_bits In () () Default (Integer 4 []) Source Public Required .false.), pos: (Variable 3 pos Local () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 3 res ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) all_set [(Var 3 x) (Var 3 num_bits)] [] [(= (Var 3 res) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 3 pos) (IntegerConstant 0 (Integer 4 [])) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) [(If (LogicalNot (FunctionCall 3 btest@btest32 3 btest [((Var 3 x)) ((Var 3 pos))] (Logical 4 []) () ()) (Logical 4 []) ()) [(= (Var 3 res) (LogicalConstant .false. (Logical 4 [])) ())] [])])] (Var 3 res) Source Public Implementation () .false. .false. .false. .false.)}) stdlib_bitsets_64 [lfortran_intrinsic_bit] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_35-10733ec.json b/tests/reference/asr-intrinsics_35-10733ec.json index 0f0b0fa07e..6bdeffbaff 100644 --- a/tests/reference/asr-intrinsics_35-10733ec.json +++ b/tests/reference/asr-intrinsics_35-10733ec.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_35-10733ec.stdout", - "stdout_hash": "7bfdf700aa9474cfadf1093f5eb2f1234c3a917f207e655792f2a429", + "stdout_hash": "ea746792094ba71c3c5147aea5f7bcb33a57a4a86d8d91aa77566ffb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_35-10733ec.stdout b/tests/reference/asr-intrinsics_35-10733ec.stdout index 96409f2a7b..b949d28f1b 100644 --- a/tests/reference/asr-intrinsics_35-10733ec.stdout +++ b/tests/reference/asr-intrinsics_35-10733ec.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), test_any: (Program (SymbolTable 2 {any: (ExternalSymbol 2 any 5 any lfortran_intrinsic_builtin [] any Private), l: (Variable 2 l Local () () Default (Logical 4 []) Source Public Required .false.), section: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) section [] [] [(= (Var 3 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 3 b) (IntegerConstant 1 (Integer 4 [])) ()) (= (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4 [])) ()) (() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] (Logical 4 []) () ())] () ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 2 (Integer 4 [])))] (Logical 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) test_any [] [(= (Var 2 l) (FunctionCall 2 any () [((ArrayConstant [(LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 []))] (Logical 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])))] (Logical 4 []) () ()) ()) (Print () [(Var 2 l)] () ()) (SubroutineCall 2 section () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), test_any: (Program (SymbolTable 2 {any: (ExternalSymbol 2 any 5 any lfortran_intrinsic_builtin [] any Private), l: (Variable 2 l Local () () Default (Logical 4 []) Source Public Required .false.), section: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) section [] [] [(= (Var 3 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 3 b) (IntegerConstant 1 (Integer 4 [])) ()) (= (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4 [])) ()) (() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] (Logical 4 []) () ())] () ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 2 (Integer 4 [])))] (Logical 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) test_any [] [(= (Var 2 l) (FunctionCall 2 any () [((ArrayConstant [(LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 []))] (Logical 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])))] (Logical 4 []) () ()) ()) (Print () [(Var 2 l)] () ()) (SubroutineCall 2 section () [] ())])}) []) diff --git a/tests/reference/asr-issue532-4bdd3b3.json b/tests/reference/asr-issue532-4bdd3b3.json index 924b508aec..e478ef77c1 100644 --- a/tests/reference/asr-issue532-4bdd3b3.json +++ b/tests/reference/asr-issue532-4bdd3b3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-issue532-4bdd3b3.stdout", - "stdout_hash": "b08631b7bbf6ae74f52cb7ffc5669878deda272d0fc4bd7a8533c905", + "stdout_hash": "28fec8bd37b6762b67a72812fba0f123c332a8ad035d434dec517955", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-issue532-4bdd3b3.stdout b/tests/reference/asr-issue532-4bdd3b3.stdout index cd48f2085f..8fece80e6f 100644 --- a/tests/reference/asr-issue532-4bdd3b3.stdout +++ b/tests/reference/asr-issue532-4bdd3b3.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {issue532: (Program (SymbolTable 5 {}) issue532 [] []), issue532_mod: (Module (SymbolTable 2 {imodulo: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), real: (ExternalSymbol 4 real 7 real lfortran_intrinsic_builtin [] real Private), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 4 y In () () Default (Integer 4 []) Source Public Required .false.)}) imodulo [(Var 4 x) (Var 4 y)] [] [(= (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((Cast (Var 4 x) IntegerToReal (Real 4 []) ()))] (Integer 4 []) () ()) Mul (Var 4 y) (Integer 4 []) ()) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), sfloor: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 4 []) Source Public Required .false.)}) sfloor [(Var 3 x)] [] [(= (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) issue532_mod [lfortran_intrinsic_builtin] .false. .false.), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin)}) []) +(TranslationUnit (SymbolTable 1 {issue532: (Program (SymbolTable 5 {}) issue532 [] []), issue532_mod: (Module (SymbolTable 2 {imodulo: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), real: (ExternalSymbol 4 real 7 real lfortran_intrinsic_builtin [] real Private), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 4 y In () () Default (Integer 4 []) Source Public Required .false.)}) imodulo [(Var 4 x) (Var 4 y)] [] [(= (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((Cast (Var 4 x) IntegerToReal (Real 4 []) ()))] (Integer 4 []) () ()) Mul (Var 4 y) (Integer 4 []) ()) ())] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), sfloor: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 4 []) Source Public Required .false.)}) sfloor [(Var 3 x)] [] [(= (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) issue532_mod [lfortran_intrinsic_builtin] .false. .false.), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin)}) []) diff --git a/tests/reference/asr-kokkos_program2-8391215.json b/tests/reference/asr-kokkos_program2-8391215.json index 32321b8ce1..bd332946f4 100644 --- a/tests/reference/asr-kokkos_program2-8391215.json +++ b/tests/reference/asr-kokkos_program2-8391215.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-kokkos_program2-8391215.stdout", - "stdout_hash": "f88f3d33d8403570dfabaa50ad44badea5f692b929c8375acdbf8ebe", + "stdout_hash": "f2d7170aba22df0abd737d54b3244c3c5f309e5c45d0fad2c4f27f11", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-kokkos_program2-8391215.stdout b/tests/reference/asr-kokkos_program2-8391215.stdout index 16e3ee6c9a..f3a699bd60 100644 --- a/tests/reference/asr-kokkos_program2-8391215.stdout +++ b/tests/reference/asr-kokkos_program2-8391215.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {kokkos_program2: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 2 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar Local () () Default (Real 4 []) Source Public Required .false.), triad: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(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 1 (Integer 4 [])) (Var 3 n) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false.)}) kokkos_program2 [] [(= (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 10.000000 (Real 4 []))) ()) (= (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4 []) (IntegerConstant 10000 (Integer 4 []))) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 nsize) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ())]) (SubroutineCall 2 triad () [((Var 2 a)) ((Var 2 b)) ((Var 2 scalar)) ((Var 2 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))] () ())])}) []) +(TranslationUnit (SymbolTable 1 {kokkos_program2: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 2 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar Local () () Default (Real 4 []) Source Public Required .false.), triad: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(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 1 (Integer 4 [])) (Var 3 n) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false. .false.)}) kokkos_program2 [] [(= (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 10.000000 (Real 4 []))) ()) (= (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4 []) (IntegerConstant 10000 (Integer 4 []))) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 nsize) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ())]) (SubroutineCall 2 triad () [((Var 2 a)) ((Var 2 b)) ((Var 2 scalar)) ((Var 2 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))] () ())])}) []) diff --git a/tests/reference/asr-kwargs_02-1588831.json b/tests/reference/asr-kwargs_02-1588831.json index 8725c775b6..3baa2a0c85 100644 --- a/tests/reference/asr-kwargs_02-1588831.json +++ b/tests/reference/asr-kwargs_02-1588831.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-kwargs_02-1588831.stdout", - "stdout_hash": "b6438486b94c0e4928b009c002f4f5a61d18f3aca1c9e6e0cbac6639", + "stdout_hash": "229a05fe78f59d35029cf4289f0e0a7dc5b76627d01df40f8a01eb7f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-kwargs_02-1588831.stdout b/tests/reference/asr-kwargs_02-1588831.stdout index 38583c5c76..8a5422b044 100644 --- a/tests/reference/asr-kwargs_02-1588831.stdout +++ b/tests/reference/asr-kwargs_02-1588831.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {kwargs_02: (Program (SymbolTable 6 {}) kwargs_02 [] []), stdlib_logger: (Module (SymbolTable 2 {add_log_file: (Function (SymbolTable 4 {filename: (Variable 4 filename In () () Default (Character 1 -1 () []) Source Public Required .false.), self: (Variable 4 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 4 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) add_log_file [(Var 4 self) (Var 4 filename) (Var 4 unit)] [] [(SubroutineCall 3 log_io_error () [((IntegerConstant 1 (Integer 4 []))) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self))] () Source Public Implementation () .false. .false. .false.), log_io_error: (Function (SymbolTable 5 {code: (Variable 5 code In () () Default (Integer 4 []) Source Public Required .false.), filename: (Variable 5 filename In () () Default (Character 1 -1 () []) Source Public Optional .false.), self: (Variable 5 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 5 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) log_io_error [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] [] () Source Public Implementation () .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_log_file: (ClassProcedure 3 add_log_file add_log_file 2 add_log_file Source), log_io_error: (ClassProcedure 3 log_io_error log_io_error 2 log_io_error Source)}) logger_type [] Source Public ())}) stdlib_logger [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {kwargs_02: (Program (SymbolTable 6 {}) kwargs_02 [] []), stdlib_logger: (Module (SymbolTable 2 {add_log_file: (Function (SymbolTable 4 {filename: (Variable 4 filename In () () Default (Character 1 -1 () []) Source Public Required .false.), self: (Variable 4 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 4 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) add_log_file [(Var 4 self) (Var 4 filename) (Var 4 unit)] [] [(SubroutineCall 3 log_io_error () [((IntegerConstant 1 (Integer 4 []))) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self))] () Source Public Implementation () .false. .false. .false. .false.), log_io_error: (Function (SymbolTable 5 {code: (Variable 5 code In () () Default (Integer 4 []) Source Public Required .false.), filename: (Variable 5 filename In () () Default (Character 1 -1 () []) Source Public Optional .false.), self: (Variable 5 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 5 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) log_io_error [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] [] () Source Public Implementation () .false. .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_log_file: (ClassProcedure 3 add_log_file add_log_file 2 add_log_file Source), log_io_error: (ClassProcedure 3 log_io_error log_io_error 2 log_io_error Source)}) logger_type [] Source Public ())}) stdlib_logger [] .false. .false.)}) []) diff --git a/tests/reference/asr-loop_test2-82d82ea.json b/tests/reference/asr-loop_test2-82d82ea.json index 316b434c7f..cf3d199ae9 100644 --- a/tests/reference/asr-loop_test2-82d82ea.json +++ b/tests/reference/asr-loop_test2-82d82ea.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-loop_test2-82d82ea.stdout", - "stdout_hash": "ab16d86e92a60d1b61cb94b85d58d2e3bdee2c8804b213f57bf991a3", + "stdout_hash": "394e360e1d900a29d04e85a645b294e2ec91741d1eb9b34bc09ad6b4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-loop_test2-82d82ea.stdout b/tests/reference/asr-loop_test2-82d82ea.stdout index 517748a806..e221e20e89 100644 --- a/tests/reference/asr-loop_test2-82d82ea.stdout +++ b/tests/reference/asr-loop_test2-82d82ea.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {indx: (Variable 2 indx Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), l1: (Variable 2 l1 Local () () Default (Integer 4 []) Source Public Required .false.), l2: (Variable 2 l2 Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), nq: (Variable 2 nq Local () () Default (Integer 4 []) Source Public Required .false.), v: (Variable 2 v Local () () Default (Real 4 []) Source Public Required .false.), ve: (Variable 2 ve Local () () Default (Real 4 []) Source Public Required .false.), vev: (Variable 2 vev Local () () Default (Real 4 []) Source Public Required .false.), wrk5: (Variable 2 wrk5 Local () () Default (Real 4 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 4 []) Source Public Required .false.)}) f [] [] [(DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4 []) ()) ()) (GoToTarget 110)]) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) ()) (GoToTarget 120)]) (GoToTarget 140)]) (= (Var 2 indx) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 l2) (IntegerConstant 1 (Integer 4 [])) (Var 2 l1) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (Var 2 zero) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ()) (GoToTarget 210)]) (= (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4 []) ()) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) ()) (GoToTarget 220)]) (GoToTarget 230)]) (Return)] () Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {indx: (Variable 2 indx Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), l1: (Variable 2 l1 Local () () Default (Integer 4 []) Source Public Required .false.), l2: (Variable 2 l2 Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), nq: (Variable 2 nq Local () () Default (Integer 4 []) Source Public Required .false.), v: (Variable 2 v Local () () Default (Real 4 []) Source Public Required .false.), ve: (Variable 2 ve Local () () Default (Real 4 []) Source Public Required .false.), vev: (Variable 2 vev Local () () Default (Real 4 []) Source Public Required .false.), wrk5: (Variable 2 wrk5 Local () () Default (Real 4 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 4 []) Source Public Required .false.)}) f [] [] [(DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4 []) ()) ()) (GoToTarget 110)]) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) ()) (GoToTarget 120)]) (GoToTarget 140)]) (= (Var 2 indx) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 l2) (IntegerConstant 1 (Integer 4 [])) (Var 2 l1) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (Var 2 zero) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ()) (GoToTarget 210)]) (= (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4 []) ()) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) ()) (GoToTarget 220)]) (GoToTarget 230)]) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-loop_unroll_small-13135c0.json b/tests/reference/asr-loop_unroll_small-13135c0.json index c6dc8a4cae..1b0c0866e5 100644 --- a/tests/reference/asr-loop_unroll_small-13135c0.json +++ b/tests/reference/asr-loop_unroll_small-13135c0.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_small-13135c0.stdout", - "stdout_hash": "81a9a0d71108fda0829338b7b3308418cac81ad79f12a6e3b38bc8c1", + "stdout_hash": "4d8039cf564d13d2a3bd36327bf92d60262966ad430e0cc88ece8776", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-loop_unroll_small-13135c0.stdout b/tests/reference/asr-loop_unroll_small-13135c0.stdout index 33489d7920..fdb9a7f5be 100644 --- a/tests/reference/asr-loop_unroll_small-13135c0.stdout +++ b/tests/reference/asr-loop_unroll_small-13135c0.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) +(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) diff --git a/tests/reference/asr-modules_01-3535389.json b/tests/reference/asr-modules_01-3535389.json index ba42444227..2b09765715 100644 --- a/tests/reference/asr-modules_01-3535389.json +++ b/tests/reference/asr-modules_01-3535389.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_01-3535389.stdout", - "stdout_hash": "00f179cc510d7e1260b82c74777d4583edfbfba6502d2408700a9f46", + "stdout_hash": "70aa2fe6abc4e622241e81f248d33229a9f60214d982f7ca17560aed", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_01-3535389.stdout b/tests/reference/asr-modules_01-3535389.stdout index 2299be7cfe..dc3cae1666 100644 --- a/tests/reference/asr-modules_01-3535389.stdout +++ b/tests/reference/asr-modules_01-3535389.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) a_01 [] .false. .false.), modules_01: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_01 [] b Public)}) modules_01 [a_01] [(SubroutineCall 4 b () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) a_01 [] .false. .false.), modules_01: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_01 [] b Public)}) modules_01 [a_01] [(SubroutineCall 4 b () [] ())])}) []) diff --git a/tests/reference/asr-modules_02-74be421.json b/tests/reference/asr-modules_02-74be421.json index ec697f262a..8c815fab11 100644 --- a/tests/reference/asr-modules_02-74be421.json +++ b/tests/reference/asr-modules_02-74be421.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_02-74be421.stdout", - "stdout_hash": "b1154a5ce8c10829f67343f0ad9ae97f09264051c6e5a06fe9f63eef", + "stdout_hash": "35b67870863e83fedd31c9ae8d5b69a8369404e31758f8e788dae1f7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_02-74be421.stdout b/tests/reference/asr-modules_02-74be421.stdout index b4471062f7..fb786e0a8b 100644 --- a/tests/reference/asr-modules_02-74be421.stdout +++ b/tests/reference/asr-modules_02-74be421.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_02: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) a_02 [] .false. .false.), c_02: (Module (SymbolTable 4 {d: (Function (SymbolTable 5 {}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.), e: (Function (SymbolTable 6 {}) e [] [] [(Print () [(StringConstant "e()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) c_02 [] .false. .false.), modules_02: (Program (SymbolTable 7 {b: (ExternalSymbol 7 b 2 b a_02 [] b Public), e: (ExternalSymbol 7 e 4 e c_02 [] e Public), x: (ExternalSymbol 7 x 4 d c_02 [] d Public)}) modules_02 [a_02 c_02] [(SubroutineCall 7 b () [] ()) (SubroutineCall 7 x () [] ()) (SubroutineCall 7 e () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a_02: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) a_02 [] .false. .false.), c_02: (Module (SymbolTable 4 {d: (Function (SymbolTable 5 {}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.), e: (Function (SymbolTable 6 {}) e [] [] [(Print () [(StringConstant "e()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) c_02 [] .false. .false.), modules_02: (Program (SymbolTable 7 {b: (ExternalSymbol 7 b 2 b a_02 [] b Public), e: (ExternalSymbol 7 e 4 e c_02 [] e Public), x: (ExternalSymbol 7 x 4 d c_02 [] d Public)}) modules_02 [a_02 c_02] [(SubroutineCall 7 b () [] ()) (SubroutineCall 7 x () [] ()) (SubroutineCall 7 e () [] ())])}) []) diff --git a/tests/reference/asr-modules_03-54c2520.json b/tests/reference/asr-modules_03-54c2520.json index 836fce7cf5..814bf07fe3 100644 --- a/tests/reference/asr-modules_03-54c2520.json +++ b/tests/reference/asr-modules_03-54c2520.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_03-54c2520.stdout", - "stdout_hash": "f411d476b1a5b4541049c85c3299c194307f8e1a2259e752289cf82b", + "stdout_hash": "16abf66cad4edf8173bab375d05fb624f0958af6b901acbe1276ffc4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_03-54c2520.stdout b/tests/reference/asr-modules_03-54c2520.stdout index af9df024ec..b436f2decd 100644 --- a/tests/reference/asr-modules_03-54c2520.stdout +++ b/tests/reference/asr-modules_03-54c2520.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_04-0d478be.json b/tests/reference/asr-modules_04-0d478be.json index c73ba46f93..4cb2ece981 100644 --- a/tests/reference/asr-modules_04-0d478be.json +++ b/tests/reference/asr-modules_04-0d478be.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_04-0d478be.stdout", - "stdout_hash": "f411d476b1a5b4541049c85c3299c194307f8e1a2259e752289cf82b", + "stdout_hash": "16abf66cad4edf8173bab375d05fb624f0958af6b901acbe1276ffc4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_04-0d478be.stdout b/tests/reference/asr-modules_04-0d478be.stdout index af9df024ec..b436f2decd 100644 --- a/tests/reference/asr-modules_04-0d478be.stdout +++ b/tests/reference/asr-modules_04-0d478be.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_05-f939cc6.json b/tests/reference/asr-modules_05-f939cc6.json index d95de13740..001a11e446 100644 --- a/tests/reference/asr-modules_05-f939cc6.json +++ b/tests/reference/asr-modules_05-f939cc6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_05-f939cc6.stdout", - "stdout_hash": "8a064c473731e37fc6eaed51be76a3a60278f236c17696045e300903", + "stdout_hash": "30b33593f44ced04f3c7bce004c1b82b28c3da5e61eeea8e81600264", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_05-f939cc6.stdout b/tests/reference/asr-modules_05-f939cc6.stdout index 3b8f4d6fb8..53ec73bd23 100644 --- a/tests/reference/asr-modules_05-f939cc6.stdout +++ b/tests/reference/asr-modules_05-f939cc6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Private Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Private Required .false.), print_vars: (Variable 3 print_vars ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) print_vars [(Var 3 a) (Var 3 b)] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 3 a)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 3 b)] () ()) (= (Var 3 print_vars) (IntegerConstant 1 (Integer 4 [])) ())] (Var 3 print_vars) Source Private Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Private Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Private Required .false.), print_vars: (Variable 3 print_vars ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) print_vars [(Var 3 a) (Var 3 b)] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 3 a)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 3 b)] () ()) (= (Var 3 print_vars) (IntegerConstant 1 (Integer 4 [])) ())] (Var 3 print_vars) Source Private Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_06-609dd30.json b/tests/reference/asr-modules_06-609dd30.json index 3c25252cb6..3aa6092c50 100644 --- a/tests/reference/asr-modules_06-609dd30.json +++ b/tests/reference/asr-modules_06-609dd30.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-609dd30.stdout", - "stdout_hash": "d03e6170844b1ab9b9b8da1f94bb69e63225bab76f8d4ec691ac907e", + "stdout_hash": "e39f66b7b55c57ef0a63ba4f875e889723a5194fad004066717873a4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-609dd30.stdout b/tests/reference/asr-modules_06-609dd30.stdout index fb90931a68..e033d7b15d 100644 --- a/tests/reference/asr-modules_06-609dd30.stdout +++ b/tests/reference/asr-modules_06-609dd30.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_06: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 r) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a_06 [] .false. .false.), modules_06: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_06 [] b Public), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.)}) modules_06 [a_06] [(= (Var 4 i) (FunctionCall 4 b () [] (Integer 4 []) () ()) ()) (Print () [(Var 4 i)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a_06: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 r) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) a_06 [] .false. .false.), modules_06: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_06 [] b Public), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.)}) modules_06 [a_06] [(= (Var 4 i) (FunctionCall 4 b () [] (Integer 4 []) () ()) ()) (Print () [(Var 4 i)] () ())])}) []) diff --git a/tests/reference/asr-modules_06-821cc56.json b/tests/reference/asr-modules_06-821cc56.json index 8c80cafd25..e4165dd3b3 100644 --- a/tests/reference/asr-modules_06-821cc56.json +++ b/tests/reference/asr-modules_06-821cc56.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-821cc56.stdout", - "stdout_hash": "b28d1600e77962023c84a49d89a16212dda9ead7e411bee66c487c93", + "stdout_hash": "cda095f78cebaf792b69af7be947e8e851ded5ba85cb87ad18a81024", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-821cc56.stdout b/tests/reference/asr-modules_06-821cc56.stdout index 98836e82c2..0861780ab8 100644 --- a/tests/reference/asr-modules_06-821cc56.stdout +++ b/tests/reference/asr-modules_06-821cc56.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {modules_06_a: (Module (SymbolTable 4 {a: (Function (SymbolTable 5 {a: (Variable 5 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [(= (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Add (FunctionCall 4 b () [] (Integer 4 []) () ()) (Integer 4 []) ()) ())] (Var 5 a) Source Public Implementation () .false. .false. .false.), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Private)}) modules_06_a [modules_06_b] .false. .false.), modules_06_b: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(= (Var 3 b) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) modules_06_b [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {modules_06_a: (Module (SymbolTable 4 {a: (Function (SymbolTable 5 {a: (Variable 5 a ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a [] [] [(= (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Add (FunctionCall 4 b () [] (Integer 4 []) () ()) (Integer 4 []) ()) ())] (Var 5 a) Source Public Implementation () .false. .false. .false. .false.), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Private)}) modules_06_a [modules_06_b] .false. .false.), modules_06_b: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(= (Var 3 b) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) modules_06_b [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_11-dd72b29.json b/tests/reference/asr-modules_11-dd72b29.json index e96dc2e9d4..9e24bfbeaf 100644 --- a/tests/reference/asr-modules_11-dd72b29.json +++ b/tests/reference/asr-modules_11-dd72b29.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_11-dd72b29.stdout", - "stdout_hash": "1887039a737483b33da3a009d1f75c4d29c00a7c566e3e73511ef250", + "stdout_hash": "2933123a2ead99b96a54443e659f37e76cefd61a22e0fe9a07fe89b4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_11-dd72b29.stdout b/tests/reference/asr-modules_11-dd72b29.stdout index 8a7abe0a79..2b0ffedeed 100644 --- a/tests/reference/asr-modules_11-dd72b29.stdout +++ b/tests/reference/asr-modules_11-dd72b29.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_externally: (Program (SymbolTable 4 {access_internally: (ExternalSymbol 4 access_internally 2 access_internally module_11 [] access_internally Public), i: (ExternalSymbol 4 i 2 i module_11 [] i Public), j: (ExternalSymbol 4 j 2 j module_11 [] j Public)}) access_externally [module_11] [(Print () [(StringConstant "j = " (Character 1 4 () [])) (Var 4 j)] () ()) (SubroutineCall 4 access_internally () [] ())]), module_11: (Module (SymbolTable 2 {access_internally: (Function (SymbolTable 3 {}) access_internally [] [] [(Print () [(StringConstant "i = " (Character 1 4 () [])) (Var 2 i)] () ())] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) module_11 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_externally: (Program (SymbolTable 4 {access_internally: (ExternalSymbol 4 access_internally 2 access_internally module_11 [] access_internally Public), i: (ExternalSymbol 4 i 2 i module_11 [] i Public), j: (ExternalSymbol 4 j 2 j module_11 [] j Public)}) access_externally [module_11] [(Print () [(StringConstant "j = " (Character 1 4 () [])) (Var 4 j)] () ()) (SubroutineCall 4 access_internally () [] ())]), module_11: (Module (SymbolTable 2 {access_internally: (Function (SymbolTable 3 {}) access_internally [] [] [(Print () [(StringConstant "i = " (Character 1 4 () [])) (Var 2 i)] () ())] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) module_11 [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_15b-09f8335.json b/tests/reference/asr-modules_15b-09f8335.json index 2a7d7a3798..f28c1a2f2c 100644 --- a/tests/reference/asr-modules_15b-09f8335.json +++ b/tests/reference/asr-modules_15b-09f8335.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_15b-09f8335.stdout", - "stdout_hash": "fcb0a67ac4764012588ecef29174f8fb5307d30c125c868d1ea0dcd5", + "stdout_hash": "5a7f731a1a36937ed0c468e41fa5772370502f8f3dd912aded8e8087", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_15b-09f8335.stdout b/tests/reference/asr-modules_15b-09f8335.stdout index c71439beef..a06cc5b589 100644 --- a/tests/reference/asr-modules_15b-09f8335.stdout +++ b/tests/reference/asr-modules_15b-09f8335.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), modules_15b: (Module (SymbolTable 2 {c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public), call_fortran_f32: (Function (SymbolTable 64 {i: (Variable 64 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 64 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32 [(Var 64 i)] [] [] (Var 64 r) BindC Public Interface () .false. .false. .false.), call_fortran_f32_value: (Function (SymbolTable 65 {i: (Variable 65 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 65 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32_value [(Var 65 i)] [] [] (Var 65 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64: (Function (SymbolTable 66 {i: (Variable 66 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 66 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64 [(Var 66 i)] [] [] (Var 66 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64_value: (Function (SymbolTable 67 {i: (Variable 67 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 67 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64_value [(Var 67 i)] [] [] (Var 67 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32: (Function (SymbolTable 60 {i: (Variable 60 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 60 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32 [(Var 60 i)] [] [] (Var 60 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32_value: (Function (SymbolTable 61 {i: (Variable 61 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 61 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32_value [(Var 61 i)] [] [] (Var 61 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64: (Function (SymbolTable 62 {i: (Variable 62 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 62 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64 [(Var 62 i)] [] [] (Var 62 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64_value: (Function (SymbolTable 63 {i: (Variable 63 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 63 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64_value [(Var 63 i)] [] [] (Var 63 r) BindC Public Interface () .false. .false. .false.), f_double_complex_value_return: (Function (SymbolTable 40 {b: (Variable 40 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 40 r ReturnVar () () Default (Complex 8 []) BindC Public Required .false.)}) f_double_complex_value_return [(Var 40 b)] [] [] (Var 40 r) BindC Public Interface () .false. .false. .false.), f_float_complex_value_return: (Function (SymbolTable 39 {b: (Variable 39 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 39 r ReturnVar () () Default (Complex 4 []) BindC Public Required .false.)}) f_float_complex_value_return [(Var 39 b)] [] [] (Var 39 r) BindC Public Interface () .false. .false. .false.), f_int_double: (Function (SymbolTable 34 {a: (Variable 34 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 34 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 34 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double [(Var 34 a) (Var 34 b)] [] [] (Var 34 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex: (Function (SymbolTable 36 {a: (Variable 36 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 36 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 36 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex [(Var 36 a) (Var 36 b)] [] [] (Var 36 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex_value: (Function (SymbolTable 38 {a: (Variable 38 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 38 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 38 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex_value [(Var 38 a) (Var 38 b)] [] [] (Var 38 r) BindC Public Interface () .false. .false. .false.), f_int_double_value: (Function (SymbolTable 42 {a: (Variable 42 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 42 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 42 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value [(Var 42 a) (Var 42 b)] [] [] (Var 42 r) BindC Public Interface () .false. .false. .false.), f_int_double_value_name: (Function (SymbolTable 46 {a: (Variable 46 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 46 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 46 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value_name [(Var 46 a) (Var 46 b)] [] [] (Var 46 r) BindC Public Interface "f_int_double_value" .false. .false. .false.), f_int_doublearray: (Function (SymbolTable 45 {b: (Variable 45 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 45 n))]) BindC Public Required .false.), n: (Variable 45 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 45 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) f_int_doublearray [(Var 45 n) (Var 45 b)] [] [] (Var 45 r) BindC Public Interface () .false. .false. .false.), f_int_float: (Function (SymbolTable 33 {a: (Variable 33 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 33 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 33 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float [(Var 33 a) (Var 33 b)] [] [] (Var 33 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex: (Function (SymbolTable 35 {a: (Variable 35 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 35 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 35 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex [(Var 35 a) (Var 35 b)] [] [] (Var 35 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex_value: (Function (SymbolTable 37 {a: (Variable 37 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 37 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 37 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex_value [(Var 37 a) (Var 37 b)] [] [] (Var 37 r) BindC Public Interface () .false. .false. .false.), f_int_float_value: (Function (SymbolTable 41 {a: (Variable 41 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 41 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 41 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_value [(Var 41 a) (Var 41 b)] [] [] (Var 41 r) BindC Public Interface () .false. .false. .false.), f_int_floatarray: (Function (SymbolTable 44 {b: (Variable 44 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 44 n))]) BindC Public Required .false.), n: (Variable 44 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 44 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f_int_floatarray [(Var 44 n) (Var 44 b)] [] [] (Var 44 r) BindC Public Interface () .false. .false. .false.), f_int_intarray: (Function (SymbolTable 43 {b: (Variable 43 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 43 n))]) BindC Public Required .false.), n: (Variable 43 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 43 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_intarray [(Var 43 n) (Var 43 b)] [] [] (Var 43 r) BindC Public Interface () .false. .false. .false.), f_string: (Function (SymbolTable 68 {r: (Variable 68 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 68 s In () () Default (Character 1 -1 () []) Source Public Required .false.)}) f_string [(Var 68 s)] [] [(= (Var 68 r) (FunctionCall 2 f_string0 () [((StringConcat (Var 68 s) (Var 2 c_null_char) (Character 1 0 () []) ()))] (Integer 4 []) () ()) ())] (Var 68 r) Source Public Implementation () .false. .false. .false.), f_string0: (Function (SymbolTable 59 {r: (Variable 59 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.), s: (Variable 59 s In () () Default (Character 1 1 () [(() ())]) BindC Public Required .false.)}) f_string0 [(Var 59 s)] [] [] (Var 59 r) BindC Public Interface "f_string" .false. .false. .false.), fortran_f32: (Function (SymbolTable 73 {i: (Variable 73 i In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 73 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32 [(Var 73 i)] [] [(= (Var 73 r) (RealBinOp (Var 73 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 73 r) BindC Public Implementation () .false. .false. .false.), fortran_f32_value: (Function (SymbolTable 74 {i: (Variable 74 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 74 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32_value [(Var 74 i)] [] [(= (Var 74 r) (RealBinOp (Var 74 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 74 r) BindC Public Implementation () .false. .false. .false.), fortran_f64: (Function (SymbolTable 75 {i: (Variable 75 i In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 75 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64 [(Var 75 i)] [] [(= (Var 75 r) (RealBinOp (Var 75 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 75 r) BindC Public Implementation () .false. .false. .false.), fortran_f64_value: (Function (SymbolTable 76 {i: (Variable 76 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 76 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64_value [(Var 76 i)] [] [(= (Var 76 r) (RealBinOp (Var 76 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 76 r) BindC Public Implementation () .false. .false. .false.), fortran_i32: (Function (SymbolTable 69 {i: (Variable 69 i In () () Default (Integer 4 []) BindC Public Required .false.), r: (Variable 69 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32 [(Var 69 i)] [] [(= (Var 69 r) (IntegerBinOp (Var 69 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 69 r) BindC Public Implementation () .false. .false. .false.), fortran_i32_value: (Function (SymbolTable 70 {i: (Variable 70 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 70 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32_value [(Var 70 i)] [] [(= (Var 70 r) (IntegerBinOp (Var 70 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 70 r) BindC Public Implementation () .false. .false. .false.), fortran_i64: (Function (SymbolTable 71 {i: (Variable 71 i In () () Default (Integer 8 []) BindC Public Required .false.), r: (Variable 71 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64 [(Var 71 i)] [] [(= (Var 71 r) (IntegerBinOp (Var 71 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 71 r) BindC Public Implementation () .false. .false. .false.), fortran_i64_value: (Function (SymbolTable 72 {i: (Variable 72 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 72 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64_value [(Var 72 i)] [] [(= (Var 72 r) (IntegerBinOp (Var 72 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 72 r) BindC Public Implementation () .false. .false. .false.), sub_int_double: (Function (SymbolTable 48 {a: (Variable 48 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 48 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 48 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double [(Var 48 a) (Var 48 b) (Var 48 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex: (Function (SymbolTable 50 {a: (Variable 50 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 50 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 50 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex [(Var 50 a) (Var 50 b) (Var 50 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex_value: (Function (SymbolTable 54 {a: (Variable 54 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 54 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 54 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex_value [(Var 54 a) (Var 54 b) (Var 54 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value: (Function (SymbolTable 52 {a: (Variable 52 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 52 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 52 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value [(Var 52 a) (Var 52 b) (Var 52 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value_name: (Function (SymbolTable 58 {a: (Variable 58 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 58 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 58 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value_name [(Var 58 a) (Var 58 b) (Var 58 r)] [] [] () BindC Public Interface "sub_int_double_value" .false. .false. .false.), sub_int_doublearray: (Function (SymbolTable 57 {b: (Variable 57 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 57 n))]) BindC Public Required .false.), n: (Variable 57 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 57 r Out () () Default (Real 8 []) BindC Public Required .false.)}) sub_int_doublearray [(Var 57 n) (Var 57 b) (Var 57 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float: (Function (SymbolTable 47 {a: (Variable 47 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 47 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 47 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float [(Var 47 a) (Var 47 b) (Var 47 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex: (Function (SymbolTable 49 {a: (Variable 49 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 49 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 49 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex [(Var 49 a) (Var 49 b) (Var 49 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex_value: (Function (SymbolTable 53 {a: (Variable 53 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 53 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 53 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex_value [(Var 53 a) (Var 53 b) (Var 53 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_value: (Function (SymbolTable 51 {a: (Variable 51 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 51 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 51 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_value [(Var 51 a) (Var 51 b) (Var 51 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_floatarray: (Function (SymbolTable 56 {b: (Variable 56 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 56 n))]) BindC Public Required .false.), n: (Variable 56 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 56 r Out () () Default (Real 4 []) BindC Public Required .false.)}) sub_int_floatarray [(Var 56 n) (Var 56 b) (Var 56 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_intarray: (Function (SymbolTable 55 {b: (Variable 55 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 55 n))]) BindC Public Required .false.), n: (Variable 55 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 55 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_intarray [(Var 55 n) (Var 55 b) (Var 55 r)] [] [] () BindC Public Interface () .false. .false. .false.)}) modules_15b [iso_c_binding] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), modules_15b: (Module (SymbolTable 2 {c_char: (ExternalSymbol 2 c_char 4 c_char lfortran_intrinsic_iso_c_binding [] c_char Public), c_double: (ExternalSymbol 2 c_double 4 c_double lfortran_intrinsic_iso_c_binding [] c_double Public), c_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int Public), c_long_long: (ExternalSymbol 2 c_long_long 4 c_long_long lfortran_intrinsic_iso_c_binding [] c_long_long Public), c_null_char: (ExternalSymbol 2 c_null_char 4 c_null_char lfortran_intrinsic_iso_c_binding [] c_null_char Public), call_fortran_f32: (Function (SymbolTable 64 {i: (Variable 64 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 64 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32 [(Var 64 i)] [] [] (Var 64 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f32_value: (Function (SymbolTable 65 {i: (Variable 65 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 65 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32_value [(Var 65 i)] [] [] (Var 65 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f64: (Function (SymbolTable 66 {i: (Variable 66 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 66 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64 [(Var 66 i)] [] [] (Var 66 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f64_value: (Function (SymbolTable 67 {i: (Variable 67 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 67 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64_value [(Var 67 i)] [] [] (Var 67 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i32: (Function (SymbolTable 60 {i: (Variable 60 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 60 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32 [(Var 60 i)] [] [] (Var 60 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i32_value: (Function (SymbolTable 61 {i: (Variable 61 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 61 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32_value [(Var 61 i)] [] [] (Var 61 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i64: (Function (SymbolTable 62 {i: (Variable 62 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 62 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64 [(Var 62 i)] [] [] (Var 62 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i64_value: (Function (SymbolTable 63 {i: (Variable 63 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 63 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64_value [(Var 63 i)] [] [] (Var 63 r) BindC Public Interface () .false. .false. .false. .false.), f_double_complex_value_return: (Function (SymbolTable 40 {b: (Variable 40 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 40 r ReturnVar () () Default (Complex 8 []) BindC Public Required .false.)}) f_double_complex_value_return [(Var 40 b)] [] [] (Var 40 r) BindC Public Interface () .false. .false. .false. .false.), f_float_complex_value_return: (Function (SymbolTable 39 {b: (Variable 39 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 39 r ReturnVar () () Default (Complex 4 []) BindC Public Required .false.)}) f_float_complex_value_return [(Var 39 b)] [] [] (Var 39 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double: (Function (SymbolTable 34 {a: (Variable 34 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 34 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 34 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double [(Var 34 a) (Var 34 b)] [] [] (Var 34 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_complex: (Function (SymbolTable 36 {a: (Variable 36 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 36 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 36 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex [(Var 36 a) (Var 36 b)] [] [] (Var 36 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_complex_value: (Function (SymbolTable 38 {a: (Variable 38 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 38 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 38 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex_value [(Var 38 a) (Var 38 b)] [] [] (Var 38 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_value: (Function (SymbolTable 42 {a: (Variable 42 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 42 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 42 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value [(Var 42 a) (Var 42 b)] [] [] (Var 42 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_value_name: (Function (SymbolTable 46 {a: (Variable 46 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 46 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 46 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value_name [(Var 46 a) (Var 46 b)] [] [] (Var 46 r) BindC Public Interface "f_int_double_value" .false. .false. .false. .false.), f_int_doublearray: (Function (SymbolTable 45 {b: (Variable 45 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 45 n))]) BindC Public Required .false.), n: (Variable 45 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 45 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) f_int_doublearray [(Var 45 n) (Var 45 b)] [] [] (Var 45 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float: (Function (SymbolTable 33 {a: (Variable 33 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 33 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 33 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float [(Var 33 a) (Var 33 b)] [] [] (Var 33 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_complex: (Function (SymbolTable 35 {a: (Variable 35 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 35 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 35 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex [(Var 35 a) (Var 35 b)] [] [] (Var 35 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_complex_value: (Function (SymbolTable 37 {a: (Variable 37 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 37 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 37 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex_value [(Var 37 a) (Var 37 b)] [] [] (Var 37 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_value: (Function (SymbolTable 41 {a: (Variable 41 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 41 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 41 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_value [(Var 41 a) (Var 41 b)] [] [] (Var 41 r) BindC Public Interface () .false. .false. .false. .false.), f_int_floatarray: (Function (SymbolTable 44 {b: (Variable 44 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 44 n))]) BindC Public Required .false.), n: (Variable 44 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 44 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f_int_floatarray [(Var 44 n) (Var 44 b)] [] [] (Var 44 r) BindC Public Interface () .false. .false. .false. .false.), f_int_intarray: (Function (SymbolTable 43 {b: (Variable 43 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 43 n))]) BindC Public Required .false.), n: (Variable 43 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 43 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_intarray [(Var 43 n) (Var 43 b)] [] [] (Var 43 r) BindC Public Interface () .false. .false. .false. .false.), f_string: (Function (SymbolTable 68 {r: (Variable 68 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 68 s In () () Default (Character 1 -1 () []) Source Public Required .false.)}) f_string [(Var 68 s)] [] [(= (Var 68 r) (FunctionCall 2 f_string0 () [((StringConcat (Var 68 s) (Var 2 c_null_char) (Character 1 0 () []) ()))] (Integer 4 []) () ()) ())] (Var 68 r) Source Public Implementation () .false. .false. .false. .false.), f_string0: (Function (SymbolTable 59 {r: (Variable 59 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.), s: (Variable 59 s In () () Default (Character 1 1 () [(() ())]) BindC Public Required .false.)}) f_string0 [(Var 59 s)] [] [] (Var 59 r) BindC Public Interface "f_string" .false. .false. .false. .false.), fortran_f32: (Function (SymbolTable 73 {i: (Variable 73 i In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 73 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32 [(Var 73 i)] [] [(= (Var 73 r) (RealBinOp (Var 73 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 73 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f32_value: (Function (SymbolTable 74 {i: (Variable 74 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 74 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32_value [(Var 74 i)] [] [(= (Var 74 r) (RealBinOp (Var 74 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 74 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f64: (Function (SymbolTable 75 {i: (Variable 75 i In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 75 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64 [(Var 75 i)] [] [(= (Var 75 r) (RealBinOp (Var 75 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 75 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f64_value: (Function (SymbolTable 76 {i: (Variable 76 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 76 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64_value [(Var 76 i)] [] [(= (Var 76 r) (RealBinOp (Var 76 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 76 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i32: (Function (SymbolTable 69 {i: (Variable 69 i In () () Default (Integer 4 []) BindC Public Required .false.), r: (Variable 69 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32 [(Var 69 i)] [] [(= (Var 69 r) (IntegerBinOp (Var 69 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 69 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i32_value: (Function (SymbolTable 70 {i: (Variable 70 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 70 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32_value [(Var 70 i)] [] [(= (Var 70 r) (IntegerBinOp (Var 70 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 70 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i64: (Function (SymbolTable 71 {i: (Variable 71 i In () () Default (Integer 8 []) BindC Public Required .false.), r: (Variable 71 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64 [(Var 71 i)] [] [(= (Var 71 r) (IntegerBinOp (Var 71 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 71 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i64_value: (Function (SymbolTable 72 {i: (Variable 72 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 72 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64_value [(Var 72 i)] [] [(= (Var 72 r) (IntegerBinOp (Var 72 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 72 r) BindC Public Implementation () .false. .false. .false. .false.), sub_int_double: (Function (SymbolTable 48 {a: (Variable 48 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 48 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 48 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double [(Var 48 a) (Var 48 b) (Var 48 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_complex: (Function (SymbolTable 50 {a: (Variable 50 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 50 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 50 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex [(Var 50 a) (Var 50 b) (Var 50 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_complex_value: (Function (SymbolTable 54 {a: (Variable 54 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 54 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 54 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex_value [(Var 54 a) (Var 54 b) (Var 54 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_value: (Function (SymbolTable 52 {a: (Variable 52 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 52 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 52 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value [(Var 52 a) (Var 52 b) (Var 52 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_value_name: (Function (SymbolTable 58 {a: (Variable 58 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 58 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 58 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value_name [(Var 58 a) (Var 58 b) (Var 58 r)] [] [] () BindC Public Interface "sub_int_double_value" .false. .false. .false. .false.), sub_int_doublearray: (Function (SymbolTable 57 {b: (Variable 57 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 57 n))]) BindC Public Required .false.), n: (Variable 57 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 57 r Out () () Default (Real 8 []) BindC Public Required .false.)}) sub_int_doublearray [(Var 57 n) (Var 57 b) (Var 57 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float: (Function (SymbolTable 47 {a: (Variable 47 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 47 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 47 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float [(Var 47 a) (Var 47 b) (Var 47 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_complex: (Function (SymbolTable 49 {a: (Variable 49 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 49 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 49 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex [(Var 49 a) (Var 49 b) (Var 49 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_complex_value: (Function (SymbolTable 53 {a: (Variable 53 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 53 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 53 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex_value [(Var 53 a) (Var 53 b) (Var 53 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_value: (Function (SymbolTable 51 {a: (Variable 51 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 51 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 51 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_value [(Var 51 a) (Var 51 b) (Var 51 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_floatarray: (Function (SymbolTable 56 {b: (Variable 56 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 56 n))]) BindC Public Required .false.), n: (Variable 56 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 56 r Out () () Default (Real 4 []) BindC Public Required .false.)}) sub_int_floatarray [(Var 56 n) (Var 56 b) (Var 56 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_intarray: (Function (SymbolTable 55 {b: (Variable 55 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 55 n))]) BindC Public Required .false.), n: (Variable 55 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 55 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_intarray [(Var 55 n) (Var 55 b) (Var 55 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.)}) modules_15b [iso_c_binding] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_01-290187e.json b/tests/reference/asr-nested_01-290187e.json index 55e4999abe..964e6e6045 100644 --- a/tests/reference/asr-nested_01-290187e.json +++ b/tests/reference/asr-nested_01-290187e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_01-290187e.stdout", - "stdout_hash": "8959dffd708da657c7bceb8b7694d90c8f08bfbd44bbc4ff2616a378", + "stdout_hash": "5898dcb43e5052edcb872642f8b5ac5044baeb62fb46759527438dba", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_01-290187e.stdout b/tests/reference/asr-nested_01-290187e.stdout index 52ca8441b6..c1c031e7a0 100644 --- a/tests/reference/asr-nested_01-290187e.stdout +++ b/tests/reference/asr-nested_01-290187e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), d: (Function (SymbolTable 4 {d: (Variable 4 d ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ()) (= (Var 4 d) (IntegerConstant 1 (Integer 4 [])) ())] (Var 4 d) Source Public Implementation () .false. .false. .false.), e: (Variable 3 e Local () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 e) (FunctionCall 3 d () [] (Integer 4 []) () ()) ()) (= (Var 3 b) (IntegerConstant 0 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), nested_01: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public), c: (Variable 5 c Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_01 [a] [(= (Var 5 c) (FunctionCall 5 b () [] (Integer 4 []) () ()) ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), d: (Function (SymbolTable 4 {d: (Variable 4 d ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ()) (= (Var 4 d) (IntegerConstant 1 (Integer 4 [])) ())] (Var 4 d) Source Public Implementation () .false. .false. .false. .false.), e: (Variable 3 e Local () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 e) (FunctionCall 3 d () [] (Integer 4 []) () ()) ()) (= (Var 3 b) (IntegerConstant 0 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), nested_01: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public), c: (Variable 5 c Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_01 [a] [(= (Var 5 c) (FunctionCall 5 b () [] (Integer 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-nested_02-8302041.json b/tests/reference/asr-nested_02-8302041.json index 7eb4841bf1..9d0c817bb1 100644 --- a/tests/reference/asr-nested_02-8302041.json +++ b/tests/reference/asr-nested_02-8302041.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_02-8302041.stdout", - "stdout_hash": "d0935d00e8dd53beba61ddd059a9d8ceeaed9fdaf28e1664ae790424", + "stdout_hash": "429e74d8dfe3faa014df23b6c6b8e13ce8fbe6d7f20ed1ef5078c27d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_02-8302041.stdout b/tests/reference/asr-nested_02-8302041.stdout index 2a4f3f900d..e51af0c39e 100644 --- a/tests/reference/asr-nested_02-8302041.stdout +++ b/tests/reference/asr-nested_02-8302041.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ())] () Source Public Implementation () .false. .false. .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), nested_02: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public)}) nested_02 [a] [(SubroutineCall 5 b () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), nested_02: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public)}) nested_02 [a] [(SubroutineCall 5 b () [] ())])}) []) diff --git a/tests/reference/asr-nested_03-57ffed2.json b/tests/reference/asr-nested_03-57ffed2.json index 5d66b69fc4..326bfdd1c4 100644 --- a/tests/reference/asr-nested_03-57ffed2.json +++ b/tests/reference/asr-nested_03-57ffed2.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_03-57ffed2.stdout", - "stdout_hash": "de18ee12ec4ff0a8c2897879cb5410f053c7230e4be1efe382f3a217", + "stdout_hash": "61bfc2f70af2286aaca0562a7c8740824fa64de1dde9744bbdbbadaf", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_03-57ffed2.stdout b/tests/reference/asr-nested_03-57ffed2.stdout index bcdb3cd740..3e7a81a23d 100644 --- a/tests/reference/asr-nested_03-57ffed2.stdout +++ b/tests/reference/asr-nested_03-57ffed2.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {nested_03: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_03_a [] b Public)}) nested_03 [nested_03_a] [(SubroutineCall 5 b () [] ())]), nested_03_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Local (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) nested_03_a [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {nested_03: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_03_a [] b Public)}) nested_03 [nested_03_a] [(SubroutineCall 5 b () [] ())]), nested_03_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Local (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_03_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_04-8423f42.json b/tests/reference/asr-nested_04-8423f42.json index 2479de781b..02147b4754 100644 --- a/tests/reference/asr-nested_04-8423f42.json +++ b/tests/reference/asr-nested_04-8423f42.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_04-8423f42.stdout", - "stdout_hash": "0e3fe9033b1ec0c1a7ed271f53b6dac7382bcd398b2d99da2834a92f", + "stdout_hash": "0c9f64656f6672bff1a9663c9ee972ca0f4011ab5dffdc81a845f869", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_04-8423f42.stdout b/tests/reference/asr-nested_04-8423f42.stdout index 7a385d6d91..f067014a36 100644 --- a/tests/reference/asr-nested_04-8423f42.stdout +++ b/tests/reference/asr-nested_04-8423f42.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {nested_04: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_04_a [] b Public), test: (Variable 5 test Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_04 [nested_04_a] [(= (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) () ()) ())]), nested_04_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Integer 4 []) Source Public Required .false.), z: (Variable 4 z In () () Default (Integer 4 []) Source Public Required .false.)}) c [(Var 4 z)] [] [(Print () [(Var 4 z)] () ()) (Print () [(Var 3 y)] () ()) (Print () [(Var 3 yy)] () ()) (= (Var 4 c) (Var 4 z) ())] (Var 4 c) Source Public Implementation () .false. .false. .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.), yy: (Variable 3 yy Local (RealConstant 6.600000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(= (Var 3 y) (Var 3 x) ()) (Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) () ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) nested_04_a [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {nested_04: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_04_a [] b Public), test: (Variable 5 test Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_04 [nested_04_a] [(= (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) () ()) ())]), nested_04_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Integer 4 []) Source Public Required .false.), z: (Variable 4 z In () () Default (Integer 4 []) Source Public Required .false.)}) c [(Var 4 z)] [] [(Print () [(Var 4 z)] () ()) (Print () [(Var 3 y)] () ()) (Print () [(Var 3 yy)] () ()) (= (Var 4 c) (Var 4 z) ())] (Var 4 c) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.), yy: (Variable 3 yy Local (RealConstant 6.600000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(= (Var 3 y) (Var 3 x) ()) (Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) () ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) nested_04_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_05-00beea9.json b/tests/reference/asr-nested_05-00beea9.json index 150f02cf09..e0213b7359 100644 --- a/tests/reference/asr-nested_05-00beea9.json +++ b/tests/reference/asr-nested_05-00beea9.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_05-00beea9.stdout", - "stdout_hash": "56d03558a30e23bcc8e7f4c290bf292265e7513e8f49755794ffc612", + "stdout_hash": "27265497ee3e7306b5ceefea3836d9a76f57ed595dd5896877328554", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_05-00beea9.stdout b/tests/reference/asr-nested_05-00beea9.stdout index 3321be3f3e..93779effad 100644 --- a/tests/reference/asr-nested_05-00beea9.stdout +++ b/tests/reference/asr-nested_05-00beea9.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {nested_05: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_05_a [] b Public)}) nested_05 [nested_05_a] [(SubroutineCall 5 b () [] ())]), nested_05_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (= (Var 3 x) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 y) (RealConstant 3.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local (RealConstant 5.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (SubroutineCall 3 c () [] ()) (Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ())] () Source Public Implementation () .false. .false. .false.)}) nested_05_a [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {nested_05: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_05_a [] b Public)}) nested_05 [nested_05_a] [(SubroutineCall 5 b () [] ())]), nested_05_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (= (Var 3 x) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 y) (RealConstant 3.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local (RealConstant 5.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (SubroutineCall 3 c () [] ()) (Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_05_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_06-1d576ad.json b/tests/reference/asr-nested_06-1d576ad.json index 558f61f8af..ac909b99d5 100644 --- a/tests/reference/asr-nested_06-1d576ad.json +++ b/tests/reference/asr-nested_06-1d576ad.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_06-1d576ad.stdout", - "stdout_hash": "e436488fff8597c7985eba75c6df638f3ea6ca92cc0b7e9eecf68843", + "stdout_hash": "e6a7da0634666e583738cbeb5a3748bd9085990643391491717014a4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_06-1d576ad.stdout b/tests/reference/asr-nested_06-1d576ad.stdout index 33bda2408d..c306c51ad3 100644 --- a/tests/reference/asr-nested_06-1d576ad.stdout +++ b/tests/reference/asr-nested_06-1d576ad.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {nested_06: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_06_a [] b Public)}) nested_06 [nested_06_a] [(SubroutineCall 5 b () [((RealConstant 6.000000 (Real 4 [])))] ())]), nested_06_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Unspecified () () Default (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) nested_06_a [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {nested_06: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b nested_06_a [] b Public)}) nested_06 [nested_06_a] [(SubroutineCall 5 b () [((RealConstant 6.000000 (Real 4 [])))] ())]), nested_06_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Unspecified () () Default (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_06_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.json b/tests/reference/asr-operator_overloading_01-9ec8e71.json index a9b4563d1e..f2a054f79c 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.json +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_01-9ec8e71.stdout", - "stdout_hash": "928ed3ffcd78a2783a602e3db3efd2727a73990313353988eefd4c9e", + "stdout_hash": "8ef0207949e75821ff1c14e14800e976663644d9cdfa49d5546cf831", "stderr": "asr-operator_overloading_01-9ec8e71.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout index ef98d4cf5f..e9fd82ec6f 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {operator_overloading_01: (Program (SymbolTable 5 {bin_add: (ExternalSymbol 5 bin_add 2 bin_add operator_overloading_01_overload_asterisk_m [] bin_add Public), f: (Variable 5 f Local (LogicalConstant .false. (Logical 4 [])) (LogicalConstant .false. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), logical_and: (ExternalSymbol 5 logical_and 2 logical_and operator_overloading_01_overload_asterisk_m [] logical_and Public), t: (Variable 5 t Local (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), ~add: (ExternalSymbol 5 ~add 2 ~add operator_overloading_01_overload_asterisk_m [] ~add Public), ~mul: (ExternalSymbol 5 ~mul 2 ~mul operator_overloading_01_overload_asterisk_m [] ~mul Public)}) operator_overloading_01 [operator_overloading_01_overload_asterisk_m] [(Print () [(StringConstant "T*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "T+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4 []) () ()))] () ())]), operator_overloading_01_overload_asterisk_m: (Module (SymbolTable 2 {bin_add: (Function (SymbolTable 4 {bin_add: (Variable 4 bin_add ReturnVar () () Default (Integer 4 []) Source Public Required .false.), log1: (Variable 4 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 4 log2 In () () Default (Logical 4 []) Source Public Required .false.)}) bin_add [(Var 4 log1) (Var 4 log2)] [] [(If (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 2 (Integer 4 [])) ())] [(If (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4 []) ()) And (LogicalNot (Var 4 log2) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 0 (Integer 4 [])) ())] [(= (Var 4 bin_add) (IntegerConstant 1 (Integer 4 [])) ())])])] (Var 4 bin_add) Source Public Implementation () .false. .false. .false.), logical_and: (Function (SymbolTable 3 {log1: (Variable 3 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 3 log2 In () () Default (Logical 4 []) Source Public Required .false.), logical_and: (Variable 3 logical_and ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) logical_and [(Var 3 log1) (Var 3 log2)] [] [(= (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4 []) ()) ())] (Var 3 logical_and) Source Public Implementation () .false. .false. .false.), ~add: (CustomOperator 2 ~add [2 bin_add] Public), ~mul: (CustomOperator 2 ~mul [2 logical_and] Public)}) operator_overloading_01_overload_asterisk_m [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {operator_overloading_01: (Program (SymbolTable 5 {bin_add: (ExternalSymbol 5 bin_add 2 bin_add operator_overloading_01_overload_asterisk_m [] bin_add Public), f: (Variable 5 f Local (LogicalConstant .false. (Logical 4 [])) (LogicalConstant .false. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), logical_and: (ExternalSymbol 5 logical_and 2 logical_and operator_overloading_01_overload_asterisk_m [] logical_and Public), t: (Variable 5 t Local (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), ~add: (ExternalSymbol 5 ~add 2 ~add operator_overloading_01_overload_asterisk_m [] ~add Public), ~mul: (ExternalSymbol 5 ~mul 2 ~mul operator_overloading_01_overload_asterisk_m [] ~mul Public)}) operator_overloading_01 [operator_overloading_01_overload_asterisk_m] [(Print () [(StringConstant "T*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "T+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4 []) () ()))] () ())]), operator_overloading_01_overload_asterisk_m: (Module (SymbolTable 2 {bin_add: (Function (SymbolTable 4 {bin_add: (Variable 4 bin_add ReturnVar () () Default (Integer 4 []) Source Public Required .false.), log1: (Variable 4 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 4 log2 In () () Default (Logical 4 []) Source Public Required .false.)}) bin_add [(Var 4 log1) (Var 4 log2)] [] [(If (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 2 (Integer 4 [])) ())] [(If (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4 []) ()) And (LogicalNot (Var 4 log2) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 0 (Integer 4 [])) ())] [(= (Var 4 bin_add) (IntegerConstant 1 (Integer 4 [])) ())])])] (Var 4 bin_add) Source Public Implementation () .false. .false. .false. .false.), logical_and: (Function (SymbolTable 3 {log1: (Variable 3 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 3 log2 In () () Default (Logical 4 []) Source Public Required .false.), logical_and: (Variable 3 logical_and ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) logical_and [(Var 3 log1) (Var 3 log2)] [] [(= (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4 []) ()) ())] (Var 3 logical_and) Source Public Implementation () .false. .false. .false. .false.), ~add: (CustomOperator 2 ~add [2 bin_add] Public), ~mul: (CustomOperator 2 ~mul [2 logical_and] Public)}) operator_overloading_01_overload_asterisk_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_02-6076a0f.json b/tests/reference/asr-operator_overloading_02-6076a0f.json index 82d919862d..e726227b20 100644 --- a/tests/reference/asr-operator_overloading_02-6076a0f.json +++ b/tests/reference/asr-operator_overloading_02-6076a0f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_02-6076a0f.stdout", - "stdout_hash": "425953f6140879d86f8478c77c2ee4c43c947f87a8b28b53596dde91", + "stdout_hash": "149df4480d84d3fcd5fc97bbf81ab17966c81ba2fcc49b582550463c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_02-6076a0f.stdout b/tests/reference/asr-operator_overloading_02-6076a0f.stdout index 226cc878b8..5c5b0689ca 100644 --- a/tests/reference/asr-operator_overloading_02-6076a0f.stdout +++ b/tests/reference/asr-operator_overloading_02-6076a0f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 5 {logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Private), tf: (Variable 5 tf Local () () Default (Logical 4 []) Source Private Required .false.), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Private)}) main [overload_assignment_m] [(= (Var 5 tf) (IntegerConstant 0 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4 [])))] ())) (Print () [(StringConstant "tf=0:" (Character 1 5 () [])) (Var 5 tf)] () ()) (= (Var 5 tf) (IntegerConstant 1 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4 [])))] ())) (Print () [(StringConstant "tf=1:" (Character 1 5 () [])) (Var 5 tf)] () ())]), overload_assignment_m: (Module (SymbolTable 2 {logical_gets_integer: (Function (SymbolTable 3 {i: (Variable 3 i In () () Default (Integer 4 []) Source Private Required .false.), tf: (Variable 3 tf Out () () Default (Logical 4 []) Source Private Required .false.)}) logical_gets_integer [(Var 3 tf) (Var 3 i)] [] [(= (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) ())] () Source Private Implementation () .false. .false. .false.), logical_gets_integer_use: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Private Required .false.), tf: (Variable 4 tf Out () () Default (Logical 4 []) Source Private Required .false.)}) logical_gets_integer_use [(Var 4 tf) (Var 4 i)] [] [(= (Var 4 tf) (Var 4 i) (SubroutineCall 2 logical_gets_integer 2 ~assign [((Var 4 tf)) ((Var 4 i))] ()))] () Source Private Implementation () .false. .false. .false.), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public)}) overload_assignment_m [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 5 {logical_gets_integer@~assign: (ExternalSymbol 5 logical_gets_integer@~assign 2 logical_gets_integer overload_assignment_m [] logical_gets_integer Private), tf: (Variable 5 tf Local () () Default (Logical 4 []) Source Private Required .false.), ~assign: (ExternalSymbol 5 ~assign 2 ~assign overload_assignment_m [] ~assign Private)}) main [overload_assignment_m] [(= (Var 5 tf) (IntegerConstant 0 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 0 (Integer 4 [])))] ())) (Print () [(StringConstant "tf=0:" (Character 1 5 () [])) (Var 5 tf)] () ()) (= (Var 5 tf) (IntegerConstant 1 (Integer 4 [])) (SubroutineCall 5 logical_gets_integer@~assign 5 ~assign [((Var 5 tf)) ((IntegerConstant 1 (Integer 4 [])))] ())) (Print () [(StringConstant "tf=1:" (Character 1 5 () [])) (Var 5 tf)] () ())]), overload_assignment_m: (Module (SymbolTable 2 {logical_gets_integer: (Function (SymbolTable 3 {i: (Variable 3 i In () () Default (Integer 4 []) Source Private Required .false.), tf: (Variable 3 tf Out () () Default (Logical 4 []) Source Private Required .false.)}) logical_gets_integer [(Var 3 tf) (Var 3 i)] [] [(= (Var 3 tf) (IntegerCompare (Var 3 i) Eq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) ())] () Source Private Implementation () .false. .false. .false. .false.), logical_gets_integer_use: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Private Required .false.), tf: (Variable 4 tf Out () () Default (Logical 4 []) Source Private Required .false.)}) logical_gets_integer_use [(Var 4 tf) (Var 4 i)] [] [(= (Var 4 tf) (Var 4 i) (SubroutineCall 2 logical_gets_integer 2 ~assign [((Var 4 tf)) ((Var 4 i))] ()))] () Source Private Implementation () .false. .false. .false. .false.), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public)}) overload_assignment_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.json b/tests/reference/asr-operator_overloading_03-f7a6efe.json index 514531c181..7622206f73 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.json +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_03-f7a6efe.stdout", - "stdout_hash": "f165faffe8381c5e87436aa30b05dac8294c3aff5b1697ba87c80ec9", + "stdout_hash": "da840fc76fb90b35aca0fe7a54b542a2bf47efb5f646147bcc013ec1", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout index 0f0fe82e01..2ab03b47a9 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {operator_overloading_01: (Program (SymbolTable 6 {f: (Variable 6 f Local (LogicalConstant .false. (Logical 4 [])) (LogicalConstant .false. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), greater_than_inverse: (ExternalSymbol 6 greater_than_inverse 2 greater_than_inverse operator_overloading_01_overload_comp_m [] greater_than_inverse Public), less_than_inverse: (ExternalSymbol 6 less_than_inverse 2 less_than_inverse operator_overloading_01_overload_comp_m [] less_than_inverse Public), less_than_overload_use: (ExternalSymbol 6 less_than_overload_use 2 less_than_overload_use operator_overloading_01_overload_comp_m [] less_than_overload_use Public), t: (Variable 6 t Local (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) Parameter (Logical 4 []) Source Public Required .false.), ~gt: (ExternalSymbol 6 ~gt 2 ~gt operator_overloading_01_overload_comp_m [] ~gt Public), ~lt: (ExternalSymbol 6 ~lt 2 ~lt operator_overloading_01_overload_comp_m [] ~lt Public)}) operator_overloading_01 [operator_overloading_01_overload_comp_m] [(Print () [(StringConstant "T>T:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>T:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "TT:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 t) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .true. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 t)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>T:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 t) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F>F:" (Character 1 4 () [])) (OverloadedCompare (Var 6 f) Gt (Var 6 f) (Logical 4 []) (LogicalConstant .false. (Logical 4 [])) (FunctionCall 6 greater_than_inverse 6 ~gt [((Var 6 f)) ((Var 6 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T Date: Tue, 6 Sep 2022 11:17:03 +0530 Subject: [PATCH 42/46] Remove StatementsFirstWalkVisitorVisitor --- src/libasr/asdl_cpp.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index df1168e456..f220d32359 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -501,33 +501,6 @@ def visitField(self, field): self.emit( "this->visit_symbol(*a.second);", 3) self.emit("}", 2) -class StatementsFirstWalkVisitorVisitor(ASTWalkVisitorVisitor, ASDLVisitor): - - def visitModule(self, mod): - self.emit("/" + "*"*78 + "/") - self.emit("// Statements First Visitor base class") - self.emit("") - self.emit("template ") - self.emit("class StatementsFirstBaseWalkVisitor : public BaseVisitor") - self.emit("{") - self.emit("private:") - self.emit(" Derived& self() { return static_cast(*this); }") - self.emit("public:") - super(ASTWalkVisitorVisitor, self).visitModule(mod) - self.emit("};") - - def make_visitor(self, name, fields): - self.emit("void visit_%s(const %s_t &x) {" % (name, name), 1) - self.used = False - have_body = False - for field in fields[::-1]: - self.visitField(field) - if not self.used: - # Note: a better solution would be to change `&x` to `& /* x */` - # above, but we would need to change emit to return a string. - self.emit("if ((bool&)x) { } // Suppress unused warning", 2) - self.emit("}", 1) - # This class generates a visitor that prints the tree structure of AST/ASR class TreeVisitorVisitor(ASDLVisitor): @@ -2222,8 +2195,7 @@ def add_masks(fields, node): visitors = [ASTNodeVisitor0, ASTNodeVisitor1, ASTNodeVisitor, ASTVisitorVisitor1, ASTVisitorVisitor1b, ASTVisitorVisitor2, ASTWalkVisitorVisitor, TreeVisitorVisitor, PickleVisitorVisitor, - StatementsFirstWalkVisitorVisitor, SerializationVisitorVisitor, - DeserializationVisitorVisitor] + SerializationVisitorVisitor, DeserializationVisitorVisitor] def main(argv): From 65589ffba1166929f6e5a95d2dec669e19cf0edd Mon Sep 17 00:00:00 2001 From: Ubaid Date: Tue, 6 Sep 2022 11:17:49 +0530 Subject: [PATCH 43/46] PASS: Remove arr_dims_propogate --- src/libasr/CMakeLists.txt | 1 - src/libasr/pass/arr_dims_propagate.cpp | 66 -------------------------- src/libasr/pass/arr_dims_propagate.h | 12 ----- 3 files changed, 79 deletions(-) delete mode 100644 src/libasr/pass/arr_dims_propagate.cpp delete mode 100644 src/libasr/pass/arr_dims_propagate.h diff --git a/src/libasr/CMakeLists.txt b/src/libasr/CMakeLists.txt index 5b215742f2..4f51317c08 100644 --- a/src/libasr/CMakeLists.txt +++ b/src/libasr/CMakeLists.txt @@ -33,7 +33,6 @@ set(SRC pass/implied_do_loops.cpp pass/array_op.cpp pass/class_constructor.cpp - pass/arr_dims_propagate.cpp pass/arr_slice.cpp pass/print_arr.cpp pass/pass_utils.cpp diff --git a/src/libasr/pass/arr_dims_propagate.cpp b/src/libasr/pass/arr_dims_propagate.cpp deleted file mode 100644 index 1abaf6993b..0000000000 --- a/src/libasr/pass/arr_dims_propagate.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -namespace LFortran { - -/* - * This ASR pass replaces ttype for all arrays passed. - * - * Converts: - * integer :: a(:, :) - * - * to: - * integer :: a(2, 3) - */ - -class ArrDimsPropagate : public ASR::StatementsFirstBaseWalkVisitor -{ -private: -// Allocator &m_al; -public: - ArrDimsPropagate(Allocator &/*al*/) /*: m_al(al)*/ { } - - void visit_FunctionCall(const ASR::FunctionCall_t &x) { - ASR::Function_t *fn = ASR::down_cast(ASRUtils::symbol_get_past_external(x.m_name)); - - for (size_t i = 0; i < x.n_args; i++) { - if (ASR::is_a(*x.m_args[i].m_value) && ASRUtils::is_array(ASRUtils::expr_type(x.m_args[i].m_value))) { - ASR::Variable_t* v = ASRUtils::EXPR2VAR(x.m_args[i].m_value); - ASR::Variable_t *fn_param = ASRUtils::EXPR2VAR(fn->m_args[i]); - ASR::dimension_t* m_dims; - int n_dims = ASRUtils::extract_dimensions_from_ttype(fn_param->m_type, m_dims); - if (n_dims > 0 && !m_dims[0].m_length && ASRUtils::check_equal_type(v->m_type, fn_param->m_type)) { - fn_param->m_type = v->m_type; - } - } - } - } - - void visit_SubroutineCall(const ASR::SubroutineCall_t &x) { - ASR::Function_t *sb = ASR::down_cast(ASRUtils::symbol_get_past_external(x.m_name)); - for (size_t i = 0; i < x.n_args; i++) { - if (ASR::is_a(*x.m_args[i].m_value) && ASRUtils::is_array(ASRUtils::expr_type(x.m_args[i].m_value))) { - ASR::Variable_t* v = ASRUtils::EXPR2VAR(x.m_args[i].m_value); - ASR::Variable_t *sb_param = ASRUtils::EXPR2VAR(sb->m_args[i]); - ASR::dimension_t* m_dims; - int n_dims = ASRUtils::extract_dimensions_from_ttype(sb_param->m_type, m_dims); - if (n_dims > 0 && !m_dims[0].m_length && ASRUtils::check_equal_type(v->m_type, sb_param->m_type)) { - sb_param->m_type = v->m_type; - } - } - } - } -}; - -void pass_propagate_arr_dims(Allocator &al, ASR::TranslationUnit_t &unit) { - ArrDimsPropagate v(al); - v.visit_TranslationUnit(unit); - LFORTRAN_ASSERT(asr_verify(unit)); -} - -} // namespace LFortran diff --git a/src/libasr/pass/arr_dims_propagate.h b/src/libasr/pass/arr_dims_propagate.h deleted file mode 100644 index 2eb38748d1..0000000000 --- a/src/libasr/pass/arr_dims_propagate.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef LFORTRAN_PASS_ARR_DIMS_PROPAGATE -#define LFORTRAN_PASS_ARR_DIMS_PROPAGATE - -#include - -namespace LFortran { - - void pass_propagate_arr_dims(Allocator &al, ASR::TranslationUnit_t &unit); - -} // namespace LFortran - -#endif // LFORTRAN_PASS_ARR_DIMS_PROPAGATE From e70d2e7d3025191aba45ff5275b512f4493b1712 Mon Sep 17 00:00:00 2001 From: Pranav <85227306+Pranavchiku@users.noreply.github.com> Date: Thu, 8 Sep 2022 00:01:36 +0530 Subject: [PATCH 44/46] Add support for ```Variable``` symbol (#703) --- src/lfortran/semantics/ast_body_visitor.cpp | 5 +++++ tests/reference/asr-variable1-4dcb4bc.json | 13 +++++++++++++ tests/reference/asr-variable1-4dcb4bc.stdout | 1 + tests/tests.toml | 4 ++++ tests/variable1.f90 | 5 +++++ 5 files changed, 28 insertions(+) create mode 100644 tests/reference/asr-variable1-4dcb4bc.json create mode 100644 tests/reference/asr-variable1-4dcb4bc.stdout create mode 100644 tests/variable1.f90 diff --git a/src/lfortran/semantics/ast_body_visitor.cpp b/src/lfortran/semantics/ast_body_visitor.cpp index 26d4e3748e..38fc00c3b2 100644 --- a/src/lfortran/semantics/ast_body_visitor.cpp +++ b/src/lfortran/semantics/ast_body_visitor.cpp @@ -1264,6 +1264,11 @@ class BodyVisitor : public CommonVisitor { } break; } + case (ASR::symbolType::Variable) : { + final_sym=original_sym; + original_sym = nullptr; + break; + } default : { throw SemanticError("Symbol type not supported", x.base.base.loc); } diff --git a/tests/reference/asr-variable1-4dcb4bc.json b/tests/reference/asr-variable1-4dcb4bc.json new file mode 100644 index 0000000000..0522532e71 --- /dev/null +++ b/tests/reference/asr-variable1-4dcb4bc.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-variable1-4dcb4bc", + "cmd": "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", + "infile": "tests/variable1.f90", + "infile_hash": "5b6d695576e5238912fcc34c5b3ca73acd415e72e7a349c1ed66c97b", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-variable1-4dcb4bc.stdout", + "stdout_hash": "4504d9d65abec7ecc73ce950bfba2cedfeaea06dbc5a618f6da32532", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-variable1-4dcb4bc.stdout b/tests/reference/asr-variable1-4dcb4bc.stdout new file mode 100644 index 0000000000..b8cb5c939d --- /dev/null +++ b/tests/reference/asr-variable1-4dcb4bc.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {variable01: (Function (SymbolTable 2 {m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), matveca: (Function (SymbolTable 3 {matveca_arg_0: (Variable 3 matveca_arg_0 Unspecified () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 m))]) Source Public Required .false.), matveca_arg_1: (Variable 3 matveca_arg_1 Unspecified () () Default (Integer 4 []) Source Public Required .false.), matveca_arg_2: (Variable 3 matveca_arg_2 Unspecified () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), matveca_arg_3: (Variable 3 matveca_arg_3 Unspecified () () Default (Complex 4 []) Source Public Required .false.), matveca_arg_4: (Variable 3 matveca_arg_4 Unspecified () () Default (Complex 4 []) Source Public Required .false.), matveca_arg_5: (Variable 3 matveca_arg_5 Unspecified () () Default (Complex 4 []) Source Public Required .false.), matveca_arg_6: (Variable 3 matveca_arg_6 Unspecified () () Default (Complex 4 []) Source Public Required .false.)}) matveca [(Var 3 matveca_arg_0) (Var 3 matveca_arg_1) (Var 3 matveca_arg_2) (Var 3 matveca_arg_3) (Var 3 matveca_arg_4) (Var 3 matveca_arg_5) (Var 3 matveca_arg_6)] [] [] () Source Public Interface () .false. .false. .false. .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), p1: (Variable 2 p1 Local () () Default (Complex 4 []) Source Public Required .false.), p2: (Variable 2 p2 Local () () Default (Complex 4 []) Source Public Required .false.), p3: (Variable 2 p3 Local () () Default (Complex 4 []) Source Public Required .false.), p4: (Variable 2 p4 Local () () Default (Complex 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 m))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.)}) variable01 [] [] [(SubroutineCall 2 matveca () [((Var 2 x)) ((Var 2 m)) ((Var 2 y)) ((Var 2 p1)) ((Var 2 p2)) ((Var 2 p3)) ((Var 2 p4))] ())] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/tests.toml b/tests/tests.toml index 3682a0e502..8f539eb31b 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2267,3 +2267,7 @@ asr = true [[test]] filename = "parameter1.f90" asr = true + +[[test]] +filename="variable1.f90" +asr_implicit_interface=true \ No newline at end of file diff --git a/tests/variable1.f90 b/tests/variable1.f90 new file mode 100644 index 0000000000..3235e0905c --- /dev/null +++ b/tests/variable1.f90 @@ -0,0 +1,5 @@ +subroutine variable01() +integer m,n +complex x(m), y(n), p1, p2, p3, p4 +call matveca(x,m,y,p1,p2,p3,p4) +end \ No newline at end of file From 6398085873e3c9208abf92ef4d51d8c15a8c1b66 Mon Sep 17 00:00:00 2001 From: gnikit Date: Wed, 14 Sep 2022 14:36:39 +0100 Subject: [PATCH 45/46] feat: add dependabot for GitHub Actions (#656) --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..8c139c7bec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From f28941af929b05bd55fb34ac41ea7793412db67c Mon Sep 17 00:00:00 2001 From: Konrad Handrick Date: Wed, 14 Sep 2022 16:03:36 +0200 Subject: [PATCH 46/46] Small regex addition to fixed form tokenizer (#713) * initial fix addition * add more tests * match parentheses; update tests * small fixes * remove regex include * add accidentally deleted tests * fix tests * Merge main * fix merge error --- run_tests.py | 23 +++++++++---- src/lfortran/parser/fixedform_tokenizer.cpp | 32 ++++++++++++++++--- tests/fixed_form_call1.f | 6 ++++ tests/fixed_form_call2.f | 8 +++++ tests/fixed_form_call3.f | 7 ++++ .../asr-fixed_form_call1-48907cd.json | 13 ++++++++ .../asr-fixed_form_call1-48907cd.stdout | 1 + .../asr-fixed_form_call2-b5a167e.json | 13 ++++++++ .../asr-fixed_form_call2-b5a167e.stdout | 1 + .../asr-fixed_form_call3-d5778bd.json | 13 ++++++++ .../asr-fixed_form_call3-d5778bd.stderr | 5 +++ tests/tests.toml | 21 ++++++++++-- 12 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 tests/fixed_form_call1.f create mode 100644 tests/fixed_form_call2.f create mode 100644 tests/fixed_form_call3.f create mode 100644 tests/reference/asr-fixed_form_call1-48907cd.json create mode 100644 tests/reference/asr-fixed_form_call1-48907cd.stdout create mode 100644 tests/reference/asr-fixed_form_call2-b5a167e.json create mode 100644 tests/reference/asr-fixed_form_call2-b5a167e.stdout create mode 100644 tests/reference/asr-fixed_form_call3-d5778bd.json create mode 100644 tests/reference/asr-fixed_form_call3-d5778bd.stderr diff --git a/run_tests.py b/run_tests.py index a5129e6e78..91244203c8 100755 --- a/run_tests.py +++ b/run_tests.py @@ -139,13 +139,22 @@ def single_test(test, specific_test, verbose, no_llvm, update_reference): extra_args) if asr_implicit_interface: - run_test( - filename, - "asr", - "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", - filename, - update_reference, - extra_args) + if filename.endswith(".f"): + run_test( + filename, + "asr", + "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + filename, + update_reference, + extra_args) + else: + run_test( + filename, + "asr", + "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", + filename, + update_reference, + extra_args) if asr_preprocess: run_test( diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index d6cb41446e..ed9ebf571b 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -683,6 +683,27 @@ struct FixedFormRecursiveDescent { return false; } + bool is_function_call(unsigned char *&cur) { + if (!next_is(cur, "call")) return false; + auto cpy = cur; + auto next = cpy; next_line(next); + std::string cur_line{tostr(cpy, next)}; + // + std::string("call").size() + cpy += 4; + // function needs to start with a letter + if (*cpy <= 'a' || *cpy >= 'z') return false; + while(*cpy++ != '(') { + if (*cpy == '\n' || *cpy == '\0') + return false; + } + int32_t nesting = 1; + while(*cpy++ != '\n') { + if (*cpy == '(') nesting++; + if (*cpy == ')') nesting--; + } + return nesting == 0; + } + bool lex_body_statement(unsigned char *&cur) { eat_label(cur); if (lex_declaration(cur)) { @@ -698,6 +719,12 @@ struct FixedFormRecursiveDescent { lex_do(cur); return true; } + + if (is_function_call(cur)) { + tokenize_line("call", cur); + return true; + } + // assignment if (contains(cur, nline, '=')) { tokenize_line("", cur); @@ -721,11 +748,6 @@ struct FixedFormRecursiveDescent { * explicitly DO NOT tokenize `CONTINUE` */ - if (next_is(cur, "call") && !contains(cur, nline, '=')) { - tokenize_line("call", cur); - return true; - } - if (next_is(cur, "return")) { tokenize_line("return", cur); return true; diff --git a/tests/fixed_form_call1.f b/tests/fixed_form_call1.f new file mode 100644 index 0000000000..40f6f7c03b --- /dev/null +++ b/tests/fixed_form_call1.f @@ -0,0 +1,6 @@ + subroutine idd_frm(m,n,w,x,y) + integer m,n,w,x,y,lw + call prinf('lw = *',lw,1) + call prinf('16m+70 = *',16*m+70,1) + return + end diff --git a/tests/fixed_form_call2.f b/tests/fixed_form_call2.f new file mode 100644 index 0000000000..1d9cbbea80 --- /dev/null +++ b/tests/fixed_form_call2.f @@ -0,0 +1,8 @@ + subroutine idd_frm(m) + integer m, a + a = 2 + call prinf('lw = *',1) + call prinf('16m+70 = *',1) + m = 1 + return + end diff --git a/tests/fixed_form_call3.f b/tests/fixed_form_call3.f new file mode 100644 index 0000000000..36479b64fb --- /dev/null +++ b/tests/fixed_form_call3.f @@ -0,0 +1,7 @@ +c FAILURE test + subroutine idd_frm(m,n,w,x,y) + integer m,n,w,x,y,lw + call prinf('lw = *',lw,1) + call prinf('16m+70 = *',16*m+70,1)) + return + end diff --git a/tests/reference/asr-fixed_form_call1-48907cd.json b/tests/reference/asr-fixed_form_call1-48907cd.json new file mode 100644 index 0000000000..c42d945281 --- /dev/null +++ b/tests/reference/asr-fixed_form_call1-48907cd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call1-48907cd", + "cmd": "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_call1.f", + "infile_hash": "cb6674a06b92dda41650f02e8f066e0e23bc067d3d89161c62dfb256", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-fixed_form_call1-48907cd.stdout", + "stdout_hash": "144d283d232dd048f544169f76e8fe8c0cc1e63fb46ae1382d46b75b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call1-48907cd.stdout b/tests/reference/asr-fixed_form_call1-48907cd.stdout new file mode 100644 index 0000000000..980c833847 --- /dev/null +++ b/tests/reference/asr-fixed_form_call1-48907cd.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {idd_frm: (Function (SymbolTable 2 {lw: (Variable 2 lw Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf: (Function (SymbolTable 3 {prinf_arg_0: (Variable 3 prinf_arg_0 Unspecified () () Default (Character 1 6 () []) Source Public Required .false.), prinf_arg_1: (Variable 3 prinf_arg_1 Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf_arg_2: (Variable 3 prinf_arg_2 Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) prinf [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1) (Var 3 prinf_arg_2)] [] [] () Source Public Interface () .false. .false. .false. .false.), w: (Variable 2 w Unspecified () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) idd_frm [(Var 2 m) (Var 2 n) (Var 2 w) (Var 2 x) (Var 2 y)] [] [(SubroutineCall 2 prinf () [((StringConstant "lw = *" (Character 1 6 () []))) ((Var 2 lw)) ((IntegerConstant 1 (Integer 4 [])))] ()) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (Character 1 10 () []))) ((IntegerBinOp (IntegerBinOp (IntegerConstant 16 (Integer 4 [])) Mul (Var 2 m) (Integer 4 []) ()) Add (IntegerConstant 70 (Integer 4 [])) (Integer 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] ()) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_call2-b5a167e.json b/tests/reference/asr-fixed_form_call2-b5a167e.json new file mode 100644 index 0000000000..bc7f2ff9b1 --- /dev/null +++ b/tests/reference/asr-fixed_form_call2-b5a167e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call2-b5a167e", + "cmd": "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_call2.f", + "infile_hash": "94899bb360f6a9205dc9fe3c76e28e8c04775b011747845b84950eb3", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-fixed_form_call2-b5a167e.stdout", + "stdout_hash": "6cd53d0894b5a34faf0f3d458380974923020c56801672c195df62ba", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call2-b5a167e.stdout b/tests/reference/asr-fixed_form_call2-b5a167e.stdout new file mode 100644 index 0000000000..75e4ebcc03 --- /dev/null +++ b/tests/reference/asr-fixed_form_call2-b5a167e.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {idd_frm: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf: (Function (SymbolTable 3 {prinf_arg_0: (Variable 3 prinf_arg_0 Unspecified () () Default (Character 1 6 () []) Source Public Required .false.), prinf_arg_1: (Variable 3 prinf_arg_1 Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) prinf [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1)] [] [] () Source Public Interface () .false. .false. .false. .false.)}) idd_frm [(Var 2 m)] [] [(= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (SubroutineCall 2 prinf () [((StringConstant "lw = *" (Character 1 6 () []))) ((IntegerConstant 1 (Integer 4 [])))] ()) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (Character 1 10 () []))) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 m) (IntegerConstant 1 (Integer 4 [])) ()) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_call3-d5778bd.json b/tests/reference/asr-fixed_form_call3-d5778bd.json new file mode 100644 index 0000000000..5cc549d0c9 --- /dev/null +++ b/tests/reference/asr-fixed_form_call3-d5778bd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call3-d5778bd", + "cmd": "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_call3.f", + "infile_hash": "d0980dc66f3d039f2f11de3b1dbb87c3c5e2db5a8ddcdcb480adfb6e", + "outfile": null, + "outfile_hash": null, + "stdout": null, + "stdout_hash": null, + "stderr": "asr-fixed_form_call3-d5778bd.stderr", + "stderr_hash": "ab1a497605476706e39b3a5cf0f850464574fd18ca9b34c4e74c999b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call3-d5778bd.stderr b/tests/reference/asr-fixed_form_call3-d5778bd.stderr new file mode 100644 index 0000000000..8ebb409c93 --- /dev/null +++ b/tests/reference/asr-fixed_form_call3-d5778bd.stderr @@ -0,0 +1,5 @@ +syntax error: Token ')' is unexpected here + --> tests/fixed_form_call3.f:5:43 + | +5 | call prinf('16m+70 = *',16*m+70,1)) + | ^ diff --git a/tests/tests.toml b/tests/tests.toml index 8f539eb31b..be3b456b33 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2269,5 +2269,22 @@ filename = "parameter1.f90" asr = true [[test]] -filename="variable1.f90" -asr_implicit_interface=true \ No newline at end of file +filename = "variable1.f90" +asr_implicit_interface=true + +[[test]] +filename = "fixed_form_goto_select.f" +ast = true +asr = true + +[[test]] +filename = "fixed_form_call1.f" +asr_implicit_interface = true + +[[test]] +filename = "fixed_form_call2.f" +asr_implicit_interface = true + +[[test]] +filename = "fixed_form_call3.f" +asr_implicit_interface = true