diff --git a/flang/test/Semantics/OpenACC/acc-data.f90 b/flang/test/Semantics/OpenACC/acc-data.f90 --- a/flang/test/Semantics/OpenACC/acc-data.f90 +++ b/flang/test/Semantics/OpenACC/acc-data.f90 @@ -75,6 +75,9 @@ !$acc exit data delete(aa) finalize + !ERROR: At most one FINALIZE clause can appear on the EXIT DATA directive + !$acc exit data delete(aa) finalize finalize + !$acc exit data detach(cc) !$acc exit data copyout(bb) @@ -83,8 +86,14 @@ !$acc exit data delete(aa) if(ifCondition) + !ERROR: At most one IF clause can appear on the EXIT DATA directive + !$acc exit data delete(aa) if(ifCondition) if(.TRUE.) + !$acc exit data delete(aa) async + !ERROR: At most one ASYNC clause can appear on the EXIT DATA directive + !$acc exit data delete(aa) async async + !$acc exit data delete(aa) async(async1) !$acc exit data delete(aa) async(1) diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td --- a/llvm/include/llvm/Frontend/OpenACC/ACC.td +++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td @@ -492,9 +492,11 @@ // 2.14.7 def ACC_ExitData : Directive<"exit data"> { let allowedClauses = [ + VersionedClause + ]; + let allowedOnceClauses = [ VersionedClause, VersionedClause, - VersionedClause, VersionedClause ]; let requiredClauses = [