82 lines · plain
1!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=602 3subroutine f004 integer :: x, v5 ! The end-directive is optional in ATOMIC WRITE. Expect no diagnostics.6 !$omp atomic write7 x = v + 18 9 !$omp atomic write10 x = v + 311 !$omp end atomic12end13 14subroutine f0115 integer, pointer :: x, v16 ! Intrinsic assignment and pointer assignment are both ok. Expect no17 ! diagnostics.18 !$omp atomic write19 x = 2 * v + 320 21 !$omp atomic write22 x => v23end24 25subroutine f02(i)26 integer :: i, v27 interface28 function p(i)29 integer, pointer :: p30 integer :: i31 end32 end interface33 34 ! Atomic variable can be a function reference. Expect no diagostics.35 !$omp atomic write36 p(i) = v37end38 39subroutine f0340 integer :: x(3), y(5), v(3)41 42 !$omp atomic write43 !ERROR: Atomic variable x should be a scalar44 x = v45 46 !$omp atomic write47 !ERROR: Atomic variable y(2_8:4_8:1_8) should be a scalar48 y(2:4) = v49end50 51subroutine f0452 integer :: x, y(3), v53 54 !$omp atomic write55 !ERROR: Within atomic operation x and x+1_4 access the same storage56 x = x + 157 58 ! Accessing same array, but not the same storage. Expect no diagnostics.59 !$omp atomic write60 y(1) = y(2)61end62 63subroutine f0664 character :: x, v65 66 !$omp atomic write67 !ERROR: Atomic variable x cannot have CHARACTER type68 x = v69end70 71subroutine f0772 integer, allocatable :: x73 integer :: v74 75 allocate(x)76 77 !$omp atomic write78 !ERROR: Atomic variable x cannot be ALLOCATABLE79 x = v80end81 82