Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d3266c

Browse files
committed
Fixing symbolic compare for test_gruntz.py
1 parent 467081e commit 3d3266c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libasr/pass/replace_symbolic.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,15 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
609609
xx.m_test = new_logical_not;
610610
}
611611
}
612+
} else if (ASR::is_a<ASR::SymbolicCompare_t>(*xx.m_test)) {
613+
ASR::SymbolicCompare_t *s = ASR::down_cast<ASR::SymbolicCompare_t>(xx.m_test);
614+
ASR::expr_t* function_call = nullptr;
615+
if (s->m_op == ASR::cmpopType::Eq) {
616+
function_call = basic_compare(xx.base.base.loc, "basic_eq", s->m_left, s->m_right);
617+
} else {
618+
function_call = basic_compare(xx.base.base.loc, "basic_neq", s->m_left, s->m_right);
619+
}
620+
xx.m_test = function_call;
612621
}
613622
}
614623

0 commit comments

Comments
 (0)