75 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! This test checks for semantic errors in notify wait statements based on the3! statement specification in section 11.6 of the Fortran 2023 standard4 5program test_notify_wait6 use iso_fortran_env, only: notify_type7 implicit none8 9 ! notify_type variables must be coarrays10 type(notify_type) :: non_coarray11 12 type(notify_type) :: notify_var[*], redundant_notify[*]13 integer :: count, sync_status14 character(len=128) :: error_message15 16 !____________________ non-standard-conforming statements __________________________17 18 !_________________________ invalid notify-variable ________________________________19 20 ! notify-variable has an unknown expression21 !ERROR: expected '('22 notify wait(notify=notify_var)23 24 !_____________ invalid event-wait-spec-lists: invalid until-spec _________________25 26 ! Invalid until-spec keyword27 !ERROR: expected '('28 notify wait(notify_var, until_amount=count)29 30 ! Invalid until-spec: missing until-spec variable31 !ERROR: expected '('32 notify wait(notify_var, until_count)33 34 ! Invalid until-spec: missing 'until_count='35 !ERROR: expected '('36 notify wait(notify_var, count)37 38 !_________________ invalid sync-stat-lists: invalid stat= ________________________39 40 ! Invalid stat-variable keyword41 !ERROR: expected '('42 notify wait(notify_var, status=sync_status)43 44 ! Invalid sync-stat-list: missing stat-variable45 !ERROR: expected '('46 notify wait(notify_var, stat)47 48 ! Invalid sync-stat-list: missing 'stat='49 !ERROR: expected '('50 notify wait(notify_var, sync_status)51 52 !________________ invalid sync-stat-lists: invalid errmsg= _______________________53 54 ! Invalid errmsg-variable keyword55 !ERROR: expected '('56 notify wait(notify_var, errormsg=error_message)57 58 ! Invalid sync-stat-list: missing 'errmsg='59 !ERROR: expected '('60 notify wait(notify_var, error_message)61 62 ! Invalid sync-stat-list: missing errmsg-variable63 !ERROR: expected '('64 notify wait(notify_var, errmsg)65 66 !______________ invalid notify-variable: redundant notify-variable _________________67 68 !ERROR: expected '('69 notify wait(notify_var, redundant_notify)70 71 !ERROR: expected '('72 notify wait(notify_var, redundant_notify, stat=sync_status, errmsg=error_message)73 74end program test_notify_wait75