brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · f0cba6b Raw
90 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! This test checks for semantic errors in event wait statements based on the3! statement specification in section 11.6.8 of the Fortran 2018 standard.4 5program test_event_wait6  use iso_fortran_env, only : event_type7  implicit none8 9  ! event_type variables must be coarrays10  type(event_type) non_coarray11 12  type(event_type) concert[*], occurrences(2)[*]13  integer threshold, indexed(1), non_event[*], sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1)14  character(len=128) error_message, non_scalar_char(1), co_indexed_character[*], superfluous_errmsg15  logical invalid_type16 17  !_______________________ standard-conforming statements ___________________________18 19  event wait(concert)20  event wait(occurrences(1))21  event wait(concert, until_count=threshold)22  event wait(concert, until_count=indexed(1))23  event wait(concert, until_count=co_indexed_integer[1])24  event wait(concert,                        stat=sync_status)25  event wait(concert, until_count=threshold, stat=sync_status)26  event wait(concert,                                          errmsg=error_message)27  event wait(concert, until_count=threshold,                   errmsg=error_message)28  event wait(concert,                        stat=sync_status, errmsg=error_message)29  event wait(concert, until_count=threshold, stat=sync_status, errmsg=error_message)30 31  !____________________ non-standard-conforming statements __________________________32 33  !_________________________ invalid event-variable ________________________________34 35  ! event-variable has an unknown expression36  !ERROR: expected ')'37  event wait(event=concert)38 39  !_____________ invalid event-wait-spec-lists: invalid until-spec _________________40 41  ! Invalid until-spec keyword42  !ERROR: expected ')'43  event wait(concert, until_amount=threshold)44 45  ! Invalid until-spec: missing until-spec variable46  !ERROR: expected ')'47  event wait(concert, until_count)48 49  ! Invalid until-spec: missing 'until_count='50  !ERROR: expected ')'51  event wait(concert, threshold)52 53  !_________________ invalid sync-stat-lists: invalid stat= ________________________54 55  ! Invalid stat-variable keyword56  !ERROR: expected ')'57  event wait(concert, status=sync_status)58 59  ! Invalid sync-stat-list: missing stat-variable60  !ERROR: expected ')'61  event wait(concert, stat)62 63  ! Invalid sync-stat-list: missing 'stat='64  !ERROR: expected ')'65  event wait(concert, sync_status)66 67  !________________ invalid sync-stat-lists: invalid errmsg= _______________________68 69  ! Invalid errmsg-variable keyword70  !ERROR: expected ')'71  event wait(concert, errormsg=error_message)72 73  ! Invalid sync-stat-list: missing 'errmsg='74  !ERROR: expected ')'75  event wait(concert, error_message)76 77  ! Invalid sync-stat-list: missing errmsg-variable78  !ERROR: expected ')'79  event wait(concert, errmsg)80 81  !______________ invalid event-variable: redundant event-variable _________________82 83  !ERROR: expected ')'84  event wait(concert, occurrences(1))85 86  !ERROR: expected ')'87  event wait(concert, occurrences(1), stat=sync_status, errmsg=error_message)88 89end program test_event_wait90