coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / array_constructor_36.f90
bloba74d256d95eea2d5acb7f970f7be0751131859d6
1 ! { dg-do run }
2 ! Test the fix for PR47348, in which the substring length
3 ! in the array constructor at line 19 would be missed and
4 ! the length of q used instead.
6 ! Contributed by Thomas Koenig <tkoenig@netcologne.de>
8 program main
9 implicit none
10 character(len = *), parameter :: fmt='(2(A,"|"))'
11 character(len = *), parameter :: test='xyc|aec|'
12 integer :: i
13 character(len = 4) :: q
14 character(len = 8) :: buffer
15 q = 'xy'
16 i = 2
17 write (buffer, fmt) (/ trim(q), 'ae' /)//'c'
18 if (buffer .ne. test) Call abort
19 write (buffer, FMT) (/ q(1:i), 'ae' /)//'c'
20 if (buffer .ne. test) Call abort
21 end program main