Skip to content

Commit 46a58e0

Browse files
authored
Merge pull request #198 from certik/str4
Get len() and string indexing working
2 parents 73b0a89 + df20141 commit 46a58e0

20 files changed

+94
-36
lines changed

integration_tests/run_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test_builtin_int.py",
2424
"test_builtin_len.py",
2525
"test_builtin_float.py",
26+
"test_builtin_str_02.py",
2627
"test_math1.py",
2728
"test_math_02.py",
2829
"test_c_interop_01.py",

integration_tests/test_builtin_len.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ def test_len():
66
assert len(s) == 0
77
assert len("abcd") == 4
88
assert len("") == 0
9+
10+
test_len()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def _lpython_str_equal(a: str, b: str) -> bool:
2+
if len(a) != len(b):
3+
return False
4+
i: i32
5+
for i in range(len(a)):
6+
if a[i] != b[i]:
7+
return False
8+
return True
9+
10+
def f():
11+
assert _lpython_str_equal("a", "a")
12+
assert not _lpython_str_equal("a2", "a")
13+
assert not _lpython_str_equal("a", "a123")
14+
assert not _lpython_str_equal("a23", "a24")
15+
assert _lpython_str_equal("a24", "a24")
16+
assert _lpython_str_equal("abcdefg", "abcdefg")
17+
assert not _lpython_str_equal("abcdef3", "abcdefg")
18+
19+
f()

