Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / synchronization04a.f90
blob138cd34b225a2bcd78bb8067ec97e9170e780042
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for errors in sync team statements based on the
3 ! statement specification in section 11.6.6 of the Fortran 2018 standard.
5 program test_sync_team
6 use iso_fortran_env, only : team_type
7 implicit none
9 integer sync_status
10 character(len=128) error_message
11 type(team_type) warriors
13 !___ standard-conforming statement ___
15 sync team(warriors)
16 sync team(warriors, stat=sync_status)
17 sync team(warriors, errmsg=error_message)
18 sync team(warriors, stat=sync_status, errmsg=error_message)
20 !___ non-standard-conforming statement ___
22 !______ missing team-value _____________________
24 !ERROR: expected '('
25 sync team
27 !ERROR: expected ')'
28 sync team(stat=sync_status, errmsg=error_message)
30 !______ invalid sync-stat-lists: invalid stat= ____________
32 !ERROR: expected ')'
33 sync team(warriors, status=sync_status)
35 ! Invalid sync-stat-list: missing stat-variable
36 !ERROR: expected ')'
37 sync team(warriors, stat)
39 ! Invalid sync-stat-list: missing 'stat='
40 !ERROR: expected ')'
41 sync team(warriors, sync_status)
43 !______ invalid sync-stat-lists: invalid errmsg= ____________
45 ! Invalid errmsg-variable keyword
46 !ERROR: expected ')'
47 sync team(warriors, errormsg=error_message)
49 ! Invalid sync-stat-list: missing 'errmsg='
50 !ERROR: expected ')'
51 sync team(warriors, error_message)
53 ! Invalid sync-stat-list: missing errmsg-variable
54 !ERROR: expected ')'
55 sync team(warriors, errmsg)
57 end program test_sync_team