blob: d016df22c49337f1bcd099340e7b43ed41f1ccfc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
! { dg-do compile }
! Test that the conversion of a BOZ constant that is too large for the
! integer variable is caught by the compiler.
program boz
implicit none
integer(1), parameter :: &
& b1 = b'0101010110101010' ! { dg-error "overflow converting" }
integer(2), parameter :: &
& b2 = b'01110000111100001111000011110000' ! { dg-error "overflow converting" }
integer(4), parameter :: &
& b4 = b'0111000011110000111100001111000011110000111100001111000011110000' ! { dg-error "overflow converting" }
integer(1), parameter :: &
& o1 = o'1234567076543210' ! { dg-error "overflow converting" }
integer(2), parameter :: &
& o2 = o'1234567076543210' ! { dg-error "overflow converting" }
integer(4), parameter :: &
& o4 = o'1234567076543210' ! { dg-error "overflow converting" }
integer(1), parameter :: &
& z1 = z'deadbeef' ! { dg-error "overflow converting" }
integer(2), parameter :: &
& z2 = z'deadbeef' ! { dg-error "overflow converting" }
integer(4), parameter :: &
& z4 = z'deadbeeffeed' ! { dg-error "overflow converting" }
end program boz
|