xref: /llvm-project/flang/test/Semantics/synchronization01a.f90 (revision 52601325f1a4db06510dbe12562240a018a254bd)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! This test checks for errors in sync all statements based on the
3! statement specification in section 11.6.3 of the Fortran 2018 standard.
4
5program test_sync_all
6  implicit none
7
8  integer sync_status
9  character(len=128) error_message
10
11  !___ standard-conforming statement ___
12
13  sync all
14  sync all()
15  sync all(stat=sync_status)
16  sync all(                  errmsg=error_message)
17  sync all(stat=sync_status, errmsg=error_message)
18
19  !___ non-standard-conforming statement ___
20
21  !______ invalid sync-stat-lists: invalid stat= ____________
22
23  !ERROR: expected end of statement
24  sync all(status=sync_status)
25
26  ! Invalid sync-stat-list: missing stat-variable
27  !ERROR: expected end of statement
28  sync all(stat)
29
30  ! Invalid sync-stat-list: missing 'stat='
31  !ERROR: expected end of statement
32  sync all(sync_status)
33
34  !______ invalid sync-stat-lists: invalid errmsg= ____________
35
36  ! Invalid errmsg-variable keyword
37  !ERROR: expected end of statement
38  sync all(errormsg=error_message)
39
40  ! Invalid sync-stat-list: missing 'errmsg='
41  !ERROR: expected end of statement
42  sync all(error_message)
43
44  ! Invalid sync-stat-list: missing errmsg-variable
45  !ERROR: expected end of statement
46  sync all(errmsg)
47
48end program test_sync_all
49