nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / date_and_time_3.f90
blob020266d87e9a3deb4ffdc75104246dd1efd9f0b6
1 ! { dg-do run }
2 ! { dg-additional-options "-std=f2018" }
4 ! PR fortran/96580 - integer kind of VALUES argument of DATE_AND_TIME intrinsic
6 program test_time_and_date
7 implicit none
8 integer(2), dimension(8) :: values2
9 integer(4), dimension(8) :: values4
10 integer(8), dimension(8) :: values8
12 call date_and_time(VALUES=values2)
13 call date_and_time(VALUES=values4)
14 call date_and_time(VALUES=values8)
16 ! Check consistency of year and of time difference from UTC
17 if (values2(1) /= -HUGE(0_2) .and. values4(1) /= -HUGE(0_4)) then
18 if (abs (values4(1) - values2(1)) > 1) stop 1
19 end if
20 if (values2(4) /= -HUGE(0_2) .and. values4(4) /= -HUGE(0_4)) then
21 if (values2(4) /= values4(4)) stop 2
22 end if
23 if (values4(1) /= -HUGE(0_4) .and. values8(1) /= -HUGE(0_8)) then
24 if (abs (values8(1) - values4(1)) > 1) stop 3
25 end if
26 if (values4(4) /= -HUGE(0_4) .and. values8(4) /= -HUGE(0_8)) then
27 if (values4(4) /= values8(4)) stop 4
28 end if
29 end program test_time_and_date