[PATCH] D114181: Add semantics unit test for SYNC ALL statement

Damian Rouson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 11:29:52 PST 2021


rouson created this revision.
rouson added reviewers: craig.rasmussen, ktras, kiranchandramohan, pmccormick.
rouson added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
rouson requested review of this revision.
Herald added a project: LLVM.

[flang] add semantics test for sync all

      

Test a range of acceptable forms of SYNC ALL statements,
including combinations with and without the stat-variable
and errmsg-variable present.  Also test that several invalid
forms of SYNC ALL call generate the correct error messages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114181

Files:
  flang/test/Semantics/synchronization01.f90


Index: flang/test/Semantics/synchronization01.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/synchronization01.f90
@@ -0,0 +1,28 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+! Check for semantic errors in sync all statements
+
+program test_sync_all
+  implicit none
+
+  integer sync_status
+  character(len=128) error_message
+  logical invalid_type
+  
+  sync all
+  sync all(stat=sync_status)
+  sync all(stat=sync_status, errmsg=error_message)
+ 
+  !ERROR: expected execution part construct
+  sync all(invalid_argument_keyword=sync_status)
+  !ERROR: expected execution part construct
+  sync all(invalid_type)
+  !ERROR: expected execution part construct
+  sync all(sync_status)
+  !ERROR: expected execution part construct
+  sync all(     sync_status, errmsg=error_message)
+  !ERROR: expected execution part construct
+  sync all(                  errmsg)
+  !ERROR: expected execution part construct
+  sync all(     sync_status, errmsg)
+ 
+end program test_sync_all


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114181.388276.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211118/fca2de8f/attachment.bin>


More information about the llvm-commits mailing list