[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / synchronization02.f90
blob1a2a4b9f18864db1719d724c5827b0b859ee622d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! XFAIL: *
3 ! Check for semantic errors in sync images statements
5 program test_sync_images
6 implicit none
8 integer, parameter :: invalid_rank(*,*) = reshape([1], [1,1])
9 integer sync_status, non_scalar(2), superfluous_stat, coindexed_integer[*], me
10 character(len=128) error_message, superfluous_errmsg, coindexed_character[*]
11 logical invalid_type
13 !___ standard-conforming statement ___
15 sync images(*, stat=sync_status, errmsg=error_message)
16 sync images(*, stat=sync_status )
17 sync images(*, errmsg=error_message)
18 sync images(* )
20 sync images(me, stat=sync_status, errmsg=error_message)
21 sync images(me+1, stat=sync_status, errmsg=error_message)
22 sync images(1, stat=sync_status, errmsg=error_message)
23 sync images(1, stat=sync_status )
24 sync images(1, errmsg=error_message)
25 sync images(1 )
27 sync images([1], stat=sync_status, errmsg=error_message)
28 sync images([1], stat=sync_status )
29 sync images([1], errmsg=error_message)
30 sync images([1] )
32 !___ non-standard-conforming statement ___
34 !______ invalid image sets ______
36 ! Image set shall not depend on the value of stat-variable
37 !ERROR: TBD
38 sync images(sync_status, stat=sync_status)
40 ! Image set shall not depend on the value of errmsg-variable
41 !ERROR: TBD
42 sync images(len(error_message), errmsg=error_message)
44 ! Image set shall be a scalar or rank-1 array
45 !ERROR: TBD
46 sync images(invalid_rank)
48 !______ invalid sync-stat-lists: invalid stat= ____________
50 ! Invalid sync-stat-list keyword
51 !ERROR: expected ')'
52 sync images(1, status=sync_status)
54 !ERROR: TBD
55 sync images([1], stat=invalid_type)
57 ! Stat-variable must an integer scalar
58 !ERROR: TBD
59 sync images(*, stat=non_scalar)
61 ! Invalid sync-stat-list: missing stat-variable
62 !ERROR: expected ')'
63 sync images(1, stat)
65 ! Invalid sync-stat-list: missing 'stat='
66 !ERROR: expected ')'
67 sync images([1], sync_status)
69 !______ invalid sync-stat-lists: invalid errmsg= ____________
71 ! Invalid errmsg-variable keyword
72 !ERROR: expected ')'
73 sync images(*, errormsg=error_message)
75 !ERROR: TBD
76 sync images(1, errmsg=invalid_type)
78 ! Invalid sync-stat-list: missing 'errmsg='
79 !ERROR: expected ')'
80 sync images([1], error_message)
82 ! Invalid sync-stat-list: missing errmsg-variable
83 !ERROR: expected ')'
84 sync images(*, errmsg)
86 !______ invalid sync-stat-lists: redundant sync-stat-list ____________
88 ! No specifier shall appear more than once in a given sync-stat-list
89 !ERROR: to be determined
90 sync images(1, stat=sync_status, stat=superfluous_stat)
92 ! No specifier shall appear more than once in a given sync-stat-list
93 !ERROR: to be determined
94 sync images([1], errmsg=error_message, errmsg=superfluous_errmsg)
96 !______ invalid sync-stat-lists: coindexed stat-variable ____________
98 ! Check constraint C1173 from the Fortran 2018 standard
99 !ERROR: to be determined
100 sync images(*, stat=coindexed_integer[1])
102 ! Check constraint C1173 from the Fortran 2018 standard
103 !ERROR: to be determined
104 sync images(1, errmsg=coindexed_character[1])
106 end program test_sync_images