diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/null_2.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/null_2.f90 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/null_2.f90 b/gcc/testsuite/gfortran.dg/null_2.f90 new file mode 100644 index 0000000..3102aad --- /dev/null +++ b/gcc/testsuite/gfortran.dg/null_2.f90 @@ -0,0 +1,15 @@ +! { dg-do compile } +! +! NULL(...) pointer is not allowed as operand +! PR fortran/20888 +! +! Contributed by Joost VandeVondele +! +PROGRAM main + IMPLICIT NONE + REAL, POINTER :: TEST + NULLIFY(TEST) + TEST => -NULL(TEST) ! { dg-error "Invalid context for NULL" } + IF (TEST .EQ. NULL(TEST)) TEST=>NULL() ! { dg-error "Invalid context for NULL" } + IF (NULL(TEST) .EQ. TEST) TEST=>NULL() ! { dg-error "Invalid context for NULL" } +END PROGRAM main |