! This is the testcase from PR 12841. We used to report a type/rank mismatch
! when passing NULL() as an argument to a function.
MODULE T
PUBLIC :: A
CONTAINS
SUBROUTINE A(B)
REAL, POIN
! we didn't give a warning if the RHS of an assignment was NULL
! { dg-do-compile }
INTEGER, POINTER :: P
I = NULL() ! { dg-error "NULL appears" "Assignment non-pointer = NULL" }
P = NULL() ! { dg-err
! { dg-do compile }
! PR fortran/20858
! If we have "x = null(i)", then "null()" acquires the type, kind type,
! and rank of i and these need to match those of x.
program null_1
integer, parameter
! Check that null initialization of pointer variable works.
! { dg-do run }
program pointer_init_1
type t
real x
end type
type(t), pointer :: a => NULL()
real, pointer :: b => NULL()
cha
/* PR c/13382 */
/* Origin: Richard Hutchinson */
/* Verify that the null initializer is converted to the right
pointer type. */
/* { dg-do compile } */
/* { dg-op
/* Test for constant expressions: details of what is a null pointer
constant.
*/
/* Origin: Joseph Myers */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990" } */
/* Not