[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / altreturn03.f90
blob703d22bc0b36780e4c717fb94c3fdd8139539ce6
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Check for various alt return error conditions
5 SUBROUTINE TEST (N, *, *)
6 REAL :: R
7 COMPLEX :: Z
8 INTEGER, DIMENSION(2) :: B
9 IF ( N .EQ. 0 ) RETURN
10 IF ( N .EQ. 1 ) RETURN 1
11 IF ( N .EQ. 2 ) RETURN 2
12 IF ( N .EQ. 3 ) RETURN 3
13 IF ( N .EQ. 4 ) RETURN N
14 IF ( N .EQ. 5 ) RETURN N * N
15 IF ( N .EQ. 6 ) RETURN B(N)
16 !ERROR: Must be a scalar value, but is a rank-1 array
17 IF ( N .EQ. 7 ) RETURN B
18 !ERROR: Must have INTEGER type, but is REAL(4)
19 IF ( N .EQ. 8 ) RETURN R
20 !ERROR: Must have INTEGER type, but is COMPLEX(4)
21 IF ( N .EQ. 9 ) RETURN Z
22 RETURN 2
23 END