view gcc/testsuite/gfortran.dg/c_sizeof_6.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do compile }
!
program foo

   use iso_c_binding, only: c_int, c_char, c_sizeof

   integer(kind=c_int) :: i

   character(kind=c_char,len=1),parameter :: str2(4) = ["a","b","c","d"]

   i = c_sizeof(str2(1:3)) ! { dg-error "must be an interoperable data" }

   if (i /= 3) STOP 1

end program foo