mirror-llvm-project/mlir/test/Conversion/OpenACCToLLVM/runtime-declaration-mismatch.mlir
Razvan Lupusoru 71e5cb7526
[mlir][acc] Introduce ACCToLLVM and executable directive codegen (#213165)
Adds initial infrastructure for converting the acc dialect to LLVM,
specifically around generating libacctarget runtime calls. The current
libacctarget APIs are not yet finalized, but the draft proposal can be
found at https://github.com/llvm/llvm-project/pull/197894. This PR adds
codegen for acc init, shutdown, set, and wait.
2026-07-31 11:04:46 -07:00

26 lines
781 B
MLIR

// RUN: mlir-opt %s -acc-to-llvm -verify-diagnostics -split-input-file | FileCheck %s
// A declaration of a runtime symbol with an incompatible signature cannot be
// called with the arguments the conversion emits.
module {
llvm.func @__tgt_acc_wait(!llvm.ptr, i64, i64, i64) -> i32
func.func @mismatched_wait() {
// expected-error @below {{OpenACC runtime function '__tgt_acc_wait' is already declared with signature}}
// expected-error @below {{failed to legalize operation 'acc.wait'}}
acc.wait
return
}
}
// -----
// A matching declaration is reused.
// CHECK-LABEL: llvm.func @matching_init
// CHECK: llvm.call @__tgt_acc_init
module {
llvm.func @__tgt_acc_init(!llvm.ptr, i64, i64, i64)
func.func @matching_init() {
acc.init
return
}
}