[flang-commits] [PATCH] D157409: [flang] Add new semantics tests for `unlock-stmt`

Samuel Da Silva via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Aug 8 09:26:13 PDT 2023


samdsilvaa created this revision.
samdsilvaa added reviewers: ktras, rouson.
samdsilvaa added projects: LLVM, Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
samdsilvaa requested review of this revision.

Add two semantics tests for `unlock-stmt`, one with standard-conforming
and one with non-standard conforming statements


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157409

Files:
  flang/test/Semantics/unlockstmt01.f90
  flang/test/Semantics/unlockstmt02.f90


Index: flang/test/Semantics/unlockstmt02.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/unlockstmt02.f90
@@ -0,0 +1,22 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+! XFAIL: *
+program test_unlock_stmt
+
+  use iso_fortran_env, only: lock_type
+
+  type(LOCK_TYPE) :: locks(10)[*]
+  integer :: non_lock
+
+  !ERROR: TBD
+  type(LOCK_TYPE) :: non_coarray !Invalid Declaration
+
+  !___ non-standard-conforming statements ___
+
+  !ERROR: TBD
+  UNLOCK(non_lock)
+  !ERROR: Must be a scalar value, but is a rank-1 array
+  UNLOCK(locks)
+
+ !Sync-stat-list.f90 contains invalid versions of sync-stat-list in unlock-stmt
+
+end program test_unlock_stmt
Index: flang/test/Semantics/unlockstmt01.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/unlockstmt01.f90
@@ -0,0 +1,16 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+program test_unlock_stmt
+
+  use iso_fortran_env, only: lock_type
+
+  type(LOCK_TYPE) :: myLock[*], locks(10)[*]
+  integer :: stat_variable
+  character(len = 128) :: errmsg_variable
+
+  !___ standard-conforming statements ___
+  UNLOCK(myLock)
+  UNLOCK(locks(3))
+  Unlock(locks(1), stat = stat_variable)
+  Unlock(locks(2), ERRMSG = errmsg_variable)
+  Unlock(locks(4), stat = stat_variable, ERRMSG = errmsg_variable)
+end program test_unlock_stmt


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157409.548252.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230808/2ca4586f/attachment.bin>


More information about the flang-commits mailing list