annotate gcc/testsuite/gfortran.dg/size_kind.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
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 fortran/36153
kono
parents:
diff changeset
4 ! Contributed by Jonathan Hogg
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 program test_64
kono
parents:
diff changeset
7 implicit none
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 integer, parameter :: long = selected_int_kind(18)
kono
parents:
diff changeset
10 integer, parameter :: short = kind(0)
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 integer(long), parameter :: big_sz = huge(0_short)+1000_long
kono
parents:
diff changeset
13 integer(long), parameter :: max_32 = huge(0_short)
kono
parents:
diff changeset
14 integer, dimension(:), allocatable :: array
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 integer(long) :: i
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 print *, "2**31 = ", 2_long**31
kono
parents:
diff changeset
19 print *, "max_32 = ", max_32
kono
parents:
diff changeset
20 print *, "big_sz = ", big_sz
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 ! Disabled as it overflows on 32bit systems (at compile time)
kono
parents:
diff changeset
23 ! (conversion of integer(8) to integer(4))
kono
parents:
diff changeset
24 ! allocate(array(big_sz))
kono
parents:
diff changeset
25 print *, "sz = ", size(array)
kono
parents:
diff changeset
26 print *, "sz = ", size(array, kind=long)
kono
parents:
diff changeset
27 end program