diff --git a/src/libasr/pass/replace_symbolic.cpp b/src/libasr/pass/replace_symbolic.cpp index 45ddbffd59..f8059f50b1 100644 --- a/src/libasr/pass/replace_symbolic.cpp +++ b/src/libasr/pass/replace_symbolic.cpp @@ -1091,6 +1091,20 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor(x); + transform_stmts(xx.m_body, xx.n_body); + transform_stmts(xx.m_orelse, xx.n_orelse); + SymbolTable* module_scope = current_scope->parent; + if (ASR::is_a(*xx.m_test)) { + ASR::IntrinsicScalarFunction_t* intrinsic_func = ASR::down_cast(xx.m_test); + if (intrinsic_func->m_type->type == ASR::ttypeType::Logical) { + ASR::expr_t* function_call = process_attributes(al, xx.base.base.loc, xx.m_test, module_scope); + xx.m_test = function_call; + } + } + } + void visit_SubroutineCall(const ASR::SubroutineCall_t &x) { SymbolTable* module_scope = current_scope->parent; Vec call_args;