view gcc/testsuite/gfortran.dg/c_sizeof_6.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +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