Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / synchronization03a.f90
blobdb885a84dbfb716560ca8d766ae50e751114bc7d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for errors in sync memory statements based on the
3 ! statement specification in section 11.6.5 of the Fortran 2018 standard.
5 program test_sync_memory
6 implicit none
8 integer sync_status
9 character(len=128) error_message
11 !___ standard-conforming statements ___
13 sync memory
14 sync memory()
15 sync memory(stat=sync_status)
16 sync memory( errmsg=error_message)
17 sync memory(stat=sync_status, errmsg=error_message)
19 !___ non-standard-conforming statements ___
21 !______ invalid sync-stat-lists: invalid stat= ____________
23 !ERROR: expected end of statement
24 sync memory(status=sync_status)
26 ! Invalid sync-stat-list: missing stat-variable
27 !ERROR: expected end of statement
28 sync memory(stat)
30 ! Invalid sync-stat-list: missing 'stat='
31 !ERROR: expected end of statement
32 sync memory(sync_status)
34 !______ invalid sync-stat-lists: invalid errmsg= ____________
36 ! Invalid errmsg-variable keyword
37 !ERROR: expected end of statement
38 sync memory(errormsg=error_message)
40 ! Invalid sync-stat-list: missing 'errmsg='
41 !ERROR: expected end of statement
42 sync memory(error_message)
44 ! Invalid sync-stat-list: missing errmsg-variable
45 !ERROR: expected end of statement
46 sync memory(errmsg)
48 end program test_sync_memory