nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / char4_decl.f90
blobbb6b6a8318a4ae9c2169ffec1b8c807df37fb0dd
1 ! { dg-do run }
2 ! { dg-additional-options "-fdump-tree-original" }
4 ! In this program shall be no kind=1,
5 ! except for the 'argv' of the 'main' program.
7 ! Related PR fortran/107266
9 ! { dg-final { scan-tree-dump-times "kind=1" 1 "original" } }
10 ! { dg-final { scan-tree-dump-times "character\\(kind=1\\) \\* \\* argv\\)" 1 "original" } }
12 program testit
13 implicit none (type, external)
14 character (kind=4, len=:), allocatable :: aa
15 character (kind=4, len=:), pointer :: pp
17 pp => NULL ()
19 call frobf (aa, pp)
20 if (.not. allocated (aa)) stop 101
21 if (storage_size(aa) /= storage_size(4_'foo')) stop 1
22 if (aa .ne. 4_'foo') stop 102
23 if (.not. associated (pp)) stop 103
24 if (storage_size(pp) /= storage_size(4_'bar')) stop 2
25 if (pp .ne. 4_'bar') stop 104
27 pp => NULL ()
29 call frobc (aa, pp)
30 if (.not. allocated (aa)) stop 105
31 if (storage_size(aa) /= storage_size(4_'frog')) stop 3
32 if (aa .ne. 4_'frog') stop 106
33 if (.not. associated (pp)) stop 107
34 if (storage_size(pp) /= storage_size(4_'toad')) stop 4
35 if (pp .ne. 4_'toad') stop 108
38 contains
40 subroutine frobf (a, p)
41 character (kind=4, len=:), allocatable :: a
42 character (kind=4, len=:), pointer :: p
43 allocate (character(kind=4, len=3) :: p)
44 a = 4_'foo'
45 p = 4_'bar'
46 end subroutine
48 subroutine frobc (a, p)
49 character (kind=4, len=:), allocatable :: a
50 character (kind=4, len=:), pointer :: p
51 allocate (character(kind=4, len=4) :: p)
52 a = 4_'frog'
53 p = 4_'toad'
54 end subroutine
56 end program