arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR115360]
[official-gcc.git] / gcc / testsuite / gfortran.dg / popcnt_poppar_2.F90
blobe45cd75b5eb8a51bcda4c8f7babe032596cfd49f
1 ! { dg-do run }
2 ! { dg-options "-ffree-line-length-none" }
3 ! { dg-require-effective-target fortran_integer_16 }
5 #define CHECK(val,res) \
6   if (popcnt(val) /= res) STOP 1; \
7   if (runtime_popcnt(val) /= res) STOP 2
9 #define CHECK2(val) \
10   if (poppar(val) /= modulo(popcnt(val),2)) STOP 3; \
11   if (runtime_poppar(val) /= poppar(val)) STOP 4
13   CHECK(0_16, 0)
14   CHECK(1_16, 1)
16   CHECK(-1_16,128)
17   CHECK(-8_16,128-3)
19   CHECK(huge(0_16), 128-1)
21   CHECK(-huge(0_16), 2)
23   CHECK2(0_16)
24   CHECK2(17_16)
25   CHECK2(-17_16)
26   CHECK2(huge(0_16))
27   CHECK2(-huge(0_16))
29 contains
30   integer function runtime_popcnt (i) result(res)
31     integer(kind=16), intent(in) :: i
32     res = popcnt(i)
33   end function
35   integer function runtime_poppar (i) result(res)
36     integer(kind=16), intent(in) :: i
37     res = poppar(i)
38   end function
39 end