[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / complex01.f90
blobcf7fd9cc2b1fb847c070a864463b4df145ea9137
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! C718 Each named constant in a complex literal constant shall be of type
4 ! integer or real.
5 subroutine s()
6 integer :: ivar = 35
7 integer, parameter :: iconst = 35
8 real :: rvar = 68.9
9 real, parameter :: rconst = 68.9
10 character :: cvar = 'hello'
11 character, parameter :: cconst = 'hello'
12 logical :: lvar = .true.
13 logical, parameter :: lconst = .true.
14 complex :: cvar1 = (1, 1)
15 complex :: cvar2 = (1.0, 1.0)
16 complex :: cvar3 = (1.0, 1)
17 complex :: cvar4 = (1, 1.0)
18 complex :: cvar5 = (iconst, 1.0)
19 complex :: cvar6 = (iconst, rconst)
20 complex :: cvar7 = (rconst, iconst)
22 !ERROR: must be a constant
23 complex :: cvar8 = (ivar, 1.0)
24 !ERROR: must be a constant
25 !ERROR: must be a constant
26 complex :: cvar9 = (ivar, rvar)
27 !ERROR: must be a constant
28 !ERROR: must be a constant
29 complex :: cvar10 = (rvar, ivar)
30 !ERROR: operands must be INTEGER or REAL
31 complex :: cvar11 = (cconst, 1.0)
32 !ERROR: operands must be INTEGER or REAL
33 complex :: cvar12 = (lconst, 1.0)
34 end subroutine s