PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / norm2_5.f90
blob0416fd67b69b308a4c1f7199a20de2602174a946
1 ! { dg-do compile }
3 ! Testcase from PR 54656
4 ! Checking for NORM2 for large float kinds
6 program test
7 implicit none
9 ! k1 and k2 will be large real kinds, if supported, and single/double
10 ! otherwise
11 integer, parameter :: k1 = &
12 max(selected_real_kind(precision(0.d0) + 1), kind(0.))
13 integer, parameter :: k2 = &
14 max(selected_real_kind(precision(0._k1) + 1), kind(0.d0))
16 real(kind=k1) :: d1(10), z1
17 real(kind=k2) :: d2(10), z2
18 d1 = 1 ; d2 = 1
19 z1 = norm2 (d1)
20 z2 = norm2 (d2)
22 print *, z1, z2
23 end program test