re PR fortran/83548 (Compilation Error using logical function in parameter)
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_22.f90
blobedf59321dd5fb5ec1f789db4802dc6b1de6e813f
1 ! { dg-do run }
2 program foo
4 implicit none
6 character(len=4) :: s
7 character(len=10) :: a
9 ! This works.
10 s = 'abc'
11 associate(t => s)
12 if (trim(t) /= 'abc') call abort
13 end associate
15 ! This failed.
16 associate(u => 'abc')
17 if (trim(u) /= 'abc') call abort
18 end associate
20 ! This failed.
21 a = s // 'abc'
22 associate(v => s // 'abc')
23 if (trim(v) /= trim(a)) call abort
24 end associate
26 ! This failed.
27 ! This still doesn't work correctly, see PR 83344
28 ! a = trim(s) // 'abc'
29 ! associate(w => trim(s) // 'abc')
30 ! if (trim(w) /= trim(a)) call abort
31 ! end associate
33 ! This failed.
34 associate(x => trim('abc'))
35 if (trim(x) /= 'abc') call abort
36 end associate
38 end program foo