[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / synchronization04.f90
blob9de8361f4a64cd754d13fd73a667781b6d85ce61
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! XFAIL: *
3 ! This test checks for semantic errors in sync team statements based on the
4 ! statement specification in section 11.6.6 of the Fortran 2018 standard.
6 program test_sync_team
7 use iso_fortran_env, only : team_type
8 implicit none
10 integer sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1), not_a_team
11 character(len=128) error_message, co_indexed_character[*], superfluous_errmsg
12 logical invalid_type
13 type(team_type) warriors
16 !___ standard-conforming statement ___
18 sync team(warriors)
19 sync team(warriors, stat=sync_status)
20 sync team(warriors, errmsg=error_message)
21 sync team(warriors, stat=sync_status, errmsg=error_message)
23 !___ non-standard-conforming statement ___
25 !______ missing or invalid team-value _____________________
27 !ERROR: TBD
28 sync team(not_a_team)
30 !ERROR: expected ')'
31 sync team(stat=sync_status, errmsg=error_message)
33 !______ invalid sync-stat-lists: invalid stat= ____________
35 !ERROR: expected ')'
36 sync team(warriors, status=sync_status)
38 ! Stat-variable must an integer scalar
39 !ERROR: TBD
40 sync team(warriors, stat=invalid_type)
42 ! Stat-variable must an integer scalar
43 !ERROR: TBD
44 sync team(warriors, stat=non_scalar)
46 ! Invalid sync-stat-list: missing stat-variable
47 !ERROR: expected ')'
48 sync team(warriors, stat)
50 ! Invalid sync-stat-list: missing 'stat='
51 !ERROR: expected ')'
52 sync team(warriors, sync_status)
54 !______ invalid sync-stat-lists: invalid errmsg= ____________
56 ! Invalid errmsg-variable keyword
57 !ERROR: expected ')'
58 sync team(warriors, errormsg=error_message)
60 !ERROR: TBD
61 sync team(warriors, errmsg=invalid_type)
63 ! Invalid sync-stat-list: missing 'errmsg='
64 !ERROR: expected ')'
65 sync team(warriors, error_message)
67 ! Invalid sync-stat-list: missing errmsg-variable
68 !ERROR: expected ')'
69 sync team(warriors, errmsg)
71 !______ invalid sync-stat-lists: redundant sync-stat-list ____________
73 ! No specifier shall appear more than once in a given sync-stat-list
74 !ERROR: to be determined
75 sync team(warriors, stat=sync_status, stat=superfluous_stat)
77 ! No specifier shall appear more than once in a given sync-stat-list
78 !ERROR: to be determined
79 sync team(warriors, errmsg=error_message, errmsg=superfluous_errmsg)
81 !______ invalid sync-stat-lists: coindexed stat-variable ____________
83 ! Check constraint C1173 from the Fortran 2018 standard
84 !ERROR: to be determined
85 sync team(warriors, stat=co_indexed_integer[1])
87 ! Check constraint C1173 from the Fortran 2018 standard
88 !ERROR: to be determined
89 sync team(warriors, errmsg=co_indexed_character[1])
91 end program test_sync_team