Expressing external function call in SPIR-V dialect using LinkageAttributes


I am looking to write an MLIR SPIR-V test case using the ‘spv’ dialect. I am a little confused as to how to call an external function in ‘spv’ dialect. Just to make it a bit clear, let’s assume the follwoing SPIR-V code, what would be the equivalent ‘spv’ dialect code?

OpName %llvm_genx_outside_func "llvm.genx.outside.func"
OpDecorate %llvm_genx_outside_func "llvm.genx.outside.func" Import
OpFunctionCall %llvm_genx_outside_func

I looked into the ‘spv’ dialect description, where it says that the ‘LinkageAttributes’ decoration can be used to express external function, but when I do this:

//Create a declaration of the external function
spv.func @llvm_genx_outside_func() -> () attributes {LinkageAttributes="llvm.genx.outside.func", "Import"}	
spv.FunctionCall @llvm_genx_outside_func() -> ()

I get the following error:
error: ‘spv.module’ cannot contain external functions

Any suggestions as to how to express it in the ‘spv’ dialect.
Thank you.

PS-> I am still pretty new in the MLIR arena, so I apologize if I have made any rookie mistake :).

Best Regards,