2 ! { dg-options "-ffree-line-length-none" }
4 interface runtime_popcnt
5 procedure runtime_popcnt_i1
6 procedure runtime_popcnt_i2
7 procedure runtime_popcnt_i4
8 procedure runtime_popcnt_i8
11 interface runtime_poppar
12 procedure runtime_poppar_i1
13 procedure runtime_poppar_i2
14 procedure runtime_poppar_i4
15 procedure runtime_poppar_i8
18 #define CHECK(val,res) \
19 if (popcnt(val) /= res) call abort ; \
20 if (runtime_popcnt(val) /= res) call abort
23 if (poppar(val) /= modulo(popcnt(val),2)) call abort ; \
24 if (runtime_poppar(val) /= poppar(val)) call abort
47 CHECK(huge(0_2), 16-1)
48 CHECK(huge(0_4), 32-1)
49 CHECK(huge(0_8), 64-1)
82 integer function runtime_popcnt_i1 (i) result(res)
83 integer(kind=1), intent(in) :: i
87 integer function runtime_popcnt_i2 (i) result(res)
88 integer(kind=2), intent(in) :: i
92 integer function runtime_popcnt_i4 (i) result(res)
93 integer(kind=4), intent(in) :: i
97 integer function runtime_popcnt_i8 (i) result(res)
98 integer(kind=8), intent(in) :: i
102 integer function runtime_poppar_i1 (i) result(res)
103 integer(kind=1), intent(in) :: i
107 integer function runtime_poppar_i2 (i) result(res)
108 integer(kind=2), intent(in) :: i
112 integer function runtime_poppar_i4 (i) result(res)
113 integer(kind=4), intent(in) :: i
117 integer function runtime_poppar_i8 (i) result(res)
118 integer(kind=8), intent(in) :: i