annotate gcc/testsuite/gfortran.dg/storage_size_2.f08 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR 44649: [OOP] F2008: storage_size intrinsic
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 use iso_c_binding, only: c_int, c_sizeof
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 type, bind(c) :: t
kono
parents:
diff changeset
10 integer(c_int) :: j
kono
parents:
diff changeset
11 end type
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 integer(4) :: i1
kono
parents:
diff changeset
14 integer(c_int) :: i2
kono
parents:
diff changeset
15 type(t) :: x
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 print *,c_sizeof(i1)
kono
parents:
diff changeset
18 print *,c_sizeof(i2)
kono
parents:
diff changeset
19 print *,c_sizeof(x)
kono
parents:
diff changeset
20 print *, c_sizeof(ran())
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 print *,storage_size(1.0,4)
kono
parents:
diff changeset
23 print *,storage_size(1.0,3.2) ! { dg-error "must be INTEGER" }
kono
parents:
diff changeset
24 print *,storage_size(1.0,(/1,2/)) ! { dg-error "must be a scalar" }
kono
parents:
diff changeset
25 print *,storage_size(1.0,irand()) ! { dg-error "must be a constant" }
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 end