diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp --- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp +++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp @@ -580,7 +580,10 @@ } LogicalResult acc::SerialOp::verify() { - + if (failed(checkSymOperandList( + *this, getPrivatizations(), getGangPrivateOperands(), "private", + "privatizations"))) + return failure(); return checkDataOperands(*this, getDataClauseOperands()); } diff --git a/mlir/test/Dialect/OpenACC/invalid.mlir b/mlir/test/Dialect/OpenACC/invalid.mlir --- a/mlir/test/Dialect/OpenACC/invalid.mlir +++ b/mlir/test/Dialect/OpenACC/invalid.mlir @@ -462,3 +462,12 @@ %2 = arith.constant 0 : i32 acc.yield %2 : i32 } + +// ----- + +func.func @fct1(%0 : !llvm.ptr) -> () { + // expected-error@+1 {{expected symbol reference @privatization_i32 to point to a private declaration}} + acc.serial private(@privatization_i32 -> %0 : !llvm.ptr) { + } + return +}