hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_23.f90
blob7bbf2eddf5cd88eeb6365be279df8bfa9f93a43a
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") STOP 1
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") STOP 2
28 ! Found to be failing during debugging
29 ASSOCIATE(should_work=>char_var_dim(1:2))
30 should_work = ["test SUCCESFUL", "test_SUCCESFUL"]
31 write (buffer, *) should_work(:)(5:14)
32 END ASSOCIATE
34 if (trim (buffer) .ne. " SUCCESFUL_SUCCESFUL") STOP 3
36 end program