Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / synchronization01b.f90
blob537041c417d63257f671f466c1c9cf7d23e7032b
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in sync all statements.
3 ! Some of the errors in this test would be hidden by the errors in
4 ! the test synchronization01a.f90 if they were included in that file,
5 ! and are thus tested here.
7 program test_sync_all
8 implicit none
10 integer sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1)
11 character(len=128) error_message, co_indexed_character[*], superfluous_errmsg
12 logical invalid_type
14 !___ non-standard-conforming statements ___
16 !ERROR: Must have INTEGER type, but is LOGICAL(4)
17 sync all(stat=invalid_type)
19 !ERROR: Must be a scalar value, but is a rank-1 array
20 sync all(stat=non_scalar)
22 !ERROR: Must have CHARACTER type, but is LOGICAL(4)
23 sync all(errmsg=invalid_type)
25 !ERROR: The stat-variable in a sync-stat-list may not be repeated
26 sync all(stat=sync_status, stat=superfluous_stat)
28 !ERROR: The errmsg-variable in a sync-stat-list may not be repeated
29 sync all(errmsg=error_message, errmsg=superfluous_errmsg)
31 !ERROR: The stat-variable in a sync-stat-list may not be repeated
32 sync all(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 all(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 all(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 all(errmsg=co_indexed_character[1])
43 end program test_sync_all