Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / boz_4.f90
blobd016df22c49337f1bcd099340e7b43ed41f1ccfc
1 ! { dg-do compile }
2 ! Test that the conversion of a BOZ constant that is too large for the
3 ! integer variable is caught by the compiler.
4 program boz
6 implicit none
8 integer(1), parameter :: &
9 & b1 = b'0101010110101010' ! { dg-error "overflow converting" }
10 integer(2), parameter :: &
11 & b2 = b'01110000111100001111000011110000' ! { dg-error "overflow converting" }
12 integer(4), parameter :: &
13 & b4 = b'0111000011110000111100001111000011110000111100001111000011110000' ! { dg-error "overflow converting" }
15 integer(1), parameter :: &
16 & o1 = o'1234567076543210' ! { dg-error "overflow converting" }
17 integer(2), parameter :: &
18 & o2 = o'1234567076543210' ! { dg-error "overflow converting" }
19 integer(4), parameter :: &
20 & o4 = o'1234567076543210' ! { dg-error "overflow converting" }
22 integer(1), parameter :: &
23 & z1 = z'deadbeef' ! { dg-error "overflow converting" }
24 integer(2), parameter :: &
25 & z2 = z'deadbeef' ! { dg-error "overflow converting" }
26 integer(4), parameter :: &
27 & z4 = z'deadbeeffeed' ! { dg-error "overflow converting" }
29 end program boz