OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [boz_4.f90] - Rev 826

Compare with Previous | Blame | View Log

! { 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

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.