2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / sizeof_2.f90
blob5f1928828060786098f5e42127d3ca121f11e3d8
1 ! { dg-do compile }
3 ! PR fortran/56650
4 ! PR fortran/36437
6 subroutine foo(x, y)
7 use iso_c_binding
8 type(*) :: x
9 integer :: y(*)
10 integer(8) :: ii
11 procedure() :: proc
13 ii = sizeof (x) ! { dg-error "Assumed-type argument at .1. is not permitted as actual argument to the intrinsic sizeof" }
14 ii = c_sizeof (x) ! { dg-error "Assumed-type argument at .1. is not permitted as actual argument to the intrinsic c_sizeof" }
15 ii = storage_size (x) ! { dg-error "Assumed-type argument at .1. is not permitted as actual argument to the intrinsic storage_size" }
17 ii = sizeof (y) ! { dg-error "shall not be an assumed-size array" }
18 ii = c_sizeof (y) ! { dg-error "shall not be an assumed-size array" }
19 ii = storage_size (y) ! okay, element-size is known
21 ii = sizeof (proc) ! { dg-error "shall not be a procedure" }
22 ii = c_sizeof (proc) ! { dg-error "Procedure unexpected as argument" }
23 ii = storage_size (proc) ! { dg-error "shall not be a procedure" }
24 end