view gcc/testsuite/gfortran.dg/pr93366.f90 @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

! { dg-do compile }
!
! PR fortran/93366 - ICE on invalid, reject invalid use of NULL() as argument

program p
  print *, kind (null())                    ! { dg-error "NULL at" }
  print *, [ merge(null(), [1]   ,.true.) ] ! { dg-error "NULL at" }
  print *, [ merge([1]   , null(),.true.) ] ! { dg-error "NULL at" }
  print *, [ merge(null(), null(),.true.) ] ! { dg-error "NULL at" }
  print *, shape (null())                   ! { dg-error "NULL at" }
  print *, sizeof (null())                  ! { dg-error "NULL at" }
  print *, spread (null(),1,1)              ! { dg-error "NULL at" }
  print *, transfer ( 1 , null())           ! { dg-error "NULL at" }
  print *, transfer ([1], null())           ! { dg-error "NULL at" }
  print *, transfer (null(), 1)             ! { dg-error "NULL at" }
  print *, transfer (null(), [1])           ! { dg-error "NULL at" }
  print *, transfer (null(), null())        ! { dg-error "NULL at" }
end