On lowering the Function decl, it throws exception if finds an expr with direct call to the function. It fails to find the symbol reference attribute.
* frame #0: 0x0000000106eed0ac mx-index`mlir::detail::StorageUserBase<mlir::DictionaryAttr, mlir::Attribute, mlir::detail::DictionaryAttrStorage, mlir::detail::AttributeUniquer, mlir::SubElementAttrInterface::Trait>::getImpl(this=0x0000000000000038) const at StorageUniquerSupport.h:157:68
frame #1: 0x0000000106eed085 mx-index`mlir::DictionaryAttr::getValue(this=0x0000000000000038) const at BuiltinAttributes.cpp.inc:147:76
frame #2: 0x0000000106ef0f3c mx-index`mlir::DictionaryAttr::getNamed(this=0x0000000000000038, name=(Data = "sym_name", Length = 8)) const at BuiltinAttributes.cpp:187:37
frame #3: 0x0000000106ef0e75 mx-index`mlir::DictionaryAttr::get(this=0x0000000000000038, name=(Data = "sym_name", Length = 8)) const at BuiltinAttributes.cpp:177:35
frame #4: 0x0000000106dc9a49 mx-index`mlir::Operation::getAttr(this=0x0000000000000000, name=(Data = "sym_name", Length = 8)) at Operation.h:332:52
frame #5: 0x00000001070072e5 mx-index`mlir::StringAttr mlir::Operation::getAttrOfType<mlir::StringAttr>(this=0x0000000000000000, name=(Data = "sym_name", Length = 8)) at Operation.h:338:12
frame #6: 0x0000000106ee3bce mx-index`mlir::Builder::getSymbolRefAttr(this=0x0000700009414338, value=0x0000000000000000) at Builders.cpp:213:14
frame #7: 0x0000000106ca4b1b mx-index`vast::hl::CallOp::build(odsBuilder=0x0000700009414338, odsState=0x0000700009412e00, callee=FuncOp @ 0x0000700009412cc8, operands=ValueRange @ 0x0000700009412cb8) at HighLevel.cpp.inc:4926:50
frame #8: 0x00000001057b9fdc mx-index`vast::hl::CallOp mlir::OpBuilder::create<vast::hl::CallOp, mlir::FuncOp, llvm::SmallVector<mlir::Value, 2u> >(this=0x0000700009414338, location=Location @ 0x0000700009412df0, args=0x0000700009412f48, args=0x0000700009412f88) at Builders.h:402:5
frame #9: 0x00000001057b9ccb mx-index`auto vast::hl::HighLevelBuilder::make<vast::hl::CallOp, mlir::Location&, mlir::FuncOp&, llvm::SmallVector<mlir::Value, 2u>&>(this=0x0000700009414330, args=0x0000700009413080, args=0x0000700009413070, args=0x00007000094130a8) at HighLevelBuilder.hpp:35:28
frame #10: 0x0000000105782fd7 mx-index`mlir::Value vast::hl::HighLevelBuilder::make_value<vast::hl::CallOp, mlir::Location&, mlir::FuncOp&, llvm::SmallVector<mlir::Value, 2u>&>(this=0x0000700009414330, args=0x0000700009413080, args=0x0000700009413070, args=0x00007000094130a8) at HighLevelBuilder.hpp:40:20
frame #11: 0x0000000105782eea mx-index`vast::hl::CodeGenVisitor::VisitDirectCall(this=0x0000700009414328, expr=0x000000011b03e060) at HighLevelVisitor.cpp:458:24
frame #12: 0x00000001057831f8 mx-index`vast::hl::CodeGenVisitor::VisitCallExpr(this=0x0000700009414328, expr=0x000000011b03e060) at HighLevelVisitor.cpp:470:36
CallExpr 0x11a0f2ed0 'int'
|-ImplicitCastExpr 0x11a0f2eb8 'int (*)(int, int)' <FunctionToPointerDecay>
| `-DeclRefExpr 0x11a0f2e30 'int (int, int)' Function 0x11a0f28b0 'internal' 'int (int, int)'
|-ImplicitCastExpr 0x11a0f2f00 'int' <LValueToRValue>
| `-DeclRefExpr 0x11a0f2e50 'int' lvalue Var 0x11a0f2c58 'one' 'int'
`-ImplicitCastExpr 0x11a0f2f18 'int' <LValueToRValue>
`-DeclRefExpr 0x11a0f2e70 'int' lvalue Var 0x11a0f2d10 'two' 'int'