56 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! This test checks for semantic errors in lock statements based on the3! statement specification in section 11.6.10 of the Fortran 2018 standard.4 5program test_lock_stmt6 use iso_fortran_env, only: lock_type7 implicit none8 9 character(len=128) error_message10 integer status11 logical bool12 type(lock_type) :: lock_var[*]13 14 !___ non-standard-conforming statements ___15 16! missing required lock-variable17 18 !ERROR: expected '('19 lock20 21 !ERROR: expected '='22 lock()23 24 !ERROR: expected ')'25 lock(acquired_lock=bool)26 27 !ERROR: expected ')'28 lock(stat=status)29 30 !ERROR: expected ')'31 lock(errmsg=error_message)32 33! specifiers in lock-stat-list are not variables34 35 !ERROR: expected ')'36 lock(lock_var, acquired_lock=.true.)37 38 !ERROR: expected ')'39 lock(lock_var, stat=1)40 41 !ERROR: expected ')'42 lock(lock_var, errmsg='c')43 44! specifier typos45 46 !ERROR: expected ')'47 lock(lock_var, acquiredlock=bool, stat=status, errmsg=error_message)48 49 !ERROR: expected ')'50 lock(lock_var, acquired_lock=bool, status=status, errmsg=error_message)51 52 !ERROR: expected ')'53 lock(lock_var, acquired_lock=bool, stat=status, errormsg=error_message)54 55end program test_lock_stmt56