Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / altreturn03.f90
blobfdf3f2472ad1fb19692ed8000b5144d2be64c538
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for various alt return error conditions
4 SUBROUTINE TEST (N, *, *)
5 REAL :: R
6 COMPLEX :: Z
7 INTEGER, DIMENSION(2) :: B
8 IF ( N .EQ. 0 ) RETURN
9 IF ( N .EQ. 1 ) RETURN 1
10 IF ( N .EQ. 2 ) RETURN 2
11 IF ( N .EQ. 3 ) RETURN 3
12 IF ( N .EQ. 4 ) RETURN N
13 IF ( N .EQ. 5 ) RETURN N * N
14 IF ( N .EQ. 6 ) RETURN B(N)
15 !ERROR: Must be a scalar value, but is a rank-1 array
16 IF ( N .EQ. 7 ) RETURN B
17 !ERROR: Must have INTEGER type, but is REAL(4)
18 IF ( N .EQ. 8 ) RETURN R
19 !ERROR: Must have INTEGER type, but is COMPLEX(4)
20 IF ( N .EQ. 9 ) RETURN Z
21 RETURN 2
22 END