PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / leadz_trailz_2.f90
blob08701d8a537ce0ad41bd76f6c4fe14e679c29f78
1 ! { dg-do run }
2 ! { dg-require-effective-target fortran_large_int }
4 integer(kind=16) :: i16
6 i16 = -1
7 if (leadz(i16) /= 0) call abort
8 if (trailz(i16) /= 0) call abort
9 if (leadz(-1_16) /= 0) call abort
10 if (trailz(-1_16) /= 0) call abort
12 i16 = -64
13 if (leadz(i16) /= 0) call abort
14 if (trailz(i16) /= 6) call abort
15 if (leadz(-64_16) /= 0) call abort
16 if (trailz(-64_16) /= 6) call abort
18 i16 = -108
19 if (leadz(i16) /= 0) call abort
20 if (trailz(i16) /= 2) call abort
21 if (leadz(-108_16) /= 0) call abort
22 if (trailz(-108_16) /= 2) call abort
24 i16 = 1
25 if (leadz(i16) /= bit_size(i16) - 1) call abort
26 if (trailz(i16) /= 0) call abort
27 if (leadz(1_16) /= bit_size(1_16) - 1) call abort
28 if (trailz(1_16) /= 0) call abort
30 i16 = 64
31 if (leadz(i16) /= 121) call abort
32 if (trailz(i16) /= 6) call abort
33 if (leadz(64_16) /= 121) call abort
34 if (trailz(64_16) /= 6) call abort
36 end