coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_40.f90
blobd40a65accceb51d6d388bba26eddd580e9954f15
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
5 ! Run-time test for memory consistency
7 ! Contributed by Deepak Eachempati
9 program cp_bug
10 implicit none
11 integer :: v1, v2, u[*]
12 integer :: me
14 me = this_image()
16 u = 0
17 v1 = 10
19 v1 = u[me]
21 ! v2 should get value in u (0)
22 v2 = v1
24 if(v2 /= u) call abort()
26 end program