coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_23.f90
blobb4d58ffd2b7bc29a8e272901de7e3025578c78aa
1 ! { dg-do run }
3 ! Tests the fix for PR64933
5 ! Contributed by Olivier Marsden <olivier.marsden@ecmwf.int>
7 program test_this
8 implicit none
9 character(len = 15) :: char_var, char_var_dim (3)
10 character(len = 80) :: buffer
12 ! Original failing case reported in PR
13 ASSOCIATE(should_work=>char_var)
14 should_work = "test succesful"
15 write (buffer, *) should_work(5:14)
16 END ASSOCIATE
18 if (trim (buffer) .ne. " succesful") call abort
20 ! Found to be failing during debugging
21 ASSOCIATE(should_work=>char_var_dim)
22 should_work = ["test SUCCESFUL", "test_SUCCESFUL", "test.SUCCESFUL"]
23 write (buffer, *) should_work(:)(5:14)
24 END ASSOCIATE
26 if (trim (buffer) .ne. " SUCCESFUL_SUCCESFUL.SUCCESFUL") call abort
28 ! Found to be failing during debugging
29 ASSOCIATE(should_work=>char_var_dim(1:2))
30 should_work = ["test SUCCESFUL", "test_SUCCESFUL", "test.SUCCESFUL"]
31 write (buffer, *) should_work(:)(5:14)
32 END ASSOCIATE
34 if (trim (buffer) .ne. " SUCCESFUL_SUCCESFUL") call abort
36 end program