[flang-commits] [flang] bee23de - [flang] Add new semantics tests for `unlock-stmt`

Katherine Rasmussen via flang-commits flang-commits at lists.llvm.org
Fri Aug 11 08:38:28 PDT 2023


Author: Sam Da Silva
Date: 2023-08-11T08:37:30-07:00
New Revision: bee23dee2ce2d547689700d38f2bdc6198582670

URL: https://github.com/llvm/llvm-project/commit/bee23dee2ce2d547689700d38f2bdc6198582670
DIFF: https://github.com/llvm/llvm-project/commit/bee23dee2ce2d547689700d38f2bdc6198582670.diff

LOG: [flang] Add new semantics tests for `unlock-stmt`

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

Reviewed By: ktras

Differential Revision: https://reviews.llvm.org/D157409

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/flang/test/Semantics/unlockstmt01.f90 b/flang/test/Semantics/unlockstmt01.f90
new file mode 100644
index 00000000000000..e562369f03394e
--- /dev/null
+++ b/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

diff  --git a/flang/test/Semantics/unlockstmt02.f90 b/flang/test/Semantics/unlockstmt02.f90
new file mode 100644
index 00000000000000..03f4ef6aa2cc6c
--- /dev/null
+++ b/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


        


More information about the flang-commits mailing list