[PATCH] D90786: [flang][openacc] Add more parsing/sema tests for init and shutdown directives

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 12:31:45 PST 2020


clementval created this revision.
clementval added reviewers: kiranchandramohan, kiranktp, SouraVX, jdoerfert, sameeranjoshi, ichoyjx.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
clementval requested review of this revision.

This patch adds some positive and failure tests for init and shutdown directives.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90786

Files:
  flang/test/Semantics/acc-clause-validity.f90


Index: flang/test/Semantics/acc-clause-validity.f90
===================================================================
--- flang/test/Semantics/acc-clause-validity.f90
+++ flang/test/Semantics/acc-clause-validity.f90
@@ -14,6 +14,8 @@
 !   2.11 Parallel Loop
 !   2.11 Kernels Loop
 !   2.11 Serial Loop
+!   2.14.1 Init
+!   2.14.2 Shutdown
 !   2.16.13 Wait
 
 program openacc_clause_validity
@@ -42,6 +44,33 @@
   !$acc init device_type(2, i, j)
   !$acc init device_num(i) device_type(i, j) if(ifCondition)
 
+  !ERROR: At most one IF clause can appear on the INIT directive
+  !$acc init if(.TRUE.) if(ifCondition)
+
+  !ERROR: At most one DEVICE_NUM clause can appear on the INIT directive
+  !$acc init device_num(1) device_num(i)
+
+  !ERROR: At most one DEVICE_TYPE clause can appear on the INIT directive
+  !$acc init device_type(2) device_type(i, j)
+
+  !$acc shutdown
+  !$acc shutdown if(.TRUE.)
+  !$acc shutdown if(ifCondition)
+  !$acc shutdown device_num(1)
+  !$acc shutdown device_num(i)
+  !$acc shutdown device_type(i)
+  !$acc shutdown device_type(2, i, j)
+  !$acc shutdown device_num(i) device_type(i, j) if(ifCondition)
+
+  !ERROR: At most one IF clause can appear on the SHUTDOWN directive
+  !$acc shutdown if(.TRUE.) if(ifCondition)
+
+  !ERROR: At most one DEVICE_NUM clause can appear on the SHUTDOWN directive
+  !$acc shutdown device_num(1) device_num(i)
+
+  !ERROR: At most one DEVICE_TYPE clause can appear on the SHUTDOWN directive
+  !$acc shutdown device_type(2) device_type(i, j)
+
   !ERROR: At least one of ATTACH, COPYIN, CREATE clause must appear on the ENTER DATA directive
   !$acc enter data
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90786.302940.patch
Type: text/x-patch
Size: 1644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201104/9344d6b8/attachment.bin>


More information about the llvm-commits mailing list