lto: Remove random_seed from section name.
[official-gcc.git] / gcc / testsuite / gfortran.dg / null_actual_4.f90
blobe03d5c8f7def01fc02c43f77a9d39feb3a4fb1ee
1 ! { dg-do compile }
2 ! PR fortran/104819
4 ! Reject NULL without MOLD as actual to an assumed-rank dummy.
5 ! See also interpretation request at
6 ! https://j3-fortran.org/doc/year/22/22-101r1.txt
8 ! Test nested NULL()
10 program p
11 implicit none
12 integer, pointer :: a, a3(:,:,:)
13 character(10), pointer :: c
15 call foo (a)
16 call foo (a3)
17 call foo (null (a))
18 call foo (null (a3))
19 call foo (null (null (a))) ! Valid: nested NULL()s
20 call foo (null (null (a3))) ! Valid: nested NULL()s
21 call foo (null ()) ! { dg-error "passed to assumed-rank dummy" }
23 call str (null (c))
24 call str (null (null (c)))
25 call str (null ()) ! { dg-error "passed to assumed-length dummy" }
26 contains
27 subroutine foo (x)
28 integer, pointer, intent(in) :: x(..)
29 print *, rank (x)
30 end
32 subroutine str (x)
33 character(len=*), pointer, intent(in) :: x
34 end
35 end