aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_si_kind.f90
blob: b231dc66ebe5887a841519cac37d23aae333f27e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
! Program to test SELECTED_INT_KIND intrinsic function.
Program test_si_kind
  integer*1 i1
  integer*2 i2
  integer*4 i4
  integer*8 i8
  integer res
  real t

  t = huge (i1)
  t = log10 (t)
  res = selected_int_kind (int (t))
  if (res .ne. 1) call abort

  t = huge (i2)
  t = log10 (t)
  res = selected_int_kind (int (t))
  if (res .ne. 2) call abort

  t = huge (i4)
  t = log10 (t)
  res = selected_int_kind (int (t))
  if (res .ne. 4) call abort

  t = huge (i8)
  t = log10 (t)
  res = selected_int_kind (int (t))
  if (res .ne. 8) call abort

  i4 = huge (i4)
  res = selected_int_kind (i4)
  if (res .ne. (-1)) call abort

end program