Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / selected_real_kind_2.f90
blobcf73520f9306480e8c8a2a05a0d143b7965c5174
1 ! { dg-do run }
2 ! { dg-options "-std=f2008 -fall-intrinsics" }
5 integer :: p, r, rdx
7 ! Compile-time version
9 if (selected_real_kind(radix=2) /= 4) call should_not_fail()
10 if (selected_real_kind(radix=4) /= -5) call should_not_fail()
11 if (selected_real_kind(precision(0.0),range(0.0),radix(0.0)) /= kind(0.0)) &
12 call should_not_fail()
13 if (selected_real_kind(precision(0.0d0),range(0.0d0),radix(0.0d0)) /= kind(0.0d0)) &
14 call should_not_fail()
16 ! Run-time version
18 rdx = 2
19 if (selected_real_kind(radix=rdx) /= 4) call abort()
20 rdx = 4
21 if (selected_real_kind(radix=rdx) /= -5) call abort()
23 rdx = radix(0.0)
24 p = precision(0.0)
25 r = range(0.0)
26 if (selected_real_kind(p,r,rdx) /= kind(0.0)) call abort()
28 rdx = radix(0.0d0)
29 p = precision(0.0d0)
30 r = range(0.0d0)
31 if (selected_real_kind(p,r,rdx) /= kind(0.0d0)) call abort()
32 end