OSDN Git Service

PR target/51393
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / pointer_check_12.f90
1 ! { dg-do run }
2 ! { dg-options "-fcheck=all" }
3 !
4 ! { dg-shouldfail "Pointer check" }
5 ! { dg-output "Fortran runtime error: Pointer actual argument 'p' is not associated" }
6 !
7 ! PR fortran/50718
8 !
9 ! Was failing with -fcheck=pointer: Segfault at run time
10
11 integer, pointer :: p => null()
12
13 call sub2(%val(p)) ! Invalid: Nonassociated pointer
14 end
15
16 ! Not quite correct dummy, but if one uses VALUE, gfortran
17 ! complains about a missing interface - which we cannot use
18 ! if we want to use %VAL().
19
20 subroutine sub2(p)
21   integer :: p
22 end subroutine sub2