1 ! RUN: %S/test_modfile.sh %s %t %flang_fc1
3 ! Intrinsics SELECTED_INT_KIND, SELECTED_REAL_KIND, PRECISION, RANGE,
7 ! INTEGER(KIND=1) handles 0 <= P < 3
8 ! INTEGER(KIND=2) handles 3 <= P < 5
9 ! INTEGER(KIND=4) handles 5 <= P < 10
10 ! INTEGER(KIND=8) handles 10 <= P < 19
11 ! INTEGER(KIND=16) handles 19 <= P < 39
12 integer, parameter :: iranges(*) = &
13 [range(0_1), range(0_2), range(0_4), range(0_8), range(0_16)]
14 logical, parameter :: ircheck
= all([2, 4, 9, 18, 38] == iranges
)
15 integer, parameter :: intpvals(*) = [0, 2, 3, 4, 5, 9, 10, 18, 19, 38, 39]
16 integer, parameter :: intpkinds(*) = &
17 [(selected_int_kind(intpvals(j
)),j
=1,size(intpvals
))]
18 logical, parameter :: ipcheck
= &
19 all([1, 1, 2, 2, 4, 4, 8, 8, 16, 16, -1] == intpkinds
)
21 ! REAL(KIND=2) handles 0 <= P < 4 (if available)
22 ! REAL(KIND=3) handles 0 <= P < 3 (if available)
23 ! REAL(KIND=4) handles 4 <= P < 7
24 ! REAL(KIND=8) handles 7 <= P < 16
25 ! REAL(KIND=10) handles 16 <= P < 19 (if available; ifort is KIND=16)
26 ! REAL(KIND=16) handles 19 <= P < 34 (would be 32 with Power double/double)
27 integer, parameter :: realprecs(*) = &
28 [precision(0._2
), precision(0._3
), precision(0._4
), precision(0._8
), &
29 precision(0._10
), precision(0._16
)]
30 logical, parameter :: rpreccheck
= all([3, 2, 6, 15, 18, 33] == realprecs
)
31 integer, parameter :: realpvals(*) = [0, 3, 4, 6, 7, 15, 16, 18, 19, 33, 34]
32 integer, parameter :: realpkinds(*) = &
33 [(selected_real_kind(realpvals(j
),0),j
=1,size(realpvals
))]
34 logical, parameter :: realpcheck
= &
35 all([2, 2, 4, 4, 8, 8, 10, 10, 16, 16, -1] == realpkinds
)
36 ! REAL(KIND=2) handles 0 <= R < 5 (if available)
37 ! REAL(KIND=3) handles 5 <= R < 38 (if available, same range as KIND=4)
38 ! REAL(KIND=4) handles 5 <= R < 38 (if no KIND=3)
39 ! REAL(KIND=8) handles 38 <= R < 308
40 ! REAL(KIND=10) handles 308 <= R < 4932 (if available; ifort is KIND=16)
41 ! REAL(KIND=16) handles 308 <= R < 4932 (except Power double/double)
42 integer, parameter :: realranges(*) = &
43 [range(0._2
), range(0._3
), range(0._4
), range(0._8
), range(0._10
), &
45 logical, parameter :: rrangecheck
= &
46 all([4, 37, 37, 307, 4931, 4931] == realranges
)
47 integer, parameter :: realrvals(*) = &
48 [0, 4, 5, 37, 38, 307, 308, 4931, 4932]
49 integer, parameter :: realrkinds(*) = &
50 [(selected_real_kind(0,realrvals(j
)),j
=1,size(realrvals
))]
51 logical, parameter :: realrcheck
= &
52 all([2, 2, 3, 3, 8, 8, 10, 10, -2] == realrkinds
)
53 logical, parameter :: radixcheck
= &
54 all([radix(0._2
), radix(0._3
), radix(0._4
), radix(0._8
), &
55 radix(0._10
), radix(0._16
)] == 2)
56 integer, parameter :: intdigits(*) = &
57 [digits(0_1), digits(0_2), digits(0_4), digits(0_8), digits(0_16)]
58 logical, parameter :: intdigitscheck
= &
59 all([7, 15, 31, 63, 127] == intdigits
)
60 integer, parameter :: realdigits(*) = &
61 [digits(0._2
), digits(0._3
), digits(0._4
), digits(0._8
), digits(0._10
), &
63 logical, parameter :: realdigitscheck
= &
64 all([11, 8, 24, 53, 64, 113] == realdigits
)
68 !integer(4),parameter::iranges(1_8:*)=[INTEGER(4)::2_4,4_4,9_4,18_4,38_4]
69 !logical(4),parameter::ircheck=.true._4
71 !integer(4),parameter::intpvals(1_8:*)=[INTEGER(4)::0_4,2_4,3_4,4_4,5_4,9_4,10_4,18_4,19_4,38_4,39_4]
72 !integer(4),parameter::intpkinds(1_8:*)=[INTEGER(4)::1_4,1_4,2_4,2_4,4_4,4_4,8_4,8_4,16_4,16_4,-1_4]
73 !logical(4),parameter::ipcheck=.true._4
74 !integer(4),parameter::realprecs(1_8:*)=[INTEGER(4)::3_4,2_4,6_4,15_4,18_4,33_4]
75 !logical(4),parameter::rpreccheck=.true._4
76 !integer(4),parameter::realpvals(1_8:*)=[INTEGER(4)::0_4,3_4,4_4,6_4,7_4,15_4,16_4,18_4,19_4,33_4,34_4]
77 !integer(4),parameter::realpkinds(1_8:*)=[INTEGER(4)::2_4,2_4,4_4,4_4,8_4,8_4,10_4,10_4,16_4,16_4,-1_4]
78 !logical(4),parameter::realpcheck=.true._4
79 !integer(4),parameter::realranges(1_8:*)=[INTEGER(4)::4_4,37_4,37_4,307_4,4931_4,4931_4]
80 !logical(4),parameter::rrangecheck=.true._4
81 !integer(4),parameter::realrvals(1_8:*)=[INTEGER(4)::0_4,4_4,5_4,37_4,38_4,307_4,308_4,4931_4,4932_4]
82 !integer(4),parameter::realrkinds(1_8:*)=[INTEGER(4)::2_4,2_4,3_4,3_4,8_4,8_4,10_4,10_4,-2_4]
83 !logical(4),parameter::realrcheck=.true._4
84 !logical(4),parameter::radixcheck=.true._4
85 !integer(4),parameter::intdigits(1_8:*)=[INTEGER(4)::7_4,15_4,31_4,63_4,127_4]
86 !logical(4),parameter::intdigitscheck=.true._4
87 !integer(4),parameter::realdigits(1_8:*)=[INTEGER(4)::11_4,8_4,24_4,53_4,64_4,113_4]
88 !logical(4),parameter::realdigitscheck=.true._4