• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: %S/test_errors.sh %s %t %f18
2! C718 Each named constant in a complex literal constant shall be of type
3! integer or real.
4subroutine s()
5  integer :: ivar = 35
6  integer, parameter :: iconst = 35
7  real :: rvar = 68.9
8  real, parameter :: rconst = 68.9
9  character :: cvar = 'hello'
10  character, parameter :: cconst = 'hello'
11  logical :: lvar = .true.
12  logical, parameter :: lconst = .true.
13  complex :: cvar1 = (1, 1)
14  complex :: cvar2 = (1.0, 1.0)
15  complex :: cvar3 = (1.0, 1)
16  complex :: cvar4 = (1, 1.0)
17  complex :: cvar5 = (iconst, 1.0)
18  complex :: cvar6 = (iconst, rconst)
19  complex :: cvar7 = (rconst, iconst)
20
21  !ERROR: must be a constant
22  complex :: cvar8 = (ivar, 1.0)
23  !ERROR: must be a constant
24  !ERROR: must be a constant
25  complex :: cvar9 = (ivar, rvar)
26  !ERROR: must be a constant
27  !ERROR: must be a constant
28  complex :: cvar10 = (rvar, ivar)
29  !ERROR: operands must be INTEGER or REAL
30  complex :: cvar11 = (cconst, 1.0)
31  !ERROR: operands must be INTEGER or REAL
32  complex :: cvar12 = (lconst, 1.0)
33end subroutine s
34