[AArch64] Fix brackets warning in assert. NFC
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-atomic-validity.f90
blobba68031b0f18bc74e647f93057b531206d555604
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.12 Atomic
6 program openacc_atomic_validity
8 implicit none
10 integer :: i
11 integer, parameter :: N = 256
12 integer, dimension(N) :: c
15 !$acc parallel
16 !$acc atomic update
17 c(i) = c(i) + 1
19 !$acc atomic update
20 c(i) = c(i) + 1
21 !$acc end atomic
23 !$acc atomic write
24 c(i) = 10
26 !$acc atomic write
27 c(i) = 10
28 !$acc end atomic
30 !$acc atomic read
31 i = c(i)
33 !$acc atomic read
34 i = c(i)
35 !$acc end atomic
37 !$acc atomic capture
38 c(i) = i
39 i = i + 1
40 !$acc end atomic
42 !$acc atomic update
43 !ERROR: RHS of atomic update statement must be scalar
44 !ERROR: LHS of atomic update statement must be scalar
45 c = c + 1
47 !$acc end parallel
49 end program openacc_atomic_validity