Skip to content

Commit caf5a03

Browse files
anutosh491certik
authored andcommitted
Fixing symbolic compare for test_gruntz.py
1 parent a6b9256 commit caf5a03

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
@@ -690,6 +690,15 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
690690
xx.m_test = new_logical_not;
691691
}
692692
}
693+
} else if (ASR::is_a<ASR::SymbolicCompare_t>(*xx.m_test)) {
694+
ASR::SymbolicCompare_t *s = ASR::down_cast<ASR::SymbolicCompare_t>(xx.m_test);
695+
ASR::expr_t* function_call = nullptr;
696+
if (s->m_op == ASR::cmpopType::Eq) {
697+
function_call = basic_compare(xx.base.base.loc, "basic_eq", s->m_left, s->m_right);
698+
} else {
699+
function_call = basic_compare(xx.base.base.loc, "basic_neq", s->m_left, s->m_right);
700+
}
701+
xx.m_test = function_call;
693702
}
694703
}
695704

0 commit comments

Comments
 (0)