c: fix ICE when forming composite type for two structures / unions [PR117548]
[official-gcc.git] / gcc / testsuite / gfortran.dg / merge_bits_2.F90
blobb12534e6d4c912593b94f45a1892e58bb3ee2d40
1 ! Test the MERGE_BITS intrinsic
3 ! { dg-do run }
4 ! { dg-options "-ffree-line-length-none" }
5 ! { dg-require-effective-target fortran_integer_16 }
7 #define CHECK(I,J,K) \
8   if (merge_bits(I,J,K) /= ior(iand(I,K),iand(J,not(K)))) STOP 1; \
9   if (run_merge(I,J,K) /= merge_bits(I,J,K)) STOP 2
11   CHECK(13_16,18_16,22_16)
12   CHECK(-13_16,18_16,22_16)
13   CHECK(13_16,-18_16,22_16)
14   CHECK(13_16,18_16,-22_16)
16 contains
18   function run_merge (i, j, k) result(res)
19     integer(kind=16) :: i, j, k, res
20     res = merge_bits(i,j,k)
21   end function 
22 end