Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_check_12.f90
blobcfef70e5999535c39bc8059e6554496ce1428178
1 ! { dg-do run }
2 ! { dg-options "-fcheck=all" }
4 ! { dg-shouldfail "Pointer check" }
5 ! { dg-output "Fortran runtime error: Pointer actual argument 'p' is not associated" }
7 ! PR fortran/50718
9 ! Was failing with -fcheck=pointer: Segfault at run time
11 integer, pointer :: p => null()
13 call sub2(%val(p)) ! Invalid: Nonassociated pointer
14 end
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().
20 subroutine sub2(p)
21 integer :: p
22 end subroutine sub2