1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
4 ! Semantic checks for various assignments related to atomic constructs
10 integer, allocatable
:: k
16 type(sample_type
) :: z
22 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches scalar INTEGER(4) and rank 1 array of INTEGER(4)
23 !ERROR: Expected scalar expression on the RHS of atomic assignment statement
27 !ERROR: Expected scalar variable of intrinsic type on RHS of atomic assignment statement
31 !ERROR: Expected scalar variable of intrinsic type on RHS of atomic assignment statement
35 !ERROR: k must not have ALLOCATABLE attribute
39 !ERROR: k must not have ALLOCATABLE attribute
43 !ERROR: k must not have ALLOCATABLE attribute
47 !ERROR: k must not have ALLOCATABLE attribute
51 !ERROR: RHS expression on atomic assignment statement cannot access 'z%y'
55 !ERROR: RHS expression on atomic assignment statement cannot access 'x'
59 !ERROR: RHS expression on atomic assignment statement cannot access 'm'
60 m
= min(m
, x
, z
%m
) + k
63 !ERROR: RHS expression on atomic assignment statement cannot access 'x'
67 !ERROR: Expected scalar variable of intrinsic type on RHS of atomic assignment statement
68 !ERROR: RHS expression on atomic assignment statement cannot access 'm'
69 m
= min(m
, x
, z
%m
) + k
72 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches scalar INTEGER(4) and rank 1 array of INTEGER(4)
73 !ERROR: Expected scalar expression on the RHS of atomic assignment statement
77 !ERROR: Expected scalar variable on the LHS of atomic assignment statement
81 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches scalar INTEGER(4) and rank 1 array of INTEGER(4)
82 !ERROR: Expected scalar expression on the RHS of atomic assignment statement
86 !ERROR: Expected scalar variable on the LHS of atomic assignment statement
94 !$omp atomic release capture
96 !ERROR: Atomic update statement should be of form `x = x operator expr` OR `x = expr operator x`
100 !$omp atomic capture hint(0)
106 !ERROR: Captured variable/array element/derived-type component x expected to be assigned in the second statement of ATOMIC CAPTURE construct
112 !ERROR: Captured variable/array element/derived-type component x expected to be assigned in the second statement of ATOMIC CAPTURE construct
118 !ERROR: Updated variable/array element/derived-type component x expected to be captured in the second statement of ATOMIC CAPTURE construct
124 !ERROR: Invalid ATOMIC CAPTURE construct statements. Expected one of [update-stmt, capture-stmt], [capture-stmt, update-stmt], or [capture-stmt, write-stmt]
130 !ERROR: Captured variable/array element/derived-type component z%y expected to be assigned in the second statement of ATOMIC CAPTURE construct
136 !ERROR: Updated variable/array element/derived-type component z%m expected to be captured in the second statement of ATOMIC CAPTURE construct
142 !ERROR: Captured variable/array element/derived-type component y(2) expected to be assigned in the second statement of ATOMIC CAPTURE construct
148 !ERROR: Updated variable/array element/derived-type component y(1) expected to be captured in the second statement of ATOMIC CAPTURE construct
154 !ERROR: Expected scalar variable on the LHS of atomic assignment statement
155 !ERROR: Expected scalar expression on the RHS of atomic assignment statement
159 !ERROR: Expected scalar variable on the LHS of atomic assignment statement
160 !ERROR: Expected scalar expression on the RHS of atomic assignment statement