xref: /llvm-project/flang/test/Semantics/synchronization02a.f90 (revision 21dceb3ca67cdc0e05b95e1d229bd01a8cd29f60)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Check for errors in sync images statements
3
4program test_sync_images
5  implicit none
6
7  integer sync_status, me
8  character(len=128) error_message
9
10  !___ standard-conforming statement ___
11
12  sync images(*, stat=sync_status, errmsg=error_message)
13  sync images(*, stat=sync_status                      )
14  sync images(*,                   errmsg=error_message)
15  sync images(*                                        )
16
17  sync images(me,   stat=sync_status, errmsg=error_message)
18  sync images(me+1, stat=sync_status, errmsg=error_message)
19  sync images(1,    stat=sync_status, errmsg=error_message)
20  sync images(1,    stat=sync_status                      )
21  sync images(1,                      errmsg=error_message)
22  sync images(1                                           )
23
24  sync images([1],  stat=sync_status, errmsg=error_message)
25  sync images([1],  stat=sync_status                      )
26  sync images([1],                    errmsg=error_message)
27  sync images([1]                                         )
28
29  !___ non-standard-conforming statement ___
30
31  !ERROR: expected '('
32  sync images
33
34  !______ invalid sync-stat-lists: invalid stat= ____________
35
36  ! Invalid sync-stat-list keyword
37  !ERROR: expected ')'
38  sync images(1, status=sync_status)
39
40  ! Invalid sync-stat-list: missing stat-variable
41  !ERROR: expected ')'
42  sync images(1, stat)
43
44  ! Invalid sync-stat-list: missing 'stat='
45  !ERROR: expected ')'
46  sync images([1], sync_status)
47
48  !______ invalid sync-stat-lists: invalid errmsg= ____________
49
50  ! Invalid errmsg-variable keyword
51  !ERROR: expected ')'
52  sync images(*, errormsg=error_message)
53
54  ! Invalid sync-stat-list: missing 'errmsg='
55  !ERROR: expected ')'
56  sync images([1], error_message)
57
58  ! Invalid sync-stat-list: missing errmsg-variable
59  !ERROR: expected ')'
60  sync images(*, errmsg)
61
62end program test_sync_images
63