111
|
1 ! { dg-do run }
|
|
2 ! { dg-options "-std=gnu" }
|
|
3 ! Test that the BOZ constant on the RHS, which are of different KIND than
|
|
4 ! the LHS, are correctly converted.
|
|
5 !
|
|
6 program boz
|
|
7
|
|
8 implicit none
|
|
9
|
|
10 integer(1), parameter :: b1 = b'000000000001111'
|
|
11 integer(2), parameter :: b2 = b'00000000000000000111000011110000'
|
|
12 integer(4), parameter :: &
|
|
13 & b4 = b'0000000000000000000000000000000001110000111100001111000011110000'
|
|
14
|
|
15 integer(1), parameter :: o1 = o'0012'
|
|
16 integer(2), parameter :: o2 = o'0004321'
|
|
17 integer(4), parameter :: o4 = o'0000000043210765'
|
|
18
|
|
19 integer(1), parameter :: z1 = z'0a'
|
|
20 integer(2), parameter :: z2 = z'00ab'
|
|
21 integer(4), parameter :: z4 = z'0000dead'
|
|
22
|
131
|
23 if (b1 /= 15_1) STOP 1
|
|
24 if (b2 /= 28912_2) STOP 2
|
|
25 if (b4 /= 1894838512_4) STOP 3
|
111
|
26
|
131
|
27 if (o1 /= 10_1) STOP 4
|
|
28 if (o2 /= 2257_2) STOP 5
|
|
29 if (o4 /= 9245173_4) STOP 6
|
111
|
30
|
131
|
31 if (z1 /= 10_1) STOP 7
|
|
32 if (z2 /= 171_2) STOP 8
|
|
33 if (z4 /= 57005_4) STOP 9
|
111
|
34
|
|
35 end program boz
|