cast<llvm::FunctionType>(convertType(function.getFunctionType())));
llvm::Function *llvmFunc = cast<llvm::Function>(llvmFuncCst.getCallee());
llvmFunc->setLinkage(convertLinkageToLLVM(function.getLinkage()));
+ llvmFunc->setCallingConv(convertCConvToLLVM(function.getCConv()));
mapFunction(function.getName(), llvmFunc);
addRuntimePreemptionSpecifier(function.getDsoLocal(), llvmFunc);
// RUN: mlir-opt -split-input-file -verify-diagnostics %s | mlir-opt | FileCheck %s
// RUN: mlir-opt -split-input-file -verify-diagnostics -mlir-print-op-generic %s | FileCheck %s --check-prefix=GENERIC
// RUN: mlir-opt -split-input-file -verify-diagnostics %s -mlir-print-debuginfo | mlir-opt -mlir-print-debuginfo | FileCheck %s --check-prefix=LOCINFO
+// RUN: mlir-translate -mlir-to-llvmir -split-input-file -verify-diagnostics %s | FileCheck %s --check-prefix=CHECK-LLVM
module {
// GENERIC: "llvm.func"
// GENERIC-SAME: sym_name = "foo"
// GENERIC-SAME: () -> ()
// CHECK: llvm.func @foo()
- "llvm.func"() ({
+ "llvm.func" () ({
}) {sym_name = "foo", function_type = !llvm.func<void ()>} : () -> ()
// GENERIC: "llvm.func"
llvm.return
}
+ // CHECK-LLVM: define ptx_kernel void @calling_conv
+ llvm.func ptx_kernelcc @calling_conv() {
+ llvm.return
+ }
+
// Omit the `external` linkage, which is the default, in the custom format.
// Check that it is present in the generic format using its numeric value.
//