1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in sync memory statements.
3 ! Some of the errors in this test would be hidden by the errors in
4 ! the test synchronization03a.f90 if they were included in that file,
5 ! and are thus tested here.
7 program test_sync_memory
10 integer sync_status
, co_indexed_integer
[*], superfluous_stat
, non_scalar(1)
11 character(len
=128) error_message
, co_indexed_character
[*], superfluous_errmsg
14 !___ non-standard-conforming statements ___
16 !ERROR: Must have INTEGER type, but is LOGICAL(4)
17 sync
memory(stat
=invalid_type
)
19 !ERROR: Must be a scalar value, but is a rank-1 array
20 sync
memory(stat
=non_scalar
)
22 !ERROR: Must have CHARACTER type, but is LOGICAL(4)
23 sync
memory(errmsg
=invalid_type
)
25 !ERROR: The stat-variable in a sync-stat-list may not be repeated
26 sync
memory(stat
=sync_status
, stat
=superfluous_stat
)
28 !ERROR: The errmsg-variable in a sync-stat-list may not be repeated
29 sync
memory(errmsg
=error_message
, errmsg
=superfluous_errmsg
)
31 !ERROR: The stat-variable in a sync-stat-list may not be repeated
32 sync
memory(stat
=sync_status
, errmsg
=error_message
, stat
=superfluous_stat
)
34 !ERROR: The errmsg-variable in a sync-stat-list may not be repeated
35 sync
memory(stat
=sync_status
, errmsg
=error_message
, errmsg
=superfluous_errmsg
)
37 !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object
38 sync
memory(stat
=co_indexed_integer
[1])
40 !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object
41 sync
memory(errmsg
=co_indexed_character
[1])
43 end program test_sync_memory