src/libasr/codegen/asr_to_cpp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,9 @@ Kokkos::View<T*> from_std_vector(const std::vector<T> &v)
10701070
void visit_DoConcurrentLoop(const ASR::DoConcurrentLoop_t &x) {
10711071
std::string indent(indentation_level*indentation_spaces, ' ');
10721072
std::string out = indent + "Kokkos::parallel_for(";
1073-
out += "Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(1, ";
1073+
out += "Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(";
1074+
visit_expr(*x.m_head.m_start);
1075+
out += src + ", ";
10741076
visit_expr(*x.m_head.m_end);
10751077
out += src + "+1)";
10761078
ASR::Variable_t *loop_var = LFortran::ASRUtils::EXPR2VAR(x.m_head.m_v);

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
999999
&& ASR::down_cast<ASR::Character_t>(x.m_type)->n_dims == 0) {
10001000
// String indexing:
10011001
if (x.n_args == 1) {
1002+
LFORTRAN_ASSERT(x.m_args[0].m_left)
1003+
LFORTRAN_ASSERT(x.m_args[0].m_right)
10021004
if (ASR::is_a<ASR::Var_t>(*x.m_args[0].m_left)
10031005
&&ASR::is_a<ASR::Var_t>(*x.m_args[0].m_right)) {
10041006
ASR::Variable_t *l = EXPR2VAR(x.m_args[0].m_left);
@@ -1022,7 +1024,20 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
10221024
throw CodeGenError("Only string(a:b) for a==b supported for now.", x.base.base.loc);
10231025
}
10241026
} else {
1025-
throw CodeGenError("Only string(a:b) for a,b variables for now.", x.base.base.loc);
1027+
//throw CodeGenError("Only string(a:b) for a,b variables for now.", x.base.base.loc);
1028+
// Use the "right" index for now
1029+
this->visit_expr_wrapper(x.m_args[0].m_right, true);
1030+
llvm::Value *idx = tmp;
1031+
idx = builder->CreateSub(idx, llvm::ConstantInt::get(context, llvm::APInt(32, 1)));
1032+
//std::vector<llvm::Value*> idx_vec = {llvm::ConstantInt::get(context, llvm::APInt(32, 0)), idx};
1033+
std::vector<llvm::Value*> idx_vec = {idx};
1034+
llvm::Value *str = builder->CreateLoad(array);
1035+
llvm::Value *p = builder->CreateGEP(str, idx_vec);
1036+
// TODO: Currently the string starts at the right location, but goes to the end of the original string.
1037+
// We have to allocate a new string, copy it and add null termination.
1038+
1039+
tmp = builder->CreateAlloca(character_type, nullptr);
1040+
builder->CreateStore(p, tmp);
10261041
}
10271042
} else {
10281043
throw CodeGenError("Only string(a:b) supported for now.", x.base.base.loc);
@@ -3901,27 +3916,27 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
39013916
} else if (parent_subroutine){
39023917
push_nested_stack(parent_subroutine);
39033918
}
3919+
bool intrinsic_function = ASRUtils::is_intrinsic_function2(s);
39043920
uint32_t h;
3905-
if (s->m_abi == ASR::abiType::Source) {
3921+
if (s->m_abi == ASR::abiType::Source && !intrinsic_function) {
39063922
h = get_hash((ASR::asr_t*)s);
39073923
} else if (s->m_abi == ASR::abiType::LFortranModule) {
39083924
throw CodeGenError("Function LFortran interfaces not implemented yet");
39093925
} else if (s->m_abi == ASR::abiType::Interactive) {
39103926
h = get_hash((ASR::asr_t*)s);
3911-
} else if (s->m_abi == ASR::abiType::Intrinsic) {
3927+
} else if (s->m_abi == ASR::abiType::Intrinsic || intrinsic_function) {
39123928
std::string func_name = s->m_name;
39133929
if( fname2arg_type.find(func_name) != fname2arg_type.end() ) {
39143930
h = get_hash((ASR::asr_t*)s);
39153931
} else {
3932+
if (func_name == "len") {
3933+
std::vector<llvm::Value *> args = convert_call_args(x, "len");
3934+
LFORTRAN_ASSERT(args.size() == 1)
3935+
tmp = lfortran_str_len(args[0]);
3936+
return;
3937+
}
39163938
if( s->m_deftype == ASR::deftypeType::Interface ) {
3917-
if (func_name == "len") {
3918-
std::vector<llvm::Value *> args = convert_call_args(x, "len");
3919-
LFORTRAN_ASSERT(args.size() == 1)
3920-
tmp = lfortran_str_len(args[0]);
3921-
return;
3922-
} else {
3923-
throw CodeGenError("Intrinsic '" + func_name + "' not implemented yet and compile time value is not available.");
3924-
}
3939+
throw CodeGenError("Intrinsic '" + func_name + "' not implemented yet and compile time value is not available.");
39253940
} else {
39263941
h = get_hash((ASR::asr_t*)s);
39273942
}

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,19 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
967967
tmp = ASR::make_Assert_t(al, x.base.base.loc, test, msg);
968968
}
969969

970+
ASR::expr_t *index_add_one(const Location &loc, ASR::expr_t *idx) {
971+
// Add 1 to the index `idx`, assumes `idx` is of type Integer 4
972+
ASR::expr_t *overloaded = nullptr;
973+
ASR::expr_t *comptime_value = nullptr;
974+
ASR::ttype_t *a_type = ASRUtils::TYPE(ASR::make_Integer_t(al, loc,
975+
4, nullptr, 0));
976+
ASR::expr_t *constant_one = ASR::down_cast<ASR::expr_t>(ASR::make_ConstantInteger_t(
977+
al, loc, 1, a_type));
978+
return ASRUtils::EXPR(ASR::make_BinOp_t(al, loc, idx,
979+
ASR::binopType::Add, constant_one, a_type,
980+
comptime_value, overloaded));
981+
}
982+
970983
void visit_Subscript(const AST::Subscript_t &x) {
971984
this->visit_expr(*x.m_value);
972985
ASR::expr_t *value = ASRUtils::EXPR(tmp);
@@ -981,25 +994,31 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
981994
AST::Slice_t *s = AST::down_cast<AST::Slice_t>(x.m_slice);
982995
if (s->m_lower != nullptr) {
983996
this->visit_expr(*s->m_lower);
984-
ai.m_left = ASRUtils::EXPR(tmp);
997+
ai.m_left = index_add_one(x.base.base.loc, ASRUtils::EXPR(tmp));
985998
}
986999
if (s->m_upper != nullptr) {
9871000
this->visit_expr(*s->m_upper);
988-
ai.m_right = ASRUtils::EXPR(tmp);
1001+
ai.m_right = index_add_one(x.base.base.loc, ASRUtils::EXPR(tmp));
9891002
}
9901003
if (s->m_step != nullptr) {
9911004
this->visit_expr(*s->m_step);
992-
ai.m_step = ASRUtils::EXPR(tmp);
1005+
ai.m_step = index_add_one(x.base.base.loc, ASRUtils::EXPR(tmp));
9931006
}
9941007
} else {
9951008
this->visit_expr(*x.m_slice);
996-
ASR::expr_t *index = ASRUtils::EXPR(tmp);
1009+
ASR::expr_t *index = index_add_one(x.base.base.loc, ASRUtils::EXPR(tmp));
9971010
ai.m_right = index;
9981011
}
999-
args.push_back(al, ai);
10001012
ASR::symbol_t *s = ASR::down_cast<ASR::Var_t>(value)->m_v;
10011013
ASR::Variable_t *v = ASR::down_cast<ASR::Variable_t>(s);
10021014
ASR::ttype_t *type = v->m_type;
1015+
if (ASR::is_a<ASR::Character_t>(*type)) {
1016+
if (!ai.m_left && ai.m_right) {
1017+
// String indexing is done using "a(3:3)" style
1018+
ai.m_left = ai.m_right;
1019+
}
1020+
}
1021+
args.push_back(al, ai);
10031022
tmp = ASR::make_ArrayRef_t(al, x.base.base.loc, s, args.p,
10041023
args.size(), type, nullptr);
10051024
}

tests/reference/asr-dictionary1-a105a36.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-dictionary1-a105a36.stdout",
9-
"stdout_hash": "7d1a1cf87681db72f9b9ea3b3e5c7e1b5177bb3179e93b13c1867f45",
9+
"stdout_hash": "a1b435f14f711aab8b1ac266fdda7fa5379c00680f64506f88359dde",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) ()) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (Integer 4 []))) ()) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "a" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ()) (= (Var 2 z) (ArrayRef 2 x [(() (ConstantString "b" (Character 1 1 () [])) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) [])
1+
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_Dict: (Subroutine (SymbolTable 2 {x: (Variable 2 x Local () () Default (Dict (Integer 4 []) (Integer 4 [])) Source Public Required .false.), y: (Variable 2 y Local () () Default (Dict (Character 1 -2 () []) (Integer 4 [])) Source Public Required .false.), z: (Variable 2 z Local () () Default (Integer 4 []) Source Public Required .false.)}) test_Dict [] [(= (Var 2 x) (ConstantDictionary [(ConstantInteger 1 (Integer 4 [])) (ConstantInteger 3 (Integer 4 []))] [(ConstantInteger 2 (Integer 4 [])) (ConstantInteger 4 (Integer 4 []))] (Dict (Integer 4 []) (Integer 4 []))) ()) (= (Var 2 y) (ConstantDictionary [(ConstantString "a" (Character 1 1 () [])) (ConstantString "b" (Character 1 1 () []))] [(UnaryOp USub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger -1 (Integer 4 []))) (UnaryOp USub (ConstantInteger 2 (Integer 4 [])) (Integer 4 []) (ConstantInteger -2 (Integer 4 [])))] (Dict (Character 1 1 () []) (Integer 4 []))) ()) (= (Var 2 z) (ArrayRef 2 x [(() (BinOp (ConstantString "a" (Character 1 1 () [])) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ()) (= (Var 2 z) (ArrayRef 2 x [(() (BinOp (ConstantString "b" (Character 1 1 () [])) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Dict (Integer 4 []) (Integer 4 [])) ()) ())] Source Public Implementation () .false. .false.)}) [])

tests/reference/asr-doconcurrentloop_01-3fdc189.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-doconcurrentloop_01-3fdc189.stdout",
9-
"stdout_hash": "183dfafc0b2bc0eb5c1e9c003ac6593e394015616ef63348ed6e2fd5",
9+
"stdout_hash": "e72faeb1c7457129366580f156612808b1990df5bcac53d69ac077e8",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 5 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 3 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar Local () () Default (Real 4 []) Source Public Required .false.)}) main0 [] [(= (Var 3 scalar) (ImplicitCast (ConstantReal 10.000000 (Real 8 [])) RealToReal (Real 4 []) ()) ()) (= (Var 3 nsize) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 3 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ()) (= (ArrayRef 3 b [(() (Var 3 i) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ())]) (SubroutineCall 1 triad () [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] ()) (Print () [(ConstantString "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), triad: (Subroutine (SymbolTable 2 {N: (Variable 2 N Local () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(= (Var 2 N) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 2 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (Var 2 i) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) ())])] Source Public Implementation () .false. .false.)}) [])
1+
(TranslationUnit (SymbolTable 1 {_lfortran_main_program: (Subroutine (SymbolTable 5 {}) _lfortran_main_program [] [(SubroutineCall 1 main0 () [] ())] Source Public Implementation () .false. .false.), main0: (Subroutine (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 3 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar Local () () Default (Real 4 []) Source Public Required .false.)}) main0 [] [(= (Var 3 scalar) (ImplicitCast (ConstantReal 10.000000 (Real 8 [])) RealToReal (Real 4 []) ()) ()) (= (Var 3 nsize) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 3 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 3 nsize) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 3 a [(() (BinOp (Var 3 i) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ()) (= (ArrayRef 3 b [(() (BinOp (Var 3 i) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) (ImplicitCast (ConstantReal 5.000000 (Real 8 [])) RealToReal (Real 4 [((ConstantInteger 1 (Integer 4 [])) (ConstantInteger 10000 (Integer 4 [])))]) ()) ())]) (SubroutineCall 1 triad () [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] ()) (Print () [(ConstantString "End Stream Triad" (Character 1 16 () []))])] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 4 {}) main_program [] [(SubroutineCall 1 _lfortran_main_program () [] ())]), triad: (Subroutine (SymbolTable 2 {N: (Variable 2 N Local () () Default (Integer 4 []) Source Public Required .false.), a: (Variable 2 a InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c InOut () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 2 a) (Var 2 b) (Var 2 scalar) (Var 2 c)] [(= (Var 2 N) (ConstantInteger 1234 (Integer 4 [])) ()) (DoConcurrentLoop ((Var 2 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (Var 2 N) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) (ConstantInteger 1 (Integer 4 []))) [(= (ArrayRef 2 c [(() (BinOp (Var 2 i) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (BinOp (ArrayRef 2 a [(() (BinOp (Var 2 i) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) Add (BinOp (Var 2 scalar) Mul (ArrayRef 2 b [(() (BinOp (Var 2 i) Add (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) () ()) ())] (Real 4 [(() ())]) ()) (Real 4 []) () ()) (Real 4 [(() ())]) () ()) ())])] Source Public Implementation () .false. .false.)}) [])

tests/reference/asr-list1-770ba33.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-list1-770ba33.stdout",
9-
"stdout_hash": "8d8b6e7775ff0eeba1cf05bb19d8d76a6d66617217d948c5f2e6c604",
9+
"stdout_hash": "914fe18743d90c819ca6101262ba2218b74a2007025b9593f8b85e35",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

0 commit comments

Comments
 (0)