[flang] Add semantic error test for integer constant containing division by zero

Original-commit: flang-compiler/f18@650cfac539
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
This commit is contained in:
Jean Perier 2019-05-24 08:22:11 -07:00
parent 33d6fb2332
commit 0dfecfa8c5
1 changed files with 9 additions and 0 deletions

View File

@ -35,4 +35,13 @@ real :: u(l*2)
character(len=l) :: v
!ERROR: Initialization expression for PARAMETER 'o' (o) cannot be computed as a constant value
real, parameter :: o = o
!ERROR: Must be a constant value
integer, parameter :: p = 0/0
!ERROR: Must be a constant value
integer, parameter :: q = 1+2*(1/0)
!ERROR: Must be a constant value
integer(kind=2/0) r
integer, parameter :: sok(:)=[1,2]/[1,2]
!ERROR: Must be a constant value
integer, parameter :: snok(:)=[1,2]/[1,0]
end