PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / null_6.f90
blob6b8f21e63bc15d4edcb7f5f0f386812685e4c852
1 ! { dg-do compile }
2 ! { dg-options "-std=f2008" }
4 ! PR fortran/34547
5 ! PR fortran/50375
7 subroutine test_PR50375_3 ()
8 interface gen3
9 subroutine s31 (pi)
10 integer, pointer :: pi
11 end subroutine
12 subroutine s32 (pr)
13 real, allocatable :: pr(:)
14 end subroutine
15 end interface
16 call gen3 (null ()) ! OK
17 end subroutine test_PR50375_3
19 subroutine test_PR50375_2 ()
20 interface gen2
21 subroutine s21 (pi)
22 integer, pointer :: pi
23 end subroutine
24 subroutine s22 (pr)
25 real, optional :: pr
26 end subroutine
27 end interface
28 call gen2 (null ()) ! { dg-error "MOLD= required in NULL|There is no specific subroutine" }
29 end subroutine test_PR50375_2
31 subroutine test_PR34547_3 ()
32 integer, allocatable :: i(:)
33 print *, NULL(i) ! { dg-error "Invalid context for NULL" }
34 end subroutine test_PR34547_3