libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / null_2.f90
blob3102aad622cd895a8db185db8c2940c0e0ec9582
1 ! { dg-do compile }
3 ! NULL(...) pointer is not allowed as operand
4 ! PR fortran/20888
6 ! Contributed by Joost VandeVondele
8 PROGRAM main
9 IMPLICIT NONE
10 REAL, POINTER :: TEST
11 NULLIFY(TEST)
12 TEST => -NULL(TEST) ! { dg-error "Invalid context for NULL" }
13 IF (TEST .EQ. NULL(TEST)) TEST=>NULL() ! { dg-error "Invalid context for NULL" }
14 IF (NULL(TEST) .EQ. TEST) TEST=>NULL() ! { dg-error "Invalid context for NULL" }
15 END PROGRAM main